mixed linux environments playbooks

This commit is contained in:
Caleb Fultz 2024-07-12 15:51:27 -04:00
parent 4d8f26f1a9
commit 0401eb333b
4 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,5 @@
[defaults]
inventory = inventory
private_key_file = ~/.ssh/hetzner

View File

@ -0,0 +1,38 @@
---
- 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: latest
when: ansible_os_family == "Debian"
- name: Install support for php
package:
name: libapache2-mod-php
state: latest
when: ansible_os_family == "Debian"
#### EL Section ####
- name: Install apache2 package
package:
name: httpd
state: latest
when: ansible_os_family == "RedHat"
- name: Install support for php
package:
name: php
state: latest
when: ansible_os_family == "RedHat"

View File

@ -0,0 +1,4 @@
10.0.0.5
10.0.0.7
10.0.0.8
10.0.0.11

View File

@ -0,0 +1,38 @@
---
- 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"