Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a91cd7b745 | ||
|
5c79f1005a | ||
|
12f480ca36 | ||
|
8987ade7f6 | ||
|
08944e6df9 |
29
Sio2/AP3/Ansible/apbase.yml
Normal file
29
Sio2/AP3/Ansible/apbase.yml
Normal file
@ -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
|
23
Sio2/AP3/Ansible/apdb.yml
Normal file
23
Sio2/AP3/Ansible/apdb.yml
Normal file
@ -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
|
19
Sio2/AP3/Ansible/apdbdump.yml
Normal file
19
Sio2/AP3/Ansible/apdbdump.yml
Normal file
@ -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
|
2
Sio2/AP3/Ansible/apt.conf
Normal file
2
Sio2/AP3/Ansible/apt.conf
Normal file
@ -0,0 +1,2 @@
|
||||
Acquire::http::Proxy "http://10.121.38.1:8080";
|
||||
Acquire::https::Proxy "http://10.121.38.1:8080";
|
2
Sio2/AP3/Ansible/hosts
Normal file
2
Sio2/AP3/Ansible/hosts
Normal file
@ -0,0 +1,2 @@
|
||||
[ap32]
|
||||
ap32-prod
|
BIN
Sio2/AP3/Ansible/sdis29-dump.sql.gz
Normal file
BIN
Sio2/AP3/Ansible/sdis29-dump.sql.gz
Normal file
Binary file not shown.
49
Sio2/SISR/40-ansible/stlab.yml
Normal file
49
Sio2/SISR/40-ansible/stlab.yml
Normal file
@ -0,0 +1,49 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
# become: true
|
||||
vars_prompt:
|
||||
- name: username
|
||||
prompt: Votre nom?
|
||||
private: false
|
||||
|
||||
tasks:
|
||||
- name: cree utilisateurs
|
||||
shell: "curl depl.sio.lan/usr/mkusrlin-2024.sh|bash"
|
||||
|
||||
- name: mdp root verrouillage
|
||||
# avec mkpasswd -m SHA-512
|
||||
ansible.builtin.user:
|
||||
name: root
|
||||
password: '$6$Ga8KbEYAgCZYGeDB$7zlfBy1j4koFv.NYQEeZa/k7pwjNTEI7hrWUlrHWTwd1YsEqm.Sy2DZ1GAFYe2qe4ZccMQJAt7QxILY1sd9AV0'
|
||||
- name: enleve sio de sudo
|
||||
ansible.builtin.user:
|
||||
name: sio
|
||||
groups: ''
|
||||
|
||||
- name: met le user "{{ username }}" dans le groupe sudo
|
||||
ansible.builtin.user:
|
||||
name: "{{ username }}"
|
||||
groups: sudo
|
||||
append: yes
|
||||
when: username != ""
|
||||
|
||||
- name: installer systemd-journal-remote
|
||||
apt:
|
||||
name:
|
||||
- systemd-journal-remote
|
||||
|
||||
- name: chnager adresse envoie log
|
||||
replace:
|
||||
path: /etc/systemd/journal-upload.conf
|
||||
regexp: '^# URL='
|
||||
replace: 'URL=http://192.168.0.1:19532'
|
||||
|
||||
- name: Enable systemd-journal-upload.service
|
||||
ansible.builtin.service:
|
||||
name: systemd-journal-upload.service
|
||||
enabled: yes
|
||||
|
||||
- name: Restart systemd-journal-upload.service
|
||||
ansible.builtin.service:
|
||||
name: systemd-journal-upload.service
|
||||
state: restarted
|
Loading…
x
Reference in New Issue
Block a user