Improved performance by executing tasks just once per host

This commit is contained in:
2023-12-12 15:10:11 +01:00
parent e4c380b2b5
commit 1d2f2875b5
29 changed files with 190 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
user:
name: backup
create_home: yes
when: run_once_backups_provider_user is not defined
- name: create .ssh directory
file:
@@ -10,6 +11,7 @@
owner: backup
group: backup
mode: '0700'
when: run_once_backups_provider_user is not defined
- name: create /home/backup/.ssh/authorized_keys
template:
@@ -18,6 +20,7 @@
owner: backup
group: backup
mode: '0644'
when: run_once_backups_provider_user is not defined
- name: create /home/backup/ssh-wrapper.sh
copy:
@@ -26,6 +29,7 @@
owner: backup
group: backup
mode: '0700'
when: run_once_backups_provider_user is not defined
- name: grant backup sudo rights
copy:
@@ -35,3 +39,9 @@
owner: root
group: root
notify: sshd restart
when: run_once_backups_provider_user is not defined
- name: run the backups_provider_user tasks once
set_fact:
run_once_backups_provider_user: true
when: run_once_backups_provider_user is not defined