create backup config dynamically
This commit is contained in:
@@ -18,6 +18,11 @@
|
||||
dest: "/opt/backup/config/"
|
||||
src: "config/"
|
||||
|
||||
- name: backup | system setup | copy backup config files 2
|
||||
template:
|
||||
src: "backup_remote.j2"
|
||||
dest: "/opt/backup/config/backup_remote.conf"
|
||||
|
||||
- name: backup | system setup | add entries to ssh_config
|
||||
blockinfile:
|
||||
dest: "{{ ansible_user_dir }}/.ssh/config"
|
||||
|
||||
3
roles/backup/templates/backup_remote.j2
Normal file
3
roles/backup/templates/backup_remote.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for host in hostvars[inventory_hostname]['hosts_to_backup'] %}
|
||||
{{ host.hostname }};/opt/backup/config/{{ host.hostname }}_includes.txt;/opt/backup/config/{{ host.hostname }}_excludes.txt
|
||||
{% endfor %}
|
||||
Reference in New Issue
Block a user