first playbooks

This commit is contained in:
Caleb Fultz 2024-07-12 15:35:38 -04:00
parent 47073d438e
commit 4d8f26f1a9
4 changed files with 43 additions and 0 deletions

View File

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

View File

@ -0,0 +1,18 @@
---
- hosts: all
become: true
tasks:
- name: Update repository index
ansible.builtin.apt:
update_cache: yes
- name: Install apache2 package
ansible.builtin.apt:
name: apache2
state: latest
- name: Install support for php
ansible.builtin.apt:
name: libapache2-mod-php
state: latest

2
first-playbook/inventory Normal file
View File

@ -0,0 +1,2 @@
10.0.0.7
10.0.0.8

View File

@ -0,0 +1,18 @@
---
- hosts: all
become: true
tasks:
- name: Update repository index
ansible.builtin.apt:
update_cache: yes
- name: Install apache2 package
ansible.builtin.apt:
name: apache2
state: absent
- name: Install support for php
ansible.builtin.apt:
name: libapache2-mod-php
state: absent