From 3140afbb50686c760b76d2e4c55ffde9a740a1d1 Mon Sep 17 00:00:00 2001 From: Tadej Humar Date: Wed, 20 Dec 2023 11:11:26 +0100 Subject: [PATCH] New modular ansibles --- operation-tools/Readme.md | 2 +- operation-tools/restart-all.yml | 3 ++ .../{restart.yml => restart-api.yml} | 6 +--- operation-tools/restart-retrieval.yml | 3 ++ operation-tools/start-all.yml | 5 ++++ operation-tools/start-db.yml | 19 ++++++++++++ operation-tools/start-retrieval.yml | 14 +++++++++ operation-tools/start.yml | 29 ------------------- operation-tools/stop-all.yml | 3 ++ operation-tools/{stop.yml => stop-db.yml} | 10 ------- operation-tools/stop-retrieval.yml | 14 +++++++++ 11 files changed, 63 insertions(+), 45 deletions(-) create mode 100644 operation-tools/restart-all.yml rename operation-tools/{restart.yml => restart-api.yml} (79%) create mode 100644 operation-tools/restart-retrieval.yml create mode 100644 operation-tools/start-all.yml create mode 100644 operation-tools/start-db.yml create mode 100644 operation-tools/start-retrieval.yml delete mode 100644 operation-tools/start.yml create mode 100644 operation-tools/stop-all.yml rename operation-tools/{stop.yml => stop-db.yml} (72%) create mode 100644 operation-tools/stop-retrieval.yml diff --git a/operation-tools/Readme.md b/operation-tools/Readme.md index 94497c3..1e8551f 100644 --- a/operation-tools/Readme.md +++ b/operation-tools/Readme.md @@ -123,7 +123,7 @@ git pull - call the restart script ```bash -ansible-playbook restart.yml +ansible-playbook restart-all.yml ``` - After waiting ~5min restart the recording again: diff --git a/operation-tools/restart-all.yml b/operation-tools/restart-all.yml new file mode 100644 index 0000000..4f85922 --- /dev/null +++ b/operation-tools/restart-all.yml @@ -0,0 +1,3 @@ + +- import_playbook: stop-all.yml +- import_playbook: start-all.yml \ No newline at end of file diff --git a/operation-tools/restart.yml b/operation-tools/restart-api.yml similarity index 79% rename from operation-tools/restart.yml rename to operation-tools/restart-api.yml index a2605d9..8efa290 100644 --- a/operation-tools/restart.yml +++ b/operation-tools/restart-api.yml @@ -1,8 +1,4 @@ -- import_playbook: stop.yml -- import_playbook: start.yml - - - name: restart data api hosts: sf_data_api_databuffer become: true @@ -20,4 +16,4 @@ - name: restart dispatcher-api-databuffer systemd: state: restarted - name: dispatcher-api-databuffer \ No newline at end of file + name: dispatcher-api-databuffer diff --git a/operation-tools/restart-retrieval.yml b/operation-tools/restart-retrieval.yml new file mode 100644 index 0000000..695a41e --- /dev/null +++ b/operation-tools/restart-retrieval.yml @@ -0,0 +1,3 @@ +- import_playbook: stop-retrieval.yml +- import_playbook: start-retrieval.yml +- import_playbook: restart-api.yml \ No newline at end of file diff --git a/operation-tools/start-all.yml b/operation-tools/start-all.yml new file mode 100644 index 0000000..f38d34f --- /dev/null +++ b/operation-tools/start-all.yml @@ -0,0 +1,5 @@ + +- import_playbook: start-db.yml +- import_playbook: start-retrieval.yml +- import_playbook: restart-api.yml + diff --git a/operation-tools/start-db.yml b/operation-tools/start-db.yml new file mode 100644 index 0000000..e03e495 --- /dev/null +++ b/operation-tools/start-db.yml @@ -0,0 +1,19 @@ + +- name: Start nodes + hosts: databuffer + become: true + tasks: + + - name: start daq-dispatcher-node + systemd: + state: started + name: daq-dispatcher-node + + - name: sleep for 60 seconds and continue with play + wait_for: + timeout: 60 + + - name: start daq-query-node + systemd: + state: started + name: daq-query-node \ No newline at end of file diff --git a/operation-tools/start-retrieval.yml b/operation-tools/start-retrieval.yml new file mode 100644 index 0000000..4826968 --- /dev/null +++ b/operation-tools/start-retrieval.yml @@ -0,0 +1,14 @@ + +- name: Start all retrieval + hosts: databuffer + become: true + tasks: + - name: start java retrieval + systemd: + state: started + name: retrieval + + - name: start retrieval + systemd: + state: started + name: retrieval-00 \ No newline at end of file diff --git a/operation-tools/start.yml b/operation-tools/start.yml deleted file mode 100644 index 8d23bca..0000000 --- a/operation-tools/start.yml +++ /dev/null @@ -1,29 +0,0 @@ -- name: Start nodes - hosts: databuffer - become: true - tasks: - - - name: start daq-dispatcher-node - systemd: - state: started - name: daq-dispatcher-node - - - name: sleep for 30 seconds and continue with play - wait_for: - timeout: 30 - - - name: start daq-query-node - systemd: - state: started - name: daq-query-node - - - name: start java retrieval - systemd: - state: started - name: retrieval - - - name: start retrieval - systemd: - state: started - name: retrieval-00 - diff --git a/operation-tools/stop-all.yml b/operation-tools/stop-all.yml new file mode 100644 index 0000000..0a37542 --- /dev/null +++ b/operation-tools/stop-all.yml @@ -0,0 +1,3 @@ + +- import_playbook: stop-retrieval.yml +- import_playbook: stop-db.yml diff --git a/operation-tools/stop.yml b/operation-tools/stop-db.yml similarity index 72% rename from operation-tools/stop.yml rename to operation-tools/stop-db.yml index dc31b01..97cd6e0 100644 --- a/operation-tools/stop.yml +++ b/operation-tools/stop-db.yml @@ -3,16 +3,6 @@ become: true tasks: - - name: stop retrieval - systemd: - state: stopped - name: retrieval-00 - - - name: stop java retrieval - systemd: - state: stopped - name: retrieval - - name: stop daq-dispatcher-node systemd: state: stopped diff --git a/operation-tools/stop-retrieval.yml b/operation-tools/stop-retrieval.yml new file mode 100644 index 0000000..721be99 --- /dev/null +++ b/operation-tools/stop-retrieval.yml @@ -0,0 +1,14 @@ + +- name: Stop all retrieval + hosts: databuffer + become: true + tasks: + - name: stop retrieval + systemd: + state: stopped + name: retrieval-00 + + - name: stop java retrieval + systemd: + state: stopped + name: retrieval \ No newline at end of file