Emergency fix to ansible
Look like the with_item <variable-name> feature is broken in the
latest 2.2.0 ansible code. It works fine with previous release
2.1.0. Inlining the lists instead of referring to the defaults
works fine. So inlining the list content is an emergency fix.
Change-Id: Ibb445abe73e6bdc9378bcad0af8c8816e1df6e6e
diff --git a/ansible/roles/common/defaults/main.yml b/ansible/roles/common/defaults/main.yml
deleted file mode 100644
index c97c39d..0000000
--- a/ansible/roles/common/defaults/main.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-hosts: [
- { host_ip: "10.100.198.220", host_name: "voltha"},
-]
-
-use_latest_for:
- - debian-keyring
- - debian-archive-keyring
- - python-dev
- - libssl-dev
- - libffi-dev
- - libpcap-dev
- - python-virtualenv
- - jq
- - python-nose
- - python-flake8
- - python-scapy
-# - python-libpcap
-
-obsolete_services:
- - puppet
- - chef-client
diff --git a/ansible/roles/common/tasks/main.yml b/ansible/roles/common/tasks/main.yml
index 070972a..f3e3c3d 100644
--- a/ansible/roles/common/tasks/main.yml
+++ b/ansible/roles/common/tasks/main.yml
@@ -9,13 +9,26 @@
dest: /etc/hosts
regexp: "^{{ item.host_ip }}"
line: "{{ item.host_ip }} {{ item.host_name }}"
- with_items: hosts
+ with_items:
+ - host_ip: "10.100.198.220"
+ host_name: "voltha"
tags: [common]
- name: Latest apt packages
apt:
name: "{{ item }}"
- with_items: use_latest_for
+ with_items:
+ - debian-keyring
+ - debian-archive-keyring
+ - python-dev
+ - libssl-dev
+ - libffi-dev
+ - libpcap-dev
+ - python-virtualenv
+ - jq
+ - python-nose
+ - python-flake8
+ - python-scapy
tags: [common]
- name: Services are not running
@@ -23,7 +36,9 @@
name: "{{ item }}"
state: stopped
ignore_errors: yes
- with_items: obsolete_services
+ with_items:
+ - puppet
+ - checf-client
tags: [common]
- name: Ensure known_hosts file is absent