-
-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
40 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
--- | ||
- name: Generate private TLS key for {{ tls_title }} | ||
community.crypto.openssl_privatekey: | ||
path: "{{ tls_privatekey_path }}" | ||
size: "4096" | ||
|
||
- name: Set the owner of the private TLS key {{ tls_privatekey_path }} to {{ tls_owner }} | ||
- name: "Ensure TLS directories exist" | ||
ansible.builtin.file: | ||
path: "{{ tls_privatekey_path }}" | ||
owner: "{{ tls_owner }}" | ||
group: "{{ tls_owner }}" | ||
mode: "0400" | ||
path: "{{ item }}" | ||
state: directory | ||
owner: "{{ tls_owner | default('postgres') }}" | ||
group: "{{ tls_owner | default('postgres') }}" | ||
mode: "0750" | ||
loop: | ||
- "{{ tls_privatekey_path | default('/etc/tls/server.key') | dirname }}" | ||
- "{{ tls_cert_path | default('/etc/tls/server.crt') | dirname }}" | ||
|
||
- name: "Generate private TLS key {{ tls_privatekey_path | default('/etc/tls/server.key') }}" | ||
community.crypto.openssl_privatekey: | ||
path: "{{ tls_privatekey_path | default('/etc/tls/server.key') }}" | ||
owner: "{{ tls_owner | default('postgres') }}" | ||
group: "{{ tls_owner | default('postgres') }}" | ||
mode: "{{ tls_privatekey_mode | default('0400') }}" | ||
size: "{{ tls_privatekey_size | default(4096) }}" | ||
type: "{{ tls_privatekey_type | default('RSA') }}" | ||
|
||
- name: Generate self-signed TLS certificate for {{ tls_title }} | ||
- name: "Generate self-signed TLS certificate {{ tls_cert_path | default('/etc/tls/server.crt') }}" | ||
community.crypto.x509_certificate: | ||
path: "{{ tls_cert_path }}" | ||
privatekey_path: "{{ tls_privatekey_path }}" | ||
owner: "{{ tls_owner }}" | ||
group: "{{ tls_owner }}" | ||
mode: "0644" | ||
provider: selfsigned | ||
entrust_not_after: "+1000d" | ||
path: "{{ tls_cert_path | default('/etc/tls/server.crt') }}" | ||
privatekey_path: "{{ tls_privatekey_path | default('/etc/tls/server.key') }}" | ||
owner: "{{ tls_owner | default('postgres') }}" | ||
group: "{{ tls_owner | default('postgres') }}" | ||
mode: "{{ tls_cert_mode | default('0644') }}" | ||
provider: "{{ tls_cert_provider | default('selfsigned') }}" | ||
entrust_not_after: "{{ tls_cert_entrust_not_after | default('+3650d') }}" |
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