mise au point
rajout tache creation bdd
This commit is contained in:
@@ -33,6 +33,12 @@ apache_user: {{ apache_server_name | regex_search( '([^.]+)' ) }} }}
|
||||
apache_allowoverride: all
|
||||
apache_update_conf: true - wether we override existing config file
|
||||
apache_ssl_root_email: email used for letsencrypt certificate
|
||||
apache_use_database: false
|
||||
apache_db_name: no default
|
||||
apache_db_user: no default
|
||||
apache_db_password: no default
|
||||
apache_db_login_user: from root/.my.cnf
|
||||
apache_db_login_password: from my.cnf
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
@@ -17,3 +17,4 @@ apache_use_stats: true
|
||||
apache_use_zabbix: true
|
||||
apache_user: "{{ apache_server_name | regex_search( '([^.]+)' ) }}"
|
||||
apache_update_conf: true
|
||||
apache_use_database: false
|
||||
|
||||
15
tasks/db.yml
Normal file
15
tasks/db.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- name: create database
|
||||
community.mysql.mysql_db:
|
||||
login_user: root
|
||||
name: "{{ apache_db_name }}"
|
||||
state: present
|
||||
|
||||
- name: create db user
|
||||
community.mysql.mysql_user:
|
||||
name: "{{ apache_db_user }}"
|
||||
password: "{{ apache_db_password }}"
|
||||
update_password: on_create
|
||||
priv: "{{ apache_db_name }}.*:ALL"
|
||||
state: present
|
||||
@@ -75,4 +75,9 @@
|
||||
- name: zabbix setup
|
||||
import_tasks: zabbix.yml
|
||||
when: apache_use_zabbix|bool
|
||||
tags: zabbix, ssl
|
||||
tags: zabbix, ssl
|
||||
|
||||
- name: db setup
|
||||
import_tasks: db.yml
|
||||
when: apache_use_database
|
||||
tags: db
|
||||
Reference in New Issue
Block a user