summaryrefslogtreecommitdiffstats
path: root/salt/profile
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-01-30 00:39:33 +0100
committerGeorg Pfuetzenreuter2023-01-30 00:39:33 +0100
commit83f698e18c3401212ba88527319c4de63ad13ec1 (patch)
tree2a3925aba93952d00a5f51d3676664633fa89841 /salt/profile
parent81a37bf842f7b4285094cf7fa9c1eaeddf9ed652 (diff)
downloadsalt-83f698e18c3401212ba88527319c4de63ad13ec1.tar.gz
salt-83f698e18c3401212ba88527319c4de63ad13ec1.tar.bz2
salt-83f698e18c3401212ba88527319c4de63ad13ec1.zip
Manage Salt roleproxy
Add role, profile and pillar for roleproxy. Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'salt/profile')
-rw-r--r--salt/profile/salt/roleproxy.sls34
1 files changed, 34 insertions, 0 deletions
diff --git a/salt/profile/salt/roleproxy.sls b/salt/profile/salt/roleproxy.sls
new file mode 100644
index 0000000..a7393f7
--- /dev/null
+++ b/salt/profile/salt/roleproxy.sls
@@ -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