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

Playbook skips to PLAY RECAP when installing specific package version with yum #16006

Closed
kellenanker opened this issue May 26, 2016 · 23 comments
Closed
Assignees
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release packaging Packaging category
Milestone

Comments

@kellenanker
Copy link

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.0.2.0
  config file = /Users/MY_NAME/.ansible.cfg
  configured module search path = Default w/o overrides
CONFIGURATION

Default; no changes

OS / ENVIRONMENT

CentOS 6.7

SUMMARY

I have a playbook, the logic behind which is simple: install some packages, then include other tasks that either configure said packages or start them up. See the example below for exact syntax.

Note that I have included the entire version details of each package, including the system architecture for which they are designed. In my experience, this hasn't generated any issues. However, in this case, when including the architecture (x86_64) after the version details, Ansible reports the following: "msg": "No Package matching 'influxdb-0.13.0.x86_64' found available, installed or updated". However, running yum search influxdb-0.13.0.x86_64 --showduplicates shows that this package does indeed exist in the repository from which I am pulling. More specifically, one line of output from this command reads influxdb-0.13.0-1.x86_64 : Distributed time-series database.. For completeness of this report, I will note that the repository is correctly referenced in /etc/yum.repos.d/.

Not only does this bizarre message appear when it seemingly shouldn't, it also terminates the entire playbook. Following this step, Ansible immediately jumps to NO MORE HOSTS LEFT, bypassing (not skipping!) the remaining steps in the role. Nothing fails explicitly, but the play recap shows that there was one failure (failed=1).

This issue is remedied when the architecture is removed from the version details. But again, I did not expect that being as specific as possible could lead to a bizarre bug that breaks my code!

STEPS TO REPRODUCE
  1. Spin up a CentOS 6.7 virtual machine. I am doing this from a MacBook Pro running OS X Yosemite 10.10.3, but I doubt that is relevant.
  2. Run the following on the host you've created:
- name: Install InfluxDB, Telegraf, Kapacitor | CentOS
  yum: name={{ item }} state=present update_cache=yes
  with_items:
    - influxdb-0.13.0.x86_64
    - telegraf-0.13.0.x86_64
    - kapacitor-0.13.0.x86_64
  when: ansible_distribution == "CentOS"
EXPECTED RESULTS

Influxdb, Telegraf, and Kapacitor are already installed on the box I am deploying. As such, I expect this installation step to be skipped. However, I do NOT expect it to skip to the very end of the role!

...

TASK [role.name : Install InfluxDB, Telegraf, Kapacitor | CentOS] *****
task path: /Users/MY_NAME/git/ansible/roles/role.name/tasks/main.yml:15
<host.com> ESTABLISH SSH CONNECTION FOR USER: None
<host.com> SSH: EXEC ssh -C -q -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=90 host.com '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-vpmtgculyicilnpppwdlutjqrqcborig; LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python -tt'"'"'"'"'"'"'"'"''"'"''
skipping: [host.com] => (item=[u'influxdb-0.13.0', u'telegraf-0.13.0', u'kapacitor-0.13.0'])  => {"changed": false, "invocation": {"module_args": {"conf_file": null, "disable_gpg_check": false, "disablerepo": null, "enablerepo": null, "exclude": null, "install_repoquery": true, "list": null, "name": ["influxdb-0.13.0", "telegraf-0.13.0", "kapacitor-0.13.0"], "state": "present", "update_cache": true}, "module_name": "yum"}, "item": ["influxdb-0.13.0", "telegraf-0.13.0", "kapacitor-0.13.0"], "msg": "", "rc": 0, "results": ["influxdb-0.13.0-1.x86_64 providing influxdb-0.13.0 is already installed", "kapacitor-0.13.0: Nothing to do"]}

...
ACTUAL RESULTS
...

TASK [role.name : Install InfluxDB, Telegraf, Kapacitor | CentOS] *****
task path: /Users/MY_NAME/git/ansible/roles/role.name/tasks/main.yml:15
<host.com> ESTABLISH SSH CONNECTION FOR USER: None
<host.com> SSH: EXEC ssh -C -q -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=90 host.com '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-gebrlupznaezjmkmqttxlkspnqfwgack; LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python -tt'"'"'"'"'"'"'"'"''"'"''
skipping: [host.com] => (item=[u'influxdb-0.13.0.x86_64', u'telegraf-0.13.0.x86_64', u'kapacitor-0.13.0.x86_64'])  => {"changed": false, "failed": true, "invocation": {"module_args": {"conf_file": null, "disable_gpg_check": false, "disablerepo": null, "enablerepo": null, "exclude": null, "install_repoquery": true, "list": null, "name": ["influxdb-0.13.0.x86_64", "telegraf-0.13.0.x86_64", "kapacitor-0.13.0.x86_64"], "state": "present", "update_cache": true}, "module_name": "yum"}, "item": ["influxdb-0.13.0.x86_64", "telegraf-0.13.0.x86_64", "kapacitor-0.13.0.x86_64"], "msg": "No Package matching 'influxdb-0.13.0.x86_64' found available, installed or updated", "rc": 0, "results": []}

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @site.retry

