summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/usb-install.yml2
-rw-r--r--roles/installer/debian/base/defaults/main.yml2
-rw-r--r--roles/installer/debian/base/tasks/main.yml6
-rw-r--r--roles/installer/debian/usb/tasks/main.yml33
-rw-r--r--roles/usb-install/meta/main.yml6
-rw-r--r--roles/usb-install/tasks/main.yml23
6 files changed, 38 insertions, 34 deletions
diff --git a/common/usb-install.yml b/common/usb-install.yml
index 33f488eb..56508af8 100644
--- a/common/usb-install.yml
+++ b/common/usb-install.yml
@@ -20,7 +20,7 @@
name: "{{ artifacts_dir }}"
roles:
- - role: usb-install
+ - role: installer/debian/usb
post_tasks:
- stat:
diff --git a/roles/installer/debian/base/defaults/main.yml b/roles/installer/debian/base/defaults/main.yml
index 39fc787d..fe6d880d 100644
--- a/roles/installer/debian/base/defaults/main.yml
+++ b/roles/installer/debian/base/defaults/main.yml
@@ -1,4 +1,4 @@
-distros:
+debian_installer_distros:
- distro: debian
codename: stretch
arch:
diff --git a/roles/installer/debian/base/tasks/main.yml b/roles/installer/debian/base/tasks/main.yml
index 8ce494ae..a7000f3c 100644
--- a/roles/installer/debian/base/tasks/main.yml
+++ b/roles/installer/debian/base/tasks/main.yml
@@ -1,5 +1,5 @@
- name: prepare directories for installer images
- loop: "{{ distros | subelements('arch') }}"
+ loop: "{{ debian_installer_distros | subelements('arch') }}"
loop_control:
label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}"
file:
@@ -7,7 +7,7 @@
state: directory
- name: download installer kernel images
- loop: "{{ distros | subelements('arch') }}"
+ loop: "{{ debian_installer_distros | subelements('arch') }}"
loop_control:
label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}"
get_url:
@@ -17,7 +17,7 @@
force: "{{ debian_installer_force_download }}"
- name: download installer initrd.gz
- loop: "{{ distros | subelements('arch') }}"
+ loop: "{{ debian_installer_distros | subelements('arch') }}"
loop_control:
label: "{{ item.0.distro }}/{{ item.0.codename }} {{ item.1 }}"
get_url:
diff --git a/roles/installer/debian/usb/tasks/main.yml b/roles/installer/debian/usb/tasks/main.yml
new file mode 100644
index 00000000..60c2dfd5
--- /dev/null
+++ b/roles/installer/debian/usb/tasks/main.yml
@@ -0,0 +1,33 @@
+---
+- block:
+ - name: download installer
+ vars:
+ debian_installer_distros:
+ - distro: "{{ install_distro }}"
+ codename: "{{ install_codename }}"
+ arch:
+ - "{{ install.arch | default('amd64') }}"
+ import_role:
+ role: installer/debian/base
+
+ - name: Create temporary workdir
+ tempfile:
+ state: directory
+ register: tmpdir
+
+ - name: generate pressed file
+ vars:
+ preseed_tmpdir: "{{ tmpdir.path }}"
+ import_role:
+ name: installer/debian/preseed
+
+ - name: Copy the preseed initramfs to the artifacts directory
+ copy:
+ src: "{{ tmpdir.path }}/initrd.preseed.gz"
+ dest: "{{ artifacts_dir }}/"
+
+ always:
+ - name: Cleanup temporary workdir
+ file:
+ path: "{{ tmpdir.path }}"
+ state: absent
diff --git a/roles/usb-install/meta/main.yml b/roles/usb-install/meta/main.yml
deleted file mode 100644
index 9db4a441..00000000
--- a/roles/usb-install/meta/main.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-dependencies:
- - role: installer/debian/base
- distros:
- - distro: "{{ install_distro }}"
- codename: "{{ install_codename }}"
- arch: [ "{{ install.arch | default('amd64') }}" ]
diff --git a/roles/usb-install/tasks/main.yml b/roles/usb-install/tasks/main.yml
deleted file mode 100644
index 3153b633..00000000
--- a/roles/usb-install/tasks/main.yml
+++ /dev/null
@@ -1,23 +0,0 @@
----
-- block:
- - name: Create temporary workdir
- tempfile:
- state: directory
- register: tmpdir
-
- - import_role:
- name: installer/debian/preseed
- vars:
- preseed_tmpdir: "{{ tmpdir.path }}"
-
- - name: Copy the preseed initramfs to the artifacts directory
- copy:
- src: "{{ tmpdir.path }}/initrd.preseed.gz"
- dest: "{{ artifacts_dir }}/"
-
-
- always:
- - name: Cleanup temporary workdir
- file:
- path: "{{ tmpdir.path }}"
- state: absent