Add mariadb install to hedwig.
This commit is contained in:
parent
53c53b17e7
commit
2e40466040
|
@ -0,0 +1,2 @@
|
|||
mariadb:
|
||||
root_pw: 'password'
|
|
@ -1,6 +1,7 @@
|
|||
base:
|
||||
'hedwig.lunch.org.uk':
|
||||
- secrets/certificates
|
||||
- secrets/mariadb
|
||||
'scabbers.lunch.org.uk':
|
||||
- secrets/dnsapi
|
||||
- secrets/gitea
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
debconf-utils:
|
||||
pkg.installed
|
||||
|
||||
mariadb_setup:
|
||||
debconf.set:
|
||||
- name: mysql-server
|
||||
- data:
|
||||
'mysql-server/root_password': {'type': 'password', 'value': '{{ salt['pillar.get']('mariadb:root_pw', '') }}' }
|
||||
'mysql-server/root_password_again': {'type': 'password', 'value': '{{ salt['pillar.get']('mariadb:root_pw', '') }}' }
|
||||
- require:
|
||||
- pkg: debconf-utils
|
||||
|
||||
python3-mysqldb:
|
||||
pkg.installed
|
||||
|
||||
mariadb-server:
|
||||
pkg.installed:
|
||||
- require:
|
||||
- debconf: mysql-server
|
||||
- pkg: python3-mysqldb
|
||||
|
||||
mariadb:
|
||||
service.running:
|
||||
- watch:
|
||||
- pkg: mariadb-server
|
||||
|
||||
/etc/salt/minion.d/mariadb.conf:
|
||||
file.managed:
|
||||
- source: salt://mariadb/minion_mariadb.conf
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 600
|
||||
- require:
|
||||
- service: mariadb
|
||||
|
||||
restart_minion_for_mariadb:
|
||||
service.running:
|
||||
- name: salt-minion
|
||||
- watch:
|
||||
- file: /etc/salt/minion.d/mariadb.conf
|
|
@ -0,0 +1,6 @@
|
|||
mysql.host: 'localhost'
|
||||
mysql.user: 'root'
|
||||
mysql.pass: '{{ pillar['mariadb']['root_pw'] }}'
|
||||
mysql.db: 'mysql'
|
||||
mysql.unix_socket: '/run/mysqld/mysqld.sock'
|
||||
mysql.charset: 'utf8'
|
|
@ -5,6 +5,7 @@ base:
|
|||
'hedwig.lunch.org.uk':
|
||||
- debian
|
||||
- apache
|
||||
- mariadb
|
||||
- backup
|
||||
- backup/hedwig
|
||||
- certificates/client
|
||||
|
|
Loading…
Reference in New Issue