Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
Commit ce2aa882 authored by freezed's avatar freezed :mountain:
Browse files

:construction: WIP: debug BACKUP | ZFS | children prod

parent 3c1dc013
No related branches found
No related tags found
No related merge requests found
--- ---
- name: "BACKUP | USER | set user «{{ backup_user }}»"
ansible.builtin.user:
groups: backup
name: "{{ backup_user }}"
shell: "{{ user_shell }}"
state: present
uid: 1001
- name: "BACKUP | USER | ssh dir presence for «{{ backup_user }}»"
ansible.builtin.file:
group: "{{ backup_user }}"
mode: 0740
owner: "{{ backup_user }}"
path: "/home/{{ backup_user }}/.ssh/"
state: directory
- name: "BACKUP | USER | ssh config for «{{ backup_user }}»"
ansible.builtin.template:
dest: "/home/{{ backup_user }}/.ssh/config"
group: "{{ backup_user }}"
mode: 0640
owner: "{{ backup_user }}"
src: templates/ssh_config_backup.j2
- name: BACKUP | ZFS | parent destination dataset
when: inventory_hostname in groups.zfs
community.general.zfs:
name: zp0/bkp
state: present
extra_zfs_properties:
mountpoint: none
compression: lz4
- name: "BACKUP | ZFS | allow commands for «{{ backup_user }}»" - name: DEBUG INVENTORY VARIABLES NAME
community.general.zfs_delegate_admin: loop: "{{ groups['production'] }}"
name: zp0/bkp ansible.builtin.debug:
users: "{{ backup_user }}" msg: "hostname: {{ hostvars[item]['inventory_hostname'] }}"
permissions: receive,hold,release
- name: BACKUP | ZFS | children destination datasets (production) - name: BACKUP | ZFS | children destination datasets (production)
when: inventory_hostname in groups.zfs when: inventory_hostname in groups.zfs
...@@ -49,7 +16,7 @@ ...@@ -49,7 +16,7 @@
"autobackup:prod_policy": true "autobackup:prod_policy": true
mountpoint: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}" mountpoint: "/home/{{ backup_user }}/repo/{{ hostvars[item]['inventory_hostname'] }}"
sharenfs: "ro={{ hostvars[item]['ansible_host'] }}" sharenfs: "ro={{ hostvars[item]['ansible_host'] }}"
"src:fqdn": "{{ hostvars[item]['inventory_fqdn' ]}}" "src:fqdn": "{{ hostvars[item]['inventory_fqdn'] }}"
"src:ip": "{{ hostvars[item]['ansible_host'] }}" "src:ip": "{{ hostvars[item]['ansible_host'] }}"
- name: BACKUP | ZFS | children destination datasets (station) - name: BACKUP | ZFS | children destination datasets (station)
......
...@@ -6,20 +6,6 @@ ...@@ -6,20 +6,6 @@
tasks: tasks:
- name: HOSTNAME | setup
ansible.builtin.hostname:
name: "{{ inventory_hostname }}"
- name: HOSTS | setup
ansible.builtin.template:
dest: "/etc/hosts"
src: templates/etc-hosts.j2
backup: true
mode: 0640
- name: ANSIBLE | re-gather facts
ansible.builtin.setup:
- name: IMPORT_TASKS | backup destination - name: IMPORT_TASKS | backup destination
when: inventory_hostname in groups.backup when: inventory_hostname in groups.backup
ansible.builtin.import_tasks: backup_dest.yml ansible.builtin.import_tasks: backup_dest.yml
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment