---
- hosts: localhost
  connection: local
  sudo: yes
  gather_facts: yes
  roles:
    - common
  tasks:
    - name: get ec2 inventory script
      sudo: no
      get_url:
        url: https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
        dest: ~/code/ec2.py
        mode: 0755
    - name: get ec2 inventory ini
      sudo: no
      get_url:
        url: https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini
        dest: ~/code/ec2.ini
        mode: 0644

---
- hosts: localhost
  connection: local
  sudo: yes
  gather_facts: yes
  roles:
    - common
    - { role: worker, sudo: no }
  tasks:
    - name: stop worker
      sudo: no
      command: ~/bin/stop-rqworker.sh
      # TODO: when rwqoekr.pid
    - name: stop akara
      command: "{{ dir_venv}}/bin/akara -f {{ dir_code }}/dpla/ingestion/akara.conf stop"
      args:
        chdir:  "{{ dir_akara_run }}"
      #TODO: when: "{{ dir_akara_run }}/logs/akara.pid"
    - name: get ec2 inventory script
      sudo: no
      get_url:
        url: https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.py
        dest: ~/code/ec2.py
        mode: 0755
    - name: get ec2 inventory ini
      sudo: no
      get_url:
        url: https://raw.githubusercontent.com/ansible/ansible/devel/plugins/inventory/ec2.ini
        dest: ~/code/ec2.ini
        mode: 0644

Add worker code then stop worker & akara
Add worker code then stop worker & akara
