From 08944e6df9182855a7c9e0d0d7f6ba196139512f Mon Sep 17 00:00:00 2001 From: root Date: Wed, 4 Jan 2023 14:26:11 +0100 Subject: [PATCH] Ansible AP3 --- Sio2/AP3/Ansible/apbase.yml | 29 ++++++++++++++++++++++++++++ Sio2/AP3/Ansible/apdb.yml | 23 ++++++++++++++++++++++ Sio2/AP3/Ansible/apdbdump.yml | 19 ++++++++++++++++++ Sio2/AP3/Ansible/apt.conf | 2 ++ Sio2/AP3/Ansible/hosts | 2 ++ Sio2/AP3/Ansible/sdis29-dump.sql.gz | Bin 0 -> 457 bytes 6 files changed, 75 insertions(+) create mode 100644 Sio2/AP3/Ansible/apbase.yml create mode 100644 Sio2/AP3/Ansible/apdb.yml create mode 100644 Sio2/AP3/Ansible/apdbdump.yml create mode 100644 Sio2/AP3/Ansible/apt.conf create mode 100644 Sio2/AP3/Ansible/hosts create mode 100644 Sio2/AP3/Ansible/sdis29-dump.sql.gz diff --git a/Sio2/AP3/Ansible/apbase.yml b/Sio2/AP3/Ansible/apbase.yml new file mode 100644 index 0000000..3cc40b2 --- /dev/null +++ b/Sio2/AP3/Ansible/apbase.yml @@ -0,0 +1,29 @@ +--- +- name: apbase + hosts: ap32 + become: true + become_method: sudo + tasks: + - name: Ajout fichier apt.conf + copy: + src: apt.conf + dest: /etc/apt/apt.conf + + - name: apt update & upgrade + apt: + update_cache: yes + upgrade: yes + + - name: Installation des packets + apt: + name: + - apache2 + - php + - php-mbstring + - php-mysql + - mariadb-server + - git + - python3-mysqldb + - python3-passlib + - python3-pymysql + state: present diff --git a/Sio2/AP3/Ansible/apdb.yml b/Sio2/AP3/Ansible/apdb.yml new file mode 100644 index 0000000..3ad0487 --- /dev/null +++ b/Sio2/AP3/Ansible/apdb.yml @@ -0,0 +1,23 @@ +--- +- name: apdb + hosts: ap32 + become: true + become_method: sudo + tasks: + - name: creation nouvelle db sdis2022 + community.mysql.mysql_db: + name: sdis29 + login_user: root + login_password: admin + state: present + login_unix_socket: /run/mysqld/mysqld.sock + + - name: creation utilisateur ap32 + community.mysql.mysql_user: + login_user: root + login_password: admin + name: ap32 + password: ap32 + priv: 'sdis29.*:ALL' + state: present + login_unix_socket: /run/mysqld/mysqld.sock diff --git a/Sio2/AP3/Ansible/apdbdump.yml b/Sio2/AP3/Ansible/apdbdump.yml new file mode 100644 index 0000000..95299f1 --- /dev/null +++ b/Sio2/AP3/Ansible/apdbdump.yml @@ -0,0 +1,19 @@ +--- +- hosts: ap32 + become: true + become_method: sudo + tasks: + - name: Dump database + community.mysql.mysql_db: + state: dump + name: "sdis29" + login_user: ap32 + login_password: ap32 + target: /tmp/sdis29-dump.sql.gz + login_unix_socket: /run/mysqld/mysqld.sock + + - name: copie du dump sur machine locale + fetch: + src: /tmp/sdis29-dump.sql.gz + dest: sdis29-dump.sql.gz + flat: yes diff --git a/Sio2/AP3/Ansible/apt.conf b/Sio2/AP3/Ansible/apt.conf new file mode 100644 index 0000000..024ff31 --- /dev/null +++ b/Sio2/AP3/Ansible/apt.conf @@ -0,0 +1,2 @@ +Acquire::http::Proxy "http://10.121.38.1:8080"; +Acquire::https::Proxy "http://10.121.38.1:8080"; diff --git a/Sio2/AP3/Ansible/hosts b/Sio2/AP3/Ansible/hosts new file mode 100644 index 0000000..6e23e54 --- /dev/null +++ b/Sio2/AP3/Ansible/hosts @@ -0,0 +1,2 @@ +[ap32] +ap32-prod diff --git a/Sio2/AP3/Ansible/sdis29-dump.sql.gz b/Sio2/AP3/Ansible/sdis29-dump.sql.gz new file mode 100644 index 0000000000000000000000000000000000000000..3bb6a8850e66ee9925f6dacc0f138f2b97ade488 GIT binary patch literal 457 zcmV;)0XF_0iwFP!000001D#ZDPlGTJ{_K9m`Dwna+T!MP#$*Up$yghKndp~>IaHDj z3@^r?Z`tM;D`;XoMr=<$1nc;U78@5>1Y1bPlExZvoO^z z3mE#>Dk9w=`3w?}UmC{I-cFJTAIl60$w{kqdbHog1QT$n2SaX~!noHR-SDU*q)QmK zMVWU!9M-wv==ADO28X&6+jA9)wZDmj+qUjmoJor@Y7}NcQR7w_m_DX1bA^J3j0hQzEvb4J6w!=)LoM; z?G@X~jek?Hs{0aI&9_W-J8@O3I+^O_Q)74fq_j>|v3?+$M&+;g%{VkpN)1EpFf@&c z+Pkf`Rl2xpfqXB_;$?e@7a#K=3uX{UpkYlzL_@d_q(6|m*Kd6T