diff --git a/molecule/default/tests/test_default.py b/molecule/default/tests/test_default.py index d5798c4c71dbc0428d2a48313e0c617227ed4c75..d4c574bba3514143ad6a41728fb9f59bda070eac 100644 --- a/molecule/default/tests/test_default.py +++ b/molecule/default/tests/test_default.py @@ -9,12 +9,14 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( def test_directory_exists(host): assert host.file("/var/www/test").exists + def test_nginx_access(host): - #403 returned because of an empty directory in the web server + # 403 returned because of an empty directory in the web server cmd = host.run('curl http://localhost') assert "403 Forbidden" in cmd.stdout + def test_nginx_running_and_enabled(host): nginx = host.service("nginx") assert nginx.is_running - assert nginx.is_enabled \ No newline at end of file + assert nginx.is_enabled diff --git a/tasks/main.yml b/tasks/main.yml index 877bc05053a989af76cecd72b99e1765572000e5..c2d2a767bf08630a1f3426a6c8b296dc50e72ee2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -36,7 +36,7 @@ - name: Create the webserver files file: - path: "{{item.root}}" + path: "{{ item.root }}" state: directory owner: nginx - loop: "{{nginx_vhosts}}" \ No newline at end of file + loop: "{{ nginx_vhosts }}"