PLAY RECAP *********************************************************************
host.com    : ok=2    changed=0    unreachable=0    failed=1  
@nitzmahone
Copy link
Member

@kellenanker Hmm, there was a bug around arg squashing that was just fixed late in 2.1 (the original task shouldn't show up as skipped, just "ok")- I'm wondering if the behavior is triggered by that bug. Could you try your repro against 2.1 and see if it's still occurring?

@nitzmahone nitzmahone added bug_report needs_info This issue requires further information. Please answer any outstanding questions. P2 Priority 2 - Issue Blocks Release labels May 26, 2016
@nitzmahone nitzmahone added this to the 2.1.0 milestone May 26, 2016
@kellenanker
Copy link
Author

Same problem. Currently working with Ansible 2.1.0.0

@nitzmahone
Copy link
Member

Interesting- do you see "ok" on that task instead of "skipped" (followed by the bailout)?

@kellenanker
Copy link
Author

Yep, its now saying "ok," but it still gives that message "No Package matching 'influxdb-0.13.0.x86_64' found available, installed or updated"

@jimi-c
Copy link
Member

jimi-c commented Jun 6, 2016

@kellenanker was influxdb installed from a yum repository or directly via an RPM downloaded? The yum module tries to query yum repositories for the data, so it will fail like this if it can't find the requested name somewhere in a yum repodata.

@jimi-c
Copy link
Member

jimi-c commented Jun 24, 2016

@kellenanker there hasn't been any follow-up recently, is this still an issue per the previous comment I left above?

@jszwedko
Copy link
Contributor

We saw this same issue with ansible 2.1.0.0 when trying to install a package that doesn't exist using with_items:

$ cat playbook.yml
# vim:ft=ansible:

---
- hosts: "{{ target }}"
  tasks:
    - yum: name={{ item }}
      with_items:
        - non-existent-package
      become: yes
$ ansible-playbook ansible/playbook.yml -i 54.172.185.149, -e target=54.172.185.149 -e ansible_ssh_user=ec2-user -vvvv
No config file found; using defaults
Loaded callback default of type stdout, v2.0

PLAYBOOK: playbook.yml *********************************************************
1 plays in ansible/playbook.yml

PLAY [54.172.185.149] **********************************************************

TASK [setup] *******************************************************************
<54.172.185.149> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<54.172.185.149> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r 54.172.185.149 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1467232866.6-28333134342170 `" && echo ansible-tmp-1467232866.6-28333134342170="` echo $HOME/.ansible/tmp/ansible-tmp-1467232866.6-28333134342170 `" ) && sleep 0'"'"''
<54.172.185.149> PUT /tmp/tmp3cjbRw TO /home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.6-28333134342170/setup
<54.172.185.149> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r '[54.172.185.149]'
<54.172.185.149> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<54.172.185.149> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r -tt 54.172.185.149 '/bin/sh -c '"'"'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.6-28333134342170/setup; rm -rf "/home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.6-28333134342170/" > /dev/null 2>&1 && sleep 0'"'"''
ok: [54.172.185.149]

TASK [yum] *********************************************************************
task path: /home/admin/cosmos/galaxy-base-image/ansible/playbook.yml:6
<54.172.185.149> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<54.172.185.149> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r 54.172.185.149 '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo $HOME/.ansible/tmp/ansible-tmp-1467232866.94-201908436327832 `" && echo ansible-tmp-1467232866.94-201908436327832="` echo $HOME/.ansible/tmp/ansible-tmp-1467232866.94-201908436327832 `" ) && sleep 0'"'"''
<54.172.185.149> PUT /tmp/tmp2rPwEI TO /home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.94-201908436327832/yum
<54.172.185.149> SSH: EXEC sftp -b - -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r '[54.172.185.149]'
<54.172.185.149> ESTABLISH SSH CONNECTION FOR USER: ec2-user
<54.172.185.149> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ec2-user -o ConnectTimeout=10 -o ControlPath=/home/admin/.ansible/cp/ansible-ssh-%h-%p-%r -tt 54.172.185.149 '/bin/sh -c '"'"'sudo -H -S -n -u root /bin/sh -c '"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-xjamltfffagyhwlyslbwtabrfbbpkaof; LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.94-201908436327832/yum; rm -rf "/home/ec2-user/.ansible/tmp/ansible-tmp-1467232866.94-201908436327832/" > /dev/null 2>&1'"'"'"'"'"'"'"'"' && sleep 0'"'"''
ok: [54.172.185.149] => (item=[u'non-existent-package']) => {"changed": false, "failed": true, "invocation": {"module_args": {"conf_file": null, "disable_gpg_check": false, "disablerepo": null, "enablerepo": null, "exclude": null, "install_repoquery": true, "list": null, "name": ["non-existent-package"], "state": "installed", "update_cache": false, "validate_certs": true}, "module_name": "yum"}, "item": ["non-existent-package"], "msg": "No Package matching 'non-existent-package' found available, installed or updated", "rc": 0, "results": []}

NO MORE HOSTS LEFT *************************************************************
        to retry, use: --limit @ansible/playbook.retry

PLAY RECAP *********************************************************************
54.172.185.149             : ok=1    changed=0    unreachable=0    failed=1

Which is confusing since the task reports ok, but still aborts the ansible run.

@kellenanker
Copy link
Author

@jimi-c influxdb was installed via a repo. Running yum search influxdb-0.13.0.x86_64 --showduplicates shows that this package does indeed exist in the repository from which I am pulling

@minusdavid
Copy link

I'm running into this same problem on RHEL 6.8 with Ansible 2.1.0.0 from EPEL 6 repository.

The task says "ok" and is written in green text.

However, at the bottom of the output it says:

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @site.retry

PLAY RECAP *********************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=1

Relevant content when using "-vvvv":

"msg": "No Package matching 'perl-Module-Build-0.42055' found available, installed or updated", "rc": 0, "results": ["perl-App-cpanminus-1.7042-1.el6.noarch providing perl-App-cpanminus is already installed"]

In this case, perl-App-cpanminus was the first of about 30 items in the "with_items" list for yum.

@minusdavid
Copy link

I suppose you could argue that it should be "ok" because yum was able to complete its task. If you register a variable for the yum task, you'll see that "command_result.msg" is "All items completed". To find "No Package matching 'perl-Module-Build-0.42055' found available, installed or updated", you have to go to loop through command_result.results and that will show you that "msg", "rc", and "results" I posted above.

But even if we're ok with it being "ok", why does Ansible show the RECAP as having a failed task?

Yum itself has an interesting behaviour in that if you tried "yum install perl-Module-Build-0.42055", it would have an exit code of 1, but if you tried "yum install perl-Module-Build-0.42055 perl-Module-Build-0.4205", it would have an exit code of 0 as the last module actually exists. However, I don't think the return code is having an effect here...

Btw, this perl-Module-Build package is one I built myself, so you won't find it in RHEL6 or EPEL6. It's just an example though. You could use any package.

@minusdavid
Copy link

Note that we're all using loops as well...

If you don't use a loop and you just specify a single name, the task has a fatal error and shows up as failed in the RECAP:

TASK [application : yum] *******************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "No Package matching 'picklesssss' found available, installed or updated", "rc": 0, "results": []}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @site.retry

