Guys,
I have a very simple task that works on Ansible 2.0 (both first and subsequent runs) but, doesn't work on Ansible 2.1 (only subsequent runs fails, first run also works on 2.1), as follows:
My group_vars/all have:
---
---
my task have:
---
- name: Configuring Open vSwitch Bridge Port
openvswitch_port: bridge=br-ex port="{{os_external}}" state=present
when: br_mode == 'OVS'
---
With Ansible 2.1, all subsequent runs fails, like this:
---
TASK [os_neutron : Configuring Open vSwitch Bridge Port] ***********************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "'str' object has no attribute 'items'"}
to retry, use: --limit @site-openstack.retry
---
So, as a workaround, I have to downgrade Ansible, like this:
(NOTE: Ansible 2.1 is installed in my Ubuntu 16.04 via "ppa:ansible/ansible".)
---
root@dell-desk-1:~# ppa-purge ppa:ansible/ansible
Updating packages lists
PPA to be removed: ansible ansible
Package revert list generated:
ansible/xenial
Disabling ansible PPA from
/etc/apt/sources.list.d/ansible-ubuntu-ansible-xenial.list
Updating packages lists
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version '2.0.0.2-2' (Ubuntu:16.04/xenial [all]) for 'ansible'
The following additional packages will be installed:
python-selinux
The following NEW packages will be installed:
python-selinux
The following packages will be DOWNGRADED:
ansible
0 upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 1,190 kB of archives.
After this operation, 630 kB disk space will be freed.
Do you want to continue? [Y/n]
Fetched 1,190 kB in 0s (3,183 kB/s)
dpkg: warning: downgrading ansible from 2.1.0.0-1ppa~xenial to 2.0.0.2-2
(Reading database ... 336785 files and directories currently installed.)
Preparing to unpack .../ansible_2.0.0.2-2_all.deb ...
Unpacking ansible (2.0.0.2-2) over (2.1.0.0-1ppa~xenial) ...
Selecting previously unselected package python-selinux.
Preparing to unpack .../python-selinux_2.4-3build2_amd64.deb ...
Unpacking python-selinux (2.4-3build2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ansible (2.0.0.2-2) ...
Installing new version of config file /etc/ansible/ansible.cfg ...
Installing new version of config file /etc/ansible/hosts ...
Setting up python-selinux (2.4-3build2) ...
PPA purged successfully
---
Now, playbook works:
---
TASK [os_neutron : Configuring Open vSwitch Bridge Port] ***********************
ok: [localhost]
---
Just to make sure that Ansible 2.1 is failing again:
---
root@dell-desk-1:~# add-apt-repository ppa:ansible/ansible
root@dell-desk-1:~# apt update
root@dell-desk-1:~# apt full-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
python-selinux
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
ansible
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,233 kB of archives.
After this operation, 1,675 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Fetched 1,233 kB in 1s (1,110 kB/s)
(Reading database ... 336622 files and directories currently installed.)
Preparing to unpack .../ansible_2.1.0.0-1ppa~xenial_all.deb ...
Unpacking ansible (2.1.0.0-1ppa~xenial) over (2.0.0.2-2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up ansible (2.1.0.0-1ppa~xenial) ...
Installing new version of config file /etc/ansible/ansible.cfg ...
Installing new version of config file /etc/ansible/hosts ...
---
Fails (with Ansible 2.1):
---
TASK [os_neutron : Configuring Open vSwitch Bridge Port] ***********************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "'str' object has no attribute 'items'"}
to retry, use: --limit @site-openstack.retry
---
What am I missing?
Thanks!
Thiago