From bdcabbe81fea5c159f3d7553860c7fdf51d8fec8 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 3 Nov 2024 14:33:47 +0100 Subject: split out debian_server from debian_cloud_server Additionally, some refactoring. --- roles/apt/defaults/main.yml | 2 +- roles/apt/tasks/main.yml | 2 +- roles/debian_cloud_server/defaults/main.yml | 15 --------------- roles/debian_cloud_server/meta/main.yml | 9 ++------- roles/debian_server/README.md | 2 ++ roles/debian_server/defaults/main.yml | 16 ++++++++++++++++ roles/debian_server/meta/main.yml | 9 +++++++++ 7 files changed, 31 insertions(+), 24 deletions(-) delete mode 100644 roles/debian_cloud_server/defaults/main.yml create mode 100644 roles/debian_server/README.md create mode 100644 roles/debian_server/defaults/main.yml create mode 100644 roles/debian_server/meta/main.yml diff --git a/roles/apt/defaults/main.yml b/roles/apt/defaults/main.yml index 900172f..2c0fef4 100644 --- a/roles/apt/defaults/main.yml +++ b/roles/apt/defaults/main.yml @@ -1,4 +1,4 @@ apt_packages: [] -apt_unattended: false +apt_unattended_upgrades: false apt_unattended_reboot: true apt_unattended_reboot_time: "02:00" diff --git a/roles/apt/tasks/main.yml b/roles/apt/tasks/main.yml index e24430f..871d055 100644 --- a/roles/apt/tasks/main.yml +++ b/roles/apt/tasks/main.yml @@ -23,4 +23,4 @@ - name: Configure unattended-upgrades ansible.builtin.include_tasks: unattended_upgrades.yml - when: apt_unattended + when: apt_unattended_upgrades diff --git a/roles/debian_cloud_server/defaults/main.yml b/roles/debian_cloud_server/defaults/main.yml deleted file mode 100644 index 8fcd07e..0000000 --- a/roles/debian_cloud_server/defaults/main.yml +++ /dev/null @@ -1,15 +0,0 @@ -debian_cloud_server_packages: - # Some common & useful packages: - - curl - - dnsutils - - git - - man-db - - ncat - - net-tools - - nmap - - rsync - - screen - - telnet - - tmux - - vim - - wget diff --git a/roles/debian_cloud_server/meta/main.yml b/roles/debian_cloud_server/meta/main.yml index 71d1bc2..937ec95 100644 --- a/roles/debian_cloud_server/meta/main.yml +++ b/roles/debian_cloud_server/meta/main.yml @@ -1,10 +1,5 @@ dependencies: - role: cloud_init_wait - - role: apt + - role: debian_server vars: - apt_packages: '{{ debian_cloud_server_packages }}' - apt_unattended: true - - role: sshd - - role: firewall - - role: linux_status - - role: journald + debian_server_unattended_upgrades: true diff --git a/roles/debian_server/README.md b/roles/debian_server/README.md new file mode 100644 index 0000000..ae55607 --- /dev/null +++ b/roles/debian_server/README.md @@ -0,0 +1,2 @@ +This is a meta-role, it simply pulls in other roles as dependencies. It's used +for general maintenance of all my Debian-based machines. diff --git a/roles/debian_server/defaults/main.yml b/roles/debian_server/defaults/main.yml new file mode 100644 index 0000000..80776a4 --- /dev/null +++ b/roles/debian_server/defaults/main.yml @@ -0,0 +1,16 @@ +debian_server_packages: + # Some common & useful packages: + - curl + - dnsutils + - git + - man-db + - ncat + - net-tools + - nmap + - rsync + - screen + - telnet + - tmux + - vim + - wget +debian_server_unattended_upgrades: false diff --git a/roles/debian_server/meta/main.yml b/roles/debian_server/meta/main.yml new file mode 100644 index 0000000..10d3eb8 --- /dev/null +++ b/roles/debian_server/meta/main.yml @@ -0,0 +1,9 @@ +dependencies: + - role: apt + vars: + apt_packages: '{{ debian_server_packages }}' + apt_unattended_upgrades: '{{ debian_server_unattended_upgrades }}' + - role: sshd + - role: firewall + - role: linux_status + - role: journald -- cgit v1.2.3