23 lines
659 B
Plaintext
23 lines
659 B
Plaintext
{% for vhost, config in pillar["vhosts"].items() %}
|
|
Prepare mariadb volume for {{ vhost }}:
|
|
docker_volume.present:
|
|
- name: mysql-{{ vhost }}
|
|
- driver: local
|
|
|
|
Run MariaDB container for {{ vhost }}:
|
|
docker_container.running:
|
|
- name: mysql-{{ vhost }}
|
|
- image: mariadb:10.4
|
|
- start: True
|
|
- restart: always
|
|
|
|
- networks:
|
|
- network-{{ vhost }}
|
|
- environment:
|
|
- MARIADB_RANDOM_ROOT_PASSWORD=yes
|
|
- MARIADB_DATABASE={{ config.mysql_database }}
|
|
- MARIADB_USER={{ config.mysql_user }}
|
|
- MARIADB_PASSWORD={{ config.mysql_password }}
|
|
- binds:
|
|
- mysql-{{ vhost }}:/var/lib/mysql
|
|
{% endfor %} |