fix map_jinja/metadata
diff --git a/etcd/files/default b/etcd/files/default
index 24da944..3224dff 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.proxy is defined %}
### Proxy Flags
@@ -93,7 +93,7 @@
## invalid example: "http://example.com:2380" (domain name is invalid for binding)
## default: "http://localhost:2380,http://localhost:7001"
# ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001"
-ETCD_LISTEN_PEER_URLS="http://{{ server.host }}:2380"
+ETCD_LISTEN_PEER_URLS="http://{{ server.bind.host }}:2380"
##### -listen-client-urls
## List of URLs to listen on for client traffic. This flag tells the etcd to accept
diff --git a/etcd/map.jinja b/etcd/map.jinja
index f30c428..cd2aa98 100644
--- a/etcd/map.jinja
+++ b/etcd/map.jinja
@@ -1,11 +1,10 @@
{% set server = salt['grains.filter_by']({
'Debian': {
'pkgs': ['etcd', 'python-etcd'],
- 'services': ['etcd'],
- 'config': '/etc/files/default'
+ 'services': ['etcd']
},
'RedHat': {
'pkgs': [],
'services': []
},
-}, merge=salt['pillar.get']('server')) %}
+}, merge=salt['pillar.get']('etcd:server')) %}
diff --git a/etcd/server.sls b/etcd/server.sls
index 4b35841..2f0ddf4 100644
--- a/etcd/server.sls
+++ b/etcd/server.sls
@@ -4,6 +4,10 @@
etcd_packages:
pkg.installed:
- names: {{ server.pkgs }}
+{%- if server.get('engine', 'systemd') %}
+ - require:
+ - file: /etc/default/etcd
+{%- endif %}
{%- if server.get('engine', 'systemd') == 'kubernetes' %}
@@ -30,20 +34,17 @@
{%- else %}
-etcd_config:
+/etc/default/etcd:
file.managed:
- - name: {{ server.config }}
- source: salt://etcd/files/default
- template: jinja
- - require:
- - pkg: etcd_packages
etcd:
service.running:
- enable: True
- name: {{ server.services }}
- watch:
- - file: etcd_config
+ - file: /etc/default/etcd
{%- endif %}
diff --git a/metadata/service/server/cluster.yml b/metadata/service/server/cluster.yml
index c42e8eb..e688599 100644
--- a/metadata/service/server/cluster.yml
+++ b/metadata/service/server/cluster.yml
@@ -7,7 +7,7 @@
server:
enabled: true
bind:
- host: ${_param:host_address}
+ host: ${_param:cluster_local_address}
token: ${_param:etcd_initial_token}
members:
- host: ${_param:cluster_node01_address}
diff --git a/metadata/service/server/single.yml b/metadata/service/server/single.yml
index 0af0ec7..b4f0577 100644
--- a/metadata/service/server/single.yml
+++ b/metadata/service/server/single.yml
@@ -7,7 +7,7 @@
server:
enabled: true
bind:
- host: ${_param:host_address}
+ host: ${_param:single_address}
token: ${_param:etcd_initial_token}
members:
- host: ${_param:node_address}