---
- name: download locustfile.py
  get_url: url={{ locustfile_url }} dest={{ locustfile_path }} force=yes
  when: locustfile_url is defined

- name: start locust
  docker:
    image: ljishen/locust
    name: locust
    state: reloaded
    volumes: /tmp/locustfile.py:/root/locustfile.py:ro
    ports: 8089:8089
    command: /usr/local/bin/locust --host={{ groups['server'][0] }}

---
- name: download locustfile.py
  get_url: url={{ locustfile_url }} dest={{ locustfile_path }} force=yes
  when: locustfile_url is defined

- name: start locust
  docker:
    image: ljishen/locust
    name: locust
    state: reloaded
    volumes: /tmp/locustfile.py:/root/locustfile.py:ro
    expose: 8089    # default port for locust
    ports: 8089:8089
    command: /usr/local/bin/locust --host={{ groups['server'][0] }}

Fix unaccessible of locust service
Fix unaccessible of locust service
