Fichier Mission2

This commit is contained in:
“cameron.desrayaud” 2021-12-15 11:40:10 +01:00
parent 9f0082b1f2
commit 23ddc9a40d
15 changed files with 25 additions and 54 deletions

View File

@ -1,13 +0,0 @@
---
- hosts: test
remote_user: root
become: yes
become_method: sudo
roles:
- tomcat
- mariadb
- mariadb_create_dump
- mariadb_create_usr
- mariadb_inject_dump
- openjdk

View File

@ -1,5 +1,5 @@
--- ---
- name: Tomcat playbook - name: Tomcat & MariaDB installation playbook
hosts: test hosts: test
become: yes become: yes
become_method: sudo become_method: sudo
@ -11,5 +11,4 @@
ui_admin_username: admin ui_admin_username: admin
ui_admin_pass: root ui_admin_pass: root
roles: roles:
- tomcat - InstallTomcatMariaDB

View File

@ -1,5 +1,5 @@
--- ---
- name: MariaDB playbook - name: MariaDB création de compte et injection BDD playbook
hosts: test hosts: test
become: yes become: yes
become_method: sudo become_method: sudo

View File

@ -5,4 +5,4 @@
- "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml" - "{{ ansible_distribution }}{{ ansible_distribution_major_version }}.yml"
- "{{ ansible_os_family }}.yml" - "{{ ansible_os_family }}.yml"
- include_tasks: "tomcat-setup-{{ ansible_os_family }}.yml" - include_tasks: "tomcat-mariadb-install.yml"

View File

@ -55,13 +55,13 @@
extra_opts: "--strip-components=1" extra_opts: "--strip-components=1"
creates: /usr/share/tomcat/bin creates: /usr/share/tomcat/bin
- name: Copie tomcat fichier service* - name: Copie tomcat fichier service
template: template:
src: templates/tomcat.service.j2 src: templates/tomcat.service.j2
dest: /etc/systemd/system/tomcat.service dest: /etc/systemd/system/tomcat.service
when: ansible_service_mgr == "systemd" when: ansible_service_mgr == "systemd"
- name: Démarrer et activé tomcat - name: Démarrer et activer tomcat
service: service:
daemon_reload: yes daemon_reload: yes
name: tomcat name: tomcat
@ -83,3 +83,22 @@
- /usr/share/tomcat/webapps/manager/META-INF/context.xml - /usr/share/tomcat/webapps/manager/META-INF/context.xml
notify: restart tomcat notify: restart tomcat
- name: "MYSQL - update cache"
apt:
update_cache: yes
- name: "MYSQL - installation"
apt:
name: mariadb-server
state: latest
- name: "PYTHON3 - installation"
apt:
name: python3-pymysql
state: latest
- name: "MYSQL - démarrage de mysql"
service:
name: "mysqld"
state: started
enabled: yes

View File

@ -1,24 +1,4 @@
--- ---
- name: "MYSQL - update cache"
apt:
update_cache: yes
- name: "MYSQL - installation"
apt:
name: mariadb-server
state: latest
- name: "PYTHON3 - installation"
apt:
name: python3-pymysql
state: latest
- name: "MYSQL - démarrage de mysql"
service:
name: "mysqld"
state: started
enabled: yes
- name: "MYSQL - creation base de données" - name: "MYSQL - creation base de données"
community.mysql.mysql_db: community.mysql.mysql_db:
name: sdis29 name: sdis29

View File

@ -1,14 +0,0 @@
- name: copie de la base de donnée
copy:
src: sdis29.sql
dest: /tmp
- name: Importation de la base de données
mysql_db:
name: sdis29
state: import
target: /tmp/sdis29.sql
login_user: dev
login_password: Azerty1+
login_unix_socket: /var/run/mysqld/mysqld.sock