---
# for Bezeq's type cluster
- hosts: etisalatservers
  vars_files:
    - ../config.yml
    - ../include/axxon_vars.yml

  tasks:
    - name: stop axxon-next-raft
      service:
        name: axxon-next-raft.service
        state: stopped
      become: true
  
    - name: remove configurator
      file:
         path: '{{ axxon_webclient_dir }}/0/configurator/'
         state: absent

    - name: copy new zip configurator
      copy:
        src: '../files/configurator.zip'
        dest: '{{ axxon_webclient_dir }}/0/configurator.zip'
        owner: root
        group: root
        mode: 0644

    - name: unarchive configurator.zip
      unarchive:
        src: '{{ axxon_webclient_dir }}/0/configurator.zip'
        dest: '{{ axxon_webclient_dir }}/0'
        remote_src: yes

    - name: Rename folder
      command: mv '{{ axxon_webclient_dir }}/0/build' '{{ axxon_webclient_dir }}/0/configurator'

    - name: remove configurator.zip
      file:
         path: '{{ axxon_webclient_dir }}/0/configurator.zip'
         state: absent

    - name: start axxon-next-raft
      service:
        name: axxon-next-raft.service
        state: started
      become: true

# vim:expandtab:ts=2:sw=2:syntax=yaml:tw=0
