summaryrefslogtreecommitdiff
path: root/roles/installer/openbsd/base/tasks/main.yml
blob: 2d6e905ead4b4887851c157e97b816e89cca8e39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- name: install genisoimage and openbsd signify
  apt:
    name:
    - genisoimage
    - signify-openbsd
    state: present

- name: prepare directories for installer iso files
  loop: "{{ openbsd_versions | subelements('arch') }}"
  loop_control:
    label: "openbsd-{{ item.0.version }} {{ item.1 }}"
  file:
    name: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}"
    state: directory

- name: download installer iso files
  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: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/install{{ item.0.version | replace('.', '') }}.iso"
    mode: 0644
    force: "{{ openbsd_installer_force_download }}"

- name: download signed sha256 files
  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 }}/SHA256.sig"
    dest: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}/SHA256.sig"
    mode: 0644
    force: "{{ openbsd_installer_force_download }}"

- name: create signing key files
  loop: "{{ openbsd_versions }}"
  loop_control:
    label: "openbsd-{{ item.version }}"
  copy:
    content: "{{ openbsd_signing_keys[item.version] }}"
    dest: "{{ installer_path }}/openbsd-{{ item.version }}/openbsd-{{ item.version | replace('.', '') }}-base.pub"

- name: verfiy downloaded iso files
  loop: "{{ openbsd_versions | subelements('arch') }}"
  loop_control:
    label: "openbsd-{{ item.0.version }} {{ item.1 }}"
  command: "signify-openbsd -Cp ../openbsd-{{ item.0.version | replace('.', '') }}-base.pub -x SHA256.sig install{{ item.0.version | replace('.', '') }}.iso"
  args:
    chdir: "{{ installer_path }}/openbsd-{{ item.0.version }}/{{ item.1 }}"
  changed_when: false