Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
terraform: fix ignored ConditionPathExists= in unit files
Browse files Browse the repository at this point in the history
Over time we've added ConditionPathExists= parameters to several unit
files. However, in some instances we were adding them in the [Service]
section instead of the [Unit] section. This meant they were ignored and
didn't have any effect.

This moves those conditions to the [Unit] section.
  • Loading branch information
iaguis committed Jun 30, 2021
1 parent 06c68de commit 106c59c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ systemd:
Documentation=https://github.com/etcd-io/etcd
Wants=docker.service
After=docker.service
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
ConditionPathExists=/etc/ssl/etcd/etcd/server-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.key
ConditionPathExists=/etc/ssl/etcd/etcd/peer-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.key
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
EnvironmentFile=/etc/kubernetes/etcd.env
ExecStartPre=-docker rm -f etcd
ExecStartPre=sh -c "docker run -d \
Expand Down
12 changes: 6 additions & 6 deletions assets/terraform-modules/controller/templates/etcd.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ systemd:
Documentation=https://github.com/etcd-io/etcd
Wants=docker.service
After=docker.service
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
ConditionPathExists=/etc/ssl/etcd/etcd/server-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.key
ConditionPathExists=/etc/ssl/etcd/etcd/peer-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.key
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
EnvironmentFile=/etc/kubernetes/etcd.env
ExecStartPre=-docker rm -f etcd
ExecStartPre=sh -c "docker run -d \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ systemd:
Wants=docker.service
After=docker.service create-etcd-config.service
Requires=create-etcd-config.service
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
ConditionPathExists=/etc/ssl/etcd/etcd/server-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.crt
ConditionPathExists=/etc/ssl/etcd/etcd/server.key
ConditionPathExists=/etc/ssl/etcd/etcd/peer-ca.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.crt
ConditionPathExists=/etc/ssl/etcd/etcd/peer.key
[Service]
Type=simple
Restart=always
RestartSec=5s
TimeoutStartSec=0
LimitNOFILE=40000
EnvironmentFile=/etc/kubernetes/etcd.config
EnvironmentFile=/etc/kubernetes/etcd.env
ExecStartPre=-docker rm -f etcd
Expand Down
Loading

0 comments on commit 106c59c

Please sign in to comment.