ansible-for-devops: ansible -B does not return ansible_job_id (page 37)

This appears to be a long-standing issue with Ansible, as seen here:

https://github.com/ansible/ansible/issues/15988

I commented on that thread with what I found, but I will copy+paste it here as well:

Attempting to do the ad-hoc command of:

ansible multi -b -B 3600 -a "yum -y update"

only returns:

192.168.60.4 | SUCCESS | rc=0 >>
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.den1.denvercolo.net
 * extras: mirrors.cat.pdx.edu
 * updates: mirrors.centos.webair.com
No packages marked for update

192.168.60.5 | SUCCESS | rc=0 >>
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nodesdirect.com
 * extras: repos.mia.quadranet.com
 * updates: mirror.atlantic.net
No packages marked for update

192.168.60.6 | SUCCESS | rc=0 >>
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.den1.denvercolo.net
 * extras: mirror.jax.hugeserver.com
 * updates: mirrors.centos.webair.com
No packages marked for update

when it should be returning something like:

background launch...
192.168.60.6 | success >> {
    "ansible_job_id": "763350539037",
    "results_file": "/root/.ansible_async/763350539037",
    "started": 1
}
... [other hosts] ...

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (12 by maintainers)

Most upvoted comments

Closing this issue as the text will now default to presuming -P doesn’t do anything unless set to -P 0 (in which case it immediately prints the job IDs and exits).

Thanks for reporting this; I’ll do a little digging.