This patch fixes Build, which broke because of Ansible's deprecation of
v2.2. We now install Ansible using pip instead of apt.
Change-Id: Iab85f416ddb52466a47c5c4923d766b903534e0b
(cherry picked from commit 2adaaafdb36bec9e70b8f89cfe0f75ddab7b422f)
diff --git a/README.md b/README.md
index 0813706..21faf4d 100644
--- a/README.md
+++ b/README.md
@@ -89,3 +89,4 @@
### Dependencies
This role depends on the `compute-node` role.
+
diff --git a/roles/ansible/tasks/main.yml b/roles/ansible/tasks/main.yml
index 10a5293..6edffcb 100644
--- a/roles/ansible/tasks/main.yml
+++ b/roles/ansible/tasks/main.yml
@@ -1,10 +1,30 @@
-- name: Ansible Repository
- become: yes
- apt_repository:
- repo: "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
-
-- name: Ensure Ansible
+- name: "Install apt dependencies"
become: yes
apt:
- name=ansible=2.2.*
- state=present
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - python-dev
+ - libffi-dev
+ - python-pip
+ - libssl-dev
+ - sshpass
+
+- name: "Install Ansible via pip"
+ pip: name=ansible version=2.2.2.0
+ become: yes
+
+# - name: Ansible Repository
+# become: yes
+# apt_repository:
+# repo: "{{ ansible_apt_repo | default('ppa:ansible/ansible') }}"
+# register: result
+# until: result | success
+# retries: 3
+# delay: 10
+
+# - name: Ensure Ansible
+# become: yes
+# apt:
+# name=ansible=2.2.*
+# state=present
diff --git a/scripts/bootstrap_ansible.sh b/scripts/bootstrap_ansible.sh
index a5e8549..3d089f3 100755
--- a/scripts/bootstrap_ansible.sh
+++ b/scripts/bootstrap_ansible.sh
@@ -18,8 +18,11 @@
set -e
echo "Installing Ansible..."
-apt-get install -y software-properties-common ca-certificates
-apt-add-repository ppa:ansible/ansible
-apt-get update
-apt-get install -y ansible
+# apt-get install -y software-properties-common ca-certificates
+# apt-add-repository ppa:ansible/ansible
+# apt-get update
+# apt-get install -y ansible
+apt-get -y install python-dev libffi-dev python-pip libssl-dev sshpass
+pip install ansible==2.2.2.0
+mkdir -p /etc/ansible
cp /maasdev/ansible/ansible.cfg /etc/ansible/ansible.cfg