PLAY RECAP *********************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=1

@minusdavid
Copy link

Interesting that the rc is 0... as that would be 1 on the command line, but good that it shows as failed. I don't know anything about writing Ansible modules, but maybe the real rc is 1 and that's what's triggering the failure?

I wonder why it doesn't work with a loop. I know the yum module is optimized to run once when using a loop... so maybe the problematic yum behaviour I noted above is involved...

@minusdavid
Copy link

I reckon this is the line that causes the module to fail and the PLAY RECAP to note a failed task: https://github.com/ansible/ansible-modules-core/blob/b3c606047d111d64d30a7e20690a081414ceae52/packaging/os/yum.py#L851

However, why is it showing up as "ok" in the task output...

dagwieers added a commit to dagwieers/ansible-modules-core that referenced this issue Sep 5, 2016
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes ansible#4214, ansible#4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
dagwieers added a commit to dagwieers/ansible-modules-core that referenced this issue Sep 5, 2016
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes ansible#4214, ansible#4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
@ansibot ansibot added affects_2.0 This issue/PR affects Ansible v2.0 and removed needs_info This issue requires further information. Please answer any outstanding questions. labels Sep 7, 2016
@geerlingguy
Copy link
Contributor

geerlingguy commented Sep 12, 2016

I've hit this recently too, on CentOS 7 on a package module install using with_items:

- name: Ensure Java is installed.
  package: "name={{ item }} state=installed"
  with_items: "{{ java_packages }}"

And in the console during a playbook run:

TASK [geerlingguy.java : Ensure Java is installed.] ****************************
ok: [logs] => (item=[u'openjdk-8-jdk'])

NO MORE HOSTS LEFT *************************************************************
    to retry, use: --limit @provisioning/elk/playbook.retry

PLAY RECAP *********************************************************************
logs                       : ok=2    changed=0    unreachable=0    failed=1 

