Skip to content

Commit

Permalink
Merge pull request #129 from satheesaran/master
Browse files Browse the repository at this point in the history
Added tasks to backup and restore files from and to /etc/ssh.
  • Loading branch information
gobindadas committed Mar 25, 2021
2 parents 2b61849 + 77b2bd3 commit f2001d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions playbooks/hc-ansible-deployment/tasks/backup.yml
Expand Up @@ -49,6 +49,9 @@
- name: Backup fstab
shell: cp -a /etc/fstab "{{backup_dir}}"

- name: Backup /etc/ssh directory
shell: cp -a /etc/ssh "{{backup_dir}}"

- name: Backup glusterd config directory
shell: cp -a /var/lib/glusterd "{{backup_dir}}"

Expand Down
6 changes: 6 additions & 0 deletions playbooks/hc-ansible-deployment/tasks/restore.yml
Expand Up @@ -114,6 +114,12 @@
path: /tmp/fstab
state: absent

- name: Restore key files under /etc/ssh
shell: yes| cp "{{ backup_dir }}"/ssh/ssh_host* /etc/ssh/ 2>/dev/zero

- name: Update file permission of files under /etc/ssh
shell: chown -R root:ssh_keys /etc/ssh/ssh_host*key

- name: Restart systemctl daemon
shell: systemctl daemon-reload

Expand Down

0 comments on commit f2001d2

Please sign in to comment.