diff --git a/.travis.yml b/.travis.yml index 293e0bb..94db4b5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -63,9 +63,7 @@ before_install: install: - pip install ansible==2.9.9 - pip install molecule[docker]==3.0.4 - - pip install testinfra - pip install ansible-lint - - pip install flake8 script: - molecule --version - ansible --version diff --git a/README.md b/README.md index 9e9aa01..d7e4dea 100644 --- a/README.md +++ b/README.md @@ -195,12 +195,12 @@ Example Playbooks Working functional playbook examples can be found in the **`molecule/common`** directory in the following files: -- **[molecule/common/playbook_default.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_default.yml):** Install a specific version of NGINX and set up logrotate -- **[molecule/common/playbook_module.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_module.yml):** Install various NGINX supported modules -- **[molecule/common/playbook_source.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_source.yml):** Install NGINX from source -- **[molecule/common/playbook_stable_push.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_stable_push.yml):** Install NGINX using the stable branch and push a preexisting config from your system to your NGINX instance -- **[molecule/common/playbook_template.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_template.yml):** Use the NGINX configuration templating variables to create an NGINX configuration file -- **[molecule/common/playbook_unit.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbook_unit.yml):** Install NGINX Unit +- **[molecule/common/playbooks/default_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/default_converge.yml):** Install a specific version of NGINX and set up logrotate +- **[molecule/common/playbooks/module_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/module_converge.yml):** Install various NGINX supported modules +- **[molecule/common/playbooks/source_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/source_converge.yml):** Install NGINX from source +- **[molecule/common/playbooks/stable_push_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/stable_push_converge.yml):** Install NGINX using the stable branch and push a preexisting config from your system to your NGINX instance +- **[molecule/common/playbooks/template_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/template_converge.yml):** Use the NGINX configuration templating variables to create an NGINX configuration file +- **[molecule/common/playbooks/unit_converge.yml](https://github.com/nginxinc/ansible-role-nginx/blob/master/molecule/common/playbooks/unit_converge.yml):** Install NGINX Unit Do note that if you install this repository via Ansible Galaxy, you will have to replace the role variable in the sample playbooks from `ansible-role-nginx` to `nginxinc.nginx`. diff --git a/molecule/common/playbook_default.yml b/molecule/common/playbooks/default_converge.yml similarity index 100% rename from molecule/common/playbook_default.yml rename to molecule/common/playbooks/default_converge.yml diff --git a/molecule/common/playbooks/default_verify.yml b/molecule/common/playbooks/default_verify.yml new file mode 100644 index 0000000..8e590fb --- /dev/null +++ b/molecule/common/playbooks/default_verify.yml @@ -0,0 +1,24 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Check if NGINX is installed + package: + name: nginx + check_mode: yes + register: install + failed_when: (install is changed) or (install is failed) + + - name: Check if NGINX service is running + service: + name: nginx + state: started + enabled: yes + check_mode: yes + register: service + failed_when: (service is changed) or (service is failed) + + - name: Verify NGINX is up and running + uri: + url: http://localhost + status_code: 200 diff --git a/molecule/common/playbook_module.yml b/molecule/common/playbooks/module_converge.yml similarity index 100% rename from molecule/common/playbook_module.yml rename to molecule/common/playbooks/module_converge.yml diff --git a/molecule/common/playbooks/module_verify.yml b/molecule/common/playbooks/module_verify.yml new file mode 100644 index 0000000..96fb669 --- /dev/null +++ b/molecule/common/playbooks/module_verify.yml @@ -0,0 +1,25 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Check if NGINX is installed + package: + name: nginx + check_mode: yes + register: install + failed_when: (install is changed) or (install is failed) + + - name: Check if NGINX service is running + service: + name: nginx + state: started + enabled: yes + check_mode: yes + register: service + failed_when: (service is changed) or (service is failed) + + - name: Check default.conf does not exist + stat: + path: /etc/nginx/conf.d/default.conf + register: stat_result + failed_when: stat_result.stat.exists diff --git a/molecule/common/playbook_source.yml b/molecule/common/playbooks/source_converge.yml similarity index 100% rename from molecule/common/playbook_source.yml rename to molecule/common/playbooks/source_converge.yml diff --git a/molecule/common/playbooks/source_verify.yml b/molecule/common/playbooks/source_verify.yml new file mode 100644 index 0000000..d69320c --- /dev/null +++ b/molecule/common/playbooks/source_verify.yml @@ -0,0 +1,17 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Check if NGINX service is running + service: + name: nginx + state: started + enabled: yes + check_mode: yes + register: service + failed_when: (service is changed) or (service is failed) + + - name: Verify NGINX is up and running + uri: + url: http://localhost + status_code: 200 diff --git a/molecule/common/playbook_stable_push.yml b/molecule/common/playbooks/stable_push_converge.yml similarity index 68% rename from molecule/common/playbook_stable_push.yml rename to molecule/common/playbooks/stable_push_converge.yml index c4841ae..6514849 100644 --- a/molecule/common/playbook_stable_push.yml +++ b/molecule/common/playbooks/stable_push_converge.yml @@ -8,6 +8,6 @@ nginx_branch: stable nginx_main_upload_enable: true - nginx_main_upload_src: files/nginx.conf + nginx_main_upload_src: ../files/nginx.conf nginx_http_upload_enable: true - nginx_http_upload_src: files/http/*.conf + nginx_http_upload_src: ../files/http/*.conf diff --git a/molecule/common/playbooks/stable_push_verify.yml b/molecule/common/playbooks/stable_push_verify.yml new file mode 100644 index 0000000..dacd38a --- /dev/null +++ b/molecule/common/playbooks/stable_push_verify.yml @@ -0,0 +1,39 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Check if NGINX is installed + package: + name: nginx + check_mode: yes + register: install + failed_when: (install is changed) or (install is failed) + + - name: Check if NGINX service is running + service: + name: nginx + state: started + enabled: yes + check_mode: yes + register: service + failed_when: (service is changed) or (service is failed) + + - name: Verify NGINX is up and running + uri: + url: http://localhost + status_code: 200 + + - name: Check default.conf exists + stat: + path: /etc/nginx/conf.d/default.conf + register: stat_result + failed_when: not stat_result.stat.exists + + - name: Ensure default.conf contains 'location /' + lineinfile: + path: /etc/nginx/conf.d/default.conf + line: " location / {" + state: present + check_mode: yes + register: conf + failed_when: (conf is changed) or (conf is failed) diff --git a/molecule/common/playbook_template.yml b/molecule/common/playbooks/template_converge.yml similarity index 100% rename from molecule/common/playbook_template.yml rename to molecule/common/playbooks/template_converge.yml diff --git a/molecule/common/playbooks/template_verify.yml b/molecule/common/playbooks/template_verify.yml new file mode 100644 index 0000000..7601f08 --- /dev/null +++ b/molecule/common/playbooks/template_verify.yml @@ -0,0 +1,69 @@ +--- +- name: Verify + hosts: all + tasks: + - name: Check if NGINX is installed + package: + name: nginx + check_mode: yes + register: install + failed_when: (install is changed) or (install is failed) + + - name: Check if NGINX service is running + service: + name: nginx + state: started + enabled: yes + check_mode: yes + register: service + failed_when: (service is changed) or (service is failed) + + - name: Verify NGINX is up and running + uri: + url: http://localhost + status_code: 200 + + - name: Check default.conf exists + stat: + path: /etc/nginx/conf.d/default.conf + register: stat_result + failed_when: not stat_result.stat.exists + + - name: Check frontend_default.conf exists + stat: + path: /etc/nginx/conf.d/frontend_default.conf + register: stat_result + failed_when: not stat_result.stat.exists + + - name: Check backend_default.conf exists + stat: + path: /etc/nginx/conf.d/backend_default.conf + register: stat_result + failed_when: not stat_result.stat.exists + + - name: Ensure default.conf contains 'location /' + lineinfile: + path: /etc/nginx/conf.d/default.conf + line: " location / {" + state: present + check_mode: yes + register: conf + failed_when: (conf is changed) or (conf is failed) + + - name: Ensure default.conf contains 'location /backend' + lineinfile: + path: /etc/nginx/conf.d/default.conf + line: " location /backend {" + state: present + check_mode: yes + register: conf + failed_when: (conf is changed) or (conf is failed) + + - name: Ensure default.conf contains 'client_max_body_size 512k;' + lineinfile: + path: /etc/nginx/conf.d/default.conf + line: " client_max_body_size 512k;" + state: present + check_mode: yes + register: conf + failed_when: (conf is changed) or (conf is failed) diff --git a/molecule/common/playbook_unit.yml b/molecule/common/playbooks/unit_converge.yml similarity index 100% rename from molecule/common/playbook_unit.yml rename to molecule/common/playbooks/unit_converge.yml diff --git a/molecule/common/test_default/test_default.py b/molecule/common/test_default/test_default.py deleted file mode 100644 index 8d12025..0000000 --- a/molecule/common/test_default/test_default.py +++ /dev/null @@ -1,30 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_nginx_is_installed(host): - ngx = host.package("nginx") - assert ngx.is_installed - - -def test_nginx_running_and_enabled(host): - ngx = host.service("nginx") - assert ngx.is_running - assert ngx.is_enabled - - -def test_hosts_file(host): - ngx = host.file('/etc/hosts') - assert ngx.exists - assert ngx.user == 'root' - assert ngx.group == 'root' - - -def test_endpoint(host): - command = """curl -I http://localhost/""" - cmd = host.run(command) - assert '200 OK' in cmd.stdout diff --git a/molecule/common/test_module/test_default.py b/molecule/common/test_module/test_default.py deleted file mode 100644 index aed00c0..0000000 --- a/molecule/common/test_module/test_default.py +++ /dev/null @@ -1,24 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_nginx_is_installed(host): - ngx = host.package("nginx") - assert ngx.is_installed - - -def test_nginx_running_and_enabled(host): - ngx = host.service("nginx") - assert ngx.is_running - assert ngx.is_enabled - - -def test_hosts_file(host): - ngx = host.file('/etc/hosts') - assert ngx.exists - assert ngx.user == 'root' - assert ngx.group == 'root' diff --git a/molecule/common/test_source/test_default.py b/molecule/common/test_source/test_default.py deleted file mode 100644 index 24fcbab..0000000 --- a/molecule/common/test_source/test_default.py +++ /dev/null @@ -1,25 +0,0 @@ -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_nginx_running_and_enabled(host): - ngx = host.service("nginx") - assert ngx.is_running - assert ngx.is_enabled - - -def test_hosts_file(host): - ngx = host.file('/etc/hosts') - assert ngx.exists - assert ngx.user == 'root' - assert ngx.group == 'root' - - -def test_endpoint(host): - command = """curl -I http://localhost/""" - cmd = host.run(command) - assert '200 OK' in cmd.stdout diff --git a/molecule/common/test_stable_push/test_default.py b/molecule/common/test_stable_push/test_default.py deleted file mode 100644 index c695962..0000000 --- a/molecule/common/test_stable_push/test_default.py +++ /dev/null @@ -1,42 +0,0 @@ -import nginx -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_nginx_is_installed(host): - ngx = host.package("nginx") - assert ngx.is_installed - - -def test_nginx_running_and_enabled(host): - ngx = host.service("nginx") - assert ngx.is_running - assert ngx.is_enabled - - -def test_hosts_file(host): - ngx = host.file('/etc/hosts') - assert ngx.exists - assert ngx.user == 'root' - assert ngx.group == 'root' - - -def test_endpoint(host): - command = """curl -I http://localhost/""" - cmd = host.run(command) - assert '200 OK' in cmd.stdout - - -def test_generated_files(host): - assert host.file('/etc/nginx/conf.d/default.conf').exists - - -def test_default_server(host): - f = host.file('/etc/nginx/conf.d/default.conf') - c = nginx.loads(f.content_string) - lf = c.server.filter('Location', '/') - assert len(lf) == 1 diff --git a/molecule/common/test_template/test_default.py b/molecule/common/test_template/test_default.py deleted file mode 100644 index 0b79c97..0000000 --- a/molecule/common/test_template/test_default.py +++ /dev/null @@ -1,58 +0,0 @@ -import nginx -import os - -import testinfra.utils.ansible_runner - -testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( - os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') - - -def test_nginx_is_installed(host): - ngx = host.package("nginx") - assert ngx.is_installed - - -def test_nginx_running_and_enabled(host): - ngx = host.service("nginx") - assert ngx.is_running - assert ngx.is_enabled - - -def test_hosts_file(host): - ngx = host.file('/etc/hosts') - assert ngx.exists - assert ngx.user == 'root' - assert ngx.group == 'root' - - -def test_endpoint(host): - command = """curl -I http://localhost/""" - cmd = host.run(command) - assert '200 OK' in cmd.stdout - - -def test_generated_files(host): - assert host.file('/etc/nginx/conf.d/default.conf').exists - assert host.file('/etc/nginx/conf.d/frontend_default.conf').exists - assert host.file('/etc/nginx/conf.d/backend_default.conf').exists - - -def test_default_server(host): - f = host.file('/etc/nginx/conf.d/default.conf') - c = nginx.loads(f.content_string) - lf = c.server.filter('Location', '/') - assert len(lf) == 1 - lb = c.server.filter('Location', '/backend') - assert len(lb) == 1 - - -def test_client_max_body_size(host): - f = host.file('/etc/nginx/conf.d/default.conf') - c = nginx.loads(f.content_string) - vs = c.server.filter('Key', 'client_max_body_size') - assert len(vs) == 1 - assert vs[0].value == '512k' - lc = c.server.filter('Location', '/') - vl = lc[0].filter('Key', 'client_max_body_size') - assert len(vl) == 1 - assert vl[0].value == '5m' diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 8be12e4..8d00cb0 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -45,7 +44,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_default.yml -verifier: - name: testinfra - directory: ../common/test_default + converge: ../common/playbooks/default_converge.yml + verify: ../common/playbooks/default_verify.yml diff --git a/molecule/default_alpine/molecule.yml b/molecule/default_alpine/molecule.yml index 8fea6a0..a3f5d17 100644 --- a/molecule/default_alpine/molecule.yml +++ b/molecule/default_alpine/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -38,7 +37,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_default.yml -verifier: - name: testinfra - directory: ../common/test_default + converge: ../common/playbooks/default_converge.yml + verify: ../common/playbooks/default_verify.yml diff --git a/molecule/default_centos/molecule.yml b/molecule/default_centos/molecule.yml index 11b030f..45178cc 100644 --- a/molecule/default_centos/molecule.yml +++ b/molecule/default_centos/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-6 image: centos:6 @@ -27,7 +26,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_default.yml -verifier: - name: testinfra - directory: ../common/test_default + converge: ../common/playbooks/default_converge.yml + verify: ../common/playbooks/default_verify.yml diff --git a/molecule/module/molecule.yml b/molecule/module/molecule.yml index f2676c4..efebe97 100644 --- a/molecule/module/molecule.yml +++ b/molecule/module/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -45,7 +44,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_module.yml -verifier: - name: testinfra - directory: ../common/test_module + converge: ../common/playbooks/module_converge.yml + verify: ../common/playbooks/module_verify.yml diff --git a/molecule/module_alpine/molecule.yml b/molecule/module_alpine/molecule.yml index 8de545e..ff3c007 100644 --- a/molecule/module_alpine/molecule.yml +++ b/molecule/module_alpine/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -38,7 +37,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_module.yml -verifier: - name: testinfra - directory: ../common/test_module + converge: ../common/playbooks/module_converge.yml + verify: ../common/playbooks/module_verify.yml diff --git a/molecule/module_centos/molecule.yml b/molecule/module_centos/molecule.yml index 0b09e78..0d80c59 100644 --- a/molecule/module_centos/molecule.yml +++ b/molecule/module_centos/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-6 image: centos:6 @@ -27,7 +26,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_module.yml -verifier: - name: testinfra - directory: ../common/test_module + converge: ../common/playbooks/module_converge.yml + verify: ../common/playbooks/module_verify.yml diff --git a/molecule/source/molecule.yml b/molecule/source/molecule.yml index 3cadc14..7fb518b 100644 --- a/molecule/source/molecule.yml +++ b/molecule/source/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -45,7 +44,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_source.yml -verifier: - name: testinfra - directory: ../common/test_source + converge: ../common/playbooks/source_converge.yml + verify: ../common/playbooks/source_verify.yml diff --git a/molecule/source_alpine/molecule.yml b/molecule/source_alpine/molecule.yml index a5b2919..31d1b10 100644 --- a/molecule/source_alpine/molecule.yml +++ b/molecule/source_alpine/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -38,7 +37,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_source.yml -verifier: - name: testinfra - directory: ../common/test_source + converge: ../common/playbooks/source_converge.yml + verify: ../common/playbooks/source_verify.yml diff --git a/molecule/source_centos/molecule.yml b/molecule/source_centos/molecule.yml index 1fff5be..e495334 100644 --- a/molecule/source_centos/molecule.yml +++ b/molecule/source_centos/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-7 image: centos:7 @@ -24,7 +23,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_source.yml -verifier: - name: testinfra - directory: ../common/test_source + converge: ../common/playbooks/source_converge.yml + verify: ../common/playbooks/source_verify.yml diff --git a/molecule/stable_push/molecule.yml b/molecule/stable_push/molecule.yml index 5843bf4..490fd27 100644 --- a/molecule/stable_push/molecule.yml +++ b/molecule/stable_push/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -48,7 +44,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_stable_push.yml -verifier: - name: testinfra - directory: ../common/test_stable_push + converge: ../common/playbooks/stable_push_converge.yml + verify: ../common/playbooks/stable_push_verify.yml diff --git a/molecule/stable_push_alpine/molecule.yml b/molecule/stable_push_alpine/molecule.yml index c2753f3..b114ffc 100644 --- a/molecule/stable_push_alpine/molecule.yml +++ b/molecule/stable_push_alpine/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -41,7 +37,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_stable_push.yml -verifier: - name: testinfra - directory: ../common/test_stable_push + converge: ../common/playbooks/stable_push_converge.yml + verify: ../common/playbooks/stable_push_verify.yml diff --git a/molecule/stable_push_centos/molecule.yml b/molecule/stable_push_centos/molecule.yml index c5f1884..5385579 100644 --- a/molecule/stable_push_centos/molecule.yml +++ b/molecule/stable_push_centos/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-6 image: centos:6 @@ -30,7 +26,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_stable_push.yml -verifier: - name: testinfra - directory: ../common/test_stable_push + converge: ../common/playbooks/stable_push_converge.yml + verify: ../common/playbooks/stable_push_verify.yml diff --git a/molecule/template/molecule.yml b/molecule/template/molecule.yml index 02e90f9..7e5083a 100644 --- a/molecule/template/molecule.yml +++ b/molecule/template/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -48,7 +44,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_template.yml -verifier: - name: testinfra - directory: ../common/test_template + converge: ../common/playbooks/template_converge.yml + verify: ../common/playbooks/template_verify.yml diff --git a/molecule/template_alpine/molecule.yml b/molecule/template_alpine/molecule.yml index a646a5b..a129057 100644 --- a/molecule/template_alpine/molecule.yml +++ b/molecule/template_alpine/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -41,7 +37,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_template.yml -verifier: - name: testinfra - directory: ../common/test_template + converge: ../common/playbooks/template_converge.yml + verify: ../common/playbooks/template_verify.yml diff --git a/molecule/template_centos/molecule.yml b/molecule/template_centos/molecule.yml index 3b0f745..4ba7ab5 100644 --- a/molecule/template_centos/molecule.yml +++ b/molecule/template_centos/molecule.yml @@ -1,14 +1,10 @@ --- -dependency: - name: shell - command: pip install python-nginx driver: name: docker lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-6 image: centos:6 @@ -30,7 +26,5 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_template.yml -verifier: - name: testinfra - directory: ../common/test_template + converge: ../common/playbooks/template_converge.yml + verify: ../common/playbooks/template_verify.yml diff --git a/molecule/unit/molecule.yml b/molecule/unit/molecule.yml index 46a6cd4..cdd301f 100644 --- a/molecule/unit/molecule.yml +++ b/molecule/unit/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: debian-stretch image: debian:stretch-slim @@ -45,4 +44,4 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_unit.yml + converge: ../common/playbooks/unit_converge.yml diff --git a/molecule/unit_alpine/molecule.yml b/molecule/unit_alpine/molecule.yml index cd02977..87945e2 100644 --- a/molecule/unit_alpine/molecule.yml +++ b/molecule/unit_alpine/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: alpine-3.8 image: alpine:3.8 @@ -38,4 +37,4 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_unit.yml + converge: ../common/playbooks/unit_converge.yml diff --git a/molecule/unit_centos/molecule.yml b/molecule/unit_centos/molecule.yml index bd73ca0..4a209ea 100644 --- a/molecule/unit_centos/molecule.yml +++ b/molecule/unit_centos/molecule.yml @@ -5,7 +5,6 @@ lint: | set -e yamllint . ansible-lint - flake8 platforms: - name: centos-6 image: centos:6 @@ -27,4 +26,4 @@ platforms: provisioner: name: ansible playbooks: - converge: ../common/playbook_unit.yml + converge: ../common/playbooks/unit_converge.yml