refactor(standardize): fix sudoers lecture syntax, extract ssh config, remove redundant os filters
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
configuration_use_efibootmgr: "{{ is_rhel | bool }}"
|
||||
configuration_efi_dir: "{{ partitioning_efi_mountpoint }}"
|
||||
configuration_bootloader_id: >-
|
||||
{{ "ubuntu" if os | lower in ["ubuntu", "ubuntu-lts"] else os }}
|
||||
{{ "ubuntu" if os in ["ubuntu", "ubuntu-lts"] else os }}
|
||||
configuration_efi_vendor: >-
|
||||
{{ "redhat" if os | lower == "rhel" else os | lower }}
|
||||
{{ "redhat" if os == "rhel" else os }}
|
||||
configuration_efibootmgr_cmd: >-
|
||||
/usr/sbin/efibootmgr -c -L '{{ os }}' -d "{{ install_drive }}" -p 1
|
||||
-l '\efi\EFI\{{ configuration_efi_vendor }}\shimx64.efi'
|
||||
@@ -23,7 +23,7 @@
|
||||
changed_when: configuration_bootloader_result.rc == 0
|
||||
|
||||
- name: Ensure lvm2 for non btrfs filesystems
|
||||
when: os | lower == "archlinux" and system_cfg.filesystem != "btrfs"
|
||||
when: os == "archlinux" and system_cfg.filesystem != "btrfs"
|
||||
ansible.builtin.lineinfile:
|
||||
path: /mnt/etc/mkinitcpio.conf
|
||||
regexp: "^(HOOKS=.*block)(?!.*lvm2)(.*)"
|
||||
@@ -31,12 +31,12 @@
|
||||
backrefs: true
|
||||
|
||||
- name: Regenerate initramfs
|
||||
when: os | lower not in ["alpine", "void"]
|
||||
when: os not in ["alpine", "void"]
|
||||
vars:
|
||||
configuration_initramfs_cmd: >-
|
||||
{{
|
||||
'/usr/sbin/mkinitcpio -P'
|
||||
if os | lower == "archlinux"
|
||||
if os == "archlinux"
|
||||
else (
|
||||
'/usr/bin/env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin '
|
||||
+ '/usr/sbin/update-initramfs -u -k all'
|
||||
@@ -51,7 +51,7 @@
|
||||
- name: Generate grub config
|
||||
vars:
|
||||
configuration_efi_vendor: >-
|
||||
{{ "redhat" if os | lower == "rhel" else os | lower }}
|
||||
{{ "redhat" if os == "rhel" else os }}
|
||||
configuration_grub_cfg_cmd: >-
|
||||
{{
|
||||
'/usr/sbin/grub2-mkconfig -o '
|
||||
|
||||
Reference in New Issue
Block a user