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

Commit 1a0d08c

Browse files
committed
Print bootkube journal if it fails
In previous attempt in e852117, I missed the fact that Terraform remote-exec only prints stderr to the user and stdout is ignored. This means, if we redirect journalctl output to stderr, then it should be printed which will improve debugging experience. Refs #440 Signed-off-by: Mateusz Gozdek <mateusz@kinvolk.io>
1 parent 2235fb7 commit 1a0d08c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

assets/terraform-modules/aws/flatcar-linux/kubernetes/ssh.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ resource "null_resource" "bootkube-start" {
102102
provisioner "remote-exec" {
103103
inline = [
104104
"sudo mv $HOME/assets /opt/bootkube",
105-
"sudo systemctl start bootkube",
105+
"sudo systemctl start bootkube || (sudo journalctl -u bootkube --no-pager; exit 1)",
106106
]
107107
}
108108
}

assets/terraform-modules/bare-metal/flatcar-linux/kubernetes/ssh.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ resource "null_resource" "bootkube-start" {
141141
provisioner "remote-exec" {
142142
inline = [
143143
"sudo mv $HOME/assets /opt/bootkube",
144-
"sudo systemctl start bootkube",
144+
"sudo systemctl start bootkube || (sudo journalctl -u bootkube --no-pager; exit 1)",
145145
]
146146
}
147147
}

assets/terraform-modules/packet/flatcar-linux/kubernetes/ssh.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ resource "null_resource" "bootkube-start" {
103103
provisioner "remote-exec" {
104104
inline = [
105105
"sudo mv $HOME/assets /opt/bootkube",
106-
"sudo systemctl start bootkube",
106+
"sudo systemctl start bootkube || (sudo journalctl -u bootkube --no-pager; exit 1)",
107107
]
108108
}
109109
}

0 commit comments

Comments
 (0)