diff --git a/ansible/restart-master-ioc.yml b/ansible/restart-master-ioc.yml new file mode 100644 index 0000000..e4f50ea --- /dev/null +++ b/ansible/restart-master-ioc.yml @@ -0,0 +1,44 @@ +- name: Restart Master IOC + # TODO: dev/prod + hosts: sls-lc + gather_facts: false + + #TODO: docs? + # For the git clone and git push commands to work smoothly inside this playbook, + # ensure your shell environment is passing your SSH key. Run ssh-add -l on your + # terminal before firing up ansible-playbook. + + # TODO + # If the machine executing this playbook doesn't have a global Git user configured, + # the git commit task will fail. You can explicitly bypass this by adding environment + # variables directly to the commit task if needed: + # environment: + # GIT_COMMITTER_NAME: "Ansible Provisioner" + # GIT_COMMITTER_EMAIL: "your-email@psi.ch" + # GIT_AUTHOR_NAME: "Ansible Provisioner" + # GIT_AUTHOR_EMAIL: "your-email@psi.ch" + + vars: + - workspace_dir: "/tmp/hla_framework_bd" + + tasks: + - name: Clone this repository + ansible.builtin.git: + repo: "git@gitea.psi.ch:sls/hla_framework_bd.git" + dest: "{{ workspace_dir }}" + version: main + accept_hostkey: true + + - name: Reinstall MASTER IOC + ansible.builtin.shell: + # TODO: prod/dev + cmd: "ioc install -V --facility sls --ioc AGEBD-CPCL-MASTER-DEV --clean" + chdir: "{{ workspace_dir }}/services/000-master/ioc" + changed_when: true + + - name: Restart MASTER IOC + ansible.builtin.shell: + # TODO: prod/dev + cmd: "ioc restart AGEBD-CPCL-MASTER-DEV" + chdir: "{{ workspace_dir }}/services/000-master/ioc" + changed_when: true \ No newline at end of file