From cdfe1da37f908c238b02bead51847afc13193a36 Mon Sep 17 00:00:00 2001 From: Lorin Hochstein Date: Mon, 6 Feb 2017 21:44:06 -0800 Subject: [PATCH] Add clean target --- ch13/Makefile | 2 ++ ch13/clean.yml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ch13/clean.yml 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 + + + -- 2.44.0