diff --git a/Pepiniere/ansible/.gitignore b/Pepiniere/Ansible/Formation/.gitignore similarity index 100% rename from Pepiniere/ansible/.gitignore rename to Pepiniere/Ansible/Formation/.gitignore diff --git a/Pepiniere/ansible/.gitlab-ci.yml b/Pepiniere/Ansible/Formation/.gitlab-ci.yml similarity index 100% rename from Pepiniere/ansible/.gitlab-ci.yml rename to Pepiniere/Ansible/Formation/.gitlab-ci.yml diff --git a/Pepiniere/ansible/.gitmodules b/Pepiniere/Ansible/Formation/.gitmodules similarity index 100% rename from Pepiniere/ansible/.gitmodules rename to Pepiniere/Ansible/Formation/.gitmodules diff --git a/Pepiniere/ansible/0.Introduction-formation.md b/Pepiniere/Ansible/Formation/0.Introduction-formation.md similarity index 100% rename from Pepiniere/ansible/0.Introduction-formation.md rename to Pepiniere/Ansible/Formation/0.Introduction-formation.md diff --git a/Pepiniere/ansible/1.Introduction-ansible.md b/Pepiniere/Ansible/Formation/1.Introduction-ansible.md similarity index 100% rename from Pepiniere/ansible/1.Introduction-ansible.md rename to Pepiniere/Ansible/Formation/1.Introduction-ansible.md diff --git a/Pepiniere/ansible/10.bonnes-pratiques.md b/Pepiniere/Ansible/Formation/10.bonnes-pratiques.md similarity index 100% rename from Pepiniere/ansible/10.bonnes-pratiques.md rename to Pepiniere/Ansible/Formation/10.bonnes-pratiques.md diff --git a/Pepiniere/ansible/2.installation-inventaire.md b/Pepiniere/Ansible/Formation/2.installation-inventaire.md similarity index 100% rename from Pepiniere/ansible/2.installation-inventaire.md rename to Pepiniere/Ansible/Formation/2.installation-inventaire.md diff --git a/Pepiniere/ansible/3.commandes-ad-hoc.md b/Pepiniere/Ansible/Formation/3.commandes-ad-hoc.md similarity index 100% rename from Pepiniere/ansible/3.commandes-ad-hoc.md rename to Pepiniere/Ansible/Formation/3.commandes-ad-hoc.md diff --git a/Pepiniere/ansible/4.playbooks.md b/Pepiniere/Ansible/Formation/4.playbooks.md similarity index 100% rename from Pepiniere/ansible/4.playbooks.md rename to Pepiniere/Ansible/Formation/4.playbooks.md diff --git a/Pepiniere/ansible/5.roles.md b/Pepiniere/Ansible/Formation/5.roles.md similarity index 100% rename from Pepiniere/ansible/5.roles.md rename to Pepiniere/Ansible/Formation/5.roles.md diff --git a/Pepiniere/ansible/6.structures-de-controle.md b/Pepiniere/Ansible/Formation/6.structures-de-controle.md similarity index 100% rename from Pepiniere/ansible/6.structures-de-controle.md rename to Pepiniere/Ansible/Formation/6.structures-de-controle.md diff --git a/Pepiniere/ansible/7.templates.md b/Pepiniere/Ansible/Formation/7.templates.md similarity index 100% rename from Pepiniere/ansible/7.templates.md rename to Pepiniere/Ansible/Formation/7.templates.md diff --git a/Pepiniere/ansible/8.notions-avancees.md b/Pepiniere/Ansible/Formation/8.notions-avancees.md similarity index 100% rename from Pepiniere/ansible/8.notions-avancees.md rename to Pepiniere/Ansible/Formation/8.notions-avancees.md diff --git a/Pepiniere/ansible/9.Ansible-Galaxy.md b/Pepiniere/Ansible/Formation/9.Ansible-Galaxy.md similarity index 100% rename from Pepiniere/ansible/9.Ansible-Galaxy.md rename to Pepiniere/Ansible/Formation/9.Ansible-Galaxy.md diff --git a/Pepiniere/ansible/README.md b/Pepiniere/Ansible/Formation/README.md similarity index 100% rename from Pepiniere/ansible/README.md rename to Pepiniere/Ansible/Formation/README.md diff --git a/Pepiniere/ansible/ansible-config-virtualbox-vms.md b/Pepiniere/Ansible/Formation/ansible-config-virtualbox-vms.md similarity index 100% rename from Pepiniere/ansible/ansible-config-virtualbox-vms.md rename to Pepiniere/Ansible/Formation/ansible-config-virtualbox-vms.md diff --git a/Pepiniere/ansible/images/ansible-ad-hoc-deployment-workflow.png b/Pepiniere/Ansible/Formation/images/ansible-ad-hoc-deployment-workflow.png similarity index 100% rename from Pepiniere/ansible/images/ansible-ad-hoc-deployment-workflow.png rename to Pepiniere/Ansible/Formation/images/ansible-ad-hoc-deployment-workflow.png diff --git a/Pepiniere/ansible/images/ansible-ad-hoc-multi-node-deployment.png b/Pepiniere/Ansible/Formation/images/ansible-ad-hoc-multi-node-deployment.png similarity index 100% rename from Pepiniere/ansible/images/ansible-ad-hoc-multi-node-deployment.png rename to Pepiniere/Ansible/Formation/images/ansible-ad-hoc-multi-node-deployment.png diff --git a/Pepiniere/ansible/images/ansible-archi-playbooks.png b/Pepiniere/Ansible/Formation/images/ansible-archi-playbooks.png similarity index 100% rename from Pepiniere/ansible/images/ansible-archi-playbooks.png rename to Pepiniere/Ansible/Formation/images/ansible-archi-playbooks.png diff --git a/Pepiniere/ansible/images/ansible-archi-roles.png b/Pepiniere/Ansible/Formation/images/ansible-archi-roles.png similarity index 100% rename from Pepiniere/ansible/images/ansible-archi-roles.png rename to Pepiniere/Ansible/Formation/images/ansible-archi-roles.png diff --git a/Pepiniere/ansible/images/ansible-archi-ssh.png b/Pepiniere/Ansible/Formation/images/ansible-archi-ssh.png similarity index 100% rename from Pepiniere/ansible/images/ansible-archi-ssh.png rename to Pepiniere/Ansible/Formation/images/ansible-archi-ssh.png diff --git a/Pepiniere/ansible/images/ansible-galaxy-site.png b/Pepiniere/Ansible/Formation/images/ansible-galaxy-site.png similarity index 100% rename from Pepiniere/ansible/images/ansible-galaxy-site.png rename to Pepiniere/Ansible/Formation/images/ansible-galaxy-site.png diff --git a/Pepiniere/ansible/images/ansible-playbook-deployment-workflow.png b/Pepiniere/Ansible/Formation/images/ansible-playbook-deployment-workflow.png similarity index 100% rename from Pepiniere/ansible/images/ansible-playbook-deployment-workflow.png rename to Pepiniere/Ansible/Formation/images/ansible-playbook-deployment-workflow.png diff --git a/Pepiniere/ansible/images/ansible-playbook-multi-node-deployment-workflow.png b/Pepiniere/Ansible/Formation/images/ansible-playbook-multi-node-deployment-workflow.png similarity index 100% rename from Pepiniere/ansible/images/ansible-playbook-multi-node-deployment-workflow.png rename to Pepiniere/Ansible/Formation/images/ansible-playbook-multi-node-deployment-workflow.png diff --git a/Pepiniere/ansible/images/ci-vs-cd-devops-difference.jpg b/Pepiniere/Ansible/Formation/images/ci-vs-cd-devops-difference.jpg similarity index 100% rename from Pepiniere/ansible/images/ci-vs-cd-devops-difference.jpg rename to Pepiniere/Ansible/Formation/images/ci-vs-cd-devops-difference.jpg diff --git a/Pepiniere/ansible/images/logo-ansible.svg b/Pepiniere/Ansible/Formation/images/logo-ansible.svg similarity index 100% rename from Pepiniere/ansible/images/logo-ansible.svg rename to Pepiniere/Ansible/Formation/images/logo-ansible.svg diff --git a/Pepiniere/ansible/images/logo-molecule.png b/Pepiniere/Ansible/Formation/images/logo-molecule.png similarity index 100% rename from Pepiniere/ansible/images/logo-molecule.png rename to Pepiniere/Ansible/Formation/images/logo-molecule.png diff --git a/Pepiniere/ansible/images/logo-testinfra.svg b/Pepiniere/Ansible/Formation/images/logo-testinfra.svg similarity index 100% rename from Pepiniere/ansible/images/logo-testinfra.svg rename to Pepiniere/Ansible/Formation/images/logo-testinfra.svg diff --git a/Pepiniere/ansible/images/manual-deployment-without-ansible.png b/Pepiniere/Ansible/Formation/images/manual-deployment-without-ansible.png similarity index 100% rename from Pepiniere/ansible/images/manual-deployment-without-ansible.png rename to Pepiniere/Ansible/Formation/images/manual-deployment-without-ansible.png diff --git a/Pepiniere/ansible/images/tower-dashboard.png b/Pepiniere/Ansible/Formation/images/tower-dashboard.png similarity index 100% rename from Pepiniere/ansible/images/tower-dashboard.png rename to Pepiniere/Ansible/Formation/images/tower-dashboard.png diff --git a/Pepiniere/ansible/images/tp.gif b/Pepiniere/Ansible/Formation/images/tp.gif similarity index 100% rename from Pepiniere/ansible/images/tp.gif rename to Pepiniere/Ansible/Formation/images/tp.gif diff --git a/Pepiniere/ansible/index.html b/Pepiniere/Ansible/Formation/index.html similarity index 100% rename from Pepiniere/ansible/index.html rename to Pepiniere/Ansible/Formation/index.html diff --git a/Pepiniere/ansible/introduction.html b/Pepiniere/Ansible/Formation/introduction.html similarity index 100% rename from Pepiniere/ansible/introduction.html rename to Pepiniere/Ansible/Formation/introduction.html diff --git a/Pepiniere/ansible/travaux-pratiques/2.tp-deploiement-app.md b/Pepiniere/Ansible/Formation/travaux-pratiques/2.tp-deploiement-app.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/2.tp-deploiement-app.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/2.tp-deploiement-app.md diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/apache-handlers.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/apache-handlers.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/apache-handlers.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/apache-handlers.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/apache-install.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/apache-install.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/apache-install.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/apache-install.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-install.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-install.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-install.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-install.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-wordpress-configure.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-wordpress-configure.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-wordpress-configure.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/mariadb-wordpress-configure.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-configure.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-configure.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-configure.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-configure.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-install.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-install.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-install.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/imports/wordpress-install.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/install-apache-wordpress-mariadb-imports.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/install-apache-wordpress-mariadb-imports.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-imports/install-apache-wordpress-mariadb-imports.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-imports/install-apache-wordpress-mariadb-imports.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/apache-wordpress-mariadb-roles-password.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/apache-wordpress-mariadb-roles-password.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/apache-wordpress-mariadb-roles-password.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/apache-wordpress-mariadb-roles-password.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/group_vars/centos7.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/group_vars/centos7.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/group_vars/centos7.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/group_vars/centos7.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/hosts b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/hosts similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/hosts rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/inventories/formation/hosts diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/passwords.txt b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/passwords.txt similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/passwords.txt rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/passwords.txt diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/apache-install/tasks/main.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/apache-install/tasks/main.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/apache-install/tasks/main.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/apache-install/tasks/main.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-configure/tasks/main.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-configure/tasks/main.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-configure/tasks/main.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-configure/tasks/main.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-install/tasks/main.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-install/tasks/main.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-install/tasks/main.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/mariadb-install/tasks/main.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-configure/tasks/main.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-configure/tasks/main.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-configure/tasks/main.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-configure/tasks/main.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-install/tasks/main.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-install/tasks/main.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-install/tasks/main.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles-password/roles/wordpress-install/tasks/main.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/group_vars/wordpress.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/group_vars/wordpress.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/group_vars/wordpress.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/group_vars/wordpress.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/hosts b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/hosts similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/hosts rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/inventories/formation/hosts diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/playbook.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/playbook.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/playbook.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/playbook.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/apache/tasks/main.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/apache/tasks/main.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/apache/tasks/main.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/apache/tasks/main.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/defaults/main.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/defaults/main.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/defaults/main.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/defaults/main.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/add-database.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/add-database.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/add-database.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/add-database.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/install.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/install.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/install.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/install.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/main.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/main.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/main.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/mariadb/tasks/main.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/meta/main.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/meta/main.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/meta/main.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/meta/main.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/configure.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/configure.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/configure.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/configure.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/install.yml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/install.yml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/install.yml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/install.yml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/main.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/main.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/main.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress-roles/roles/wordpress/tasks/main.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/hosts b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/hosts similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/hosts rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/hosts diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/install-apache-wordpress-mariadb.yaml b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/install-apache-wordpress-mariadb.yaml similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/install-apache-wordpress-mariadb.yaml rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/install-apache-wordpress-mariadb.yaml diff --git a/Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/script-tp2.sh b/Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/script-tp2.sh similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/files/tp-wordpress/script-tp2.sh rename to Pepiniere/Ansible/Formation/travaux-pratiques/files/tp-wordpress/script-tp2.sh diff --git a/Pepiniere/ansible/travaux-pratiques/images/ansible-archi-ssh.png b/Pepiniere/Ansible/Formation/travaux-pratiques/images/ansible-archi-ssh.png similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/images/ansible-archi-ssh.png rename to Pepiniere/Ansible/Formation/travaux-pratiques/images/ansible-archi-ssh.png diff --git a/Pepiniere/ansible/travaux-pratiques/images/ansible-galaxy-search-role.png b/Pepiniere/Ansible/Formation/travaux-pratiques/images/ansible-galaxy-search-role.png similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/images/ansible-galaxy-search-role.png rename to Pepiniere/Ansible/Formation/travaux-pratiques/images/ansible-galaxy-search-role.png diff --git a/Pepiniere/ansible/travaux-pratiques/revealjs b/Pepiniere/Ansible/Formation/travaux-pratiques/revealjs similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/revealjs rename to Pepiniere/Ansible/Formation/travaux-pratiques/revealjs diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-divers.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-divers.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-divers.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-divers.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-divers.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-divers.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-divers.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-divers.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-galaxy.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-galaxy.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-galaxy.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-galaxy.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-galaxy.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-galaxy.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-galaxy.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-galaxy.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-imports.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-imports.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-imports.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-imports.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-imports.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-imports.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-imports.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-imports.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-inventaire.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-inventaire.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-inventaire.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-inventaire.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-inventaire.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-inventaire.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-inventaire.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-inventaire.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-les-commandes-ad-hoc.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-playbooks.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-playbooks.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-playbooks.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-playbooks.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-playbooks.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-playbooks.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-playbooks.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-playbooks.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-roles.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-roles.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-roles.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-roles.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-roles.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-roles.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-roles.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-roles.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-structures-de-controle.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-structures-de-controle.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-structures-de-controle.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-structures-de-controle.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-structures-de-controle.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-structures-de-controle.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-structures-de-controle.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-structures-de-controle.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-templates.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-templates.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-templates.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-templates.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-templates.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-templates.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-templates.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-templates.md diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-vault.html b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-vault.html similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-vault.html rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-vault.html diff --git a/Pepiniere/ansible/travaux-pratiques/tp-ansible-vault.md b/Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-vault.md similarity index 100% rename from Pepiniere/ansible/travaux-pratiques/tp-ansible-vault.md rename to Pepiniere/Ansible/Formation/travaux-pratiques/tp-ansible-vault.md diff --git a/Pepiniere/Ansible/Travaux_pratiques/ansible.cfg b/Pepiniere/Ansible/Travaux_pratiques/ansible.cfg new file mode 100644 index 0000000..0361169 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/ansible.cfg @@ -0,0 +1,2 @@ +[defaults] +vault_password_file = vault-password diff --git a/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/all/vault b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/all/vault new file mode 100644 index 0000000..700b0b3 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/all/vault @@ -0,0 +1,7 @@ +$ANSIBLE_VAULT;1.1;AES256 +33366532393138353666653365633234396238316366613234383661316466323333376565366333 +3830646663633362313234656439663962323666633935350a393632336239343963626135623962 +34363931383263346663636235656236653762346561366536383630356263616565643365336138 +3264376566383861650a643261343935306564646165333831666530643231303430346134653836 +32623163396533373735616534313536646261633630346562356139353230326161336561613739 +3132613930623633613437633665653361316566666465313338 diff --git a/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/wordpress.yaml b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/wordpress.yaml new file mode 100644 index 0000000..1a86f88 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/group_vars/wordpress.yaml @@ -0,0 +1,5 @@ +DB_NAME: wordpress_db +DB_USER_NAME: admin +DB_USER_PASSWORD: admin +DB_HOST: "{{ hostvars['ansible-2']['ansible_host'] }}" +WEB_HOST: "{{ hostvars['ansible-1']['ansible_host'] }}" diff --git a/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/hosts b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/hosts new file mode 100644 index 0000000..ad47ff0 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/inventories/formation/hosts @@ -0,0 +1,23 @@ +ansible-1 ansible_host=192.168.56.52 +ansible-2 ansible_host=192.168.56.54 +ansible-3 ansible_host=192.168.56.56 +ansible-4 ansible_host=192.168.56.58 ansible_user=root + + + +[centos] +ansible-1 +ansible-2 +ansible-3 + +[debian] +ansible-4 + +[tous:children] +centos +debian + +[wordpress] +ansible-1 +ansible-2 + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbook-vault.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbook-vault.yaml new file mode 100644 index 0000000..498231a --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbook-vault.yaml @@ -0,0 +1,5 @@ +- hosts: ansible-3 + tasks: + - name: Display secure password + debug: + msg: "Robert's password is: {{ vault_robert_password }}" diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbook.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbook.yaml new file mode 100644 index 0000000..08d4094 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbook.yaml @@ -0,0 +1,9 @@ +- hosts: ansible-2 + roles: + - role: postgre + + +- hosts: ansible-1 + roles: + - role: apache + - role: wordpress diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_mariadb.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_mariadb.yaml new file mode 100644 index 0000000..0d3b391 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_mariadb.yaml @@ -0,0 +1,14 @@ + - name: create a new database + mysql_db: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: '{{ DB_NAME }}' + state: present + + - name: create a new user in database + mysql_user: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: '{{ DB_USER_NAME }}' + password: '{{ DB_USER_PASSWORD }}' + priv: '{{ DB_NAME }}.*:ALL' + host: '{{ DB_HOST }}' + state: present diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_postgre.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_postgre.yaml new file mode 100644 index 0000000..1bee03c --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_postgre.yaml @@ -0,0 +1,28 @@ + - name: create a new database + become: yes + become_user: postgres + postgresql_db: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: '{{ DB_NAME }}' + state: present + + + - name: create a new user in database + become: yes + become_user: postgres + postgresql_user: + # login_unix_socket: /var/run/mysqld/mysqld.sock + db: '{{ DB_NAME }}' + name: '{{ DB_USER_NAME }}' + password: '{{ DB_USER_PASSWORD }}' + priv: ALL + expires: infinity + +# - name: grant all privileges + # become: yes + # become_user: postgres + # postgresql_privs: + # db: "{{ 'DB_NAME' }}" + # privs: ALL + # type: database + # role: diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_wordpress.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_wordpress.yaml new file mode 100644 index 0000000..860af4f --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/configure_wordpress.yaml @@ -0,0 +1,32 @@ + + - name: Create wordpress configuration file + copy: + src: /var/www/html/wordpress/wp-config-sample.php + dest: /var/www/html/wordpress/wp-config.php + remote_src: yes + + - name: Wordpress conf, db name + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'database_name_here' + replace: '{{ DB_NAME }}' + + + - name: Wordpress conf, db username + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'username_here' + replace: '{{ DB_USER_NAME }}' + + - name: Wordpress conf, db passwd + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'password_here' + replace: '{{ DB_USER_PASSWORD }}' + + - name: Wordpress conf, db host + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'localhost' + replace: '192.168.56.54' + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_web_server.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_web_server.yaml new file mode 100644 index 0000000..d778694 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_web_server.yaml @@ -0,0 +1,26 @@ +- hosts: ansible-1 + tasks: + - name: Install and launch httpd + yum: + name: httpd + state: present + update_cache: yes + + - name: Set https systemctl enable + service: + name: httpd + state: started + enabled: yes + + - name: Copy static web page + copy: + src: index.html + dest: /var/www/html/index.html + mode: 0444 + + - name: Configure firewalld + firewalld: + service: http + permanent: yes + state: enabled + immediate: yes diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_wordpress.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_wordpress.yaml new file mode 100644 index 0000000..289d51f --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/create_wordpress.yaml @@ -0,0 +1,115 @@ +- hosts: ansible-2 + tasks: + - name: install mariadb-server # DONE + yum: + name: + - MySQL-python + - mariadb-server + - python3-pip + - python3 + - firewalld + state: present + update_cache: yes + +# - name: Install pymysql + # pip: + # name: PyMySQL + # state: present + # executable: pip3 + + - name: create a new database #DONE + mysql_db: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: wordpress_db + state: present + + - name: create a new user in database wordpress_db #DONE + mysql_user: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: admin + password: admin + priv: 'wordpress_db.*:ALL' + host: 192.168.56.52 + state: present + + - name: configure firewalld # DONE + firewalld: + service: mysql + permanent: true + state: enabled + immediate: yes + + +- hosts: ansible-1 + tasks: + - name: Install https, php, php-mysqlnd, firewalld + yum: + name: + - httpd + - php + - php-mysqlnd + - firewalld + - php-fpm + state: present + update_cache: yes + + - name: Enable systemctl service installed + service: + name: httpd + state: started + enabled: yes + + - name: Enable php + service: + name: php-fpm + state: started + enabled: yes + + - name: Configure firewalld + firewalld: + service: http + permanent: yes + state: enabled + immediate: yes + + - name: Install wordpress 5.0.8 + unarchive: + src: https://wordpress.org/latest.tar.gz + dest: /var/www/html/ + remote_src: yes + + - name: Create wordpress configuration file + copy: + src: /var/www/html/wordpress/wp-config-sample.php + dest: /var/www/html/wordpress/wp-config.php + remote_src: yes + + - name: Wordpress conf, db name + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'database_name_here' + replace: wordpress_db + + + - name: Wordpress conf, db username + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'username_here' + replace: admin + + - name: Wordpress conf, db passwd + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'password_here' + replace: admin + + - name: Wordpress conf, db host + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'localhost' + replace: 192.168.156.54 + + - name: restart httpd service + service: + name: httpd + state: restarted diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/get-user-id.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/get-user-id.yaml new file mode 100644 index 0000000..c7b0dcc --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/get-user-id.yaml @@ -0,0 +1,10 @@ +- hosts: all + tasks: + - name: Get user id + command: id + register: user_id + + - name: Display user id + ansible.builtin.debug: + var: user_id.stdout + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/index.html b/Pepiniere/Ansible/Travaux_pratiques/playbooks/index.html new file mode 100644 index 0000000..e4ae2d3 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/index.html @@ -0,0 +1,30 @@ + + + + + Titre de la page + + + + +

