Merge pull request #2 from LotharKAtt/master
fix if syntax
diff --git a/etcd/files/default b/etcd/files/default
index a946dcc..24da944 100644
--- a/etcd/files/default
+++ b/etcd/files/default
@@ -2,7 +2,7 @@
## etcd(1) daemon options
## See "/usr/share/doc/etcd/Documentation/configuration.md.gz".
-{%- if {{ server.get('proxy', 'false') }} %}
+{%- if server.get('proxy', 'false') %}
### Proxy Flags
@@ -268,3 +268,4 @@
#### Daemon parameters:
# DAEMON_ARGS=""
+{% endif %}
\ No newline at end of file
diff --git a/etcd/map.jinja b/etcd/map.jinja
index 68ff80e..f30c428 100644
--- a/etcd/map.jinja
+++ b/etcd/map.jinja
@@ -1,10 +1,11 @@
-{% set etcd = salt['grains.filter_by']({
+{% set server = salt['grains.filter_by']({
'Debian': {
'pkgs': ['etcd', 'python-etcd'],
- 'services': ['etcd']
+ 'services': ['etcd'],
+ 'config': '/etc/files/default'
},
'RedHat': {
'pkgs': [],
'services': []
},
-}, merge=salt['pillar.get']('etcd')) %}
+}, merge=salt['pillar.get']('server')) %}
diff --git a/etcd/server.sls b/etcd/server.sls
index ec8c077..4b35841 100644
--- a/etcd/server.sls
+++ b/etcd/server.sls
@@ -30,19 +30,20 @@
{%- else %}
-/etc/default/etcd:
+etcd_config:
file.managed:
+ - name: {{ server.config }}
- source: salt://etcd/files/default
- template: jinja
- require:
- pkg: etcd_packages
-etcd_service:
+etcd:
service.running:
- - name: etcd
- enable: True
+ - name: {{ server.services }}
- watch:
- - file: /etc/default/etcd
+ - file: etcd_config
{%- endif %}