- name: Prepare images
  hosts: all
  strategy: mitogen_free
  gather_facts: true
  tasks:
    - name: Commit containers
      command: >
        docker commit
        --change 'EXPOSE 22'
        --change 'CMD ["/usr/sbin/sshd", "-D"]'
        {{ inventory_hostname }}
        {{ container_image_name }}
      delegate_to: localhost

    - name: Stop containers
      command: >
        docker rm -f {{ inventory_hostname }}
      delegate_to: localhost
