mod_ssl and certificates, first try.
This commit is contained in:
parent
1af3349e63
commit
ba3afd0da3
5 changed files with 109 additions and 0 deletions
51
roles/httpd/certificate/tasks/main.yml
Normal file
51
roles/httpd/certificate/tasks/main.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
# Expected vars
|
||||
# - name...
|
||||
# - SSLCertificateChainFile:
|
||||
# - cert:
|
||||
# - key:
|
||||
|
||||
- name: Copy over SSLCertificateChainFile if defined
|
||||
copy: >
|
||||
src={{private}}/httpd/{{SSLCertificateChainFile}}
|
||||
dest=/etc/pki/tls/certs/{{SSLCertificateChainFile}}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
when: SSLCertificateChainFile is defined
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/certificate
|
||||
|
||||
- name: Copy {{name}}.cert
|
||||
copy: >
|
||||
src={{item}}
|
||||
dest=/etc/pki/tls/certs/{{item}}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
with_first_found:
|
||||
- {{private}}/httpd/{{name}}.cert
|
||||
- {{cert}}
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/certificate
|
||||
|
||||
- name: Copy {{name}}.key
|
||||
copy: >
|
||||
src={{item}}
|
||||
dest=/etc/pki/tls/private/{{item}}
|
||||
owner=root
|
||||
group=root
|
||||
mode=0600
|
||||
with_first_found:
|
||||
- {{private}}/httpd/{{name}}.key
|
||||
- {{key}}
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/certificate
|
1
roles/httpd/mod_ssl/files/ssl.conf
Normal file
1
roles/httpd/mod_ssl/files/ssl.conf
Normal file
|
@ -0,0 +1 @@
|
|||
LoadModule ssl_module modules/mod_ssl.so
|
20
roles/httpd/mod_ssl/tasks/main.yml
Normal file
20
roles/httpd/mod_ssl/tasks/main.yml
Normal file
|
@ -0,0 +1,20 @@
|
|||
- name: Install mod_ssl
|
||||
yum: name=mod_ssl state=installed
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/mod_ssl
|
||||
|
||||
- name: Copy over SSLCertificateChainFile if defined
|
||||
copy: >
|
||||
src=ssl.conf
|
||||
dest=/etc/httpd/ssl.conf
|
||||
owner=root
|
||||
group=root
|
||||
mode=0644
|
||||
notify:
|
||||
- restart httpd
|
||||
tags:
|
||||
- httpd
|
||||
- httpd/certificate
|
Loading…
Add table
Add a link
Reference in a new issue