From a0db0772811d73ee30d2d70ea082effb07dba808 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 29 May 2021 08:59:03 +0200 Subject: [PATCH] updated salt_minion state --- states/salt_minion/config.sls | 10 ++++++++++ states/salt_minion/init.sls | 26 +++----------------------- states/salt_minion/service.sls | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 23 deletions(-) create mode 100644 states/salt_minion/config.sls create mode 100644 states/salt_minion/service.sls diff --git a/states/salt_minion/config.sls b/states/salt_minion/config.sls new file mode 100644 index 0000000..2904b65 --- /dev/null +++ b/states/salt_minion/config.sls @@ -0,0 +1,10 @@ +--- +{%- from "salt_minion/map.jinja" import salt_minion with context %} +salt-minion-config: + file.managed: + - name: /etc/salt/minion + - source: salt://salt_minion/minion.j2 + - template: jinja + - user: root + - group: root + - mode: 640 diff --git a/states/salt_minion/init.sls b/states/salt_minion/init.sls index 6a977b2..30a8dca 100644 --- a/states/salt_minion/init.sls +++ b/states/salt_minion/init.sls @@ -1,24 +1,4 @@ --- -{%- from "salt_minion/map.jinja" import salt_minion with context %} -salt-minion-config: - file.managed: - - name: /etc/salt/minion - - source: salt://salt_minion/minion.j2 - - template: jinja - - user: root - - group: root - - mode: 640 - -salt-minion-service-file: - file.managed: - - name: /etc/systemd/system/salt-minion.service - - source: salt://salt_minion/salt-minion.service.j2 - - template: jinja - - user: root - - group: root - - mode: 644 - -salt-minion-service: - service.running: - - name: salt-minion - - enable: True +include: + - .config + - .service diff --git a/states/salt_minion/service.sls b/states/salt_minion/service.sls new file mode 100644 index 0000000..0b3a9e6 --- /dev/null +++ b/states/salt_minion/service.sls @@ -0,0 +1,15 @@ +--- +{%- from "salt_minion/map.jinja" import salt_minion with context %} +salt-minion-service-file: + file.managed: + - name: /etc/systemd/system/salt-minion.service + - source: salt://salt_minion/salt-minion.service.j2 + - template: jinja + - user: root + - group: root + - mode: 644 + +salt-minion-service: + service.running: + - name: salt-minion + - enable: True