---
- name: pip install swifttool
  pip: name="/opt/stack/{{ swift.swifttool_dir  }}" extra_args='-i https://pypi.python.org/simple/'
  register: result
  until: result|success
  retries: 3
  delay: 10
  notify:
    - update ca-certs

- name: update ca-certs
  command: update-ca-certificates

- name: restart rsync
  service: name=rsync state=restarted

- name: restart rsyslog
  service: name=rsyslog state=restarted

- name: restart swift services
  service: name={{ item }} state=restarted must_exist=false
  when: restart|default('True')
  with_items:
    - swift-container
    - swift-container-auditor
    - swift-container-updater
    - swift-container-replicator
    - swift-account
    - swift-account-auditor
    - swift-account-reaper
    - swift-account-replicator
    - swift-proxy
    - swift-object
    - swift-object-expirer
    - swift-object-auditor
    - swift-object-replicator
    - swift-object-updater

---
- name: pip install swifttool
  pip: name="/opt/stack/{{ swift.swifttool_dir  }}" extra_args='-i https://pypi.python.org/simple/'
  register: result
  until: result|success
  retries: 3
  delay: 10
  notify:
    - update ca-certs

- name: update ca-certs
  command: update-ca-certificates

# Restarting rsync failing with pid file exists error
# Adding retry logic to workaround
- name: restart rsync
  service: name=rsync state=restarted
  register: result
  until: result|success
  retries: 3
  delay: 10

- name: restart rsyslog
  service: name=rsyslog state=restarted

- name: restart swift services
  service: name={{ item }} state=restarted must_exist=false
  when: restart|default('True')
  with_items:
    - swift-container
    - swift-container-auditor
    - swift-container-updater
    - swift-container-replicator
    - swift-account
    - swift-account-auditor
    - swift-account-reaper
    - swift-account-replicator
    - swift-proxy
    - swift-object
    - swift-object-expirer
    - swift-object-auditor
    - swift-object-replicator
    - swift-object-updater

Add retry logic to rsync restart
Add retry logic to rsync restart
