Allow choice in TLS Certificate from mod_md

This commit is contained in:
Jason Rothstein 2022-01-23 17:07:18 -06:00
parent f2a99b77e4
commit d2fa1b290a
4 changed files with 7 additions and 4 deletions

View File

@ -11,7 +11,9 @@ Any pre-requisites that may not be covered by Ansible itself or the role should
Role Variables
--------------
A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well.
| variable | default | description |
|-|-|-|
| mariadb_vhost | inventory_hostname | What mod_md certificate should be used for MariaDB |
Dependencies
------------

View File

@ -1,2 +1,3 @@
---
# defaults file for ensure_mariadb
mariadb_vhost: '{{ inventory_hostname }}'

View File

@ -4,7 +4,7 @@ Description=Copy TLS Certificates for Mariadb
[Service]
Type=oneshot
ExecStartPre=mkdir -p /etc/my.cnf.d/certificates
ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/*/*.pem /etc/my.cnf.d/certificates/'
ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/{{ mariadb_vhost }}/*.pem /etc/my.cnf.d/certificates/'
ExecStartPost=chown -R mysql:mysql /etc/my.cnf.d/certificates
[Install]

View File

@ -4,7 +4,7 @@ Description=Copy TLS Certificates for Mariadb
[Service]
Type=oneshot
ExecStartPre=mkdir -p /etc/my.cnf.d/certificates
ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/*/*.pem /etc/my.cnf.d/certificates/'
ExecStart=/bin/bash -lc 'cp /etc/httpd/md/domains/{{ mariadb_vhost }}/*.pem /etc/my.cnf.d/certificates/'
ExecStartPost=chown -R mysql:mysql /etc/my.cnf.d/certificates
[Install]