From b92b0101920627cf0b8e7dd0d826d25b9fd96a41 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Wed, 10 Sep 2025 22:20:09 +0200 Subject: Refactor site playbooks to be more host oriented This also improves the dependency management, making the roles less repeating when not needing to execute multiple times --- site.yml | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'site.yml') diff --git a/site.yml b/site.yml index ce4fd5fb..8c533a07 100644 --- a/site.yml +++ b/site.yml @@ -1,32 +1,22 @@ --- -- name: "Distro bootstrap configure" +- name: "Dev machines configure" gather_facts: true - # Password policy is technically not required for boot, - # But it's quite nice to configure it for boot and therefore - # enforce the required policies/configurations wanted for the first passwrod change - tags: ["required_for_boot"] - hosts: all + hosts: + - archlinux.local + - ubuntu.local roles: + - role: "package_cache" + tags: ["required_for_boot"] - role: "hostname" + tags: ["required_for_boot"] - role: "network" + tags: ["required_for_boot"] - role: "user" + tags: ["required_for_boot"] - role: "ssh" + tags: ["required_for_boot"] - role: "password_policy" - pre_tasks: - - name: "Update package cache" - become: true - ansible.builtin.package: - update_cache: true - async: 60 - poll: 5 - failed_when: false - -- name: "Dev machines configure" - gather_facts: true - hosts: - - archlinux.local - - ubuntu.local - roles: + tags: ["required_for_boot"] - role: "locales" - role: "timezone" - role: "wireguard" @@ -43,6 +33,18 @@ - rpi5.local become: true roles: + - role: "package_cache" + tags: ["required_for_boot"] + - role: "hostname" + tags: ["required_for_boot"] + - role: "network" + tags: ["required_for_boot"] + - role: "user" + tags: ["required_for_boot"] + - role: "ssh" + tags: ["required_for_boot"] + - role: "password_policy" + tags: ["required_for_boot"] - role: "locales" - role: "timezone" - role: "wireguard" -- cgit v1.2.3