summaryrefslogtreecommitdiff
path: root/playbooks/diskimage_builder.yaml
diff options
context:
space:
mode:
authorckonstanski <ckonstanski@pippiandcarlos.com>2017-11-20 18:08:15 +0000
committerckonstanski <ckonstanski@pippiandcarlos.com>2017-11-20 18:08:15 +0000
commit31d56effdc9c62055f0d35cc3a1c4bdd5ceccbe8 (patch)
treeeeb98e0fc235dda9bd564e3d208e7deed79683cd /playbooks/diskimage_builder.yaml
parentcf291ef708d38a8d6b43c796ca6f123daea0a373 (diff)
autocommit Mon Nov 20 18:08:15 UTC 2017
Diffstat (limited to 'playbooks/diskimage_builder.yaml')
-rw-r--r--playbooks/diskimage_builder.yaml51
1 files changed, 51 insertions, 0 deletions
diff --git a/playbooks/diskimage_builder.yaml b/playbooks/diskimage_builder.yaml
new file mode 100644
index 0000000..4a0fbfd
--- /dev/null
+++ b/playbooks/diskimage_builder.yaml
@@ -0,0 +1,51 @@
+---
+- name: "Install diskimage-builder"
+ hosts: all
+ tasks:
+ - name: "Update apt"
+ apt:
+ update_cache: yes
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Install packages"
+ apt:
+ pkg: "{{ item }}"
+ state: present
+ with_items:
+ - qemu
+ - parted
+ - kpartx
+ - python-yaml
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Discover whether pip is installed"
+ shell: which pip && echo "true" || echo "false"
+ register: pip_installed
+
+ - name: "Install pip"
+ shell: |
+ mkdir -p /tmp/pip
+ cd /tmp/pip
+ wget https://bootstrap.pypa.io/get-pip.py
+ python get-pip.py
+ pip install --upgrade pip dib-utils networkx
+ when: ansible_distribution == "Ubuntu" and pip_installed.stdout == "false"
+
+ - name: "Install diskimage-builder"
+ shell: |
+ mkdir -p /tmp/diskimage-builder
+ cd /tmp/diskimage-builder
+ git clone https://github.com/openstack/diskimage-builder.git
+ cd diskimage-builder
+ pip install --upgrade -r requirements.txt
+ python setup.py install
+ when: ansible_distribution == "Ubuntu"
+
+ - name: "Install packages"
+ portage:
+ name: "{{ item }}"
+ state: present
+ with_items:
+ - app-emulation/diskimage-builder
+ - app-emulation/qemu
+ when: ansible_distribution == "Gentoo"