Skip to content

Commit

Permalink
molecule tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Aug 18, 2023
1 parent 40ce0fc commit e5b2937
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 18 deletions.
2 changes: 0 additions & 2 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ dependency:
name: galaxy
options:
role-file: requirements-standalone.yml
roles-path: ${MOLECULE_PROJECT_DIRECTORY}/../community
requirements-file: requirements-collections.yml
collections-path: ${MOLECULE_PROJECT_DIRECTORY}/../community-collections
driver:
name: vagrant
provider:
Expand Down
2 changes: 1 addition & 1 deletion molecule/default/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_nginx_proxy_vhost_files_contains_target(host):

def test_docker_interface_is_configured_in_firewalld(host):
command = """
sudo firewall-cmd --list-all --zone=public | \
sudo firewall-cmd --list-all --zone=docker | \
grep -c 'docker0'
"""
cmd = host.run(command)
Expand Down
2 changes: 0 additions & 2 deletions molecule/kvm/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ dependency:
name: galaxy
options:
role-file: requirements-standalone.yml
roles-path: ${MOLECULE_PROJECT_DIRECTORY}/../community
requirements-file: requirements-collections.yml
collections-path: ${MOLECULE_PROJECT_DIRECTORY}/../community-collections
driver:
name: vagrant
provider:
Expand Down
2 changes: 0 additions & 2 deletions molecule/parallels/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ dependency:
name: galaxy
options:
role-file: requirements-standalone.yml
roles-path: ${MOLECULE_PROJECT_DIRECTORY}/../community
requirements-file: requirements-collections.yml
collections-path: ${MOLECULE_PROJECT_DIRECTORY}/../community-collections
driver:
name: vagrant
provider:
Expand Down
2 changes: 1 addition & 1 deletion requirements-monorepo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
roles:
# Install a role from Ansible Galaxy.
- name: geerlingguy.docker
- name: mrlesmithjr.manage-lvm
- name: mrlesmithjr.manage_lvm
4 changes: 2 additions & 2 deletions requirements-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
roles:
# Install a role from Ansible Galaxy.
- name: geerlingguy.docker
- name: mrlesmithjr.manage-lvm
- name: mrlesmithjr.manage_lvm
- name: tcharl.ansible_volumes
- name: tcharl.ansible_containerization
- name: tcharl.ansible_routing
- name: tcharl.ansible_routing
3 changes: 3 additions & 0 deletions tasks/nginx-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,17 @@
- name: Nginx-proxy | debug volumes to mount
ansible.builtin.debug:
msg: "{{ [virtual_hosts | selectattr('volumes', 'defined') | map(attribute='volumes') | list | default([]), '/var/run/docker.sock:/tmp/docker.sock:ro', docker_shared_data_nginx_proxy_certs_path + ':/etc/nginx/certs', docker_shared_data_nginx_proxy_vhosts_path + ':/etc/nginx/vhost.d', docker_shared_data_nginx_proxy_html_path + ':/usr/share/nginx/html'] | flatten | unique }}"
verbosity: 2

- name: Nginx-proxy | debug dhparams
ansible.builtin.debug:
msg: "{{ 'true' if virtual_hosts | selectattr('gen_certs', 'defined') | selectattr('gen_certs', 'equalto', True) | list | length != 0 else 'false' }}"
verbosity: 2

- name: Nginx-proxy | debug default host
ansible.builtin.debug:
msg: "{{ virtual_hosts | selectattr('default_host', 'defined') | selectattr('default_host', 'equalto', True) | selectattr('name', 'defined') | map(attribute='name') | first | default('Not found') }}"
verbosity: 2

- name: Nginx-proxy | start proxy
community.docker.docker_container:
Expand Down
6 changes: 0 additions & 6 deletions tasks/requirements.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
---

- name: Requirements | install firewalld
ansible.builtin.import_role:
name: tcharl.ansible_routing
tags:
- standalone

- name: Requirements | install docker
ansible.builtin.import_role:
name: tcharl.ansible_containerization
Expand Down
3 changes: 1 addition & 2 deletions tasks/virtual-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
ansible.builtin.debug:
msg: "{{ ansible_facts[virtual_host.nic_name | default('')]['ipv4']['address'] | default(ansible_facts['default_ipv4']['address']) }}"
delegate_to: "{{ virtual_host.redirect_on_group_machine_ip[0] }}"
delegate_facts: true
register: group_machines_fact
when:
- virtual_host.redirect_on_group_machine_ip is defined
Expand Down Expand Up @@ -69,4 +68,4 @@
not virtual_host.container) or
virtual_host.redirect_on_group_machine_ip is defined
)
become: true
become: true

0 comments on commit e5b2937

Please sign in to comment.