BONJOUR

+
+

Cedric

+
+ + + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache.yaml new file mode 100644 index 0000000..7c33efc --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache.yaml @@ -0,0 +1,20 @@ + - name: Install httpd (apache) + yum: + name: + - httpd + state: present + update_cache: yes + + - name: Start and enable httpd service + service: + name: httpd + state: started + enabled: yes + + - name: Allow http in firewalld + firewalld: + service: http + permanent: yes + state: enabled + immediate: yes + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache_wordpress_mariadb.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache_wordpress_mariadb.yaml new file mode 100644 index 0000000..c217fca --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_apache_wordpress_mariadb.yaml @@ -0,0 +1,23 @@ +- hosts: ansible-2 + vars: + - DB_NAME: wordpress_db + - DB_USER_NAME: admin + - DB_USER_PASSWORD: "admin" + - DB_HOST: "{{ hostvars['ansible-2']['ansible_host'] }}" + - DB_WEB: "{{ hostvars['ansible-1']['ansible_host'] }}" + tasks: + - include_tasks: install_mariadb.yaml + - include_tasks: configure_mariadb.yaml + +- hosts: ansible-1 + vars: + - DB_NAME: wordpress_db + - DB_USER_NAME: admin + - DB_USER_PASSWORD: "admin" + - DB_HOST: "{{ hostvars['ansible-2]['ansible_ssh_host'] }}" + tasks: + - include_tasks: install_apache.yaml + - include_tasks: install_php.yaml + - include_tasks: install_wordpress_latest.yaml + - include_tasks: configure_wordpress.yaml + - import_tasks: restart_apache.yaml diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_mariadb.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_mariadb.yaml new file mode 100644 index 0000000..77283a4 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_mariadb.yaml @@ -0,0 +1,20 @@ + - name: install mariadb-server + yum: + name: + - MySQL-python + - mariadb-server + state: present + update_cache: yes + + - name: + service: + name: mariadb + state: started + enabled: yes + + - name: + firewalld: + service: mysql + permanent: true + state: enabled + immediate: yes diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_php.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_php.yaml new file mode 100644 index 0000000..b11aab8 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_php.yaml @@ -0,0 +1,16 @@ + - name: Install php, php-mysqlnd + yum: + name: + - php + - php-mysqlnd + - php-fpm + state: present + update_cache: yes + + - name: Enable php + service: + name: php-fpm + state: started + enabled: yes + + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre.yaml new file mode 100644 index 0000000..6e3caba --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre.yaml @@ -0,0 +1,32 @@ + + - name: Enable EPEL Repository on CentOS 7 + yum: + name: epel-release + state: latest + + + - name: install mariadb-server + yum: + name: + - epel-release + - postgresql + - postgresql-server + - python-setuptools + - python-psycopg2 + - python2 + - python2-pip + state: present + update_cache: yes + + - name: + service: + name: postgresql + state: started + enabled: yes + + - name: + firewalld: + port: 5432/tcp + permanent: true + state: enabled + immediate: yes diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre_apache_wordpress.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre_apache_wordpress.yaml new file mode 100644 index 0000000..aecd63b --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_postgre_apache_wordpress.yaml @@ -0,0 +1,23 @@ +- hosts: ansible-2 + vars: + - DB_NAME: wordpress_db + - DB_USER_NAME: admin + - DB_USER_PASSWORD: "admin" + - DB_HOST: "{{ hostvars['ansible-2']['ansible_host'] }}" + - DB_WEB: "{{ hostvars['ansible-1']['ansible_host'] }}" + tasks: + - include_tasks: install_postgre.yaml + - include_tasks: configure_postgre.yaml + +- hosts: ansible-1 + vars: + - DB_NAME: wordpress_db + - DB_USER_NAME: admin + - DB_USER_PASSWORD: "admin" + - DB_HOST: "{{ hostvars['ansible-2]['ansible_host'] }}" + tasks: + - include_tasks: install_apache.yaml + - include_tasks: install_php.yaml + - include_tasks: install_wordpress_latest.yaml + - include_tasks: configure_wordpress.yaml + - import_tasks: restart_apache.yaml diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_wordpress_latest.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_wordpress_latest.yaml new file mode 100644 index 0000000..a736b10 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/install_wordpress_latest.yaml @@ -0,0 +1,6 @@ + - name: Install wordpress latest version + unarchive: + src: https://wordpress.org/latest.tar.gz + dest: /var/www/html/ + remote_src: yes + diff --git a/Pepiniere/Ansible/Travaux_pratiques/playbooks/restart_apache.yaml b/Pepiniere/Ansible/Travaux_pratiques/playbooks/restart_apache.yaml new file mode 100644 index 0000000..4a5f6a4 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/playbooks/restart_apache.yaml @@ -0,0 +1,5 @@ + + - name: restart httpd service + service: + name: httpd + state: restarted diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/apache/handlers/restart_apache.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/handlers/restart_apache.yaml new file mode 100644 index 0000000..92c2bc2 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/handlers/restart_apache.yaml @@ -0,0 +1,5 @@ + + - name: reload Apache + service: + name: httpd + state: restarted diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_apache.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_apache.yaml new file mode 100644 index 0000000..d1eec97 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_apache.yaml @@ -0,0 +1,31 @@ + - name: install Apache/Httpd + yum: + name: + - httpd + state: present + update_cache: yes + when: + - ansible_os_family == "RedHat" + + - name: install Apache/Httpd + apt: + name: + - httpd + state: present + update_cache: yes + when: + - ansible_os_family == "Debian" + + - name: start Httpd; enabled Httpd" + service: + name: httpd + state: started + enabled: yes + + - name: allow Httpd throught firewalld + firewalld: + service: http + permanent: yes + state: enabled + immediate: yes + diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_php.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_php.yaml new file mode 100644 index 0000000..2e59d7e --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/install_php.yaml @@ -0,0 +1,29 @@ + - name: install php, php-mysqlnd + yum: + name: + - php + - php-mysqlnd + state: present + update_cache: yes + when: + - ansible_os_family == "RedHat" + notify: reload Apache + + - name: install php, php-mysqlnd + apt: + name: + - php + - php-mysqlnd + state: present + update_cache: yes + when: + - ansible_os_family == "Debian" + notify: reload Apache + + + - name: start php ; enable php + service: + name: php-fpm + state: started + enabled: yes + diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/main.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/main.yaml new file mode 100644 index 0000000..fcb57a1 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/apache/tasks/main.yaml @@ -0,0 +1,2 @@ +- import_tasks: install_apache.yaml +- import_tasks: install_php.yaml diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/defaults/main.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/defaults/main.yaml new file mode 100644 index 0000000..22a6432 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/defaults/main.yaml @@ -0,0 +1,4 @@ +DB_NAME: default_db +DB_USER_NAME: root +DB_USER_PASSWORD: Pa$$w0rd +WEB_HOST: localhost diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_database.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_database.yaml new file mode 100644 index 0000000..aca78af --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_database.yaml @@ -0,0 +1,7 @@ + - name: create a new database + become: yes + become_user: postgres + postgresql_db: + # login_unix_socket: /var/run/mysqld/mysqld.sock + name: '{{ DB_NAME }}' + state: present diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_user.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_user.yaml new file mode 100644 index 0000000..d07767b --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/add_user.yaml @@ -0,0 +1,11 @@ + - name: create a new user in database + become: yes + become_user: postgres + postgresql_user: + # login_unix_socket: /var/run/mysqld/mysqld.sock + db: '{{ DB_NAME }}' + name: '{{ DB_USER_NAME }}' + password: '{{ DB_USER_PASSWORD }}' + priv: ALL + expires: infinity + diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/install.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/install.yaml new file mode 100644 index 0000000..03ff82f --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/install.yaml @@ -0,0 +1,40 @@ + + - name: Enable EPEL Repository on CentOS 7 + yum: + name: epel-release + state: latest + when: + - ansible_os_family == "RedHat" + + - name: install mariadb-server + yum: + name: + - postgresql-server + - python-setuptools + - python-psycopg2 + state: present + update_cache: yes + when: + - ansible_os_family == "RedHat" + + - name: Install postgresql + apt: + name: + - postgresql-server + - python-setuptools + - python-psycopg2 + when: + - ansible_os_family == "Debian" + + - name: + service: + name: postgresql + state: started + enabled: yes + + - name: + firewalld: + port: 5432/tcp + permanent: true + state: enabled + immediate: yes diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/main.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/main.yaml new file mode 100644 index 0000000..1d097bb --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/postgre/tasks/main.yaml @@ -0,0 +1,3 @@ +- import_tasks: install.yaml +- import_tasks: add_database.yaml +- import_tasks: add_user.yaml diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/configure_wordpress.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/configure_wordpress.yaml new file mode 100644 index 0000000..738ff28 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/configure_wordpress.yaml @@ -0,0 +1,32 @@ + + - name: Create wordpress configuration file + copy: + src: /var/www/html/wordpress/wp-config-sample.php + dest: /var/www/html/wordpress/wp-config.php + remote_src: yes + + - name: Wordpress conf, db name + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'database_name_here' + replace: '{{ DB_NAME }}' + + + - name: Wordpress conf, db username + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'username_here' + replace: '{{ DB_USER_NAME }}' + + - name: Wordpress conf, db passwd + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'password_here' + replace: '{{ DB_USER_PASSWORD }}' + + - name: Wordpress conf, db host + replace: + dest: /var/www/html/wordpress/wp-config.php + regexp: 'localhost' + replace: '{{ DB_HOST }}' + diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/install_wordpress_latest.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/install_wordpress_latest.yaml new file mode 100644 index 0000000..a736b10 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/install_wordpress_latest.yaml @@ -0,0 +1,6 @@ + - name: Install wordpress latest version + unarchive: + src: https://wordpress.org/latest.tar.gz + dest: /var/www/html/ + remote_src: yes + diff --git a/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/main.yaml b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/main.yaml new file mode 100644 index 0000000..1ea2008 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/roles/wordpress/tasks/main.yaml @@ -0,0 +1,2 @@ +- import_tasks: install_wordpress_latest.yaml +- import_tasks: configure_wordpress.yaml diff --git a/Pepiniere/Ansible/Travaux_pratiques/vault-password b/Pepiniere/Ansible/Travaux_pratiques/vault-password new file mode 100644 index 0000000..a85f728 --- /dev/null +++ b/Pepiniere/Ansible/Travaux_pratiques/vault-password @@ -0,0 +1 @@ +Pa$$w0rd