Compare commits

...

3 Commits

Author SHA1 Message Date
Daniel SP
0919571744 Merge branch 'master' into raspbian-cgroups-fix 2024-02-24 21:26:40 -05:00
Daniel San Pedro
7db9f5bd9b Add check and variable so that we write to the correct file 2024-02-24 21:25:55 -05:00
Angel Garza
83a0be3afd Added pre_task to verify minimum Ansible version (#454) 2024-02-24 19:20:57 -06:00
2 changed files with 20 additions and 1 deletions

View File

@@ -1,7 +1,17 @@
--- ---
- name: Test for cmdline path
command: grep -E "console=|rootfstype" /boot/cmdline.txt
register: boot_cmdline_path
failed_when: false
changed_when: false
- name: Set path to cmdline based on test
set_fact:
cmdline_path: "{{ (boot_cmdline_path.rc == 0) | ternary('/boot/cmdline.txt', '/boot/firmware/cmdline.txt') }}"
- name: Activating cgroup support - name: Activating cgroup support
lineinfile: lineinfile:
path: /boot/firmware/cmdline.txt path: "{{ cmdline_path }}"
regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$' regexp: '^((?!.*\bcgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory\b).*)$'
line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory' line: '\1 cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
backrefs: true backrefs: true

View File

@@ -1,4 +1,13 @@
--- ---
- name: Pre tasks
hosts: all
pre_tasks:
- name: Verify Ansible is version 2.11 or above. (If this fails you may need to update Ansible)
assert:
that: "ansible_version.full is version_compare('2.11', '>=')"
msg: >
"Ansible is out of date. See here for more info: https://docs.technotim.live/posts/ansible-automation/"
- name: Prepare Proxmox cluster - name: Prepare Proxmox cluster
hosts: proxmox hosts: proxmox
gather_facts: true gather_facts: true