diff --git a/docs/rolereference.rst b/docs/rolereference.rst index 272a767c3a6295733eee1d96c14896ce6c236ca6..c05b8c94d3374d4fda718beb1dc32bbd6c1e6918 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -1614,12 +1614,13 @@ Parameters syntax. **environment_indicator** (dictionary, optional, ``null``) - Specify configuration for including environment indicator on all HTML - pages. Indicator is a simple strip at bottom of a page with custom background - colour, text colour, and text. + Specify configuration for including environment indicator on all + HTML pages. Indicator is a simple strip at bottom of a page with + custom background colour, text colour, and text. Indicator can be + collapsed by clicking on the arrows on the left side of the strip. - Specifying environment indicator is useful for avoiding mistakes when testing - by having better visibility what environment you are in + Specifying environment indicator is useful for avoiding mistakes + when testing by having better visibility what environment you are in (production/staging/test). The following keys need to be specified: diff --git a/roles/php_website/molecule/default/tests/test_parameters_optional.py b/roles/php_website/molecule/default/tests/test_parameters_optional.py index ed1e5840e5a7462e036d08140efca37de8bd7bbb..f838838ac419a5a3e7be6d7a3154b39047faee09 100644 --- a/roles/php_website/molecule/default/tests/test_parameters_optional.py +++ b/roles/php_website/molecule/default/tests/test_parameters_optional.py @@ -230,9 +230,14 @@ def test_environment_indicator(host): page = host.run('curl https://parameters-optional.local/info.myphp') + expected_content = """\ +
+ 🞀🞂 +
parameters-optional
+
""" + assert page.rc == 0 - assert "
parameters-optional
" in page.stdout + assert expected_content in page.stdout def test_php_rewrire_urls(host): diff --git a/roles/php_website/templates/nginx_site.j2 b/roles/php_website/templates/nginx_site.j2 index c0eaddf0e2d06f4cb4ce3c039f5d72db01a68b00..84eaf22f5a33078f6107649875d3f70058606399 100644 --- a/roles/php_website/templates/nginx_site.j2 +++ b/roles/php_website/templates/nginx_site.j2 @@ -68,7 +68,12 @@ server { # Show environment indicator on HTML pages. sub_filter_types text/html; sub_filter_once on; - sub_filter "" "
{{ environment_indicator.text }}
"; + sub_filter "" " +
+ 🞀🞂 +
{{ environment_indicator.text }}
+
+"; {% endif -%} access_log /var/log/nginx/{{ fqdn }}-access.log;