add support for centos
Change-Id: I229c6957972c22f347dbe7a43ac2dfdbcbbdd1ff
diff --git a/etcd/server/service.sls b/etcd/server/service.sls
index 70bbf91..2ef7d31 100644
--- a/etcd/server/service.sls
+++ b/etcd/server/service.sls
@@ -18,15 +18,37 @@
{% elif server.get('source', {}).get('engine') == 'docker_hybrid' %}
+{%- if grains.os_family == 'RedHat' %}
+etcd_enable_epel:
+ pkg.installed:
+ - name: epel-release
+
+etcd_install_pip:
+ pkg.installed:
+ - name: python2-pip
+
+etcd_python_etcd_from_pip:
+ pip.installed:
+ - name: python-etcd
+
+{%- endif %}
+
+
+{%- set _support_pkgs = [] %}
+{%- for pkg in server.pkgs %}
+{%- do _support_pkgs.append(pkg) %}
+{%- endfor %}
+
+{%- if _support_pkgs|length > 1 %}
etcd_support_packages:
pkg.installed:
- pkgs:
-{%- for pkg in server.pkgs %}
-{%- if pkg != 'etcd' %}
- - {{ pkg }}
-{%- endif %}
+{%- for pkg in _support_pkgs %}
+ - {{ pkg }}
{%- endfor %}
+{%- endif %}
+
user_etcd:
user.present:
- name: etcd
@@ -141,4 +163,4 @@
{%- endif %}
-{%- endif %}
\ No newline at end of file
+{%- endif %}