Skip to content

Commit

Permalink
Reduce tasks for Archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
k0ste committed Feb 24, 2025
1 parent eadbd25 commit 4b6e6bf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 48 deletions.
43 changes: 12 additions & 31 deletions tasks/deploy.d/locale/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
---
- name: "linux_helper | Prepare locale.gen file [Archlinux]"
ansible.builtin.template:
src: "locale_gen.j2"
dest: "/etc/locale.gen"
owner: "root"
group: "root"
mode: "0644"
force: "yes"
when:
- "hostvars[inventory_hostname]['ansible_os_family'] == 'Archlinux'"
- name: "linux_helper | Deploy locales"
block:
- name: "linux_helper | Deploy locales [ArchLinux]"
ansible.builtin.command:
cmd: "locale-gen"
register: "linux_helper_locale_gen_result"
changed_when: "linux_helper_locale_gen_result['rc'] == 0"
failed_when: "linux_helper_locale_gen_result['rc'] != 0"
when:
- "hostvars[inventory_hostname]['ansible_os_family'] == 'Archlinux'"
- name: "linux_helper | Deploy locales [Debian]"
community.general.locale_gen:
name: "{{ linux_helper_locale_gen_locales['locale'] + '.' +
linux_helper_locale_gen_locales['charset'] }}"
state: "present"
loop: "{{ vars['linux_helper_locale_settings'] | flatten(levels=1) }}"
loop_control:
loop_var: "linux_helper_locale_gen_locales"
label: "{{ 'Deploy locale: ' +
linux_helper_locale_gen_locales['locale'] }}"
when:
- "hostvars[inventory_hostname]['ansible_os_family'] == 'Debian'"
community.general.locale_gen:
name: "{{ linux_helper_locale_gen_locales['locale'] + '.' +
linux_helper_locale_gen_locales['charset'] }}"
state: "present"
loop: "{{ vars['linux_helper_locale_settings'] | flatten(levels=1) }}"
loop_control:
loop_var: "linux_helper_locale_gen_locales"
label: "{{ 'Deploy locale: ' +
linux_helper_locale_gen_locales['locale'] }}"
when:
- "hostvars[inventory_hostname]['ansible_os_family'] in ('Debian',
'Archlinux')"
- name: "linux_helper | Deploy locale.conf"
ansible.builtin.template:
src: "locale_conf.j2"
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy.d/locale/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "linux_helper | Include localre packages tasks"
- name: "linux_helper | Include locale packages tasks"
ansible.builtin.import_tasks:
file: "deploy.d/locale/packages.yml"
- name: "linux_helper | Include locale deployment tasks"
Expand Down
2 changes: 1 addition & 1 deletion tasks/deploy.d/netconsole/packages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "linux_helper | Install the netconsole packages for RedHat via dnf"
- name: "linux_helper | Install the netconsole packages in RedHat derivatives"
ansible.builtin.dnf:
name: "netconsole-service"
state: "present"
Expand Down
5 changes: 2 additions & 3 deletions tasks/deploy_modprobe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
community.general.json_query(\"[].modprobe[].modprobes\" ~
\"[?file_name=='\" ~ vars['outer_item'] ~ \"']\") | flatten(levels=1) }}"
loop_control:
loop_var: "linux_helper_modprobes"
label: "{{ 'Deploy modprobe file: ' ~
linux_helper_modprobes['file_name'] }}"
loop_var: "linux_helper_modprobes_deploy"
label: "{{ 'Deploy modprobe file: ' ~ vars['outer_item'] }}"
notify:
# https://access.redhat.com/discussions/1519283
- "Run dracut"
10 changes: 0 additions & 10 deletions templates/locale_gen.j2

This file was deleted.

4 changes: 2 additions & 2 deletions templates/modprobe.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{ '## ' ~ linux_helper_modprobes['file_name'] ~ '.conf' }}
{{ '## ' ~ vars['outer_item'] ~ '.conf' }}
{{ '# ' + ansible_managed }}
{{ '# Do not edit manually' }}

{% for a in linux_helper_modprobes['actions'] %}
{% for a in linux_helper_modprobes_deploy['actions'] %}
{% if a['action'] is defined and a['action'] != '' %}
{% if a['action'] == 'alias' %}
{% if (a['wildcard'] is defined and a['wildcard'] != '') and (a['module'] is
Expand Down

0 comments on commit 4b6e6bf

Please sign in to comment.