diff options
author | Christian Pointner <equinox@spreadspace.org> | 2019-12-08 23:17:00 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2019-12-08 23:17:00 +0100 |
commit | c3ebbe6bcf645612b2e89efd8eec763cffd285d1 (patch) | |
tree | e0b4c4d989c158e4393d106b37497b1955392e8d | |
parent | elevate-festival: added ip config for wireless wire bridges (diff) |
added openbsd installer role
-rw-r--r-- | chaos-at-home/ch-atlas.yml | 1 | ||||
-rw-r--r-- | chaos-at-home/ch-gnocchi.yml | 2 | ||||
-rw-r--r-- | dan/sk-2019vm.yml | 1 | ||||
-rw-r--r-- | inventory/group_vars/kvmhosts/main.yml | 2 | ||||
-rw-r--r-- | inventory/host_vars/ch-gnocchi.yml | 6 | ||||
-rw-r--r-- | roles/installer/debian/defaults/main.yml (renamed from roles/debian-installer/defaults/main.yml) | 3 | ||||
-rw-r--r-- | roles/installer/debian/tasks/main.yml (renamed from roles/debian-installer/tasks/main.yml) | 0 | ||||
-rw-r--r-- | roles/installer/openbsd/defaults/main.yml | 10 | ||||
-rw-r--r-- | roles/installer/openbsd/tasks/main.yml | 17 | ||||
-rw-r--r-- | roles/usb-install/meta/main.yml | 2 | ||||
-rw-r--r-- | roles/vm/host/meta/main.yml | 3 | ||||
-rw-r--r-- | roles/vm/host/tasks/main.yml | 32 | ||||
-rw-r--r-- | roles/vm/install/meta/main.yml | 2 |
13 files changed, 68 insertions, 13 deletions
diff --git a/chaos-at-home/ch-atlas.yml b/chaos-at-home/ch-atlas.yml index dc7ef545..21c52da1 100644 --- a/chaos-at-home/ch-atlas.yml +++ b/chaos-at-home/ch-atlas.yml @@ -5,3 +5,4 @@ - role: sshd - role: zsh - role: vm/host + - role: installer/debian diff --git a/chaos-at-home/ch-gnocchi.yml b/chaos-at-home/ch-gnocchi.yml index 751ec65a..b4c1ef21 100644 --- a/chaos-at-home/ch-gnocchi.yml +++ b/chaos-at-home/ch-gnocchi.yml @@ -6,6 +6,8 @@ - role: sshd - role: zsh - role: vm/host + - role: installer/debian + - role: installer/openbsd post_tasks: - pause: prompt: "{{ __interface_configs__ }}" diff --git a/dan/sk-2019vm.yml b/dan/sk-2019vm.yml index 01290563..bb7b7d76 100644 --- a/dan/sk-2019vm.yml +++ b/dan/sk-2019vm.yml @@ -9,6 +9,7 @@ - role: cryptdisk - role: zfs/base - role: vm/host + - role: installer/debian tasks: - name: install post-boot script copy: diff --git a/inventory/group_vars/kvmhosts/main.yml b/inventory/group_vars/kvmhosts/main.yml index 7ae104b1..eef2a639 100644 --- a/inventory/group_vars/kvmhosts/main.yml +++ b/inventory/group_vars/kvmhosts/main.yml @@ -1,3 +1,3 @@ --- preseed_path: /srv/preseed -debian_installer_path: /srv/installer +installer_path: /srv/installer diff --git a/inventory/host_vars/ch-gnocchi.yml b/inventory/host_vars/ch-gnocchi.yml index 04217417..278ef9f4 100644 --- a/inventory/host_vars/ch-gnocchi.yml +++ b/inventory/host_vars/ch-gnocchi.yml @@ -12,6 +12,12 @@ network: domain: spreadspace.org +installer_lvm: + vg: "{{ host_name }}" + lv: installer + size: 10G + fs: ext4 + __interfaces__: enp1s0: diff --git a/roles/debian-installer/defaults/main.yml b/roles/installer/debian/defaults/main.yml index ba20efdb..b778e85b 100644 --- a/roles/debian-installer/defaults/main.yml +++ b/roles/installer/debian/defaults/main.yml @@ -17,7 +17,8 @@ distros: - i386 debian_installer_force_download: no - debian_installer_url: debian: "https://debian.ffgraz.net/debian" ubuntu: "https://debian.ffgraz.net/ubuntu" + +debian_installer_path: "{{ installer_path }}" diff --git a/roles/debian-installer/tasks/main.yml b/roles/installer/debian/tasks/main.yml index 77228e91..77228e91 100644 --- a/roles/debian-installer/tasks/main.yml +++ b/roles/installer/debian/tasks/main.yml diff --git a/roles/installer/openbsd/defaults/main.yml b/roles/installer/openbsd/defaults/main.yml new file mode 100644 index 00000000..4538646f --- /dev/null +++ b/roles/installer/openbsd/defaults/main.yml @@ -0,0 +1,10 @@ +openbsd_versions: + - version: 6.6 + arch: + - amd64 + - i386 + +openbsd_installer_force_download: no +openbsd_installer_url: "https://cdn.openbsd.org/pub/OpenBSD/" + +openbsd_installer_path: "{{ installer_path }}" diff --git a/roles/installer/openbsd/tasks/main.yml b/roles/installer/openbsd/tasks/main.yml new file mode 100644 index 00000000..6aeba7ef --- /dev/null +++ b/roles/installer/openbsd/tasks/main.yml @@ -0,0 +1,17 @@ +- name: prepare directories for installer isos + loop: "{{ openbsd_versions | subelements('arch') }}" + loop_control: + label: "openbsd-{{ item.0.version }} {{ item.1 }}" + file: + name: "{{ openbsd_installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}" + state: directory + +- name: download installer isos + loop: "{{ openbsd_versions | subelements('arch') }}" + loop_control: + label: "openbsd-{{ item.0.version }} {{ item.1 }}" + get_url: + url: "{{ openbsd_installer_url }}/{{ item.0.version }}/{{ item.1 }}/install{{ item.0.version | replace('.', '') }}.iso" + dest: "{{ openbsd_installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/install.iso" + mode: 0644 + force: "{{ openbsd_installer_force_download }}" diff --git a/roles/usb-install/meta/main.yml b/roles/usb-install/meta/main.yml index bca7f83d..0fc96588 100644 --- a/roles/usb-install/meta/main.yml +++ b/roles/usb-install/meta/main.yml @@ -1,5 +1,5 @@ dependencies: - - role: debian-installer + - role: installer/debian distros: - distro: "{{ install_distro }}" codename: "{{ install_codename }}" diff --git a/roles/vm/host/meta/main.yml b/roles/vm/host/meta/main.yml deleted file mode 100644 index 40f6fcb3..00000000 --- a/roles/vm/host/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - role: debian-installer diff --git a/roles/vm/host/tasks/main.yml b/roles/vm/host/tasks/main.yml index 83b5fca1..ef349d4c 100644 --- a/roles/vm/host/tasks/main.yml +++ b/roles/vm/host/tasks/main.yml @@ -18,15 +18,35 @@ path: /etc/default/haveged notify: restart haveged +- name: install vm-host network + when: vm_host.network is defined + include_tasks: network.yml + +- name: create lvm-based disk for installers + when: installer_lvm is defined + block: + - name: create logical volume + lvol: + vg: "{{ installer_lvm.vg }}" + lv: "{{ installer_lvm.lv }}" + size: "{{ installer_lvm.size }}" + + - name: create filesystem + filesystem: + fstype: "{{ installer_lvm.fs }}" + dev: "/dev/mapper/{{ installer_lvm.vg | replace('-', '--') }}-{{ installer_lvm.lv | replace('-', '--') }}" + + - name: mount filesytem + mount: + src: "/dev/mapper/{{ installer_lvm.vg | replace('-', '--') }}-{{ installer_lvm.lv | replace('-', '--') }}" + path: "{{ installer_path }}" + fstype: "{{ installer_lvm.fs }}" + state: mounted + - name: make sure installer directories exists loop: - - "{{ debian_installer_path }}" + - "{{ installer_path }}" - "{{ preseed_path }}" file: name: "{{ item }}" state: directory - -- name: install vm-host network - when: vm_host.network is defined - include_tasks: network.yml - diff --git a/roles/vm/install/meta/main.yml b/roles/vm/install/meta/main.yml index d5f95204..710f90ad 100644 --- a/roles/vm/install/meta/main.yml +++ b/roles/vm/install/meta/main.yml @@ -1,6 +1,6 @@ --- dependencies: - - role: debian-installer + - role: installer/debian distros: - distro: "{{ install_distro }}" codename: "{{ install_codename }}" |