pytest-testinfra icon indicating copy to clipboard operation
pytest-testinfra copied to clipboard

get variables from ansible playbook

Open w1ndblow opened this issue 5 years ago • 5 comments

added parameter --ansible-playbook. for example --ansible-playbook=test-playbook.yml the process of applying variables in "vars" in the playbook is:

  1. applying variables from play with "all" value of "hosts" directive
  2. applying variables from play with hostname value of "hosts" directive

w1ndblow avatar Jul 23 '19 18:07 w1ndblow

Hi, this looks interesting, thanks for this.

However I think i'd be preferable to pass the playbook file in ansible.get_variables(playbook="/path/to/playbook.yml") (from the ansible module). Rather than from the command line. This would allow to read variables from any playbook.

philpep avatar Aug 04 '19 12:08 philpep

I think, both sources of "playbook" can stay. What do you think? If you insist on one variant, I'll do that.

w1ndblow avatar Aug 14 '19 21:08 w1ndblow

Build succeeded (third-party-check pipeline).

opendev-zuul[bot] avatar Oct 11 '19 20:10 opendev-zuul[bot]

Build failed (third-party-check pipeline) integration testing with OpenStack. For information on how to proceed, see http://docs.openstack.org/infra/manual/developers.html#automated-testing

opendev-zuul[bot] avatar Feb 11 '20 22:02 opendev-zuul[bot]

Build succeeded (third-party-check pipeline).

opendev-zuul[bot] avatar Feb 25 '20 14:02 opendev-zuul[bot]