arnaudblancher.docker_unprovisionning

arnaudblancher.docker_unprovisionning

Goal: Remove Docker containers using the Ansible role arnaudblancher.docker_unprovisionning.

This role works with arnaudblancher.docker_provisionning, which uses an Ansible inventory to create a Docker container for each host listed.

Requirements

  • You need to have Docker installed and running.

To check if Docker is running, use the following command (you may need to run it as root):

docker info

Role Variables

For available variables, please check defaults/main.yml.

Dependencies

None

Example Playbook

See the subdirectory ./demo/.

Content of demo/docker-unprovisionning.yml:

- name: "Remove Docker containers and network"
  hosts: localhost
  gather_facts: no

  roles:
    - { role : arnaudblancher.docker_unprovisionning,
      docker_unprovisionning_net: "ansible_myplatform" }

Content of inventory/docker/000_hosts:

[mysql]
dock-mysql

[apache]
dock-apache

[all:vars]
ansible_connection=docker

To run the playbook, use:

ansible-playbook -i ./inventory/docker/ docker-unprovisionning.yml

You can use the same inventory file to create and remove your containers.

License

GPLv3

Author Information

Arnaud Blancher

https://github.com/arnaudblancher/ansible-role-docker_unprovisionning

Informazioni sul progetto

Take an ansible inventory and remove docker container for each listed hosts. This role is the companion of docker_provisionning

Installa
ansible-galaxy install arnaudblancher.docker_unprovisionning
Licenza
Unknown
Download
104
Proprietario