From e13b8c9a481c15f6532d1a7b5e60384eca5b78bd Mon Sep 17 00:00:00 2001 From: Gilles Mouchet Date: Sun, 16 Jun 2024 18:54:48 +0200 Subject: [PATCH] add yum-update script --- inst-raps.sh | 2 +- main.yml | 6 ++---- yum-check-update.yml | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 yum-check-update.yml diff --git a/inst-raps.sh b/inst-raps.sh index a90833e..da9c3f4 100755 --- a/inst-raps.sh +++ b/inst-raps.sh @@ -151,7 +151,7 @@ printSuccess "Date and Time updated successfully" # get yum-check-update script #----------------------------------------------------------------------------- printInfo "Get yum-check-update script" -git clone https://gitweb.dyndns.org/scripts/yum-check.git /tmp/ +git clone https://gitweb.dyndns.org/scripts/yum-check.git /tmp/yumupd if [ $? -ne 0 ]; then printError "Problem to clone yum-check-update script";exit; fi printSuccess "yum-check-update script cloned successfully" diff --git a/main.yml b/main.yml index b9d58ec..0a81f66 100644 --- a/main.yml +++ b/main.yml @@ -16,10 +16,8 @@ import_role: name: role-postfix - - name: import yum-check role - import_role: - name: role-yum-check - + - include_tasks: yum-check-update.yml + - name: import netdata role import_role: name: role-netdata diff --git a/yum-check-update.yml b/yum-check-update.yml new file mode 100644 index 0000000..6edbeda --- /dev/null +++ b/yum-check-update.yml @@ -0,0 +1,18 @@ +--- +- name: get check-yum-update + copy: + src: /tmp/yumupd/check-yum-updates.sh + dest: /usr/local/bin/check-yum-updates.sh + mode: 0755 + +- name: create link crontab daily + file: + src: /usr/local/bin/check-yum-updates.sh + dest: /etc/cron.daily/check-yum-updates.sh + state: link + +- name: delete source + file: + path: /tmp/yumupd + state: absent +