Compare commits

...

4 Commits

Author SHA1 Message Date
root
1c1993021b ajout du role gotify 2024-01-20 20:22:03 +01:00
root
b146170467 maj docker 2024-01-20 17:11:15 +01:00
root
df9d3c6c1c maj goss s-nxc 2024-01-20 17:02:33 +01:00
root
d75f4ffb3f zabbix ajout auto 2024-01-20 17:19:38 +01:00
10 changed files with 135 additions and 42 deletions

View File

@@ -2,121 +2,139 @@ file:
/root/nxc:
exists: true
mode: "0755"
size: 4096
owner: root
group: root
#size: 4096
#owner: root
#group: root
filetype: directory
contains: []
/root/nxc/certs:
exists: true
mode: "0755"
size: 4096
owner: root
group: root
#size: 4096
#owner: root
#group: root
filetype: directory
contains: []
/root/nxc/config:
exists: true
mode: "0755"
size: 4096
owner: root
group: root
#size: 4096
#owner: root
#group: root
filetype: directory
contains: []
/root/nxc/config/dynamic.yml:
exists: true
mode: "0644"
size: 415
owner: root
group: root
#size: 415
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/config/static.yml:
exists: true
mode: "0644"
size: 452
owner: root
group: root
#size: 452
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/docker-compose.yml:
exists: true
mode: "0644"
size: 2135
owner: root
group: root
#size: 2135
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/nxc-debug.sh:
exists: true
mode: "0755"
size: 64
owner: root
group: root
#size: 64
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/nxc-prune.sh:
exists: true
mode: "0755"
size: 110
owner: root
group: root
#size: 110
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/nxc-start.sh:
exists: true
mode: "0755"
size: 34
owner: root
group: root
#size: 34
#owner: root
#group: root
filetype: file
contains: []
/root/nxc/nxc-stop.sh:
exists: true
mode: "0755"
size: 32
owner: root
group: root
#size: 32
#owner: root
#group: root
filetype: file
contains: []
/usr/local/bin/mkcert:
exists: true
mode: "0755"
size: 4788866
owner: root
group: root
#size: 4788866
#owner: root
#group: root
filetype: file
contains: []
addr:
tcp://s-nxc.gsb.lan:8081:
tcp://s-nxc.gsb.lan:443:
reachable: true
timeout: 500
port:
tcp:22:
listening: true
ip:
- 0.0.0.0
tcp:80:
listening: true
ip: []
tcp:443:
listening: true
ip: []
tcp:8081:
listening: true
ip:
- 0.0.0.0
#tcp:8081:
#listening: true
#ip:
#- 0.0.0.0
interface:
enp0s3:
exists: true
addrs:
- 192.168.99.7/24
mtu: 1500
enp0s8:
exists: true
addrs:
- 172.16.0.7/24
mtu: 1500
http:
https://s-nxc.gsb.lan:
status: 200

Binary file not shown.

View File

@@ -7,7 +7,7 @@
- name: on verifie si docker est installe
stat:
path: /usr/bin/docker
# command: which docker
#command: which docker
register: docker_present
- name: Execution du script getdocker si docker n'est pas deja installe

View File

@@ -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

View File

@@ -0,0 +1,4 @@
server:
keepaliveperiodseconds: 0
listenaddr: "" # the address to bind on, leave empty to bind on all addresses
port: 8008

View File

@@ -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

View File

@@ -1,2 +1,3 @@
SERVER: "127.0.0.1"
SERVERACTIVE: "172.16.0.8"
SERVERACTIVE: "192.168.99.8"
TOKENAPI: "f72473b7e5402a5247773e456f3709dcdd5e41792360108fc3451bbfeed8eafe"

View File

@@ -28,6 +28,11 @@
state: restarted
enabled: yes
#- name: remonter les machines
#command: curl -X POST -H "Content-Type: application/json" -d '{ "jsonrpc":"2.0","method":"host.create","params": {"host": "s-itil","groups": [{"groupid": "6"}],"templates": [{"templateid": "10343"}],"inventory_mode": 0,"inventory": {"type": 0}},"auth": "a44e2a4977d61a869437739cb6086ae42f4b9937fbb96aed24bbad028469a1cf","id": 1}' http://192.168.99.8/zabbix/api_jsonrpc.php
- name: mise ne place script hostcreate
template:
src: hostcreate.sh.j2
dest: /tmp/hostcreate.sh
- name: lancement script hostcreate
command: bash /tmp/hostcreate.sh

View File

@@ -0,0 +1 @@
curl -X POST -H "Content-Type: application/json" -d '{ "jsonrpc":"2.0","method":"host.create","params": {"host": "{{ ansible_hostname }}","groups": [{"groupid": "6"}],"templates": [{"templateid": "10343"}],"inventory_mode": 0,"inventory": {"type": 0}},"auth": "{{ TOKENAPI }}","id": 1}' http://{{ SERVERACTIVE }}/zabbix/api_jsonrpc.php

View File

@@ -7,6 +7,7 @@
- goss
# - proxy3
- zabbix-cli
- gotify
# - ssh-cli
# - syslog-cli
- smb-backup