Manage Salt roleproxy
All checks were successful
ci/lysergic/push/pipeline Pipeline was successful

Add role, profile and pillar for roleproxy.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-01-30 00:39:33 +01:00
parent 81a37bf842
commit 83f698e18c
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57
3 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,12 @@
salt:
roleproxy:
nb_host: ${'secret_salt:roleproxy:nb_host'}
nb_token: ${'secret_salt:roleproxy:nb_token'}
firewalld:
zones:
internal:
ports:
- comment: salt-roleproxy
port: 4580
protocol: tcp

View File

@ -0,0 +1,34 @@
{%- set roleproxy_pillar = pillar['salt']['roleproxy'] -%}
salt_roleproxy_packages:
pkg.installed:
- names:
- salt-netbox-roleproxy
- watch_in:
- service: salt_roleproxy_service
salt_roleproxy_sysconfig:
file.keyvalue:
- name: /etc/sysconfig/roleproxy
- separator: '='
- show_changes: False
- key_values:
NB_HOST: {{ roleproxy_pillar['nb_host'] }}
NB_TOKEN: {{ roleproxy_pillar['nb_token'] }}
- require:
- pkg: salt_roleproxy_packages
- watch_in:
- service: salt_roleproxy_service
salt_roleproxy_service_enable:
service.enabled:
- name: roleproxy
- require:
- pkg: salt_roleproxy_packages
salt_roleproxy_service:
service.running:
- name: roleproxy
- watch:
- pkg: salt_roleproxy_packages
- file: salt_roleproxy_sysconfig

View File

@ -0,0 +1,2 @@
include:
- profile.salt.roleproxy