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
diff --git a/README.md b/README.md
index f1836c7..88c15ce 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 cd98dac..ef70c5c 100644
--- a/roles/ansible/tasks/main.yml
+++ b/roles/ansible/tasks/main.yml
@@ -1,14 +1,29 @@
-- 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
+- name: "Install apt dependencies"
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