ansible-course/02-mixed-linux-environments/remove_apache.yml

39 lines
710 B
YAML
Raw Permalink Normal View History

2024-07-12 21:51:27 +02:00
---
- hosts: all
become: true
tasks:
- name: Update repository index
ansible.builtin.package:
update_cache: yes
#### Ubuntu/Debian Section ####
- name: Install apache2 package
package:
name: apache2
state: absent
when: ansible_os_family == "Debian"
- name: Install support for php
package:
name: libapache2-mod-php
state: absent
when: ansible_os_family == "Debian"
#### EL Section ####
- name: Install apache2 package
package:
name: httpd
state: absent
when: ansible_os_family == "RedHat"
- name: Install support for php
package:
name: php
state: absent
when: ansible_os_family == "RedHat"