diff options
Diffstat (limited to 'ansible/roles')
9 files changed, 22 insertions, 34 deletions
diff --git a/ansible/roles/certificates/molecule/default/playbook.yml b/ansible/roles/certificates/molecule/default/playbook.yml index 5dcd42ee..13583ebb 100644 --- a/ansible/roles/certificates/molecule/default/playbook.yml +++ b/ansible/roles/certificates/molecule/default/playbook.yml @@ -1,14 +1,17 @@ --- - name: Infra hosts: infrastructure + handlers: + - name: Restart Docker + debug: msg="Docker restart called" roles: - certificates - - docker # docker role needed here just because of docker restart handler - name: Kube hosts: kubernetes - roles: - - docker # docker role needed here just because of docker restart handler + handlers: + - name: Restart Docker + debug: msg="Docker restart called" tasks: - include_role: name: certificates diff --git a/ansible/roles/certificates/molecule/default/prepare.yml b/ansible/roles/certificates/molecule/default/prepare.yml deleted file mode 100644 index 8df759c9..00000000 --- a/ansible/roles/certificates/molecule/default/prepare.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: Prepare infra - hosts: all - roles: - - prepare-docker diff --git a/ansible/roles/docker/molecule/default/molecule.yml b/ansible/roles/docker/molecule/default/molecule.yml index d1f67d75..1e800ee9 100644 --- a/ansible/roles/docker/molecule/default/molecule.yml +++ b/ansible/roles/docker/molecule/default/molecule.yml @@ -13,9 +13,11 @@ platforms: command: ${MOLECULE_DOCKER_COMMAND:-""} groups: - infrastructure + networks: + - name: docker_install + purge_networks: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro - - /dev:/dev:ro + - /var/lib/docker provisioner: name: ansible lint: diff --git a/ansible/roles/docker/molecule/default/prepare.yml b/ansible/roles/docker/molecule/default/prepare.yml index 8df759c9..6bdde697 100644 --- a/ansible/roles/docker/molecule/default/prepare.yml +++ b/ansible/roles/docker/molecule/default/prepare.yml @@ -2,4 +2,6 @@ - name: Prepare infra hosts: all roles: - - prepare-docker + - role: prepare-docker-dind + vars: + start_docker: false diff --git a/ansible/roles/rancher/molecule/default/cleanup.yml b/ansible/roles/rancher/molecule/default/cleanup.yml deleted file mode 100644 index d4bf4495..00000000 --- a/ansible/roles/rancher/molecule/default/cleanup.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Cleanup host - hosts: localhost - roles: - - role: cleanup-containers - vars: - container_list: - - rancher-agent - - rancher-server - - role: cleanup-rancher - vars: - container_list_by_label: - - { 'label':'io.rancher.project.name', 'value':'healthcheck'} - - { 'label':'io.rancher.project.name', 'value':'kubernetes'} diff --git a/ansible/roles/rancher/molecule/default/molecule.yml b/ansible/roles/rancher/molecule/default/molecule.yml index b21325d4..eb7f8c19 100644 --- a/ansible/roles/rancher/molecule/default/molecule.yml +++ b/ansible/roles/rancher/molecule/default/molecule.yml @@ -13,8 +13,7 @@ platforms: override_command: false restart_policy: unless-stopped volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /var/lib/rancher:/var/lib/rancher:ro + - /var/lib/docker groups: - infrastructure networks: @@ -27,12 +26,14 @@ platforms: override_command: false restart_policy: unless-stopped volumes: - - /var/run/docker.sock:/var/run/docker.sock - - /var/lib/rancher:/var/lib/rancher:ro + - /var/lib/docker + - /var/lib/rancher + - /var/lib/kubelet groups: - kubernetes networks: - name: rancher + purge_networks: true provisioner: name: ansible diff --git a/ansible/roles/rancher/molecule/default/playbook.yml b/ansible/roles/rancher/molecule/default/playbook.yml index e0ef086c..e4a7151e 100644 --- a/ansible/roles/rancher/molecule/default/playbook.yml +++ b/ansible/roles/rancher/molecule/default/playbook.yml @@ -2,7 +2,7 @@ - name: Converge rancher master hosts: infrastructure roles: - - prepare-common # molecule specific role needed here to populate cluster_ip + - prepare-common - role: rancher vars: mode: server diff --git a/ansible/roles/rancher/molecule/default/prepare.yml b/ansible/roles/rancher/molecule/default/prepare.yml index 90159c6c..d70cda43 100644 --- a/ansible/roles/rancher/molecule/default/prepare.yml +++ b/ansible/roles/rancher/molecule/default/prepare.yml @@ -1,5 +1,5 @@ --- -- name: Prepare kube nodes - hosts: kubernetes +- name: Prepare hosts + hosts: all roles: - - prepare-docker + - prepare-docker-dind diff --git a/ansible/roles/rancher/tasks/rancher_agent.yml b/ansible/roles/rancher/tasks/rancher_agent.yml index 091503c7..73d9a642 100644 --- a/ansible/roles/rancher/tasks/rancher_agent.yml +++ b/ansible/roles/rancher/tasks/rancher_agent.yml @@ -7,7 +7,6 @@ volumes: - "/var/run/docker.sock:/var/run/docker.sock" - "/var/lib/rancher:/var/lib/rancher" - auto_remove: true privileged: true vars: server_hostvars: "{{ hostvars[groups.infrastructure.0] }}" |