lots of stuff
This commit is contained in:
@@ -41,12 +41,72 @@
|
||||
dest: /opt/backup/restoreTest.sh
|
||||
mode: '0700'
|
||||
|
||||
- name: Copy metrics library
|
||||
ansible.builtin.template:
|
||||
src: metrics.sh.j2
|
||||
dest: /opt/backup/metrics.sh
|
||||
mode: '0700'
|
||||
|
||||
- name: Copy inventory collector
|
||||
ansible.builtin.template:
|
||||
src: backupInventory.sh.j2
|
||||
dest: /opt/backup/backupInventory.sh
|
||||
mode: '0700'
|
||||
|
||||
- name: Copy passphrase
|
||||
ansible.builtin.template:
|
||||
src: passphrase.txt.j2
|
||||
dest: /opt/backup/passphrase.txt
|
||||
mode: '0600'
|
||||
|
||||
- name: Create textfile directory
|
||||
ansible.builtin.file:
|
||||
path: "{{ node_exporter_textfile_dir }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
|
||||
- name: Install inventory timer
|
||||
ansible.builtin.copy:
|
||||
dest: "/etc/systemd/system/beepi-backup-inventory.{{ item.kind }}"
|
||||
content: "{{ item.content }}"
|
||||
mode: '0644'
|
||||
loop:
|
||||
- kind: service
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Collect backup inventory metrics
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/opt/backup/backupInventory.sh
|
||||
- kind: timer
|
||||
content: |
|
||||
[Unit]
|
||||
Description=Collect backup inventory metrics
|
||||
|
||||
[Timer]
|
||||
OnBootSec=2min
|
||||
OnUnitActiveSec=15min
|
||||
AccuracySec=1min
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
notify: Reload systemd
|
||||
|
||||
- name: Flush handlers
|
||||
ansible.builtin.meta: flush_handlers
|
||||
|
||||
- name: Enable inventory timer
|
||||
ansible.builtin.systemd_service:
|
||||
name: beepi-backup-inventory.timer
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: Run inventory collector once
|
||||
changed_when: true
|
||||
ansible.builtin.command:
|
||||
cmd: /opt/backup/backupInventory.sh
|
||||
|
||||
- name: Set path
|
||||
ansible.builtin.cron:
|
||||
name: PATH
|
||||
@@ -78,3 +138,8 @@
|
||||
hour: '6'
|
||||
weekday: '0'
|
||||
job: /opt/backup/restoreTest.sh >> /var/log/beepi-backup.log 2>&1
|
||||
|
||||
handlers:
|
||||
- name: Reload systemd
|
||||
ansible.builtin.systemd_service:
|
||||
daemon_reload: true
|
||||
|
||||
Reference in New Issue
Block a user