Browse Source

fix: [apache] bail out as soon as posisble on failures

postgres
Valentin Lab 6 years ago
parent
commit
255bbdb466
  1. 7
      apache/hooks/web_proxy-relation-joined
  2. 4
      apache/lib/common

7
apache/hooks/web_proxy-relation-joined

@ -1,15 +1,14 @@
#!/bin/bash #!/bin/bash
## Should be executable N time in a row with same result. ## Should be executable N time in a row with same result.
. lib/common
set -e set -e
. lib/common
apache_proxy_dir apache_proxy_dir
APACHE_CORE_RULES=$(relation-get apache-core-rules 2>/dev/null) || true APACHE_CORE_RULES=$(relation-get apache-core-rules 2>/dev/null) || true
if [ "$APACHE_CORE_RULES" ]; then if [ "$APACHE_CORE_RULES" ]; then
apache_core_rules_add "$APACHE_CORE_RULES"
apache_core_rules_add "$APACHE_CORE_RULES" || exit 1
fi fi

4
apache/lib/common

@ -6,7 +6,7 @@ apache_proxy_dir () {
err "You must specify a ${WHITE}domain$NORMAL option in relation." err "You must specify a ${WHITE}domain$NORMAL option in relation."
return 1 return 1
} }
proxy=yes apache_vhost_create
proxy=yes apache_vhost_create || return 1
info "Added $DOMAIN as a proxy to $TARGET." info "Added $DOMAIN as a proxy to $TARGET."
} }
export -f apache_proxy_dir export -f apache_proxy_dir
@ -40,7 +40,7 @@ apache_vhost_create () {
__vhost_cfg_creds_enabled=$(relation-get creds 2>/dev/null) || true __vhost_cfg_creds_enabled=$(relation-get creds 2>/dev/null) || true
if [ "$__vhost_cfg_creds_enabled" ]; then if [ "$__vhost_cfg_creds_enabled" ]; then
apache_passwd_file
apache_passwd_file || return 1
fi fi
if is_protocol_enabled https; then if is_protocol_enabled https; then

Loading…
Cancel
Save