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:
Patrick Marchand 2020-06-23 11:07:55 -04:00
parent 9bdd5ad9e7
commit 8caca4c711
5 changed files with 20 additions and 19 deletions

View file

@ -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

View 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 }}

View file

@ -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

View file

@ -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

View file

@ -1,5 +1,8 @@
---
- include: "jail_port.yml"
when: evobackup_ssh_port = ''
- name: Verify evolix backup servers
known_hosts:
path: /root/.ssh/known_hosts