Added all

This commit is contained in:
2026-05-27 12:11:32 +02:00
parent aaae16f141
commit 3fe81f42a2
11 changed files with 12 additions and 65 deletions

View File

@@ -1,12 +0,0 @@
[loadbalancer]
lb01 ansible_connection=local
[webserver]
app01 ansible_connection=local
app02 ansible_connection=local
[database]
db01 ansible_connection=local
[control]
control ansible_connection=local

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -1,12 +0,0 @@
[loadbalancer]
lb01
[webserver]
app01
app02
[database]
db01
[control]
control ansible_connection=local

View File

@@ -1,5 +1,8 @@
[database]
192.168.0.2
192.168.11.20
[loadbalancer]
192.168.0.3
192.168.11.30
[webserver]
192.168.11.40

View File

@@ -2,5 +2,5 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -2,5 +2,5 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes

View File

@@ -1,5 +0,0 @@
---
- hosts: all
tasks:
- name: get server hostname
command: hostname

View File

@@ -2,8 +2,8 @@
- hosts: database
become: true
tasks:
- name: install mysql-server
apt: name=mysql-server state=present update_cache=yes
- name: install default-mysql-server
apt: name=default-mysql-server state=present update_cache=yes
- name: ensure mysql started
service: name=mysql state=started enabled=yes

View File

@@ -1,17 +0,0 @@
---
- hosts: database
become: true
tasks:
- name: reiniciar mysql
service: name=mysql state=restarted
- hosts: loadbalancer
become: true
tasks:
- name: reiniciar nginx
service: name=nginx state=restarted
- hosts: webserver
become: true
tasks:
service: name=apache2 state=restarted