From 66f0f197b3038ff6c45b5b7d3d86cbd221c2f7d3 Mon Sep 17 00:00:00 2001 From: PhysicsIsAwesome Date: Sun, 30 Jul 2023 15:29:13 +0200 Subject: [PATCH 1/2] Add Arch Linux family support --- meta/main.yml | 4 +++- vars/main.yml | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index d1c30a6..16f2aa6 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -27,7 +27,9 @@ galaxy_info: - name: Ubuntu versions: - all - + - name: ArchLinux + versions: + - all galaxy_tags: - grub - system diff --git a/vars/main.yml b/vars/main.yml index 47b2541..1c5bcc6 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -8,6 +8,9 @@ _grub_packages: - grub Debian: - grub2 + Archlinux: + - grub + grub_packages: "{{ _grub_packages[ansible_os_family] | default(_grub_packages['default']) }}" @@ -15,5 +18,6 @@ _grub_update_grub_command: default: grub2-mkconfig -o /boot/grub2/grub.cfg Alpine: grub-mkconfig -o /boot/grub/grub.cfg Debian: update-grub + Archlinux: grub-mkconfig -o /boot/grub/grub.cfg grub_update_grub_command: "{{ _grub_update_grub_command[ansible_os_family] | default(_grub_update_grub_command['default']) }}" From 3a516d03ba7acbd2a947d7cb7505f4151c8eb845 Mon Sep 17 00:00:00 2001 From: PhysicsIsAwesome Date: Sun, 30 Jul 2023 16:37:20 +0200 Subject: [PATCH 2/2] Change truthy values from "yes" to "true" --- handlers/main.yml | 2 +- tasks/assert.yml | 8 ++++---- tasks/main.yml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 7de7d6f..58c76d5 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,7 +4,7 @@ - name: Update grub ansible.builtin.command: cmd: "{{ grub_update_grub_command }}" - changed_when: yes + changed_when: true when: - ansible_connection not in [ "container", "docker", "community.docker.docker" ] notify: diff --git a/tasks/assert.yml b/tasks/assert.yml index 81c5b9a..5e5b56a 100644 --- a/tasks/assert.yml +++ b/tasks/assert.yml @@ -6,7 +6,7 @@ - grub_timeout is defined - grub_timeout is number - grub_timeout >= 0 - quiet: yes + quiet: true - name: assert | Test if grub_recordfail_timeout is set correctly ansible.builtin.assert: @@ -14,13 +14,13 @@ - grub_recordfail_timeout is defined - grub_recordfail_timeout is number - grub_recordfail_timeout >= 0 - quiet: yes + quiet: true - name: assert | Test if grub_options is set correctly ansible.builtin.assert: that: - grub_options is iterable - quiet: yes + quiet: true when: - grub_options is defined @@ -31,7 +31,7 @@ - item.option is string - item.option is not none - item.value is defined - quiet: yes + quiet: true loop: "{{ grub_options }}" loop_control: label: "{{ item.option }}" diff --git a/tasks/main.yml b/tasks/main.yml index 9690d35..9e2fddc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -3,7 +3,7 @@ - name: Import assert.yml ansible.builtin.import_tasks: assert.yml - run_once: yes + run_once: true delegate_to: localhost - name: Install required packages @@ -15,7 +15,7 @@ ansible.builtin.lineinfile: path: /etc/default/grub line: GRUB_TIMEOUT={{ grub_timeout }} - create: yes + create: true mode: "0664" notify: - Update grub @@ -24,7 +24,7 @@ ansible.builtin.lineinfile: path: /etc/default/grub line: GRUB_RECORDFAIL_TIMEOUT={{ grub_recordfail_timeout }} - create: yes + create: true mode: "0664" notify: - Update grub