Split jail port retrival tasks into their own file
This makes it easier to manage the dependency of the other tasks on this variable. I removed the tags on those tasks so they would not be excluded.
This commit is contained in:
parent
9bdd5ad9e7
commit
8caca4c711
|
@ -39,19 +39,3 @@
|
|||
tags:
|
||||
- evobackup_client
|
||||
- evobackup_client_jail
|
||||
|
||||
- name: 'get jail port'
|
||||
command: "bkctld port {{ evolinux_hostname }}"
|
||||
become: true
|
||||
register: bkctld_port
|
||||
delegate_to: "{{ evobackup_client__hosts[0].ip }}"
|
||||
tags:
|
||||
- evobackup_client
|
||||
- evobackup_client_jail
|
||||
|
||||
- name: 'register jail port'
|
||||
set_fact:
|
||||
evobackup_ssh_port={{ bkctld_port.stdout }}
|
||||
tags:
|
||||
- evobackup_client
|
||||
- evobackup_client_jail
|
||||
|
|
11
evobackup-client/tasks/jail_port.yml
Normal file
11
evobackup-client/tasks/jail_port.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- name: 'get jail port'
|
||||
command: "bkctld port {{ evolinux_hostname }}"
|
||||
become: true
|
||||
register: bkctld_port
|
||||
delegate_to: "{{ evobackup_client__hosts[0].ip }}"
|
||||
|
||||
- name: 'register jail port'
|
||||
set_fact:
|
||||
evobackup_ssh_port={{ bkctld_port.stdout }}
|
|
@ -8,6 +8,9 @@
|
|||
- evobackup_client
|
||||
- evobackup_client_backup_firewall
|
||||
|
||||
- include: "jail_port.yml"
|
||||
when: evobackup_ssh_port = ''
|
||||
|
||||
- name: Add backup SSH port in /etc/default/minifirewall
|
||||
blockinfile:
|
||||
dest: /etc/default/minifirewall
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
|
||||
- include: "jail_port.yml"
|
||||
when: evobackup_ssh_port = ''
|
||||
|
||||
- name: Upload evobackup script
|
||||
template:
|
||||
src: "{{ item }}"
|
||||
|
@ -11,6 +14,3 @@
|
|||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.{{ host_group }}.sh.j2"
|
||||
- "templates/evobackup-client/{{ evobackup_client__cron_template_name }}.sh.j2"
|
||||
- "zzz_evobackup.default.sh.j2"
|
||||
tags:
|
||||
- evobackup_client
|
||||
- evobackup_client_backup_scripts
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
---
|
||||
|
||||
- include: "jail_port.yml"
|
||||
when: evobackup_ssh_port = ''
|
||||
|
||||
- name: Verify evolix backup servers
|
||||
known_hosts:
|
||||
path: /root/.ssh/known_hosts
|
||||
|
|
Loading…
Reference in a new issue