---

# Install (docker-py) python package as is a docker module dependency.
- pip:
    name: docker-py
    version: 1.1.0
  environment: proxy_env
  tags:
    - registrator

# tasks file for docker registrator
- name: run registrator container
  docker:
    name: registrator
    image: "{{ registrator_image }}"
    state: started
    restart_policy: always
    net: host
    command: "-internal {{ registrator_uri }}"
    volumes:
    - "/var/run/docker.sock:/tmp/docker.sock"
  environment: proxy_env
  tags:
    - registrator

---

# Install (docker-py) python package as is a docker module dependency.
- pip:
    name: docker-py
    version: 1.1.0
  environment: proxy_env
  tags:
    - registrator

# tasks file for docker registrator
- name: run registrator container
  docker:
    name: registrator
    image: "{{ registrator_image }}"
    state: started
    restart_policy: always
    net: host
    command: "-internal -resync=120 {{ registrator_uri }}"
    volumes:
    - "/var/run/docker.sock:/tmp/docker.sock"
  environment: proxy_env
  tags:
    - registrator

Set -resync flag for registrator reregistering all services
Set -resync flag for registrator reregistering all services
