From 07d5ad329209cb843351945b5af8aabe1aeea2b0 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Sun, 4 Dec 2022 17:24:00 +0100 Subject: [PATCH] Use snake_case for all yml files --- .../system/status-mail@.service | 0 .../user/status-mail@.service | 0 .../20auto-upgrades | 0 .../50unattended-upgrades | 0 .../{systemd-mail.yml => systemd_mail.yml} | 18 +++++++++--------- .../tasks/include/unattended-upgrades.yml | 15 --------------- .../tasks/include/unattended_upgrades.yml | 15 +++++++++++++++ plays/roles/system_base/tasks/main.yml | 12 ++++++------ .../system/systemd-mail-systemctl-status.j2 | 0 .../user/systemd-mail-systemctl-status.j2 | 0 plays/roles/system_zfs/defaults/main.yml | 2 +- .../zfs-load-key-hpool.service | 0 .../include/{load-key.yml => load_key.yml} | 8 ++++---- plays/roles/system_zfs/tasks/main.yml | 6 +++--- 14 files changed, 38 insertions(+), 38 deletions(-) rename plays/roles/system_base/files/{systemd-mail => systemd_mail}/system/status-mail@.service (100%) rename plays/roles/system_base/files/{systemd-mail => systemd_mail}/user/status-mail@.service (100%) rename plays/roles/system_base/files/{unattended-upgrades => unattended_upgrades}/20auto-upgrades (100%) rename plays/roles/system_base/files/{unattended-upgrades => unattended_upgrades}/50unattended-upgrades (100%) rename plays/roles/system_base/tasks/include/{systemd-mail.yml => systemd_mail.yml} (57%) delete mode 100644 plays/roles/system_base/tasks/include/unattended-upgrades.yml create mode 100644 plays/roles/system_base/tasks/include/unattended_upgrades.yml rename plays/roles/system_base/templates/{systemd-mail => systemd_mail}/system/systemd-mail-systemctl-status.j2 (100%) rename plays/roles/system_base/templates/{systemd-mail => systemd_mail}/user/systemd-mail-systemctl-status.j2 (100%) rename plays/roles/system_zfs/files/{load-key => load_key}/zfs-load-key-hpool.service (100%) rename plays/roles/system_zfs/tasks/include/{load-key.yml => load_key.yml} (67%) diff --git a/plays/roles/system_base/files/systemd-mail/system/status-mail@.service b/plays/roles/system_base/files/systemd_mail/system/status-mail@.service similarity index 100% rename from plays/roles/system_base/files/systemd-mail/system/status-mail@.service rename to plays/roles/system_base/files/systemd_mail/system/status-mail@.service diff --git a/plays/roles/system_base/files/systemd-mail/user/status-mail@.service b/plays/roles/system_base/files/systemd_mail/user/status-mail@.service similarity index 100% rename from plays/roles/system_base/files/systemd-mail/user/status-mail@.service rename to plays/roles/system_base/files/systemd_mail/user/status-mail@.service diff --git a/plays/roles/system_base/files/unattended-upgrades/20auto-upgrades b/plays/roles/system_base/files/unattended_upgrades/20auto-upgrades similarity index 100% rename from plays/roles/system_base/files/unattended-upgrades/20auto-upgrades rename to plays/roles/system_base/files/unattended_upgrades/20auto-upgrades diff --git a/plays/roles/system_base/files/unattended-upgrades/50unattended-upgrades b/plays/roles/system_base/files/unattended_upgrades/50unattended-upgrades similarity index 100% rename from plays/roles/system_base/files/unattended-upgrades/50unattended-upgrades rename to plays/roles/system_base/files/unattended_upgrades/50unattended-upgrades diff --git a/plays/roles/system_base/tasks/include/systemd-mail.yml b/plays/roles/system_base/tasks/include/systemd_mail.yml similarity index 57% rename from plays/roles/system_base/tasks/include/systemd-mail.yml rename to plays/roles/system_base/tasks/include/systemd_mail.yml index d9eef31..d30ecd0 100644 --- a/plays/roles/system_base/tasks/include/systemd-mail.yml +++ b/plays/roles/system_base/tasks/include/systemd_mail.yml @@ -1,30 +1,30 @@ -- name: "systemd-mail : systemd mail root script" +- name: "systemd_mail : systemd mail root script" ansible.builtin.template: - src: "./systemd-mail/system/systemd-mail-systemctl-status.j2" + src: "./systemd_mail/system/systemd-mail-systemctl-status.j2" dest: "/usr/local/sbin/systemd-mail-systemctl-status" mode: 0755 -- name: "systemd-mail : systemd mail user script" +- name: "systemd_mail : systemd mail user script" ansible.builtin.template: - src: "./systemd-mail/user/systemd-mail-systemctl-status.j2" + src: "./systemd_mail/user/systemd-mail-systemctl-status.j2" dest: "/usr/local/bin/systemd-mail-systemctl-status" mode: 0755 -- name: "systemd-mail : systemd mail root service" +- name: "systemd_mail : systemd mail root service" ansible.builtin.copy: - src: "./systemd-mail/system/status-mail@.service" + src: "./systemd_mail/system/status-mail@.service" dest: "/etc/systemd/system/status-mail@.service" mode: 0644 register: systemd_system_status_mail_service_file -- name: "systemd-mail : systemd mail user service" +- name: "systemd_mail : systemd mail user service" ansible.builtin.copy: - src: "./systemd-mail/user/status-mail@.service" + src: "./systemd_mail/user/status-mail@.service" dest: "/etc/systemd/user/status-mail@.service" mode: 0644 register: systemd_user_status_mail_service_file -- name: "systemd-mail : systemd daemon reload" +- name: "systemd_mail : systemd daemon reload" ansible.builtin.systemd: daemon_reload: true when: diff --git a/plays/roles/system_base/tasks/include/unattended-upgrades.yml b/plays/roles/system_base/tasks/include/unattended-upgrades.yml deleted file mode 100644 index 9374ceb..0000000 --- a/plays/roles/system_base/tasks/include/unattended-upgrades.yml +++ /dev/null @@ -1,15 +0,0 @@ -- name: "unattended-upgrades : install unattended-upgrades" - ansible.builtin.apt: - name: "unattended-upgrades" - -- name: "unattended-upgrades : configure unattended-upgrades" - ansible.builtin.copy: - src: "./unattended-upgrades/50unattended-upgrades" - dest: "/etc/apt/apt.conf.d/50unattended-upgrades" - mode: 0644 - -- name: "unattended-upgrades : enable unattended-upgrades" - ansible.builtin.copy: - src: "./unattended-upgrades/20auto-upgrades" - dest: "/etc/apt/apt.conf.d/20auto-upgrades" - mode: 0644 diff --git a/plays/roles/system_base/tasks/include/unattended_upgrades.yml b/plays/roles/system_base/tasks/include/unattended_upgrades.yml new file mode 100644 index 0000000..689acb0 --- /dev/null +++ b/plays/roles/system_base/tasks/include/unattended_upgrades.yml @@ -0,0 +1,15 @@ +- name: "unattended_upgrades : install unattended-upgrades" + ansible.builtin.apt: + name: "unattended-upgrades" + +- name: "unattended_upgrades : configure unattended-upgrades" + ansible.builtin.copy: + src: "./unattended_upgrades/50unattended-upgrades" + dest: "/etc/apt/apt.conf.d/50unattended-upgrades" + mode: 0644 + +- name: "unattended_upgrades : enable unattended-upgrades" + ansible.builtin.copy: + src: "./unattended_upgrades/20auto-upgrades" + dest: "/etc/apt/apt.conf.d/20auto-upgrades" + mode: 0644 diff --git a/plays/roles/system_base/tasks/main.yml b/plays/roles/system_base/tasks/main.yml index 4594122..0001d8e 100644 --- a/plays/roles/system_base/tasks/main.yml +++ b/plays/roles/system_base/tasks/main.yml @@ -18,17 +18,17 @@ import_tasks: "include/fstrim.yml" tags: "role:system_base:fstrim" -- name: "role:system_base:unattended-upgrades" - import_tasks: "include/unattended-upgrades.yml" - tags: "role:system_base:unattended-upgrades" +- name: "role:system_base:unattended_upgrades" + import_tasks: "include/unattended_upgrades.yml" + tags: "role:system_base:unattended_upgrades" - name: "role:system_base:logs" import_tasks: "include/logs.yml" tags: "role:system_base:logs" -- name: "role:system_base:systemd-mail" - import_tasks: "include/systemd-mail.yml" - tags: "role:system_base:systemd-mail" +- name: "role:system_base:systemd_mail" + import_tasks: "include/systemd_mail.yml" + tags: "role:system_base:systemd_mail" - name: "role:system_base:utils" import_tasks: "include/utils.yml" diff --git a/plays/roles/system_base/templates/systemd-mail/system/systemd-mail-systemctl-status.j2 b/plays/roles/system_base/templates/systemd_mail/system/systemd-mail-systemctl-status.j2 similarity index 100% rename from plays/roles/system_base/templates/systemd-mail/system/systemd-mail-systemctl-status.j2 rename to plays/roles/system_base/templates/systemd_mail/system/systemd-mail-systemctl-status.j2 diff --git a/plays/roles/system_base/templates/systemd-mail/user/systemd-mail-systemctl-status.j2 b/plays/roles/system_base/templates/systemd_mail/user/systemd-mail-systemctl-status.j2 similarity index 100% rename from plays/roles/system_base/templates/systemd-mail/user/systemd-mail-systemctl-status.j2 rename to plays/roles/system_base/templates/systemd_mail/user/systemd-mail-systemctl-status.j2 diff --git a/plays/roles/system_zfs/defaults/main.yml b/plays/roles/system_zfs/defaults/main.yml index e27c5af..d2a3e7a 100644 --- a/plays/roles/system_zfs/defaults/main.yml +++ b/plays/roles/system_zfs/defaults/main.yml @@ -4,5 +4,5 @@ zpools: [] # trim zpools_trim: [] -# load-key +# load_key zpools_load_key: [] diff --git a/plays/roles/system_zfs/files/load-key/zfs-load-key-hpool.service b/plays/roles/system_zfs/files/load_key/zfs-load-key-hpool.service similarity index 100% rename from plays/roles/system_zfs/files/load-key/zfs-load-key-hpool.service rename to plays/roles/system_zfs/files/load_key/zfs-load-key-hpool.service diff --git a/plays/roles/system_zfs/tasks/include/load-key.yml b/plays/roles/system_zfs/tasks/include/load_key.yml similarity index 67% rename from plays/roles/system_zfs/tasks/include/load-key.yml rename to plays/roles/system_zfs/tasks/include/load_key.yml index 86c93e5..cff3460 100644 --- a/plays/roles/system_zfs/tasks/include/load-key.yml +++ b/plays/roles/system_zfs/tasks/include/load_key.yml @@ -1,19 +1,19 @@ # TODO: drop file dependence on hpool. -- name: "load-key : zfs load key service file" +- name: "load_key : zfs load key service file" ansible.builtin.copy: - src: "./load-key/zfs-load-key-hpool.service" + src: "./load_key/zfs-load-key-hpool.service" dest: "/etc/systemd/system/zfs-load-key-hpool.service" mode: 0644 register: systemd_zfs_load_key_service_file -- name: "load-key : systemd daemon reload" +- name: "load_key : systemd daemon reload" ansible.builtin.systemd: daemon_reload: true when: systemd_zfs_load_key_service_file.changed -- name: "load-key : enable service to load for {{ item }}" +- name: "load_key : enable service to load for {{ item }}" ansible.builtin.systemd: name: "zfs-load-key-hpool.service" enabled: true diff --git a/plays/roles/system_zfs/tasks/main.yml b/plays/roles/system_zfs/tasks/main.yml index 92fe9ee..9c77eb6 100644 --- a/plays/roles/system_zfs/tasks/main.yml +++ b/plays/roles/system_zfs/tasks/main.yml @@ -14,9 +14,9 @@ import_tasks: "include/scrub.yml" tags: "role:system_zfs:scrub" -- name: "role:system_zfs:load-key" - import_tasks: "include/load-key.yml" - tags: "role:system_zfs:load-key" +- name: "role:system_zfs:load_key" + import_tasks: "include/load_key.yml" + tags: "role:system_zfs:load_key" - name: "role:system_zfs:fstrim" import_tasks: "include/fstrim.yml"