Same thing if I use the yum module. Note that the problem is that the package is incorrect (I was using the same playbook for Ubuntu and CentOS, but the CentOS package should've been java-1.8.0-openjdk. However, the failure wasn't noted and that caused a bit of a misdirection!

Using Ansible 2.1.1.0 from pip.

@jimi-c
Copy link
Member

jimi-c commented Sep 20, 2016

@minusdavid perhaps we should add an option there to allow that case to be ignored rather than raise an error?

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Sep 20, 2016
@mckerrj mckerrj modified the milestones: 2.3.0, stable-2.1 Sep 30, 2016
@ansibot
Copy link
Contributor

ansibot commented Oct 7, 2016

@kellenanker ping, this issue is still waiting on your feedback. We will close the issue if you do not respond.
click here for bot help

@minusdavid
Copy link

@jimi-c how do you mean? Could yoi elaborate on your idea?

@kellenanker
Copy link
Author

Just to follow up on this matter (and so the ticket isn't closed while everyone is still discussing it): rolling back to Ansible 2.0.1.0 fixed the issue. I have yet to attempt to reproduce it on a more recent version since rolling back.

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 10, 2016
abadger pushed a commit to ansible/ansible-modules-core that referenced this issue Oct 18, 2016
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes #4214, #4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
abadger pushed a commit to ansible/ansible-modules-core that referenced this issue Oct 18, 2016
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes #4214, #4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252

(cherry picked from commit 20726b9)
@abadger
Copy link
Contributor

abadger commented Oct 28, 2016

can someone verify whether this is fixed by ansible/ansible-modules-core#4617 ? That change has been merged to devel and stable-2.2 and will be in 2.2.0 when released.

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 28, 2016
bdowling pushed a commit to bdowling/ansible-modules-core that referenced this issue Oct 28, 2016
The implementation is fairly simple, we force the rc= parameter to not be zero so that the check in _executor/task_result.py_ correctly determines that it failed. Without this change Ansible would report the task to be ok (despite failed=True and msg=Some_error_message) although Ansible stops and the summary output reports a failed task.

This fixes ansible#4214, ansible#4384 and also relates to ansible/ansible#12070, ansible/ansible#16006, ansible/ansible##16597, ansible/ansible#17208 and ansible/ansible#17252
@ansibot
Copy link
Contributor

ansibot commented Nov 13, 2016

@kellenanker ping, this issue is still waiting on your feedback. We will close the issue if you do not respond.
click here for bot help

@jszwedko
Copy link
Contributor

This appears to be fixed in 2.1.2.0

@jimi-c
Copy link
Member

jimi-c commented Nov 27, 2016

Based on the above reply from @jszwedko and no further follow-ups, we'll go ahead and consider this fixed and close it now.

If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:

Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved.

Thank you!

@jimi-c jimi-c closed this as completed Nov 27, 2016
@jimi-c jimi-c removed the needs_info This issue requires further information. Please answer any outstanding questions. label Nov 27, 2016
@glenjarvis-repairpal
Copy link

glenjarvis-repairpal commented Apr 27, 2017

I'm not certain that it's fixed in 2.1.2.0. I think possibly the underlaying problem was fixed coincidentally when upgrading.

I have this version:

$ ansible-playbook --version
ansible-playbook 2.2.2.0
  config file = /Users/glenjarvis/Desktop/CodeRepos/snip/ansible.cfg
  configured module search path = Default w/o overrides

I see this as the complete output:

PLAY RECAP *********************************************************************

When, normally, the output would be this:

PLAY [snip-rails] *************************************************************

TASK [setup] *******************************************************************
ok: [34.201.129.104]

TASK [Does it work?] ***********************************************************
changed: [34.201.129.104]

PLAY RECAP *********************************************************************
34.201.129.104             : ok=2    changed=1    unreachable=0    failed=0

However, my particular problem is related to my custom ansible/hosts file that I just modified. When doing the test with a static host file, I get the good results above. When testing against the changes (that should be equivalent) for my dynamic inventory ansible/hosts file, I see the PLAY RECAP only output above.

So, I know that this is actually my problem. But, we still get similar behavior as above. I have to keep digging what is different in this ansible/hosts file.. I keep comparing and coming up with the results that it's the same -- but clearly, it isn't -- so there's something here I need to uncover.

Update: I was debugging and forgot to take out my pretty print. So, the hosts file probably did not return actual JSON. So, I found my answer -- but there wasn't really good debugging to only see the RECAP printed.

def main():
    """Gather AWS inventory in expected format and print to stdout"""

    #print ansible_hosts_json()
    import pprint
    pprint.pprint(ansible_hosts())

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@dagwieers dagwieers added the packaging Packaging category label Mar 3, 2019
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.0 This issue/PR affects Ansible v2.0 bug This issue/PR relates to a bug. P2 Priority 2 - Issue Blocks Release packaging Packaging category
Projects
None yet
Development

No branches or pull requests