From 56bc32e10735cdba34bbfb39fa1eacda707c98f6 Mon Sep 17 00:00:00 2001 From: daniwe4 Date: Fri, 1 Dec 2023 13:44:20 +0100 Subject: [PATCH] master proxy-enable-https: 409 add domain as param --- README.md | 2 +- setup/stack/states/proxy-enable-https/https/init.sls | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c6c4c231..61786c54 100644 --- a/README.md +++ b/README.md @@ -329,7 +329,7 @@ This is done by certbot. In order for this state to run successfully, it is important that the proxy is already accessible from the Internet and the DNS entries are set. To execute the state you have to log in to the salt master using `doil salt:login`. The following command is then executed there: ```bash - salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": ""}' + salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "", "domain": ""}' ``` If the state has run successfully, the current status of the proxy still needs to be committed. To do this, leave the salt master again with `ctrl-d` and execute the following command: diff --git a/setup/stack/states/proxy-enable-https/https/init.sls b/setup/stack/states/proxy-enable-https/https/init.sls index 039d775a..9a74ba5f 100755 --- a/setup/stack/states/proxy-enable-https/https/init.sls +++ b/setup/stack/states/proxy-enable-https/https/init.sls @@ -3,7 +3,7 @@ # This state must be executed on the salt master. The following command is used for this. # Please note that you must provide your email address. # -# salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": ""}' +# salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{"email": "", "domain" = ""}' # # After applying the state, it is important that you commit the new proxy status to the docker image on the docker host. # To do this, run the following command on the Docker host. @@ -14,6 +14,7 @@ # so https take effect in ILIAS. {% set email = salt['pillar.get']('email', '') %} +{% set domain = salt['pillar.get']('domain', '') %} {% if email != "" %} https_packages: @@ -25,7 +26,7 @@ https_packages: install_cert: cmd.run: - - name: certbot -n --nginx --agree-tos --email {{ email }} + - name: certbot -n --nginx --agree-tos --email {{ email }} --domains {{ domain }} - runas: root cert_renew_by_cron: @@ -36,6 +37,6 @@ cert_renew_by_cron: {% else %} custom_raise: test.fail_without_changes: - - msg: "Missing email! Please use this command: salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{\"email\": \"\"}'" + - msg: "Missing email! Please use this command: salt 'doil.proxy' state.highstate saltenv=proxy-enable-https pillar='{\"email\": \"\", \"domain\": \"\"}'" - failhard: True {% endif %} \ No newline at end of file