automation/deployer/roles/build/tasks/postgres.yml
2020-06-01 08:21:27 +02:00

31 lines
1 KiB
YAML

---
# Needs variables:
# - site: dict describing the site install (cf group_vars/all/vars.yml)
- name: "Create database {{ site.mysql_database }} if inexistent"
# mysql_db:
# name: "{{ site.mysql_database }}"
# state: present
# # Credentials to log in MySQL
# login_host: localhost
# login_user: root
# login_password: "{{ mysql_root_password }}"
# MySQL equivalent:
# TODO: PostgreSQL?
# create user <user>@<ip> identified by <pass>;
# grant all on <db>.* to <user>@<ip>;
- name: "Add database user {{ site.mysql_username }}@{{ site.subnet_site_ip }} and grant all privileges on {{ site.mysql_database }}"
# mysql_user:
# # Credentials to log in MySQL
# login_host: localhost
# login_user: root
# login_password: "{{ mysql_root_password }}"
# # Credentials of the new db user
# host: "{{ site.subnet_site_ip }}"
# name: "{{ site.mysql_username }}"
# password: "{{ site.mysql_password }}"
# # Grants
# priv: "{{ site.mysql_database }}.*:all"
# state: present