Refactor Ansible tasks and templates for improved consistency and clarity
This commit is contained in:
+57
-36
@@ -5,7 +5,8 @@
|
||||
# timezone
|
||||
# locales
|
||||
# systemd-nofiles
|
||||
- import_tasks: basic.yml
|
||||
- name: (main.yml) Import basic.yml tasks
|
||||
ansible.builtin.import_tasks: basic.yml
|
||||
tags:
|
||||
- basic
|
||||
|
||||
@@ -13,7 +14,8 @@
|
||||
# tags supported inside sshd.yml
|
||||
#
|
||||
# sshd-config
|
||||
- import_tasks: sshd.yml
|
||||
- name: (main.yml) Import sshd.yml tasks
|
||||
ansible.builtin.import_tasks: sshd.yml
|
||||
tags: sshd
|
||||
|
||||
|
||||
@@ -27,18 +29,21 @@
|
||||
# apt-remove
|
||||
# apt-autoremove
|
||||
# apt-clean
|
||||
- import_tasks: apt.yml
|
||||
- name: (main.yml) Import apt.yml tasks
|
||||
ansible.builtin.import_tasks: apt.yml
|
||||
tags: apt
|
||||
|
||||
|
||||
- import_tasks: default-users.yml
|
||||
- name: (main.yml) Import default-users.yml tasks
|
||||
ansible.builtin.import_tasks: default-users.yml
|
||||
tags: default-user
|
||||
|
||||
|
||||
# tags supported inside systemd-resolved.yml
|
||||
#
|
||||
# systemd-resolved
|
||||
- import_tasks: systemd-resolved.yml
|
||||
- name: (main.yml) Import systemd-resolved.yml tasks
|
||||
ansible.builtin.import_tasks: systemd-resolved.yml
|
||||
tags:
|
||||
- systemd-resolved
|
||||
when:
|
||||
@@ -52,7 +57,8 @@
|
||||
# git-default-repositories
|
||||
# git-file-server-repositories
|
||||
# git-gateway-server-repositories
|
||||
- import_tasks: git.yml
|
||||
- name: (main.yml) Import git.yml tasks
|
||||
ansible.builtin.import_tasks: git.yml
|
||||
tags: git
|
||||
|
||||
|
||||
@@ -60,7 +66,8 @@
|
||||
#
|
||||
# cups-server
|
||||
# cups-client
|
||||
- import_tasks: cups-install.yml
|
||||
- name: (main.yml) Import cups-install.yml tasks
|
||||
ansible.builtin.import_tasks: cups-install.yml
|
||||
tags:
|
||||
- cups
|
||||
|
||||
@@ -68,7 +75,8 @@
|
||||
# tags supported inside nis-user.yml:
|
||||
#
|
||||
# nis-user
|
||||
- import_tasks: nis-user.yml
|
||||
- name: (main.yml) Import nis-user.yml tasks
|
||||
ansible.builtin.import_tasks: nis-user.yml
|
||||
when: "groups['nis_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- nis-user
|
||||
@@ -77,14 +85,16 @@
|
||||
# tags supported inside ntp.yml:
|
||||
#
|
||||
# ntp-server
|
||||
- import_tasks: ntp.yml
|
||||
- name: (main.yml) Import ntp.yml tasks
|
||||
ansible.builtin.import_tasks: ntp.yml
|
||||
tags:
|
||||
- ntp
|
||||
|
||||
|
||||
# tags supported inside pure-ftpd-install.yml:
|
||||
#
|
||||
- import_tasks: pure-ftpd-install.yml
|
||||
- name: (main.yml) Import pure-ftpd-install.yml tasks
|
||||
ansible.builtin.import_tasks: pure-ftpd-install.yml
|
||||
when:
|
||||
- groups['ftp_server']|string is search(inventory_hostname)
|
||||
tags:
|
||||
@@ -95,7 +105,8 @@
|
||||
#
|
||||
# nfs-server
|
||||
# nfs-client
|
||||
- import_tasks: nfs.yml
|
||||
- name: (main.yml) Import nfs.yml tasks
|
||||
ansible.builtin.import_tasks: nfs.yml
|
||||
tags:
|
||||
- nfs
|
||||
|
||||
@@ -104,7 +115,8 @@
|
||||
#
|
||||
# samba-server
|
||||
# samba-client
|
||||
- import_tasks: samba-install.yml
|
||||
- name: (main.yml) Import samba-install.yml tasks
|
||||
ansible.builtin.import_tasks: samba-install.yml
|
||||
tags:
|
||||
- samba-install
|
||||
- samba
|
||||
@@ -112,14 +124,16 @@
|
||||
|
||||
# tags supported inside samba-remove-user.yml:
|
||||
#
|
||||
- import_tasks: samba-remove-user.yml
|
||||
- name: (main.yml) Import samba-remove-user.yml tasks
|
||||
ansible.builtin.import_tasks: samba-remove-user.yml
|
||||
tags:
|
||||
- samba-remove-user
|
||||
|
||||
|
||||
# tags supported inside system-remove-user.yml:
|
||||
#
|
||||
- import_tasks: system-remove-user.yml
|
||||
- name: (main.yml) Import system-remove-user.yml tasks
|
||||
ansible.builtin.import_tasks: system-remove-user.yml
|
||||
tags:
|
||||
- system-remove-user
|
||||
|
||||
@@ -127,7 +141,8 @@
|
||||
# tags supported inside system-user.yml:
|
||||
#
|
||||
# system-user
|
||||
- import_tasks: system-user.yml
|
||||
- name: (main.yml) Import system-user.yml tasks
|
||||
ansible.builtin.import_tasks: system-user.yml
|
||||
when: "groups['file_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- system-user
|
||||
@@ -136,7 +151,8 @@
|
||||
# tags supported inside nis-install-server.yml:
|
||||
#
|
||||
# nis-install-server
|
||||
- import_tasks: nis-install-server.yml
|
||||
- name: (main.yml) Import nis-install-server.yml tasks
|
||||
ansible.builtin.import_tasks: nis-install-server.yml
|
||||
when: "groups['nis_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- nis-install
|
||||
@@ -146,7 +162,8 @@
|
||||
# tags supported inside nis-install-client.yml:
|
||||
#
|
||||
# nis-install-client
|
||||
- import_tasks: nis-install-client.yml
|
||||
- name: (main.yml) Import nis-install-client.yml tasks
|
||||
ansible.builtin.import_tasks: nis-install-client.yml
|
||||
when: "groups['nis_client']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- nis-install
|
||||
@@ -156,7 +173,8 @@
|
||||
# tags supported inside samba-user.yml:
|
||||
#
|
||||
# samba-user
|
||||
- import_tasks: samba-user.yml
|
||||
- name: (main.yml) Import samba-user.yml tasks
|
||||
ansible.builtin.import_tasks: samba-user.yml
|
||||
when: "groups['samba_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- nis-samba-user
|
||||
@@ -167,7 +185,8 @@
|
||||
# profile
|
||||
# bashrc
|
||||
# vimrc
|
||||
- import_tasks: system-user-systemfiles.yml
|
||||
- name: (main.yml) Import system-user-systemfiles.yml tasks
|
||||
ansible.builtin.import_tasks: system-user-systemfiles.yml
|
||||
when: "groups['file_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- user-systemfiles
|
||||
@@ -178,7 +197,8 @@
|
||||
# profile
|
||||
# bashrc
|
||||
# vimrc
|
||||
- import_tasks: nis-user-systemfiles.yml
|
||||
- name: (main.yml) Import nis-user-systemfiles.yml tasks
|
||||
ansible.builtin.import_tasks: nis-user-systemfiles.yml
|
||||
when: "groups['nis_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- user-systemfiles
|
||||
@@ -188,7 +208,8 @@
|
||||
# tags supported root-files-scripts.yml:
|
||||
|
||||
# wakeup_lan
|
||||
- import_tasks: root-files-scripts.yml
|
||||
- name: (main.yml) Import root-files-scripts.yml tasks
|
||||
ansible.builtin.import_tasks: root-files-scripts.yml
|
||||
tags:
|
||||
- root-files-scripts
|
||||
|
||||
@@ -198,7 +219,8 @@
|
||||
# sudoers-remove
|
||||
# sudoers-file-configuration
|
||||
# sudoers-global-configuration
|
||||
- import_tasks: sudoers-pc.yml
|
||||
- name: (main.yml) Import sudoers-pc.yml tasks
|
||||
ansible.builtin.import_tasks: sudoers-pc.yml
|
||||
when: "groups['client_pc']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- sudoers
|
||||
@@ -209,21 +231,21 @@
|
||||
# sudoers-remove
|
||||
# sudoers-file-configuration
|
||||
# sudoers-global-configuration
|
||||
- import_tasks: sudoers-server.yml
|
||||
- name: (main.yml) Import sudoers-server.yml tasks
|
||||
ansible.builtin.import_tasks: sudoers-server.yml
|
||||
when: "groups['file_server']|string is search(inventory_hostname)"
|
||||
tags:
|
||||
- sudoers
|
||||
|
||||
|
||||
- import_tasks: cron.yml
|
||||
- name: (main.yml) Import cron.yml tasks
|
||||
ansible.builtin.import_tasks: cron.yml
|
||||
tags:
|
||||
- cron
|
||||
|
||||
|
||||
|
||||
# tags supported inside mount_samba_shares.yml:
|
||||
#
|
||||
#- import_tasks: mount_samba_shares.yml
|
||||
# - import_tasks: mount_samba_shares.yml
|
||||
# when: "groups['client_pc']|string is search(inventory_hostname)"
|
||||
# tags:
|
||||
# - samba-shares
|
||||
@@ -236,7 +258,7 @@
|
||||
# - Ubuntu 18.04LTSi
|
||||
|
||||
- name: "For OS: Ubuntu 16.04LTS, Arch: amd64"
|
||||
import_tasks: ubuntu-x11vnc-1604-amd64.yml
|
||||
ansible.builtin.import_tasks: ubuntu-x11vnc-1604-amd64.yml
|
||||
when:
|
||||
- ansible_facts["distribution_version"] == "16.04"
|
||||
- ansible_architecture == "x86_64"
|
||||
@@ -247,7 +269,7 @@
|
||||
|
||||
|
||||
- name: "For OS: Ubuntu 18.04LTS, Arch: amd64"
|
||||
import_tasks: ubuntu-x11vnc-1804-amd64.yml
|
||||
ansible.builtin.import_tasks: ubuntu-x11vnc-1804-amd64.yml
|
||||
when:
|
||||
- ansible_facts["distribution_version"] == "18.04"
|
||||
- ansible_architecture == "x86_64"
|
||||
@@ -258,7 +280,7 @@
|
||||
|
||||
|
||||
- name: "For OS: Ubuntu 20.04LTS, Arch: amd64"
|
||||
import_tasks: ubuntu-x11vnc-2004-amd64.yml
|
||||
ansible.builtin.import_tasks: ubuntu-x11vnc-2004-amd64.yml
|
||||
when:
|
||||
- ansible_facts["distribution_version"] == "20.04"
|
||||
- ansible_architecture == "x86_64"
|
||||
@@ -269,7 +291,7 @@
|
||||
|
||||
|
||||
- name: "For OS: Ubuntu 22.04LTS, Arch: amd64"
|
||||
import_tasks: ubuntu-x11vnc-2204-amd64.yml
|
||||
ansible.builtin.import_tasks: ubuntu-x11vnc-2204-amd64.yml
|
||||
when:
|
||||
- ansible_facts["distribution_version"] == "22.04"
|
||||
- ansible_architecture == "x86_64"
|
||||
@@ -279,9 +301,8 @@
|
||||
- finish-client-install
|
||||
|
||||
|
||||
|
||||
#- name: "Configure LUKS"
|
||||
# import_tasks: luks.yml
|
||||
# when: "groups['client_pc']|string is search(inventory_hostname)"
|
||||
# tags:
|
||||
# - name: "Configure LUKS"
|
||||
# import_tasks: luks.yml
|
||||
# when: "groups['client_pc']|string is search(inventory_hostname)"
|
||||
# tags:
|
||||
# - luks
|
||||
|
||||
Reference in New Issue
Block a user