if one package fails all other non dependent packages installation fails in ansible

21 views
Skip to first unread message

Sameer Modak

unread,
Aug 20, 2017, 2:32:13 PM8/20/17
to Ansible Project
TASK [get python-yum and python-curl] *************************************************************************************************************************************
...ignoring
failed: [192.168.211.131] (item=[u'python-pycurl', u'git', u'curl', u'php5-common', u'php5-cli', u'php5-mysql', u'php5-curl', u'php5-gd', u'php5-dev', u'php5-mcrypt', u'php-apc', u'php-pear', u'python-mysqldb', u'mysql-server']) => {"changed": false, "failed": true, "item": ["python-pycurl", "git", "curl", "php5-common", "php5-cli", "php5-mysql", "php5-curl", "php5-gd", "php5-dev", "php5-mcrypt", "php-apc", "php-pear", "python-mysqldb", "mysql-server"], "msg": "No package matching 'php5-common' found available, installed or updated", "rc": 126, "results": ["python-pycurl-7.19.0-17.el7.x86_64 providing python-pycurl is already installed", "git-1.8.3.1-5.el7.x86_64 providing git is already installed", "curl-7.29.0-25.el7.centos.x86_64 providing curl is already installed", "No package matching 'php5-common' found available, installed or updated"]}
=========================================================
code:
- name: "get python-yum and python-curl"
    yum: name={{ item }} state=installed
    with_items:
    - python-pycurl
    - git
    - curl
    - php5-common
    - php5-cli
    - php5-mysql
    - php5-curl
    - php5-gd
    - php5-dev
    - php5-mcrypt
    - php-apc
    - php-pear
    - python-mysqldb
    - mysql-server
    ignore_errors: yes

Kai Stian Olstad

unread,
Aug 25, 2017, 4:53:42 PM8/25/17
to ansible...@googlegroups.com
On søndag 20. august 2017 20.32.13 CEST Sameer Modak wrote:
> TASK [get python-yum and python-curl]
> ****************************************************************************
> ********************************************************* ...ignoring
> failed: [192.168.211.131] (item=[u'python-pycurl', u'git', u'curl',
> u'php5-common', u'php5-cli', u'php5-mysql', u'php5-curl', u'php5-gd',
> u'php5-dev', u'php5-mcrypt', u'php-apc', u'php-pear', u'python-mysqldb',
> u'mysql-server']) => {"changed": false, "failed": true, "item":
> ["python-pycurl", "git", "curl", "php5-common", "php5-cli", "php5-mysql",
> "php5-curl", "php5-gd", "php5-dev", "php5-mcrypt", "php-apc", "php-pear",
> "python-mysqldb", "mysql-server"], "msg": "No package matching
> 'php5-common' found available, installed or updated", "rc": 126, "results":
> ["python-pycurl-7.19.0-17.el7.x86_64 providing python-pycurl is already
> installed", "git-1.8.3.1-5.el7.x86_64 providing git is already installed",
> "curl-7.29.0-25.el7.centos.x86_64 providing curl is already installed", "No
> package matching 'php5-common' found available, installed or updated"]}
> =========================================================
> code:
> - name: "get python-yum and python-curl"
> yum: name={{ item }} state=installed
> with_items:
> - python-pycurl
> - git

<snip />

That's by design, this is one task and Ansible fails a entire task and not
just part of it.
If you need that feature you need to split it up in several tasks.


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages