Browse Source

initial import of nprobe satellite role

main
Felix Kronlage-Dammers 6 months ago
commit
c60c9ed7a7
  1. 4
      defaults/main.yml
  2. 25
      tasks/linux.yml
  3. 6
      tasks/main.yml
  4. 15
      templates/nprobe_probe.service.j2
  5. 4
      vars/main.yml

4
defaults/main.yml

@ -0,0 +1,4 @@
---
head_node: "nprobe-head.example.com"
debug: false

25
tasks/linux.yml

@ -0,0 +1,25 @@
---
- name: Create opt directory
become: true
file:
path: /opt/nprobe/sbin
state: directory
mode: 0755
- name: Download nprobe
get_url:
url: "{{ nprobe_linux }}"
dest: /opt/nprobe/sbin/nprobe
checksum: "{{ nprobe_linux_sha256 }}"
mode: 0755
- name: Create systemd unit
template:
src: templates/nprobe_probe.service.j2
dest: /etc/systemd/system/nprobe_probe.service
- name: Start probe
systemd:
name: nprobe_probe
state: started

6
tasks/main.yml

@ -0,0 +1,6 @@
---
- name: Install nprobe on linux
include_tasks: linux.yml
when: ansible_os_family == "RedHat" or
ansible_os_family == "Debian"

15
templates/nprobe_probe.service.j2

@ -0,0 +1,15 @@
[Unit]
Description=nprobe probe service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
Environment="NPROBE_SECRET={{ nprobe_secret }}"
ExecStart=/opt/nprobe/sbin/nprobe --head {{ head_node }} --name {{ probe_name }} --privileged{% if defined nprobe_debug and nprobe_debug sameas true %} --debug{% endif %}
[Install]
WantedBy=multi-user.target

4
vars/main.yml

@ -0,0 +1,4 @@
---
nprobe_linux: "https://g.hazardous.org/attachments/444721bd-1da6-4eee-95e7-631ddff882f8"
nprobe_linux_sha256: "sha256:05c9b83faa3244414010a48c753422088ac92277edbaf2e7113a24652ff5100f"
Loading…
Cancel
Save