mirror of
https://github.com/telekom-security/tpotce.git
synced 2025-04-20 06:02:24 +00:00
add tpot.service
This commit is contained in:
parent
234fb16394
commit
abe03436d4
2 changed files with 56 additions and 0 deletions
17
installer/install/tpot.service
Normal file
17
installer/install/tpot.service
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[Unit]
|
||||||
|
Description=T-Pot
|
||||||
|
Wants=docker.service network-online.target
|
||||||
|
After=docker.service network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
Type=simple
|
||||||
|
TimeoutSec=infinity
|
||||||
|
ExecStartPre=-/usr/bin/docker compose -f /home/{{ ansible_user_id }}/tpotce/docker-compose.yml down -v
|
||||||
|
ExecStart=/usr/bin/docker compose -f /home/{{ ansible_user_id }}/tpotce/docker-compose.yml up
|
||||||
|
ExecStop=/usr/bin/docker compose -f /home/{{ ansible_user_id }}/tpotce/docker-compose.yml down -v
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -672,3 +672,42 @@
|
||||||
msg: "Detected user: '{{ ansible_user_id }}'"
|
msg: "Detected user: '{{ ansible_user_id }}'"
|
||||||
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
|
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
|
||||||
failed_when: ansible_user_id == "root"
|
failed_when: ansible_user_id == "root"
|
||||||
|
|
||||||
|
###########################
|
||||||
|
# T-Pot - Install service #
|
||||||
|
###########################
|
||||||
|
|
||||||
|
- name: T-Pot - Install service
|
||||||
|
hosts: all
|
||||||
|
gather_facts: true
|
||||||
|
become: false
|
||||||
|
tags:
|
||||||
|
- "AlmaLinux"
|
||||||
|
- "Debian"
|
||||||
|
- "Fedora"
|
||||||
|
- "openSUSE Tumbleweed"
|
||||||
|
- "Raspbian"
|
||||||
|
- "Rocky"
|
||||||
|
- "Ubuntu"
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Install systemd service (All)
|
||||||
|
become: true
|
||||||
|
ansible.builtin.template:
|
||||||
|
src: '/home/{{ ansible_user_id }}/tpotce/installer/install/tpot.service'
|
||||||
|
dest: '/etc/systemd/system/tpot.service'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: '0755'
|
||||||
|
notify: Reload systemd and enable service
|
||||||
|
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Reload systemd and enable service
|
||||||
|
become: true
|
||||||
|
ansible.builtin.systemd:
|
||||||
|
name: tpot.service
|
||||||
|
daemon_reload: yes
|
||||||
|
state: stopped
|
||||||
|
enabled: yes
|
||||||
|
when: ansible_distribution in ["AlmaLinux", "Debian", "Fedora", "openSUSE Tumbleweed", "Raspbian", "Rocky", "Ubuntu"]
|
||||||
|
|
Loading…
Reference in a new issue