Updated README
This commit is contained in:
parent
23cd031851
commit
6bea9b14a7
5
05-adding-tags/ansible.cfg
Normal file
5
05-adding-tags/ansible.cfg
Normal file
@ -0,0 +1,5 @@
|
||||
[defaults]
|
||||
inventory = inventory
|
||||
private_key_file = ~/.ssh/hetzner
|
||||
|
||||
|
15
05-adding-tags/install_apache.yml
Normal file
15
05-adding-tags/install_apache.yml
Normal file
@ -0,0 +1,15 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
#### Ubuntu/Debian Section ####
|
||||
|
||||
- name: Install apache2 package with php support
|
||||
package:
|
||||
name:
|
||||
- "{{ apache_package }}"
|
||||
- "{{ php_package }}"
|
||||
state: latest
|
||||
update_cache: yes
|
||||
|
7
05-adding-tags/inventory
Normal file
7
05-adding-tags/inventory
Normal file
@ -0,0 +1,7 @@
|
||||
[web_servers]
|
||||
10.0.0.7
|
||||
10.0.0.8
|
||||
|
||||
[db_servers]
|
||||
10.0.0.5
|
||||
10.0.0.11
|
49
05-adding-tags/site.yml
Normal file
49
05-adding-tags/site.yml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
- hosts: all
|
||||
become: true
|
||||
pre_tasks:
|
||||
|
||||
- name: install updates for RHEL distros
|
||||
tags: always
|
||||
package:
|
||||
update_only: yes
|
||||
update_cache: yes
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- name: install updates for Debian distros
|
||||
tags: always
|
||||
package:
|
||||
upgrade: dist
|
||||
update_cache: yes
|
||||
when: ansible_os_family == "Debian"
|
||||
|
||||
- hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: Install common packages
|
||||
package:
|
||||
name:
|
||||
- htop
|
||||
- neofetch
|
||||
|
||||
- hosts: web_servers
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: Install apache on web servers
|
||||
tags: apache,debian
|
||||
package:
|
||||
name:
|
||||
- apache2
|
||||
- libapache2-mod-php
|
||||
|
||||
- hosts: db_servers
|
||||
tags: db,el
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: install mariadb package on db servers
|
||||
package:
|
||||
name: mariadb
|
||||
state: latest
|
@ -1,3 +1,7 @@
|
||||
# ansible-course
|
||||
|
||||
LearnLinuxTV Ansible Course Repository. If you're on [GitHub](https://github.com/cfultz/ansible-course), this is mirrored on my personal [Gitea](https://git.cfultz.wtf/cfultz/ansible-course) instance.
|
||||
|
||||
# Changes
|
||||
|
||||
I updated some of the commands i already knew in earlier playbooks to make things morr streamlined.
|
||||
|
Loading…
Reference in New Issue
Block a user