Skip to content

Commit

Permalink
add playbook for networkid private key backups
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 28, 2023
1 parent b7a20c0 commit 8d45f99
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions playbooks/networkid_pk_backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Standards: 0.2
---
- name: Backup networkid secret key
hosts: polkadot,cumulus,encointer
gather_facts: True
tasks:
- name: Find network ID directory
become: True
become_user: root
ansible.builtin.find:
paths: "{{ default_database_path }}"
file_type: directory
register: network_dir

- name: Extract subdomain from hostname
ansible.builtin.set_fact:
subdomain: "{{ inventory_hostname.split('.')[0] }}"

# - name: Backup secrets from servers to local storage
# become: True
# become_user: root
# ansible.builtin.copy:
# src: "{{ network_dir.files[0].path }}/network/secret_ed25519"
# dest: "/opt/backup/{{ subdomain }}_secret_ed25519"
# owner: root
# group: root
# mode: 0600
# remote_src: True
# when: network_dir.matched > 0
# tags: backup

- name: Backup secrets from servers to local storage
become: True
become_user: root
ansible.builtin.fetch:
src: "{{ network_dir.files[0].path }}/network/secret_ed25519"
dest: "/opt/backup/{{ subdomain }}_secret_ed25519"
flat: yes

Check warning on line 38 in playbooks/networkid_pk_backup.yaml

View workflow job for this annotation

GitHub Actions / build (3.10)

38:15 [truthy] truthy value should be one of [False, True]
when: network_dir.matched > 0
tags: backup
...

0 comments on commit 8d45f99

Please sign in to comment.