summaryrefslogtreecommitdiffstats
path: root/roles/etcd
diff options
context:
space:
mode:
authorJason DeTiberus <jdetiber@redhat.com>2016-03-11 02:56:16 -0500
committerJason DeTiberus <jdetiber@redhat.com>2016-03-14 11:38:20 -0400
commit8f7b31051dae0cdb853ca2f7fb68c31a40ae2967 (patch)
tree6719a20fe3e1559c563985adc02332357e37e576 /roles/etcd
parent1565bc6e71bdda712d4cfdbf28754f00b38a4674 (diff)
downloadopenshift-8f7b31051dae0cdb853ca2f7fb68c31a40ae2967.tar.gz
openshift-8f7b31051dae0cdb853ca2f7fb68c31a40ae2967.tar.bz2
openshift-8f7b31051dae0cdb853ca2f7fb68c31a40ae2967.tar.xz
openshift-8f7b31051dae0cdb853ca2f7fb68c31a40ae2967.zip
improve ordering of systemd units
Diffstat (limited to 'roles/etcd')
-rw-r--r--roles/etcd/tasks/main.yml4
-rw-r--r--roles/etcd/templates/etcd.docker.service3
2 files changed, 7 insertions, 0 deletions
diff --git a/roles/etcd/tasks/main.yml b/roles/etcd/tasks/main.yml
index 0be042f7f..d6956de71 100644
--- a/roles/etcd/tasks/main.yml
+++ b/roles/etcd/tasks/main.yml
@@ -36,6 +36,10 @@
state: stopped
enabled: no
+- name: Mask system etcd when containerized
+ when: openshift.common.is_containerized | bool
+ command: systemctl mask etcd
+
- name: Reload systemd units
command: systemctl daemon-reload
when: openshift.common.is_containerized | bool and ( install_etcd_result | changed )
diff --git a/roles/etcd/templates/etcd.docker.service b/roles/etcd/templates/etcd.docker.service
index 8058fa188..defc070bd 100644
--- a/roles/etcd/templates/etcd.docker.service
+++ b/roles/etcd/templates/etcd.docker.service
@@ -1,12 +1,15 @@
[Unit]
Description=The Etcd Server container
After=docker.service
+Requires=docker.service
+PartOf=docker.service
[Service]
EnvironmentFile=/etc/etcd/etcd.conf
ExecStartPre=-/usr/bin/docker rm -f {{ etcd_service }}
ExecStart=/usr/bin/docker run --name {{ etcd_service }} --rm -v /var/lib/etcd:/var/lib/etcd:z -v /etc/etcd:/etc/etcd:z --env-file=/etc/etcd/etcd.conf --net=host --entrypoint=/usr/bin/etcd {{ openshift.etcd.etcd_image }}
ExecStop=/usr/bin/docker stop {{ etcd_service }}
+SyslogIdentifier=etcd_container
Restart=always
[Install]