Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update staging logic to accept any string that starts with "stage" #116

Merged
merged 1 commit into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions states/nginx/cclicdev.sls
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include:
- service: nginx service


{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}


{{ sls }} installed packages:
Expand Down Expand Up @@ -67,7 +67,7 @@ include:
SLS: {{ sls }}
- require:
- pkg: nginx installed packages
{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}
- webutil: {{ sls }} basic authentication user exists
{%- endif %}
- watch_in:
Expand Down
4 changes: 2 additions & 2 deletions states/nginx/dispatch.sls
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ include:
- service: nginx service


{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}


{{ sls }} installed packages:
Expand Down Expand Up @@ -68,7 +68,7 @@ include:
SLS: {{ sls }}
- require:
- pkg: nginx installed packages
{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}
- webutil: {{ sls }} basic authentication user exists
{%- endif %}
- watch_in:
Expand Down
2 changes: 1 addition & 1 deletion states/nginx/files/cclicdev_tls_template
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ server {
server_name {{ CERT_NAME }};
ssl_certificate /etc/letsencrypt/live/{{ CERT_NAME }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ CERT_NAME }}/privkey.pem;
{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}
auth_basic "Staging Environment Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion states/nginx/files/dispatch_tls_template
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ server {
json_debug buffer=32k flush=2s;
ssl_certificate /etc/letsencrypt/live/{{ CERT_NAME }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ CERT_NAME }}/privkey.pem;
{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}
auth_basic "Staging Environment Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
{%- endif %}
Expand Down
2 changes: 1 addition & 1 deletion states/postfix/files/main.cf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ smtpd_helo_required = yes
smtpd_tls_ciphers = $smtp_tls_ciphers
smtpd_tls_dh1024_param_file = /etc/ssl/private/dhparams.pem
smtpd_tls_exclude_ciphers = $smtp_tls_exclude_ciphers
{%- if pillar.pod == "stage" %}
{%- if pillar.pod.startswith("stage") %}
transport_maps = hash:/etc/postfix/transport
{%- endif %}
4 changes: 2 additions & 2 deletions states/postfix/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ include:

{{ pf.install_alias(sls, "0444", "/etc/aliases", "aliases") -}}
{{ pf.install_map(sls, "0400", "/etc/postfix/sasl_passwd", "sasl_passwd") -}}
{% if pillar.hst == "cclicdev" and pillar.pod == "stage" -%}
{% if pillar.hst == "cclicdev" and pillar.pod.startswith("stage") -%}
{{ pf.install_map(sls, "0400", "/etc/postfix/transport",
"transport_stage_caktus") -}}
{% elif pillar.pod == "stage" -%}
{% elif pillar.pod.startswith("stage") -%}
{{ pf.install_map(sls, "0400", "/etc/postfix/transport", "transport_stage") -}}
{% endif -%}
2 changes: 1 addition & 1 deletion states/wordpress/files/composer-wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#define('DISALLOW_FILE_MODS', True);

# Plugin: Jetpack
{%- if POD == "stage" %}
{%- if POD.startswith("stage") %}
define( 'JETPACK_DEV_DEBUG', True );
{%- else %}
define( 'JETPACK_DEV_DEBUG', False );
Expand Down
2 changes: 1 addition & 1 deletion states/wordpress/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ include:
- composer: /usr/local/bin/composer
- php: /usr/bin/php
- optimize: True
{%- if POD == "stage" %}
{%- if POD.startswith("stage") %}
- no_dev: False
{%- else %}
- no_dev: True
Expand Down