1.0
This commit is contained in:
5
ansible/inventory/inventory.ini
Normal file
5
ansible/inventory/inventory.ini
Normal file
@@ -0,0 +1,5 @@
|
||||
[firewall]
|
||||
nftables ansible_host='192.168.1.119'
|
||||
|
||||
[Database]
|
||||
Database ansible_host='192.168.1.119'
|
||||
28
ansible/playbook/deploy_firewall.yml
Normal file
28
ansible/playbook/deploy_firewall.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
|
||||
- name: Déploiement des règles nftables
|
||||
hosts: firewall
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Installation nftables
|
||||
apt:
|
||||
name: nftables
|
||||
state: present
|
||||
|
||||
- name: Copie de la configuration du module 'nftables.conf'
|
||||
copy:
|
||||
src: ../../modules/nftables.conf
|
||||
dest: /etc/nftables.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: Redémarrer nftables
|
||||
|
||||
handlers:
|
||||
- name: Redémarrer nftables
|
||||
service:
|
||||
name: nftables
|
||||
state: restarted
|
||||
|
||||
|
||||
17
ansible/playbook/setup_db.yml
Normal file
17
ansible/playbook/setup_db.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: "Déploiement Automatique Database"
|
||||
hosts: Database
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Installer mariadb-server
|
||||
apt:
|
||||
name: mariadb-server
|
||||
state: present
|
||||
update-cache: yes
|
||||
|
||||
- name: Installer mariadb-client
|
||||
apt:
|
||||
name: mariadb-client
|
||||
state: present
|
||||
|
||||
8
ansible/playbook/site.yml
Normal file
8
ansible/playbook/site.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
- name: Lancement de la configuration Database
|
||||
import_playbook: setup_db.yml
|
||||
|
||||
- name: Lancement de la configuration nftables
|
||||
import_playbook: deploy_firewall.yml
|
||||
|
||||
Reference in New Issue
Block a user