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
|
||||
connection: local
|
||||
vars:
|
||||
maria_dbhost: "192.168.102.254"
|
||||
maria_dbname: "wordpress"
|
||||
maria_dbuser: "wp"
|
||||
maria_dbpasswd: "wp"
|
||||
- hosts: all
|
||||
become: true
|
||||
tasks:
|
||||
|
||||
- name: modules python pour
|
||||
apt:
|
||||
name: python3-pymysql
|
||||
state: present
|
||||
|
||||
roles:
|
||||
- base
|
||||
- goss
|
||||
- post
|
||||
#- s-lb-bd-ab
|
||||
- mariadb-ab
|
||||
# - role: db-user
|
||||
# cli_ip: "192.168.102.1"
|
||||
# - role: db-user
|
||||
# cli_ip: "192.168.102.2"
|
||||
# - role: db-user
|
||||
# cli_ip: "192.168.102.3"
|
||||
- snmp-agent
|
||||
# - post
|
||||
- name: install mariadb-server
|
||||
apt:
|
||||
name: mariadb-server
|
||||
state: present
|
||||
|
||||
- name: Cree Bd wordpress
|
||||
mysql_db:
|
||||
db: wordpressdb
|
||||
login_unix_socket: /var/run/mysqld/mysqld.sock
|
||||
state: present
|
||||
|
||||
- name: Ouvre port 3306 mariadb-server
|
||||
replace:
|
||||
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