mixed linux environments playbooks
This commit is contained in:
parent
4d8f26f1a9
commit
0401eb333b
5
mixed-linux-environments/ansible.cfg
Normal file
5
mixed-linux-environments/ansible.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
[defaults]
|
||||
inventory = inventory
|
||||
private_key_file = ~/.ssh/hetzner
|
||||
|
||||
|
38
mixed-linux-environments/install_apache.yml
Normal file
38
mixed-linux-environments/install_apache.yml
Normal 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"
|
4
mixed-linux-environments/inventory
Normal file
4
mixed-linux-environments/inventory
Normal file
@ -0,0 +1,4 @@
|
||||
10.0.0.5
|
||||
10.0.0.7
|
||||
10.0.0.8
|
||||
10.0.0.11
|
38
mixed-linux-environments/remove_apache.yml
Normal file
38
mixed-linux-environments/remove_apache.yml
Normal 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"
|
Loading…
Reference in New Issue
Block a user