diff --git a/tasks/system_cfg/backup_dest.yml b/tasks/system_cfg/backup_dest.yml index 14a15a8448c37a061c78a32d10b07b66c4f9661a..8ec92ebef88a6cebd7c8d42f4dcbdaad2a0e5462 100644 --- a/tasks/system_cfg/backup_dest.yml +++ b/tasks/system_cfg/backup_dest.yml @@ -21,7 +21,7 @@ group: "{{ backup_user }}" mode: 0640 owner: "{{ backup_user }}" - src: templates/ssh_config_backup.j2 + src: templates/ssh-config_backup.j2 - name: BACKUP | ZFS | parent destination dataset when: inventory_hostname in groups.zfs @@ -41,27 +41,41 @@ - name: BACKUP | ZFS | children destination datasets (production) when: inventory_hostname in groups.zfs loop: "{{ groups['production'] }}" + vars: + server_properties: + - key: "autobackup:bkp_{{ hostvars[item]['inventory_hostname'] }}" + value: true + - key: mountpoint + value: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}" + - key: sharenfs + value: "ro={{ hostvars[item]['ansible_host'] }}" + - key: "src:fqdn" + value: "{{ hostvars[item]['inventory_fqdn'] }}" + - key: "src:ip" + value: "{{ hostvars[item]['ansible_host'] }}" + properties: "{{ server_properties | items2dict }}" community.general.zfs: name: "zp0/bkp/{{ hostvars[item]['inventory_hostname'] }}" state: present - extra_zfs_properties: - "autobackup:bkp_{{ hostvars[item]['inventory_hostname'] }}": true - "autobackup:prod_policy": true - mountpoint: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}" - sharenfs: "ro={{ hostvars[item]['ansible_host'] }}" - "src:fqdn": "{{ hostvars[item]['inventory_fqdn' ]}}" - "src:ip": "{{ hostvars[item]['ansible_host'] }}" + extra_zfs_properties: "{{ properties }}" - name: BACKUP | ZFS | children destination datasets (station) when: inventory_hostname in groups.zfs loop: "{{ groups['station'] }}" + vars: + server_properties: + - key: "autobackup:bkp_{{ hostvars[item]['inventory_hostname'] }}" + value: true + - key: mountpoint + value: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}" + - key: sharenfs + value: "ro={{ hostvars[item]['ansible_host'] }}" + - key: "src:fqdn" + value: "{{ hostvars[item]['inventory_fqdn'] }}" + - key: "src:ip" + value: "{{ hostvars[item]['ansible_host'] }}" + properties: "{{ server_properties | items2dict }}" community.general.zfs: - name: "zp0/bkp/{{hostvars[item]['inventory_hostname']}}" + name: "zp0/bkp/{{ hostvars[item]['inventory_hostname'] }}" state: present - extra_zfs_properties: - "autobackup:bkp_{{ hostvars[item]['inventory_hostname'] }}": true - "autobackup:stat_policy": true - mountpoint: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}" - sharenfs: "ro={{ gateway }}" - "src:fqdn": "{{ hostvars[item]['inventory_fqdn' ]}}" - "src:ip": "{{ hostvars[item]['ansible_host'] }}" + extra_zfs_properties: "{{ properties }}"