modification de lb-bd
This commit is contained in:
parent
9fd18796a6
commit
9019c0dbe7
68
s-lb-bd.yml
68
s-lb-bd.yml
@ -1,24 +1,50 @@
|
|||||||
---
|
---
|
||||||
- hosts: localhost
|
- hosts: all
|
||||||
connection: local
|
become: true
|
||||||
vars:
|
tasks:
|
||||||
maria_dbhost: "192.168.102.254"
|
|
||||||
maria_dbname: "wordpress"
|
|
||||||
maria_dbuser: "wp"
|
|
||||||
maria_dbpasswd: "wp"
|
|
||||||
|
|
||||||
|
- name: modules python pour
|
||||||
|
apt:
|
||||||
|
name: python3-pymysql
|
||||||
|
state: present
|
||||||
|
|
||||||
roles:
|
- name: install mariadb-server
|
||||||
- base
|
apt:
|
||||||
- goss
|
name: mariadb-server
|
||||||
- post
|
state: present
|
||||||
#- s-lb-bd-ab
|
|
||||||
- mariadb-ab
|
- name: Cree Bd wordpress
|
||||||
# - role: db-user
|
mysql_db:
|
||||||
# cli_ip: "192.168.102.1"
|
db: wordpressdb
|
||||||
# - role: db-user
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
# cli_ip: "192.168.102.2"
|
state: present
|
||||||
# - role: db-user
|
|
||||||
# cli_ip: "192.168.102.3"
|
- name: Ouvre port 3306 mariadb-server
|
||||||
- snmp-agent
|
replace:
|
||||||
# - post
|
path: /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||||
|
regexp: '^bind-address.*'
|
||||||
|
replace: '#bind-adress = 127.0.0.1'
|
||||||
|
backup: yes
|
||||||
|
notify: restart mariadb
|
||||||
|
|
||||||
|
- name: Create MySQL user for wordpress
|
||||||
|
mysql_user:
|
||||||
|
name: wordpressuser
|
||||||
|
password: wordpresspasswd
|
||||||
|
priv: "wordpressdb.*:ALL"
|
||||||
|
host: '%'
|
||||||
|
state: present
|
||||||
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: restart mariadb
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: mariadb
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- base
|
||||||
|
- goss
|
||||||
|
- post
|
||||||
|
- mariadb-ab
|
||||||
|
- snmp-agent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user