2022-11-18 07:51:49 +00:00
|
|
|
- name: Install MariaDB Server
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: mariadb-server
|
2020-01-17 05:46:06 +00:00
|
|
|
state: present
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-19 08:01:45 +00:00
|
|
|
- name: Install MySQL Support for Python 3
|
|
|
|
ansible.builtin.apt:
|
|
|
|
name: python3-pymysql
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Create MariaDB databases
|
|
|
|
community.mysql.mysql_db:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
state: present
|
|
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
loop: "{{ databases }}"
|
|
|
|
no_log: "{{ item.pass is defined }}"
|
|
|
|
|
|
|
|
- name: Create MariaDB users
|
|
|
|
community.mysql.mysql_user:
|
|
|
|
name: "{{ item.name }}"
|
|
|
|
password: "{{ item.pass }}"
|
|
|
|
priv: "{{ item.name }}.*:ALL,GRANT"
|
|
|
|
state: present
|
|
|
|
login_unix_socket: /var/run/mysqld/mysqld.sock
|
|
|
|
loop: "{{ databases }}"
|
|
|
|
no_log: "{{ item.pass is defined }}"
|
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
- name: Create webserver docker-compose directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ webserver_root }}"
|
|
|
|
state: directory
|
|
|
|
mode: 0600
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
- name: Install webserver docker-compose.yml
|
|
|
|
ansible.builtin.copy:
|
|
|
|
src: docker-compose.yml
|
|
|
|
dest: "{{ webserver_root }}/docker-compose.yml"
|
|
|
|
mode: 0600
|
|
|
|
notify: composeup_webserver
|
2019-01-02 05:04:01 +00:00
|
|
|
|
2022-11-18 07:51:49 +00:00
|
|
|
- name: Install docker-compose .env
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: compose-env.j2
|
|
|
|
dest: "{{ webserver_root }}/.env"
|
|
|
|
mode: 0600
|
|
|
|
notify: composeup_webserver
|