From: Lorin Hochstein Date: Tue, 7 Feb 2017 05:44:06 +0000 (-0800) Subject: Add clean target X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=cdfe1da37f908c238b02bead51847afc13193a36;p=ansiblebook.git Add clean target --- diff --git a/ch13/Makefile b/ch13/Makefile index 6eaba46..797a362 100644 --- a/ch13/Makefile +++ b/ch13/Makefile @@ -21,6 +21,8 @@ build: start: ansible-playbook ghost.yml +clean: + ansible-playbook clean.yml # Generate self-signed certs for localhost ssl: certs/nginx.crt certs/nginx.key diff --git a/ch13/clean.yml b/ch13/clean.yml new file mode 100644 index 0000000..a1c02c9 --- /dev/null +++ b/ch13/clean.yml @@ -0,0 +1,19 @@ +- name: remove all ghost containers and networks + hosts: ghost + become: True + gather_facts: False + tasks: + - name: remove containers + docker_container: + name: "{{ item }}" + state: absent + with_items: + - nginx_ghost + - ghost + - name: remove network + docker_network: + name: ghostnet + state: absent + + +