Skip to content

Commit 27944a9

Browse files
authored
Merge pull request #1184 from buildkite/add-missing-auth-keys-systemd-units
Add missing authorized keys systemd units
2 parents 804061d + ec642b9 commit 27944a9

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

goss.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ file:
88
owner: buildkite-agent
99
group: buildkite-agent
1010

11+
/etc/systemd/system/refresh_authorized_keys.service:
12+
exists: true
13+
14+
/etc/systemd/system/refresh_authorized_keys.timer:
15+
exists: true
16+
1117
/var/lib/buildkite-agent/builds:
1218
filetype: directory
1319
exists: true
@@ -128,6 +134,13 @@ command:
128134
wget --version:
129135
exit-status: 0
130136

137+
# Check refresh authorized keys gear is present, but disabled.
138+
# disabled: The unit file is not enabled, but contains an [Install] section with installation instructions.
139+
systemctl is-enabled refresh_authorized_keys.timer:
140+
exit-status: 1
141+
stdout:
142+
- /disabled/
143+
131144
systemctl is-enabled docker-gc.timer:
132145
exit-status: 0
133146

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
[Unit]
22
Description=Download ssh authorized_keys file from s3
3-
Wants=refresh_authorized_keys.service
43

54
[Service]
65
Type=oneshot
76
ExecStart=/usr/local/bin/refresh_authorized_keys
8-
9-
[Install]
10-
WantedBy=multi-user.target

packer/linux/scripts/install-buildkite-utils.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ sudo curl -Lf -o /usr/bin/lifecycled \
2525
sudo chmod +x /usr/bin/lifecycled
2626
sudo curl -Lf -o /etc/systemd/system/lifecycled.service \
2727
https://raw.githubusercontent.com/buildkite/lifecycled/${LIFECYCLED_VERSION}/init/systemd/lifecycled.unit
28+
29+
echo "Adding authorized keys systemd units..."
30+
sudo cp /tmp/conf/ssh/systemd/* /etc/systemd/system

0 commit comments

Comments
 (0)