nouveau fichier : ap32-prod/ansible/apbase.yml

nouveau fichier : ap32-prod/ansible/apdb.yml
This commit is contained in:
Nathan Genret 2024-11-15 08:41:32 +01:00
parent 5b1915c9fa
commit f04324f5f6
2 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,31 @@
---
- hosts: all
become: true
tasks:
- name: Parametrage Timezone Europe/Paris
community.general.timezone:
name: Europe/Paris
- name: Copie apt.conf
copy:
content: |
Acquire::http::Proxy "http://10.121.38.1:8080";
Acquire::https::Proxy "http://10.121.38.1:8080";
dest: /etc/apt/apt.conf
- name: Update and upgrade apt packages
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day
- name: Installation paquets
apt:
name: "{{ item }}"
with_items:
- tomcat10
- mariadb-server
- ant
- qemu-guest-agent

View File

@ -0,0 +1,38 @@
---
- hosts: all
become: true
tasks:
- name: installation extensions python
apt:
name: python3-pymysql
state: present
- name: Create a new database
community.mysql.mysql_db:
name: sdis29
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name: Create a new user
community.mysql.mysql_user:
name: admin
password: Azerty1+
priv: 'sdis29.*:ALL'
state: present
login_unix_socket: /run/mysqld/mysqld.sock
- name:
copy:
src: sdis29.sql
dest: /tmp/
- name: Import database
community.mysql.mysql_db:
name: sdis29
state: import
target: /tmp/sdis29.sql
login_unix_socket: /run/mysqld/mysqld.sock