- hosts: docker_hosts
  sudo: yes

  tasks:

    - name: Install pip
      apt:
        name: python-pip
        state: present

    - name: Install docker-py
      pip:
        name: docker-py
        version: 1.5.0

    - name: run page-hit-counter-redis
      docker:
        docker_api_version: "1.18"
        image: redis:3.0.5
        state: started
        pull: "always"
        registry: "<< your registry here >>"
        username: "<< your username here >>"
        email: "<< your email here >>"
        password: "<< your password here >>"
        name: page-hit-counter-redis

    - name: run page-hit-counter-app
      docker:
        docker_api_version: "1.18"
        image: "<< your registry here >>/page-hit-counter"
        ports:
        - "80:5000"
        state: reloaded
        pull: "always"
        registry: "<< your registry here >>"
        username: "<< your username here >>"
        email: "<< your email here >>"
        password: "<< your password here >>"
        name: page-hit-counter-app
- hosts: docker_hosts
  sudo: yes

  tasks:

    - name: Install pip
      apt:
        name: python-pip
        state: present

    - name: Install docker-py
      pip:
        name: docker-py
        version: 1.5.0

    - name: run page-hit-counter-redis
      docker:
        docker_api_version: "1.18"
        image: redis:3.0.5
        state: started
        pull: "always"
        name: page-hit-counter-redis

    - name: run page-hit-counter-app
      docker:
        docker_api_version: "1.18"
        image: "<< your registry here >>/page-hit-counter"
        ports:
        - "80:5000"
        state: reloaded
        pull: "always"
        registry: "<< your registry here >>"
        username: "<< your username here >>"
        email: "<< your email here >>"
        password: "<< your password here >>"
        name: page-hit-counter-app
Remove registry credentials for public redis image
Remove registry credentials for public redis image
