forked from openstack/kolla-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matus Jenca <[email protected]>
- Loading branch information
1 parent
e50c99d
commit c2a3461
Showing
119 changed files
with
465 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
- name: Ensuring private MariaDB directory exist | ||
file: | ||
path: "{{ mariadb_dir }}" | ||
state: "directory" | ||
mode: "0770" | ||
|
||
- name: Creating MariaDB SSL configuration file | ||
template: | ||
src: "{{ item }}.j2" | ||
dest: "{{ kolla_certificates_dir }}/{{ item }}" | ||
mode: "0660" | ||
with_items: | ||
- "openssl-kolla-mariadb.cnf" | ||
|
||
- name: Creating MariaDB Server Certificate key | ||
command: > | ||
openssl genrsa | ||
-out "{{ mariadb_dir }}/mariadb.key" 2048 | ||
args: | ||
creates: "{{ kolla_tls_mariadb_key }}" | ||
|
||
- name: Creating MariaDB Server Certificate signing request | ||
command: > | ||
openssl req | ||
-new | ||
-key "{{ mariadb_dir }}/mariadb.key" | ||
-out "{{ mariadb_dir }}/mariadb.csr" | ||
-config "{{ kolla_certificates_dir }}/openssl-kolla-mariadb.cnf" | ||
-sha256 | ||
args: | ||
creates: "{{ mariadb_dir }}/mariadb.csr" | ||
|
||
- name: Creating MariaDB Server Certificate | ||
command: > | ||
openssl x509 | ||
-req | ||
-in "{{ mariadb_dir }}/mariadb.csr" | ||
-CA "{{ root_dir }}/root.crt" | ||
-CAkey "{{ root_dir }}/root.key" | ||
-CAcreateserial | ||
-extensions v3_req | ||
-extfile "{{ kolla_certificates_dir }}/openssl-kolla-mariadb.cnf" | ||
-out "{{ mariadb_dir }}/mariadb.crt" | ||
-days 500 | ||
-sha256 | ||
args: | ||
creates: "{{ mariadb_dir }}/mariadb.crt" | ||
|
||
- name: Setting permissions on MariaDB key | ||
file: | ||
path: "{{ mariadb_dir }}/mariadb.key" | ||
mode: "0660" | ||
state: file | ||
|
||
- name: Copy MariaDB cert to default configuration location | ||
copy: | ||
src: "{{ mariadb_dir }}/mariadb.crt" | ||
dest: "{{ kolla_certificates_dir }}/mariadb-cert.pem" | ||
mode: "0660" | ||
|
||
- name: Copy MariaDB key to default configuration location | ||
copy: | ||
src: "{{ mariadb_dir }}/mariadb.key" | ||
dest: "{{ kolla_certificates_dir }}/mariadb-key.pem" | ||
mode: "0660" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
ansible/roles/certificates/templates/openssl-kolla-mariadb.cnf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[req] | ||
prompt = no | ||
distinguished_name = req_distinguished_name | ||
req_extensions = v3_req | ||
|
||
[req_distinguished_name] | ||
countryName = US | ||
stateOrProvinceName = NC | ||
localityName = RTP | ||
organizationalUnitName = kolla | ||
|
||
[v3_req] | ||
subjectAltName = @alt_names | ||
|
||
[alt_names] | ||
{% if kolla_external_fqdn != kolla_external_vip_address %} | ||
DNS.1 = {{ kolla_external_fqdn }} | ||
{% endif %} | ||
IP.1 = {{ kolla_external_vip_address }} | ||
{% for host in groups['tls-backend']%} | ||
IP.{{ loop.index + 1 }} = {{ 'api' | kolla_address(host) }} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.