|
@ -3,23 +3,24 @@ |
|
|
path: "{{ item.server.ssl_certificate_key }}" |
|
|
path: "{{ item.server.ssl_certificate_key }}" |
|
|
|
|
|
|
|
|
- name: generate certificate signing request |
|
|
- name: generate certificate signing request |
|
|
command: > |
|
|
|
|
|
|
|
|
command: > |
|
|
openssl req |
|
|
openssl req |
|
|
-new |
|
|
-new |
|
|
-sha256 |
|
|
-sha256 |
|
|
-nodes |
|
|
-nodes |
|
|
-key {{ item.server.ssl_certificate_key }} |
|
|
-key {{ item.server.ssl_certificate_key }} |
|
|
-out {{ item.letsencrypt.ssl_csr }} |
|
|
|
|
|
-subj "/C={{ item.letsencrypt.ssl_country }} |
|
|
|
|
|
/ST={{ item.letsencrypt.ssl_state }} |
|
|
|
|
|
/L{{ item.letsencrypt.ssl_loc }} |
|
|
|
|
|
/O={{ item.letsencrypt.ssl_org }} |
|
|
|
|
|
/emailAddress={{ item.letsencrypt.ssl_email }}" |
|
|
|
|
|
|
|
|
-out {{ item.letsencrypt.ssl_csr | default(item.server.ssl_certificate~".csr") }} |
|
|
|
|
|
-subj "/C={{ item.letsencrypt.ssl_country | default(letsencrypt_ssl_country) |
|
|
|
|
|
}}/ST={{ item.letsencrypt.ssl_state | default(letsencrypt_ssl_state) |
|
|
|
|
|
}}/L{{ item.letsencrypt.ssl_loc | default(letsencrypt_ssl_loc) |
|
|
|
|
|
}}/O={{ item.letsencrypt.ssl_org | default(letsencrypt_ssl_org) |
|
|
|
|
|
}}/CN={{ item.letsencrypt.ssl_cn | default(item.server.server_name) |
|
|
|
|
|
}}/emailAddress={{ item.letsencrypt.ssl_email | default(letsencrypt_ssl_email) }}" |
|
|
|
|
|
|
|
|
- name: get challenge(s) from letsencrypt server |
|
|
- name: get challenge(s) from letsencrypt server |
|
|
letsencrypt: |
|
|
letsencrypt: |
|
|
account_key: "{{ letsencrypt_account_key }}" |
|
|
account_key: "{{ letsencrypt_account_key }}" |
|
|
csr: "{{ item.letsencrypt.ssl_csr }}" |
|
|
|
|
|
|
|
|
csr: "{{ item.letsencrypt.ssl_csr | default(item.server.ssl_certificate~'.csr') }}" |
|
|
dest: "{{ item.server.ssl_certificate }}" |
|
|
dest: "{{ item.server.ssl_certificate }}" |
|
|
register: letsencrypt_challenge |
|
|
register: letsencrypt_challenge |
|
|
|
|
|
|
|
@ -30,6 +31,7 @@ |
|
|
- name: get signed certificate(s) from letsencrypt server |
|
|
- name: get signed certificate(s) from letsencrypt server |
|
|
letsencrypt: |
|
|
letsencrypt: |
|
|
account_key: "{{ letsencrypt_account_key }}" |
|
|
account_key: "{{ letsencrypt_account_key }}" |
|
|
csr: "{{ item.letsencrypt.ssl_csr }}" |
|
|
|
|
|
|
|
|
csr: "{{ item.letsencrypt.ssl_csr | default(item.server.ssl_certificate~'.csr') }}" |
|
|
dest: "{{ item.server.ssl_certificate }}" |
|
|
dest: "{{ item.server.ssl_certificate }}" |
|
|
data: "{{ letsencrypt_challenge }}" |
|
|
data: "{{ letsencrypt_challenge }}" |
|
|
|
|
|
notify: restart nginx |