From 993a54d0b07dc1b6ff68d5ad3f38b4d492f0943a Mon Sep 17 00:00:00 2001 From: Liberty Young Date: Wed, 26 Aug 2015 11:51:36 -0700 Subject: [PATCH] Managee /sumo/sumo.config for install. Renamed installer.sls to install.sls. --- pillar.example | 5 +++++ sumologic/defaults.json | 7 +++++++ sumologic/files/sumo.config | 5 +++++ sumologic/{installer.sls => install.sls} | 11 +++++++++++ 4 files changed, 28 insertions(+) create mode 100644 sumologic/defaults.json create mode 100644 sumologic/files/sumo.config rename sumologic/{installer.sls => install.sls} (72%) diff --git a/pillar.example b/pillar.example index e69de29..cd92b2e 100644 --- a/pillar.example +++ b/pillar.example @@ -0,0 +1,5 @@ +## https://service.sumologic.com/help/Using_sumo.conf.htm +# +sumologic_install: + accessid: 'access_id' + accesskey: 'accesskey' diff --git a/sumologic/defaults.json b/sumologic/defaults.json new file mode 100644 index 0000000..b5667c4 --- /dev/null +++ b/sumologic/defaults.json @@ -0,0 +1,7 @@ +{% load_json as rawmap %} +{ + "accessid": "access_id", + "accesskey": "access_key", + "sources": "/sumo/sumo.json" +} +{% endload %} diff --git a/sumologic/files/sumo.config b/sumologic/files/sumo.config new file mode 100644 index 0000000..b8076bd --- /dev/null +++ b/sumologic/files/sumo.config @@ -0,0 +1,5 @@ +{%- from "sumologic/defaults.json" import rawmap with context -%} +{%- set sumoconf = salt['pillar.get']('sumologic_install', rawmap, True) -%} +accessid={{ sumoconf.accessid }} +accesskey={{ sumoconf.accesskey }} +sources={{ sumoconf.sources}} diff --git a/sumologic/installer.sls b/sumologic/install.sls similarity index 72% rename from sumologic/installer.sls rename to sumologic/install.sls index 72aeec3..8250ded 100644 --- a/sumologic/installer.sls +++ b/sumologic/install.sls @@ -10,6 +10,16 @@ - group: root - mode: 555 +/sumo/sumo.config: + file.managed: + - user: root + - group: root + - mode: 400 + - template: jinja + - source: salt://sumologic/files/sumo.config + - requires: + - file: /sumo + sumologic_installer: file.managed: - name: /opt/sumo64.sh @@ -26,3 +36,4 @@ sumologic_installer: - requires: - file: /opt/sumo64.sh - file: /opt/SumoCollector + - file: /sumo/sumo.config