title: ansible plybook script for destroy all containers and remove images from remote
body: <p>looking for ansible playbook script which can stop and destroy all container on remote and remove existing images as well the below given code is just stopping the running containers </p>
  
  <pre><code>---
   - hosts: all
     gather_facts: false
  
     tasks:
   - name: Get running containers
     docker_host_info:
      containers: yes
     register: docker_info
  
   - name: Stop running containers
     docker_container:
       name: "{{ item }}"
       state: stopped
     loop: "{{ docker_info.containers | map(attribute='Id') | list }}"
  </code></pre>