yum module and with_items: confusing error output

29 views
Skip to first unread message

Julien Tognazzi

unread,
Oct 21, 2016, 9:47:20 AM10/21/16
to Ansible Project
Dear list,

I noticed the following behaviour with ansible 2.1.1.0

the following play:
- hosts: all
  become
: true

  tasks
:
 
- name: Install required packages
    yum
: name={{ item }} state=latest update_cache=yes
    with_items
:
   
- donotexist-1.2


output:
$ ansible-playbook -i myinventory yum.yml

PLAY [all] *********************************************************************

TASK [Install required packages] ***********************************************
Friday 21 October 2016  15:35:48 +0200 (0:00:00.050)       0:00:00.050 ********
ok: [myserver] => (item=[u'donotexist-1.2'])

NO MORE HOSTS LEFT *************************************************************

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

Friday 21 October 2016  15:36:03 +0200 (0:00:14.521)       0:00:14.572 ********
===============================================================================
Install required packages ---------------------------------------------- 14.52s
Playbook run took 0 days, 0 hours, 0 minutes, 14 seconds

Notice how the task status is ok but the play failed.

If I get rid of "with_items" then the task and the play fails as it should.

Should I report a bug ? 

Thank for your attention.
Reply all
Reply to author
Forward
0 new messages