Advertisement
quantim

ansible firewalld and yum in single task

Sep 30th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.28 KB | None | 0 0
  1. ---
  2. - hosts: all
  3.   become: true
  4.   tasks:
  5.     - name: Configure firewalld
  6.       systemd: name=firewalld state=started enabled=yes
  7.  
  8.     - name: Enable EPEL YUM repository
  9.       yum_repository:
  10.         name: epel
  11.         description: EPEL YUM repository
  12.         baseurl: https://download.fedoraproject.org/pub/epel/7/x86_64/
  13.  
  14.     - name: Configure Ansible "Server"
  15.       yum: name=ansible state=present update_cache=yes
  16.    
  17.     - name: Configure NFS Server
  18.       yum:
  19.         name: "{{ item }}"
  20.         state: present
  21.         update_cache: yes
  22.       with_items:
  23.        # For nfs Server/Client support
  24.         - nfs-utils
  25.         # For Automounting NFS files
  26.         - autofs
  27.         - mountd
  28.         - rpcbind
  29.       firewalld:
  30.         service: nfs
  31.         permanenet: true
  32.         state: enabled
  33.  
  34.       systemd:
  35.         name: "{{ item }}"
  36.         state: started
  37.         enabled: yes
  38.       with_items:
  39.        - nfs
  40.         - autofs
  41.         - rpcbind
  42.         - mountd
  43.  
  44.     - name: Configure Check_MK Monitoring
  45.         # Monitoring using Check_MK
  46.       yum:
  47.         name: "{{ item }}"
  48.         state: present
  49.         update_cache: yes
  50.       with_items:
  51.        - check-mk-agent
  52.         - xinetd
  53.       systemd: name=inetd state=started enabled=yes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement