diff --git a/testsite/group_vars/web.yml b/testsite/group_vars/web.yml index 983c7bedadb580e28d320d2ff818e46f416f94bb..8fdf936d98ba6e6e9b48793ff2ff99b16443ca7f 100644 --- a/testsite/group_vars/web.yml +++ b/testsite/group_vars/web.yml @@ -15,4 +15,9 @@ web_default_message: "You are attempting to access the web server using a wrong db_root_password: "root" -website_mail_recipients: "john.doe@example.com" \ No newline at end of file +website_mail_recipients: "john.doe@example.com" + +environment_indicator: + background_colour: "purple" + text_colour: "white" + text: "Majic Ansible Roles Test Site" \ No newline at end of file diff --git a/testsite/playbooks/roles/wsgihello/files/hello.wsgi b/testsite/playbooks/roles/wsgihello/files/hello.wsgi index 79b68a048e89f7588ae16d5e2ca932f66dd20f55..e58bf83e553fc9bd28660cdbe64415b48f28f47f 100644 --- a/testsite/playbooks/roles/wsgihello/files/hello.wsgi +++ b/testsite/playbooks/roles/wsgihello/files/hello.wsgi @@ -4,9 +4,22 @@ import os def application(environ, start_response): status = '200 OK' - output = 'Hello, world one! I am website %s' % os.environ.get("WEBSITE_NAME", "that nobody set a name for :(") - response_headers = [('Content-type', 'text/plain'), + template = """ + + + + {title} + + +

Hello, world!

+

I am website {title}

+ + +""" + output = template.format(title=os.environ.get("WEBSITE_NAME", "that nobody set a name for :(")) + + response_headers = [('Content-type', 'text/html'), ('Content-Length', str(len(output)))] start_response(status, response_headers)