diff --git a/main.yml b/main.yml index be7ae57fa4..655a114100 100644 --- a/main.yml +++ b/main.yml @@ -33,6 +33,7 @@ - import_playbook: /srv/web/infra/ansible/playbooks/groups/koji-hub.yml - import_playbook: /srv/web/infra/ansible/playbooks/groups/kojipkgs.yml - import_playbook: /srv/web/infra/ansible/playbooks/groups/logserver.yml +- import_playbook: /srv/web/infra/ansible/playbooks/groups/logdetective.yml - import_playbook: /srv/web/infra/ansible/playbooks/groups/mailman.yml - import_playbook: /srv/web/infra/ansible/playbooks/groups/maintainer-test.yml - import_playbook: /srv/web/infra/ansible/playbooks/groups/mariadb-server.yml diff --git a/playbooks/groups/logdetective.yml b/playbooks/groups/logdetective.yml index 30245f8d0c..2e05acd22d 100644 --- a/playbooks/groups/logdetective.yml +++ b/playbooks/groups/logdetective.yml @@ -38,5 +38,6 @@ # Roles are run first, before tasks, regardless of where you place them here. roles: - base + - nvidia-cdi - logdetective - nagios_client diff --git a/roles/logdetective/files/logdetective.service b/roles/logdetective/files/logdetective.service new file mode 100644 index 0000000000..2950d33a27 --- /dev/null +++ b/roles/logdetective/files/logdetective.service @@ -0,0 +1,15 @@ +[Unit] +Description=LogDetective compose stack +After=network-online.target nvidia-cdi-generate.service +Wants=network-online.target nvidia-cdi-generate.service + +[Service] +Type=simple +WorkingDirectory=/root/logdetective +ExecStart=/usr/bin/podman-compose -f /root/logdetective/docker-compose-prod.yaml up --abort-on-container-failure +ExecStopPost=/usr/bin/podman-compose -f /root/logdetective/docker-compose-prod.yaml down +Restart=on-failure +RestartSec=20 + +[Install] +WantedBy=multi-user.target diff --git a/roles/logdetective/handlers/main.yml b/roles/logdetective/handlers/main.yml new file mode 100644 index 0000000000..c28484f735 --- /dev/null +++ b/roles/logdetective/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: Reload systemd + ansible.builtin.systemd: + daemon_reload: true diff --git a/roles/logdetective/tasks/main.yml b/roles/logdetective/tasks/main.yml index b3f6a414d5..973d648c1d 100644 --- a/roles/logdetective/tasks/main.yml +++ b/roles/logdetective/tasks/main.yml @@ -144,3 +144,22 @@ with_items: - http - https + +- name: Install logdetective systemd service + ansible.builtin.copy: + src: logdetective.service + dest: /etc/systemd/system/logdetective.service + owner: root + group: root + mode: "0644" + notify: + - Reload systemd + tags: + - config + +- name: Enable and start logdetective service + ansible.builtin.systemd: + name: logdetective.service + enabled: true + state: started + daemon_reload: true