yoho.reload-cobar.yml 509 Bytes
---
- hosts: cobar-server
  remote_user: master
  tasks:
    - name: --COBAR-- Checking cobar status
      command: /home/master/cobar-server/bin/switch.sh status
      register: cobar_status
      failed_when: cobar_status.rc != 0
      changed_when: False

    - name: --COBAR-- Reloading cobar
      command: /usr/bin/mysql -h localhost -uyh_vpc_bak -p"{{ passwd }}" -P 9066 -e "reload @@config"
      register: cobar_reload
      failed_when: cobar_reload.rc != 0
      changed_when: cobar_reload.rc == 0