diff --git a/roles/luks_ssh/defaults/main.yml b/roles/luks_ssh/defaults/main.yml index d51dfa0..189d394 100644 --- a/roles/luks_ssh/defaults/main.yml +++ b/roles/luks_ssh/defaults/main.yml @@ -19,14 +19,14 @@ # along with this program. If not, see . # The install location for the dracut module -dracut_ssh_dir: /usr/lib/dracut/modules.d/46sshd/ +luks_ssh_dracut_ssh_dir: /usr/lib/dracut/modules.d/46sshd/ # The authorized keys # fields: # - owner - The owner of the key file # comment - A comment for the authorized_keys file about the key # ssh_key - A path to the ssh public key file that should be added -dracut_authorized_keys: [] +luks_ssh_dracut_authorized_keys: [] # Disables the import state service # Note: This is used to prevent issues with the import of the state that was used in the initrd, which is usually just IPv4 in DHCP mode. diff --git a/roles/luks_ssh/tasks/main.yml b/roles/luks_ssh/tasks/main.yml index b71a2d4..3866043 100644 --- a/roles/luks_ssh/tasks/main.yml +++ b/roles/luks_ssh/tasks/main.yml @@ -20,11 +20,11 @@ - name: Create dracut extension ansible.builtin.file: - path: "{{ dracut_ssh_dir }}" + path: "{{ luks_ssh_dracut_ssh_dir }}" state: directory - mode: '0755' - owner: 'root' - group: 'root' + mode: "0755" + owner: "root" + group: "root" become: true - name: Add SSH keys for grub2 @@ -33,29 +33,29 @@ state: present key: "{{ lookup('file', item.ssh_key) }}" comment: "{{ item.owner }} - {{ item.comment }} | Managed by Ansible" - path: "{{ dracut_ssh_dir }}/authorized_keys" + path: "{{ luks_ssh_dracut_ssh_dir }}/authorized_keys" with_items: - - "{{ dracut_authorized_keys }}" + - "{{ luks_ssh_dracut_authorized_keys }}" become: true notify: Regenerate dracut - name: Copy module setup file ansible.builtin.copy: src: "module-setup.sh" - dest: "{{ dracut_ssh_dir }}/module-setup.sh" - mode: '0755' - owner: 'root' - group: 'root' + dest: "{{ luks_ssh_dracut_ssh_dir }}/module-setup.sh" + mode: "0755" + owner: "root" + group: "root" become: true notify: Regenerate dracut - name: Copy module files ansible.builtin.copy: src: "{{ item }}" - dest: "{{ dracut_ssh_dir }}/{{ item }}" - mode: '0644' - owner: 'root' - group: 'root' + dest: "{{ luks_ssh_dracut_ssh_dir }}/{{ item }}" + mode: "0644" + owner: "root" + group: "root" become: true with_items: - "sshd.service" @@ -64,10 +64,10 @@ - name: Copy templated module files ansible.builtin.template: src: "{{ item }}" - dest: "{{ dracut_ssh_dir }}/{{ item }}" - mode: '0644' - owner: 'root' - group: 'root' + dest: "{{ luks_ssh_dracut_ssh_dir }}/{{ item }}" + mode: "0644" + owner: "root" + group: "root" become: true with_items: - "sshd_config" @@ -89,7 +89,7 @@ - name: Ensure that GRUB_CMDLINE_LINUX_DEFAULT is present ansible.builtin.lineinfile: path: /etc/default/grub - regexp: '^GRUB_CMDLINE_LINUX_DEFAULT' + regexp: "^GRUB_CMDLINE_LINUX_DEFAULT" line: 'GRUB_CMDLINE_LINUX_DEFAULT=""' become: true notify: Regenerate grub config