From 982497467a5492b00d5d434429e2e96645eafc9b Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Sat, 1 Nov 2025 21:13:35 +0100 Subject: [PATCH] feat: move tag logic to playbook file --- playbook.yaml | 17 +++++++++++++---- tasks/main.yaml | 15 --------------- tasks/reboot.yaml | 3 --- tasks/update.yaml | 3 --- 4 files changed, 13 insertions(+), 25 deletions(-) delete mode 100644 tasks/main.yaml diff --git a/playbook.yaml b/playbook.yaml index 96515ca..d642fd1 100644 --- a/playbook.yaml +++ b/playbook.yaml @@ -16,7 +16,16 @@ changed_when: false failed_when: false - # execute the role - - name: "execute role: toolbox" - ansible.builtin.include_role: - name: "toolbox" + # install updates + - name: "install updates" + tags: + - "update" + - "never" + ansible.builtin.include_tasks: "tasks/update.yaml" + + # initiate reboot + - name: "initiate reboot" + tags: + - "reboot" + - "never" + ansible.builtin.include_tasks: "tasks/reboot.yaml" diff --git a/tasks/main.yaml b/tasks/main.yaml deleted file mode 100644 index 7bd836d..0000000 --- a/tasks/main.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- - -# install updates -- name: "install updates" - tags: - - "update" - - "never" - ansible.builtin.include_tasks: "update.yaml" - -# initiate reboot -- name: "initiate reboot" - tags: - - "reboot" - - "never" - ansible.builtin.include_tasks: "reboot.yaml" diff --git a/tasks/reboot.yaml b/tasks/reboot.yaml index a57f93d..d91696d 100644 --- a/tasks/reboot.yaml +++ b/tasks/reboot.yaml @@ -2,9 +2,6 @@ # reboot the system - name: "reboot the system" - tags: - - "update" - - "never" ansible.builtin.reboot: msg: "Reboot initiated by Ansible" reboot_timeout: 120 diff --git a/tasks/update.yaml b/tasks/update.yaml index 3d87cbe..4041a6a 100644 --- a/tasks/update.yaml +++ b/tasks/update.yaml @@ -2,9 +2,6 @@ # install updates - name: "install updates" - tags: - - "update" - - "never" block: # install updates - alpine