chore!: separated galaxy deps and own collections; modified ansible script generation to use two paths for collections
REQUIRES REGENERATING ansible.cfg!
This commit is contained in:
parent
4af69c31ce
commit
888590ed9f
188 changed files with 30 additions and 30 deletions
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
- name: install client packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
force_apt_get: true
|
||||
pkg:
|
||||
- mariadb-client
|
||||
- mariadb-client-core
|
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
- name: setup server
|
||||
include_tasks: server.yml
|
||||
when: mariadb_install_server is truthy
|
||||
|
||||
- name: setup client
|
||||
include_tasks: client.yml
|
||||
when: mariadb_install_client is truthy
|
||||
|
||||
- name: install firewall rules
|
||||
become: true
|
||||
template:
|
||||
src: ../templates/nftables.d/mariadb.nft.j2
|
||||
dest: /etc/nftables.d/mariadb.nft
|
||||
mode: '0600'
|
||||
register: nft_rule
|
||||
|
||||
- name: load firewall rules
|
||||
become: true
|
||||
ansible.builtin.command: /usr/sbin/nft -f /etc/nftables.d/mariadb.nft
|
||||
when: nft_rule.changed
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
- name: install server packages
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
cache_valid_time: 3600
|
||||
force_apt_get: true
|
||||
pkg:
|
||||
- mariadb-common
|
||||
- mariadb-server
|
||||
- mariadb-server-core
|
||||
|
||||
- name: initialize database
|
||||
become: true
|
||||
block:
|
||||
- name: export initialization SQL file
|
||||
ansible.builtin.template:
|
||||
src: ../templates/mariadb_init.sql.j2
|
||||
dest: /tmp/mariadb_init.sql
|
||||
mode: '0600'
|
||||
register: sql_init
|
||||
- name: run initialization file
|
||||
ansible.builtin.shell: mysql < /tmp/mariadb_init.sql
|
||||
when: sql_init.changed
|
||||
when: mariadb_server_run_init_sql is truthy or mariadb_server_run_custom_sql is truthy
|
||||
|
||||
- name: update bind addresses to allow external connections
|
||||
become: true
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/mysql/mariadb.conf.d/50-server.cnf
|
||||
regexp: '^bind-address\b.+'
|
||||
line: "bind-address = {{ mariadb_server_bind_addresses|join(',') }}"
|
||||
state: present
|
||||
when: mariadb_server_bind_addresses is truthy
|
||||
notify:
|
||||
- 'mariadb : restart mariadb service'
|
Loading…
Add table
Add a link
Reference in a new issue