mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-08 10:26:35 +00:00
Upercased MariaDB variables
This commit is contained in:
@@ -1,27 +1,27 @@
|
||||
- name: "Setup docker network for {{ application_id }}"
|
||||
include_tasks: "{{ [playbook_dir, 'roles/docker-compose/tasks/utils/network.yml' ] | path_join }}"
|
||||
vars:
|
||||
docker_network_name: "{{ mariadb_network }}"
|
||||
docker_network_subnet: "{{ mariadb_subnet }}"
|
||||
docker_network_name: "{{ MARIADB_NETWORK }}"
|
||||
docker_network_subnet: "{{ MARIADB_SUBNET }}"
|
||||
|
||||
- name: install MariaDB
|
||||
community.docker.docker_container:
|
||||
name: "{{ mariadb_name }}"
|
||||
image: "{{ mariadb_image }}:{{ mariadb_version}}"
|
||||
name: "{{ MARIADB_NAME }}"
|
||||
image: "{{ MARIADB_IMAGE }}:{{ MARIADB_VERSION}}"
|
||||
detach: yes
|
||||
env:
|
||||
MARIADB_ROOT_PASSWORD: "{{ mariadb_root_pwd }}"
|
||||
MARIADB_ROOT_PASSWORD: "{{ MARIADB_ROOT_PWD }}"
|
||||
MARIADB_AUTO_UPGRADE: "1"
|
||||
networks:
|
||||
- name: "{{ mariadb_network }}"
|
||||
- name: "{{ MARIADB_NETWORK }}"
|
||||
volumes:
|
||||
- "{{ mariadb_volume }}:/var/lib/mysql"
|
||||
- "{{ MARIADB_VOLUME }}:/var/lib/mysql"
|
||||
published_ports:
|
||||
- "127.0.0.1:{{ mariadb_port }}:3306" # can be that this will be removed if all applications use sockets
|
||||
- "127.0.0.1:{{ MARIADB_PORT }}:3306" # can be that this will be removed if all applications use sockets
|
||||
command: "--transaction-isolation=READ-COMMITTED --binlog-format=ROW" #for nextcloud
|
||||
restart_policy: "{{ DOCKER_RESTART_POLICY }}"
|
||||
healthcheck:
|
||||
test: "/usr/bin/mariadb --user=root --password={{ mariadb_root_pwd }} --execute \"SHOW DATABASES;\""
|
||||
test: "/usr/bin/mariadb --user=root --password={{ MARIADB_ROOT_PWD }} --execute \"SHOW DATABASES;\""
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 18
|
||||
@@ -32,9 +32,9 @@
|
||||
name: python-mysqlclient
|
||||
state: present
|
||||
|
||||
- name: "Wait until the MariaDB container with hostname '{{ mariadb_name }}' is healthy"
|
||||
- name: "Wait until the MariaDB container with hostname '{{ MARIADB_NAME }}' is healthy"
|
||||
community.docker.docker_container_info:
|
||||
name: "{{ mariadb_name }}"
|
||||
name: "{{ MARIADB_NAME }}"
|
||||
register: db_info
|
||||
until:
|
||||
- db_info.container is defined
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
name: "{{ database_name }}"
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{ mariadb_root_pwd }}"
|
||||
login_password: "{{ MARIADB_ROOT_PWD }}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{ database_port }}"
|
||||
encoding: "{{ database_encoding }}"
|
||||
@@ -17,7 +17,7 @@
|
||||
priv: '{{ database_name }}.*:ALL'
|
||||
state: present
|
||||
login_user: root
|
||||
login_password: "{{mariadb_root_pwd}}"
|
||||
login_password: "{{MARIADB_ROOT_PWD}}"
|
||||
login_host: 127.0.0.1
|
||||
login_port: "{{ database_port }}"
|
||||
|
||||
@@ -25,6 +25,6 @@
|
||||
# @todo Remove if this works fine in the future.
|
||||
#- name: Grant database privileges
|
||||
# ansible.builtin.shell:
|
||||
# cmd: "docker exec {{mariadb_name }} mariadb -u root -p{{ mariadb_root_pwd }} -e \"GRANT ALL PRIVILEGES ON `{{ database_name }}`.* TO '{{ database_username }}'@'%';\""
|
||||
# cmd: "docker exec {{MARIADB_NAME }} mariadb -u root -p{{ MARIADB_ROOT_PWD }} -e \"GRANT ALL PRIVILEGES ON `{{ database_name }}`.* TO '{{ database_username }}'@'%';\""
|
||||
# args:
|
||||
# executable: /bin/bash
|
||||
@@ -1,9 +1,9 @@
|
||||
application_id: svc-db-mariadb
|
||||
mariadb_root_pwd: "{{ applications | get_app_conf(application_id,'credentials.root_password') }}"
|
||||
mariadb_subnet: "{{ networks.local['svc-db-mariadb'].subnet }}"
|
||||
mariadb_network: "{{ applications | get_app_conf(application_id,'docker.network') }}"
|
||||
mariadb_volume: "{{ applications | get_app_conf(application_id,'docker.volumes.data') }}"
|
||||
mariadb_image: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.image','mariadb') }}"
|
||||
mariadb_version: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.version') }}"
|
||||
mariadb_name: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.name') }}"
|
||||
mariadb_port: "{{ database_port | default(ports.localhost.database[ application_id ]) }}"
|
||||
MARIADB_ROOT_PWD: "{{ applications | get_app_conf(application_id,'credentials.root_password') }}"
|
||||
MARIADB_SUBNET: "{{ networks.local['svc-db-mariadb'].subnet }}"
|
||||
MARIADB_NETWORK: "{{ applications | get_app_conf(application_id,'docker.network') }}"
|
||||
MARIADB_VOLUME: "{{ applications | get_app_conf(application_id,'docker.volumes.data') }}"
|
||||
MARIADB_IMAGE: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.image','mariadb') }}"
|
||||
MARIADB_VERSION: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.version') }}"
|
||||
MARIADB_NAME: "{{ applications | get_app_conf(application_id,'docker.services.mariadb.name') }}"
|
||||
MARIADB_PORT: "{{ database_port | default(ports.localhost.database[ application_id ]) }}"
|
||||
|
||||
Reference in New Issue
Block a user