Updated README

This commit is contained in:
Caleb Fultz 2024-07-12 22:31:00 -04:00
parent 23cd031851
commit 6bea9b14a7
20 changed files with 80 additions and 0 deletions

View File

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

View 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
View 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
View 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

View File

@ -1,3 +1,7 @@
# ansible-course # 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. 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.