diff --git a/roles/gotify/tasks/main.yml b/roles/gotify/tasks/main.yml new file mode 100644 index 0000000..0b6ac6e --- /dev/null +++ b/roles/gotify/tasks/main.yml @@ -0,0 +1,50 @@ +--- + - name: Mise a jour apt cache + apt: + update_cache: yes + + - name: Creation /etc/gotify + ansible.builtin.file: + path: /etc/gotify + state: directory + mode: '0755' + + - name: Creation /opt/gotify + ansible.builtin.file: + path: /opt/gotify + state: directory + mode: '0755' + + - name: installation de gotify + get_url: + url: "https://github.com/gotify/server/releases/latest/download/gotify-linux-amd64.zip" + dest: "/tmp/gotify.zip" + + - name: Extraction de Gotify + ansible.builtin.unarchive: + src: "/tmp/gotify.zip" + dest: "/opt/gotify" + become: yes + + - name: Creation du fichier systemd + template: + src: "gotify.service.j2" + dest: "/etc/systemd/system/gotify.service" + become: yes + + - name: Reload systemd + systemd: + daemon_reload: yes + + - name: Creation du fichier conf gotify + template: + src: "config.yml.j2" + dest: "/etc/gotify/config.yml" + become: yes + + - name: Demarage du gotify + systemd: + name: gotify + state: started + enabled: yes + diff --git a/roles/gotify/templates/config.yml.j2 b/roles/gotify/templates/config.yml.j2 new file mode 100644 index 0000000..9e8452a --- /dev/null +++ b/roles/gotify/templates/config.yml.j2 @@ -0,0 +1,4 @@ +server: + keepaliveperiodseconds: 0 + listenaddr: "" # the address to bind on, leave empty to bind on all addresses + port: 8008 diff --git a/roles/gotify/templates/gotify.service.j2 b/roles/gotify/templates/gotify.service.j2 new file mode 100644 index 0000000..55db0d6 --- /dev/null +++ b/roles/gotify/templates/gotify.service.j2 @@ -0,0 +1,13 @@ +[Unit] +Description=Gotify Server +After=network.target + +[Service] +Type=simple +User=root +ExecStart=/opt/gotify/gotify-linux-amd64 +Restart=on-failure + +[Install] +WantedBy=multi-user.target + diff --git a/s-backup.yml b/s-backup.yml index e68ec35..772ccda 100644 --- a/s-backup.yml +++ b/s-backup.yml @@ -7,6 +7,7 @@ - goss # - proxy3 - zabbix-cli + - gotify # - ssh-cli # - syslog-cli - smb-backup