summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuya Kusakabe <yuya.kusakabe@gmail.com>2018-06-22 05:48:40 +0900
committerYuya Kusakabe <yuya.kusakabe@gmail.com>2018-06-22 05:48:40 +0900
commita630e8003465c8386f99236bc57f450c3cbb1ab4 (patch)
tree3a2dca22c5a144a221d2eae2dd9c150f3681a5af
parenta941d7972609f859f4de6d3fd6f6ceb6c065a94b (diff)
downloadvyos-vm-images-a630e8003465c8386f99236bc57f450c3cbb1ab4.tar.gz
vyos-vm-images-a630e8003465c8386f99236bc57f450c3cbb1ab4.zip
Move install_package to common role
-rw-r--r--roles/common/tasks/get_latest_iso.yml9
-rw-r--r--roles/common/tasks/install_packages.yml (renamed from roles/hyperv/tasks/install_packages.yml)2
-rw-r--r--roles/common/tasks/main.yml11
-rw-r--r--roles/qemu/tasks/install_packages.yml10
-rw-r--r--roles/qemu/tasks/main.yml1
-rw-r--r--roles/vagrant-libvirt/tasks/install_packages.yml10
-rw-r--r--roles/vmware/tasks/install_open_vmdk.yml (renamed from roles/vmware/tasks/install_packages.yml)10
-rw-r--r--roles/vmware/tasks/main.yml2
8 files changed, 14 insertions, 41 deletions
diff --git a/roles/common/tasks/get_latest_iso.yml b/roles/common/tasks/get_latest_iso.yml
new file mode 100644
index 0000000..82d07f8
--- /dev/null
+++ b/roles/common/tasks/get_latest_iso.yml
@@ -0,0 +1,9 @@
+- name: get latest_iso if iso is not defined
+ latest_iso:
+ when: iso is not defined
+ register: latest_iso
+
+- name: set latest_iso as vyos_iso_url
+ set_fact:
+ vyos_iso_url: "{{ latest_iso.latest_iso }}"
+ when: latest_iso is defined
diff --git a/roles/hyperv/tasks/install_packages.yml b/roles/common/tasks/install_packages.yml
index b60241e..c5a2dbe 100644
--- a/roles/hyperv/tasks/install_packages.yml
+++ b/roles/common/tasks/install_packages.yml
@@ -7,4 +7,6 @@
- e2fsprogs
- gnupg
- qemu-utils
+ - python-lxml
+ - aufs-tools
state: present
diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml
index 82d07f8..f3f1395 100644
--- a/roles/common/tasks/main.yml
+++ b/roles/common/tasks/main.yml
@@ -1,9 +1,2 @@
-- name: get latest_iso if iso is not defined
- latest_iso:
- when: iso is not defined
- register: latest_iso
-
-- name: set latest_iso as vyos_iso_url
- set_fact:
- vyos_iso_url: "{{ latest_iso.latest_iso }}"
- when: latest_iso is defined
+- include_tasks: install_packages.yml
+- include_tasks: get_latest_iso.yml
diff --git a/roles/qemu/tasks/install_packages.yml b/roles/qemu/tasks/install_packages.yml
deleted file mode 100644
index b60241e..0000000
--- a/roles/qemu/tasks/install_packages.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-- name: Install required packages
- become: yes
- apt:
- update_cache: yes
- name:
- - parted
- - e2fsprogs
- - gnupg
- - qemu-utils
- state: present
diff --git a/roles/qemu/tasks/main.yml b/roles/qemu/tasks/main.yml
index e857382..c2a1b28 100644
--- a/roles/qemu/tasks/main.yml
+++ b/roles/qemu/tasks/main.yml
@@ -1,4 +1,3 @@
-- include_tasks: install_packages.yml
- include_tasks: load_modules.yml
- include_tasks: setup_iso.yml
- include_tasks: build_image.yml
diff --git a/roles/vagrant-libvirt/tasks/install_packages.yml b/roles/vagrant-libvirt/tasks/install_packages.yml
deleted file mode 100644
index b60241e..0000000
--- a/roles/vagrant-libvirt/tasks/install_packages.yml
+++ /dev/null
@@ -1,10 +0,0 @@
-- name: Install required packages
- become: yes
- apt:
- update_cache: yes
- name:
- - parted
- - e2fsprogs
- - gnupg
- - qemu-utils
- state: present
diff --git a/roles/vmware/tasks/install_packages.yml b/roles/vmware/tasks/install_open_vmdk.yml
index 23e5f6f..87c54c2 100644
--- a/roles/vmware/tasks/install_packages.yml
+++ b/roles/vmware/tasks/install_open_vmdk.yml
@@ -1,13 +1,3 @@
-- name: Install required packages
- become: yes
- apt:
- update_cache: yes
- name:
- - parted
- - e2fsprogs
- - gnupg
- - qemu-utils
- state: present
- name: Download open-vmdk
get_url:
url: https://github.com/vmware/open-vmdk/archive/master.zip
diff --git a/roles/vmware/tasks/main.yml b/roles/vmware/tasks/main.yml
index e857382..00492a9 100644
--- a/roles/vmware/tasks/main.yml
+++ b/roles/vmware/tasks/main.yml
@@ -1,4 +1,4 @@
-- include_tasks: install_packages.yml
+- include_tasks: install_open_vmdk.yml
- include_tasks: load_modules.yml
- include_tasks: setup_iso.yml
- include_tasks: build_image.yml