infra-ansible
ansible script to ship alpine/ssh/wireguard
git clone https://9o.is/git/infra-ansible.git
commit 9ca0948dfb5aa9be0f21c34d734b4c79ad48952b parent 9c5e9a193ad16b6ba2be3ef9f388c6076e27ced2 Author: Jul <jul@9o.is> Date: Fri, 17 May 2024 23:45:28 +0800 refresh ansible facts after setup is over Diffstat:
| M | host/readme.md | | | 3 | +-- |
| M | host/roles/setup/tasks/main.yml | | | 18 | +++++++++++++++--- |
| M | host/site.yml | | | 13 | ++++++------- |
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/host/readme.md b/host/readme.md @@ -2,7 +2,6 @@ ``` ansible-playbook site.yml --tags raw-setup --user root -ansible-playbook site.yml --tags setup --user root -ansible-playbook site.yml --tags wireguard +ansible-playbook site.yml --user root ``` diff --git a/host/roles/setup/tasks/main.yml b/host/roles/setup/tasks/main.yml @@ -1,4 +1,16 @@ --- -- include_tasks: networking.yml -- include_tasks: hostname.yml -- include_tasks: apt-upgrades.yml +- name: set networking + tags: networking + import_tasks: networking.yml + +- name: set hostname + tags: hostname + import_tasks: hostname.yml + +- name: upgrade packages and set auto-updates + tags: apt-upgrade + import_tasks: apt-upgrades.yml + +- name: refresh ansible facts + setup: + diff --git a/host/site.yml b/host/site.yml @@ -6,16 +6,15 @@ roles: - raw-setup -- name: Setup - hosts: servers - tags: setup - roles: - - setup - - openssh - - name: Create Services hosts: servers roles: + - role: setup + tags: setup + + - role: openssh + tags: openssh + - role: wireguard tags: wireguard