handle 2nd hostname
parent
a82c5a1c2c
commit
81b2c47362
|
@ -13,6 +13,7 @@ wsgi_python_path: "/opt/regluit/venv/bin/python"
|
||||||
git_repo: "https://github.com/Gluejar/regluit.git"
|
git_repo: "https://github.com/Gluejar/regluit.git"
|
||||||
git_branch: "production"
|
git_branch: "production"
|
||||||
le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
alt_server_name:
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
mysql_db_name: "{{ vault_mysql_db_name }}"
|
mysql_db_name: "{{ vault_mysql_db_name }}"
|
||||||
|
|
|
@ -12,8 +12,9 @@ wsgi_home: "/opt/regluit/venv"
|
||||||
wsgi_python_path: "/opt/regluit/venv/bin/python"
|
wsgi_python_path: "/opt/regluit/venv/bin/python"
|
||||||
git_repo: "https://github.com/Gluejar/regluit.git"
|
git_repo: "https://github.com/Gluejar/regluit.git"
|
||||||
git_branch: "lencrypt"
|
git_branch: "lencrypt"
|
||||||
#le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
||||||
le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
alt_server_name: "ondeck.unglue.it"
|
||||||
|
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
|
|
|
@ -14,7 +14,7 @@ git_repo: "https://github.com/Gluejar/regluit.git"
|
||||||
git_branch: "master"
|
git_branch: "master"
|
||||||
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-v02.api.letsencrypt.org/directory
|
||||||
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
#le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
alt_server_name:
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
mysql_db_name: "{{ vault_mysql_db_name }}"
|
mysql_db_name: "{{ vault_mysql_db_name }}"
|
||||||
|
|
|
@ -13,6 +13,7 @@ wsgi_python_path: "/opt/regluit/venv/bin/python"
|
||||||
git_repo: "https://github.com/Gluejar/regluit.git"
|
git_repo: "https://github.com/Gluejar/regluit.git"
|
||||||
git_branch: "production"
|
git_branch: "production"
|
||||||
le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
le_endpoint: https://acme-staging-v02.api.letsencrypt.org/directory
|
||||||
|
alt_server_name: "unglue.it"
|
||||||
|
|
||||||
### Variables in settings.prod.py ###
|
### Variables in settings.prod.py ###
|
||||||
mysql_db_name: "{{ vault_mysql_db_name }}"
|
mysql_db_name: "{{ vault_mysql_db_name }}"
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
acme_directory: "{{ le_endpoint }}"
|
acme_directory: "{{ le_endpoint }}"
|
||||||
acme_version: 2
|
acme_version: 2
|
||||||
remaining_days: 45
|
remaining_days: 45
|
||||||
|
force: no
|
||||||
select_crypto_backend: openssl
|
select_crypto_backend: openssl
|
||||||
csr: "private/decrypted/{{ server_name }}.csr"
|
csr: "private/decrypted/{{ server_name }}.csr"
|
||||||
dest: private/certs/{{ server_name }}.crt
|
dest: private/certs/{{ server_name }}.crt
|
||||||
|
@ -77,16 +78,24 @@
|
||||||
group: "{{ user_name }}"
|
group: "{{ user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- copy:
|
- name: copy main challenge
|
||||||
|
copy:
|
||||||
dest: /var/www/static/{{ acme_challenge['challenge_data'][server_name]['http-01']['resource'] }}
|
dest: /var/www/static/{{ acme_challenge['challenge_data'][server_name]['http-01']['resource'] }}
|
||||||
content: "{{ acme_challenge['challenge_data'][server_name]['http-01']['resource_value'] }}"
|
content: "{{ acme_challenge['challenge_data'][server_name]['http-01']['resource_value'] }}"
|
||||||
when: acme_challenge is changed
|
when: acme_challenge is changed
|
||||||
|
|
||||||
|
- name: copy alt challenge
|
||||||
|
copy:
|
||||||
|
dest: /var/www/static/{{ acme_challenge['challenge_data'][alt_server_name]['http-01']['resource'] }}
|
||||||
|
content: "{{ acme_challenge['challenge_data'][alt_server_name]['http-01']['resource_value'] }}"
|
||||||
|
when: acme_challenge is changed and alt_server_name != ''
|
||||||
|
|
||||||
- name: Create a challenge for server_name using a account key file.
|
- name: Create a challenge for server_name using a account key file.
|
||||||
acme_certificate:
|
acme_certificate:
|
||||||
account_key_src: private/decrypted/letsencrypt_account.key
|
account_key_src: private/decrypted/letsencrypt_account.key
|
||||||
acme_directory: "{{ le_endpoint }}"
|
acme_directory: "{{ le_endpoint }}"
|
||||||
acme_version: 2
|
acme_version: 2
|
||||||
|
force: no
|
||||||
remaining_days: 45
|
remaining_days: 45
|
||||||
select_crypto_backend: openssl
|
select_crypto_backend: openssl
|
||||||
csr: "private/decrypted/{{ server_name }}.csr"
|
csr: "private/decrypted/{{ server_name }}.csr"
|
||||||
|
|
Loading…
Reference in New Issue