Ansible roles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
753 B

---
- name: Install packages
yum: name=nfs-utils
tags: nfs
- name: Handle NFS ports
iptables_raw:
name: nfs_ports
state: "{{ (nfs_src_ip | length > 0) | ternary('present','absent') }}"
rules: "-A INPUT -m state --state NEW -p tcp -m multiport --dports {{ nfs_ports | join(',') }} -s {{ nfs_src_ip | join(',') }} -j ACCEPT\n
-A INPUT -m state --state NEW -p udp -m multiport --dports {{ nfs_ports | join(',') }} -s {{ nfs_src_ip | join(',') }} -j ACCEPT"
when: iptables_manage | default(True)
tags: nfs,firewall
- name: Configure exports
template: src=exports.j2 dest=/etc/exports
notify: reload nfs
- name: Start and enable services
service: name={{ item }} state=started enabled=True
with_items:
- nfs