refactor(vars): add system/hypervisor dict inputs
This commit is contained in:
@@ -17,14 +17,14 @@
|
||||
mode: "0644"
|
||||
|
||||
- name: Remove deprecated attr2 and disable large extent
|
||||
when: os | lower in ["almalinux", "rhel8", "rhel9", "rhel10", "rocky"] and filesystem == "xfs"
|
||||
when: os in ["almalinux", "rocky", "rhel"] and filesystem == "xfs"
|
||||
ansible.builtin.replace:
|
||||
path: /mnt/etc/fstab
|
||||
regexp: "(xfs.*?)(attr2)"
|
||||
replace: '\1allocsize=64m'
|
||||
replace: "\\1allocsize=64m"
|
||||
|
||||
- name: Replace ISO UUID entry with /dev/sr0 in fstab
|
||||
when: os in ["rhel8", "rhel9", "rhel10"]
|
||||
when: os == "rhel"
|
||||
vars:
|
||||
configuration_fstab_dvd_line: >-
|
||||
{{
|
||||
@@ -34,12 +34,12 @@
|
||||
}}
|
||||
ansible.builtin.lineinfile:
|
||||
path: /mnt/etc/fstab
|
||||
regexp: '^.*\/dvd.*$'
|
||||
regexp: "^.*\\/dvd.*$"
|
||||
line: "{{ configuration_fstab_dvd_line }}"
|
||||
state: present
|
||||
|
||||
- name: Write image from RHEL ISO to the target machine
|
||||
when: os in ["rhel8", "rhel9", "rhel10"] and hypervisor == 'vmware'
|
||||
when: os == "rhel" and hypervisor == 'vmware'
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- dd
|
||||
@@ -57,9 +57,9 @@
|
||||
line: "{{ fstab_entry.line }}"
|
||||
insertafter: EOF
|
||||
loop:
|
||||
- {regexp: '^# TempFS$', line: '# TempFS'}
|
||||
- {regexp: '^tmpfs\\s+/tmp\\s+', line: 'tmpfs /tmp tmpfs defaults,nosuid,nodev,noexec 0 0'}
|
||||
- {regexp: '^tmpfs\\s+/var/tmp\\s+', line: 'tmpfs /var/tmp tmpfs defaults,nosuid,nodev,noexec 0 0'}
|
||||
- {regexp: '^tmpfs\\s+/dev/shm\\s+', line: 'tmpfs /dev/shm tmpfs defaults,nosuid,nodev,noexec 0 0'}
|
||||
- { regexp: "^# TempFS$", line: "# TempFS" }
|
||||
- { regexp: "^tmpfs\\\\s+/tmp\\\\s+", line: "tmpfs /tmp tmpfs defaults,nosuid,nodev,noexec 0 0" }
|
||||
- { regexp: "^tmpfs\\\\s+/var/tmp\\\\s+", line: "tmpfs /var/tmp tmpfs defaults,nosuid,nodev,noexec 0 0" }
|
||||
- { regexp: "^tmpfs\\\\s+/dev/shm\\\\s+", line: "tmpfs /dev/shm tmpfs defaults,nosuid,nodev,noexec 0 0" }
|
||||
loop_control:
|
||||
loop_var: fstab_entry
|
||||
|
||||
Reference in New Issue
Block a user