Merge "Opens ports to NFS server's firewalld"

This commit is contained in:
Zuul 2021-01-22 20:38:41 +00:00 committed by Gerrit Code Review
commit b7fa85399e
2 changed files with 35 additions and 0 deletions

View File

@ -69,3 +69,6 @@ tripleo_backup_and_restore_ceph_backup_file: "/var/lib/ceph.tar.gz"
# Ceph directory to back up
tripleo_backup_and_restore_ceph_path: "/var/lib/ceph"
# If there is a firewalld active, setup the zone where the NFS server ports need to be opened
tripleo_backup_and_restore_firewalld_zone: "libvirt"

View File

@ -68,6 +68,38 @@
tags:
- bar_setup_nfs_server
- name: Gather status of services running on the system
service_facts:
register: services_state
ignore_errors: true
tags:
- bar_setup_nfs_server
- name: Open ports in firewalld
become: true
block:
- name: Allow NFS port 111 in the firewall
firewalld:
port: 111/tcp
permanent: true
immediate: true
state: enabled
zone: "{{ tripleo_backup_and_restore_firewalld_zone }}"
- name: Allow NFS port 2049 in the firewall
firewalld:
port: 2049/tcp
permanent: true
immediate: true
state: enabled
zone: "{{ tripleo_backup_and_restore_firewalld_zone }}"
when: >
services_state is defined and
services_state.ansible_facts.services['firewalld.service'] is defined and
services_state.ansible_facts.services['firewalld.service'].state == "running"
tags:
- bar_setup_nfs_server
- name: Enable the NFS service in the NFS server
become: true
systemd: