Update nfs_server_packages.yml
package:
name: "{{ item }}"
state: present
- with_items:
- - nfs-utils
- - firewalld
+ with_items: "{{ nfs_utilities }}"
- name: Start and enable rpcbind and nfs-server service
service:
name: "{{ item }}"
state: started
enabled: yes
- with_items:
- - rpcbind
- - nfs-server
- - firewalld
+ with_items: "{{ nfs_services }}"
+
+- name: Add services to firewalld
+ command: firewall-cmd --add-service="{{ item }}" --zone=internal --permanent
+ changed_when: false
+ with_items: "{{ firewall_services }}"
+
+- name: Add ports to firwalld
+ command: firewall-cmd --add-port="{{ item }}" --permanent
+ changed_when: false
+ with_items: "{{ firewall_ports }}"
+
+- name: Reload firewalld
+ command: firewall-cmd --reload
+ changed_when: false
