From fc3fc7a31afdbd8354195a0ff0654f65398c2817 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Tue, 30 Dec 2025 20:21:28 -0700 Subject: [PATCH] Fixed indentation of the Install AgentDVR tasks, and service start. Restart AgentDVR (and ~systemctl daemon-reload~) when the unit definition changes. --- README.org | 75 +++++++++++++++------------ roles_t/abbey-dvr/tasks/main.yml | 11 ++-- roles_t/abbey-front/handlers/main.yml | 8 +++ 3 files changed, 52 insertions(+), 42 deletions(-) diff --git a/README.org b/README.org index 577c2ca..752198e 100644 --- a/README.org +++ b/README.org @@ -2205,48 +2205,55 @@ by =install.sh=. #+CAPTION: [[file:roles_t/abbey-dvr/tasks/main.yml][=roles_t/abbey-dvr/tasks/main.yml=]] #+BEGIN_SRC conf :tangle roles_t/abbey-dvr/tasks/main.yml - - name: Install AgentDVR.service. - become: yes - copy: - content: | - [Unit] - Description=AgentDVR +- name: Install AgentDVR.service. + become: yes + copy: + content: | + [Unit] + Description=AgentDVR - [Service] - WorkingDirectory=/home/agentdvr/AgentDVR - ExecStart=/home/agentdvr/AgentDVR/Agent + [Service] + WorkingDirectory=/home/agentdvr/AgentDVR + ExecStart=/home/agentdvr/AgentDVR/Agent - # fix memory management issue with dotnet core - Environment="MALLOC_TRIM_THRESHOLD_=100000" + # fix memory management issue with dotnet core + Environment="MALLOC_TRIM_THRESHOLD_=100000" - # to query logs using journalctl, set a logical name here - SyslogIdentifier=AgentDVR + # to query logs using journalctl, set a logical name here + SyslogIdentifier=AgentDVR - User=agentdvr + User=agentdvr - # ensure the service automatically restarts - Restart=always - # amount of time to wait before restarting the service - RestartSec=5 + # ensure the service automatically restarts + Restart=always + # amount of time to wait before restarting the service + RestartSec=5 - [Install] - WantedBy=multi-user.target - dest: /etc/systemd/system/AgentDVR.service + [Install] + WantedBy=multi-user.target + dest: /etc/systemd/system/AgentDVR.service + notify: + - Reload systemd. + - Restart AgentDVR. - - name: Start AgentDVR.service. - become: yes - systemd: - service: AgentDVR - state: started - when: agentdvr.stat.exists - tags: actualizer +- name: Enable AgentDVR.service. + become: yes + systemd: + service: AgentDVR + enabled: yes + when: agentdvr.stat.exists +#+END_SRC - - name: Enable AgentDVR.service. - become: yes - systemd: - service: AgentDVR - enabled: yes - when: agentdvr.stat.exists +#+CAPTION: [[file:roles_t/abbey-front/handlers/main.yml][=roles_t/abbey-front/handlers/main.yml=]] +#+BEGIN_SRC conf :tangle roles_t/abbey-front/handlers/main.yml + +- name: Restart AgentDVR. + become: yes + systemd: + service: AgentDVR + state: restarted + when: agentdvr.stat.exists + tags: actualizer #+END_SRC ** Create AgentDVR Storage diff --git a/roles_t/abbey-dvr/tasks/main.yml b/roles_t/abbey-dvr/tasks/main.yml index b7736c9..bebce06 100644 --- a/roles_t/abbey-dvr/tasks/main.yml +++ b/roles_t/abbey-dvr/tasks/main.yml @@ -60,14 +60,9 @@ [Install] WantedBy=multi-user.target dest: /etc/systemd/system/AgentDVR.service - -- name: Start AgentDVR.service. - become: yes - systemd: - service: AgentDVR - state: started - when: agentdvr.stat.exists - tags: actualizer + notify: + - Reload systemd. + - Restart AgentDVR. - name: Enable AgentDVR.service. become: yes diff --git a/roles_t/abbey-front/handlers/main.yml b/roles_t/abbey-front/handlers/main.yml index de939e3..7415a0f 100644 --- a/roles_t/abbey-front/handlers/main.yml +++ b/roles_t/abbey-front/handlers/main.yml @@ -26,3 +26,11 @@ - name: Import root@core's public key. become: yes command: gpg --import ~/.gnupg-root-pub.pem + +- name: Restart AgentDVR. + become: yes + systemd: + service: AgentDVR + state: restarted + when: agentdvr.stat.exists + tags: actualizer -- 2.47.3