From 56682b164658dec3575d3b2a85e74188afbb220d Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Thu, 21 Jul 2022 14:45:06 +0200 Subject: [PATCH] add a update-utils.yml playbook to update scripts --- CHANGELOG | 1 + README.md | 2 +- update-utils.yml | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 update-utils.yml diff --git a/CHANGELOG b/CHANGELOG index 93a4b45..07d6683 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - base: add a "next_part" before executing evobackup in daily.local file - base: add update-evobackup-canary script - base: session timeout is configurable +- add a update-utils.yml playbook to update scripts ### Changed diff --git a/README.md b/README.md index 935e3d5..55a0655 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ ansible-playbook evolixisation.yml --ask-vault-pass -CDKi hosts --skip-tags pf - ## How to update scripts -Several tags in the format `*utils` are configured to update the different scripts : +Several tags in the format `*utils` are configured to update the different scripts, to be used with the update-utils.yml playbook : * utils : update scripts from base role, utils.yml task * motd-utils : update script from post-install role, motd.yml task diff --git a/update-utils.yml b/update-utils.yml new file mode 100644 index 0000000..c3b7292 --- /dev/null +++ b/update-utils.yml @@ -0,0 +1,43 @@ +# yamllint disable rule:line-length +# Playbook command +# ansible-playbook update-utils.yml -CDKi hosts --tags utils,motd-utils,evomaintenance-utils,evocheck-utils,nagios-nrpe-utils,etc-git-utils -l HOSTNAME + +--- +- name: Update of scripts used by EvoBSD + hosts: openbsd + become: true + become_user: root + become_method: sudo + + vars_files: + - vars/main.yml + - vars/evolix-main.yml + + pre_tasks: + - include_role: + name: etc-git + tasks_from: commit.yml + vars: + commit_message: "Ansible pre-run update-utils.yml" + when: not ansible_check_mode + tags: always + + roles: + - etc-git + - base + - nagios-nrpe + - evocheck + - post-install + + post_tasks: + - include_role: + name: etc-git + tasks_from: commit.yml + vars: + commit_message: "Ansible post-run update-utils.yml" + when: not ansible_check_mode + tags: always + + - include_role: + name: evocheck + tasks_from: exec.yml