Send secrets file to server.

This commit is contained in:
yohan 2023-11-04 19:28:09 +01:00
parent d4f9263b07
commit 2cefe5f2af
2 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,4 @@
- name: Unpack secrets - name: Pack secrets
hosts: localhost hosts: localhost
tasks: tasks:
- name: include self role - name: include self role

View File

@ -56,3 +56,29 @@
path: /mnt/cloud path: /mnt/cloud
state: unmounted state: unmounted
become: true become: true
- name: Create /mnt/archives_critiques/secrets directory on serveur-appart
ansible.builtin.file:
path: /mnt/archives_critiques/secrets
state: directory
owner: "{{ user }}"
group: "{{ user }}"
remote_user: "{{ user }}"
vars:
ansible_ssh_port: 2224
delegate_to: chez-yohan.scimetis.net
become: true
- name: Get checksum of secrets.tar.gz.enc
ansible.builtin.stat:
path: "{{ WORKDIR }}/secrets.tar.gz.enc"
register: stats_output
- name: Copy new secrets on serveur-appart
ansible.builtin.copy:
src: "{{ WORKDIR }}/secrets.tar.gz.enc"
dest: "/mnt/archives_critiques/secrets/secrets.tar.gz.enc-{{ stats_output.stat.checksum }}"
remote_user: "{{ user }}"
vars:
ansible_ssh_port: 2224
delegate_to: chez-yohan.scimetis.net