Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tower_job_template: implement extra_vars #57225

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@dlerch-tpgroup
Copy link
Contributor

commented May 31, 2019

replace extra_vars_path by extra_vars
implement integration tests for extra_vars_path and extra_vars

SUMMARY

In the current module, extra variable for the job template can only be set via creating a YAML file and providing the path to this file via extra_vars_path.
I implement the variable extra_vars, where the variables can be set directly and document the way of archiving the current behavior via extra_vars. Setting the variables directly is in my humble opinion the common use case, that's why I mark the extra_vars_path with a deprecation warning.
Also add tests.

Fixes #45173

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

tower_job_template

ADDITIONAL INFORMATION

The existing behavior can be archived with by looking up the yaml file:

extra_vars: "{{ lookup('file', '/path/to/file') | from_yaml }}"

@dlerch-tpgroup dlerch-tpgroup force-pushed the dlerch-tpgroup:devel branch from ef79aa4 to f889961 May 31, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:217:0: ansible-bad-module-import Import external package or ansible.module_utils not ansible.parsing.yaml.dumper
lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:251:8: undefined-variable Undefined variable 'module'

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:219:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:0:0: E309 version_added for new option (extra_vars) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot

This comment has been minimized.

@AlanCoding

This comment has been minimized.

Copy link
Member

commented May 31, 2019

I agree with your proposal here. The time period of 2.13 is plenty.

shipit

@ansibot ansibot removed the needs_triage label May 31, 2019

@dlerch-tpgroup dlerch-tpgroup force-pushed the dlerch-tpgroup:devel branch from f889961 to ebd7a7f Jun 3, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:217:0: ansible-bad-module-import Import external package or ansible.module_utils not ansible.parsing.yaml.dumper

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ImportError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:215:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:219:1: E302 expected 2 blank lines, found 1

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:0:0: E309 version_added for new option (extra_vars) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

@ansibot ansibot added the ci_verified label Jun 3, 2019

@dlerch-tpgroup dlerch-tpgroup force-pushed the dlerch-tpgroup:devel branch from ebd7a7f to e492b80 Jun 4, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 4, 2019

The test ansible-test sanity --test pylint [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:218:0: ansible-bad-module-import Import external package or ansible.module_utils not ansible.parsing.yaml.dumper

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ImportError: No module named yaml

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ImportError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ModuleNotFoundError: No module named 'yaml'

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/ansible_tower/tower_job_template.py:216:0: ModuleNotFoundError: No module named 'yaml'

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

@ansibot ansibot removed the ci_verified label Jun 5, 2019

@dlerch-tpgroup dlerch-tpgroup force-pushed the dlerch-tpgroup:devel branch 2 times, most recently from 22e1199 to d7cccbe Jun 5, 2019

tower_job_template: implement extra_vars
replace extra_vars_path by extra_vars
implement integration tests for extra_vars_path and extra_vars

@dlerch-tpgroup dlerch-tpgroup force-pushed the dlerch-tpgroup:devel branch from d7cccbe to ca203f2 Jun 5, 2019

@ansibot ansibot added core_review and removed needs_revision labels Jun 5, 2019

@ansibot ansibot added needs_revision and removed core_review labels Jun 5, 2019

Update docs/docsite/rst/porting_guides/porting_guide_2.9.rst
Co-Authored-By: Sandra McCann <samccann@redhat.com>

@ansibot ansibot added the needs_rebase label Jun 6, 2019

@samccann
Copy link
Contributor

left a comment

docs portion LGTM.

@ansibot ansibot removed the needs_rebase label Jun 6, 2019

@dlerch-tpgroup

This comment has been minimized.

Copy link
Contributor Author

commented Jun 7, 2019

couldn't reproduce the error on my machine, can we retrigger the tests?

@ansibot ansibot added core_review and removed needs_revision labels Jun 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.