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

Replace obsolete with_items by loop in error message #47215

Merged
merged 0 commits into from Feb 12, 2019
Merged

Replace obsolete with_items by loop in error message #47215

merged 0 commits into from Feb 12, 2019

Conversation

bmillemathias
Copy link
Contributor

SUMMARY

Replace example provided when error YAML_COMMON_UNQUOTED_VARIABLE_ERROR is raised with loop instead of with_items

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

Error Message

ANSIBLE VERSION

can be any starting with ansible 2.5

@ansibot
Copy link
Contributor

ansibot commented Oct 17, 2018

Hi @bmillemathias, thank you for submitting this pull-request!

click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. small_patch support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 17, 2018
@jborean93 jborean93 added docs This issue/PR relates to or includes documentation. and removed needs_triage Needs a first human triage before being processed. labels Oct 18, 2018
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Oct 26, 2018
@beeankha
Copy link
Contributor

I tested the usage of loop using a playbook that originally had with_items. Snippet of the playbook is below:

- name: Install npm modules required by our app
  npm:
    name: "{{item}}"
    global: yes
    state: present
  loop: "{{node_npm_modules}}"

The items being looped through:

---
node_npm_modules:
  - forever
  - async
  - request

Output from the run is below:

bhenderson$ ansible-playbook -i inventory nodejsrole.yml

PLAY [web2] ********************************************************************

TASK [Gathering Facts] *********************************************************
ok: [192.168.60.5]

TASK [Install Remi repo.] ******************************************************
changed: [192.168.60.5]

TASK [nodejs : Install Node.js and npm.] ***************************************
changed: [192.168.60.5]

TASK [nodejs : Install npm modules required by our app] ************************
changed: [192.168.60.5] => (item=forever)
changed: [192.168.60.5] => (item=async)
changed: [192.168.60.5] => (item=request)

[other tasks cut out for output brevity]

PLAY RECAP *********************************************************************
192.168.60.5               : ok=12   changed=8    unreachable=0    failed=0

@acozine
Copy link
Contributor

acozine commented Dec 14, 2018

Thanks @beeankha for testing! Thanks @bmillemathias for updating and modernizing this error message.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. core_review In order to be merged, this PR must follow the core review workflow. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Dec 14, 2018
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Dec 27, 2018
@ansibot ansibot added owner_pr This PR is made by the module's maintainer. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed core_review In order to be merged, this PR must follow the core review workflow. small_patch labels Feb 12, 2019
@samdoran samdoran merged commit 7fbacf9 into ansible:devel Feb 12, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. docs This issue/PR relates to or includes documentation. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. owner_pr This PR is made by the module's maintainer. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants