refs #8414 - Refactor extract playbook variables and secrets everywhere in TV Screen

This commit is contained in:
Xavi Lleó 2025-01-24 14:49:49 +01:00
parent 89c18a0e6d
commit 4d70766a41
4 changed files with 17 additions and 57 deletions

View File

@ -62,13 +62,13 @@
command: mount -a
when: fstab.changed
- name: Set MariaDB Cron to /etc/cron.d
template:
src: templates/cron_mariadb
dest: /etc/cron.d/vn
owner: root
group: root
mode: u=rw,g=r,o=r
# - name: Set MariaDB Cron to /etc/cron.d
# template:
# src: templates/cron_mariadb
# dest: /etc/cron.d/vn
# owner: root
# group: root
# mode: u=rw,g=r,o=r
- name: Insert MySQL certificates
copy:
@ -80,14 +80,6 @@
loop: "{{ certificates }}"
notify: restart-mariadb
- name: Configure MySQL master cert
copy:
content: "{{ lookup(passbolt, 'private_mysql', folder_parent_id=passbolt_folder).description }}"
dest: /etc/mysql/key.pem
owner: mysql
group: mysql
mode: u=rw,g=,o=
- when: production is true
block:
- name: Set MariaDB custom configuration Production
@ -125,41 +117,14 @@
- "files/mariaconfigfiles/z92-testing.cnf"
notify: restart-mariadb
# - name: Extracting passwords
# no_log: true
# set_fact:
# jenkins_token: "{{ lookup(passbolt, jenkins_user_name, folder_parent_id=passbolt_folder).password }}"
# - name: Debug variable
# debug:
# msg: "{{ jenkins_token }}"
- name: Set MariaBackup custom configuration Test
template:
src: "apply.config-test.sh"
dest: /root/mariabackup/apply.config.sh
owner: root
group: root
mode: u=rw,g=r,o=r
# - name: Set MariaBackup custom configuration Test
# template:
# src: "apply.config-test.sh"
# dest: /root/mariabackup/apply.config.sh
# owner: root
# group: root
# mode: u=rw,g=r,o=r
- name: Extracting dbusername
set_fact:
dbusername: "{{ lookup(passbolt, dbuser, folder_parent_id=passbolt_folder).username }}"
- name: Extracting dbpassword
no_log: true
set_fact:
dbpass: "{{ lookup(passbolt, dbuser, folder_parent_id=passbolt_folder).password }}"
- name: Extracting MariaBackup UserName
set_fact:
mariabackupusernametpl: "{{ lookup(passbolt, mariabackupusername, folder_parent_id=passbolt_folder).username }}"
- name: Extracting MariaBackup Password
no_log: true
set_fact:
mariabackuppasstpl: "{{ lookup(passbolt, mariabackupusername, folder_parent_id=passbolt_folder).password }}"
- name: Set MariaBackup custom template configuration Test
template:
src: "{{ item }}"
@ -168,7 +133,7 @@
group: root
mode: u=rw,g=,o=
with_items:
- "apply.cnf"
- "test-db/apply.config.sh"
- "my.cnf"
- name: Set MariaDB local configuration file

View File

@ -1,5 +0,0 @@
[client]
host = localhost
user = {{ dbusername }}
password = {{ dbpass }}
socket = /var/run/mysqld/mysqld.sock

View File

@ -1,7 +1,7 @@
[mariabackup]
host = localhost
user = {{ mariabackupusernametpl }}
password = {{ mariabackuppasstpl }}
user = mariabackup
password = {{ lookup(passbolt, 'mariabackup', folder_parent_id=passbolt_folder).password }}
use-memory = 1G
parallel = 2
stream = mbstream