From 8f424db147837e31d45d289b8c7823b330958aa8 Mon Sep 17 00:00:00 2001 From: b0xxer Date: Mon, 12 Feb 2024 07:42:02 -0600 Subject: [PATCH] Created zincati update schedule and wariness settings --- hosts | 8 ++++++++ roles/config/tasks/main.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/hosts b/hosts index 0282638..2732b07 100644 --- a/hosts +++ b/hosts @@ -33,5 +33,13 @@ bitcoin_version=26.0 bitcoin_rpcpassword=rVhfmriXjB8uFekmn7sLvnUiY610JaOx electrs_version=0.10.2 zerotier_network= +#Update wariness - 1 = very reluctant to update, 0 = eager to update +#days - which days to update (its a list) +#starttime - 24hr time format of when updates are permitted +#length - how long is update window open +update_wariness=0.75 +update_schedule_days=['Sat'] +update_schedule_starttime="02:00" +update_schedule_length=60 diff --git a/roles/config/tasks/main.yml b/roles/config/tasks/main.yml index 7629386..859d5eb 100644 --- a/roles/config/tasks/main.yml +++ b/roles/config/tasks/main.yml @@ -89,3 +89,34 @@ state: stopped masked: true +- name: Set {{ ansible_user }} user to linger + become: yes + become_method: sudo + command: loginctl enable-linger {{ ansible_user }} + args: + creates: /var/lib/systemd/linger/{{ ansible_user }} + +- name: Set update zincati wariness to {{update_wariness}} + become: yes + become_method: sudo + ansible.builtin.copy: + dest: /etc/zincati/config.d/10-update-wariness.toml + content: | + [identity] + rollout_wariness = {{update_wariness}} + +- name: Set update schedule for zincati + become: yes + become_method: sudo + ansible.builtin.copy: + dest: /etc/zincati/config.d/20-update-schedule.toml + content: | + [updates] + strategy = "periodic" + + [[updates.periodic.window]] + days = {{ update_schedule_days }} + start_time = {{ update_schedule_starttime }} + length_minutes = {{ update_schedule_length }} + +