--- - hosts: all tasks: - name: apache telepítés apt: name: apache2 state: present become: yes
- name: Csomagok telepíése apt: name: "{{ packages }}" vars: packages: - egyik - masodik
--- - hosts: all tasks: - name: apache indítas service: name: apache2 state: started become: yes
--- - hosts: all tasks: - name: apache leállítása service: name: apache2 state: stopped become: yes
--- - hosts: all tasks: - name: apache újraindítás service: name: apache2 state: restarted become: yes
--- - hosts: all tasks: - name: stop nginx service: name: nginx state: stopped become: yes - name: delete nginx apt: name: nginx state: absent purge: yes autoremove: yes become: yes
--- - hosts: all tasks: - name: Biztosan fusson az apache systemd: state: started name: apache2 become: yes
--- - hosts: all tasks: - name: Állítsuk le az apache-t systemd: name: apache2 state: stopped become: yes
--- - hosts: all tasks: - name: Újraindítjuk a szolgáltatást systemd: state: restarted daemon_reload: yes name: apache2 become: yes
--- - hosts: all tasks: - name: Konfigurációs újratöltése systemd: name: apache2 state: reloaded become: yes
--- - hosts: all tasks: - name: szolgáltatás engedélyezése systemd: name: apache2 enabled: yes masked: no become: yes