From 642290c73407a7969857197810123633c83c6a26 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 13 Feb 2022 01:37:39 +0100 Subject: Bulk update Signed-off-by: Georg Pfuetzenreuter --- ansible/deployment_poc/tasks/configure_dps.yml | 54 ++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ansible/deployment_poc/tasks/configure_dps.yml (limited to 'ansible/deployment_poc/tasks/configure_dps.yml') diff --git a/ansible/deployment_poc/tasks/configure_dps.yml b/ansible/deployment_poc/tasks/configure_dps.yml new file mode 100644 index 0000000..1b610b0 --- /dev/null +++ b/ansible/deployment_poc/tasks/configure_dps.yml @@ -0,0 +1,54 @@ +--- +- name: Configure Deployment Server + block: + - name: Set DP host OS + set_fact: + dp_os: "{{ hostvars[deployment_host]['platforms'][0] }}" + + - name: Prepare Grub host file + ansible.builtin.template: + src: ../templates/grub.j2 + dest: "/srv/www/boot/hosts/{{ ip_address }}.cfg" + group: wheel + mode: '0444' #consider 0440 if group is changed to one shared by admins and webserver service user + when: dp_os == 'fedora-x86_64' or dp_os == 'openSUSE-Leap-x86_64' + + - name: Prepare unattended installation + ansible.builtin.template: + src: "../templates/autoinst_{{ namespace }}.xml.j2" + dest: "/srv/www/autoinst_{{ vm_name }}.xml" + group: wheel + mode: '0444' #consider 0440 if group is changed to one shared by admins and webserver service user + when: dp_os == 'fedora-x86_64' or dp_os == 'openSUSE-Leap-x86_64' + + - name: Prepare Grub host file for http + ansible.builtin.template: + src: ../templates/grub.j2 + dest: "/var/www/htdocs/www/boot/hosts/{{ ip_address }}.cfg" + group: wheel + mode: '0444' #consider 0440 if group is changed to one shared by admins and webserver service user + when: dp_os == 'openbsd-x86_64' + + - name: Prepare Grub host file for tftp + ansible.builtin.template: + src: ../templates/grub.j2 + dest: "/tftpboot/boot/hosts/{{ ip_address }}.cfg" + group: wheel + mode: '0444' + when: dp_os == 'openbsd-x86_64' + + - name: Generate LUKS passphrase + set_fact: + luks_passphrase: "{{ lookup('password', '/dev/null', length=15, chars=hexdigits, seed=inventory_hostname) }}" + + - name: Prepare unattended installation + ansible.builtin.template: + src: "../templates/autoinst_{{ namespace }}.xml.j2" + dest: "/var/www/htdocs/www/autoinst_{{ vm_name }}.xml" + group: wheel + mode: '0444' #consider 0440 if group is changed to one shared by admins and webserver service user + when: dp_os == 'openbsd-x86_64' + + delegate_to: "{{ deployment_host }}" + tags: + - init_dp -- cgit v1.2.3