Skip to content

Commit 45e28eb

Browse files
authored
Merge pull request #274 from jprovaznik/osc
Improve checking of os-collect-config setup
2 parents d76f53a + 38d3e56 commit 45e28eb

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

collect-config-setup/fragments/configure_config_agent.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -eux
33

4+
# this file should be included in write_files section for the node
5+
source /usr/local/share/openshift-on-openstack/common_functions.sh
6+
47
# on Atomic host os-collect-config runs inside a container which is
58
# fetched&started in another step
69
[ -e /run/ostree-booted ] && exit 0
@@ -99,5 +102,13 @@ ln -s /usr/share/openstack-heat-templates/software-config/heat-container-agent/s
99102
ln -s /usr/share/openstack-heat-templates/software-config/elements/heat-config/bin/heat-config-notify /usr/bin/heat-config-notify
100103

101104
# run once to write out /etc/os-collect-config.conf
102-
os-collect-config --one-time --debug
105+
# use notify_failure from common_functions.sh to
106+
# make sure cloud-init reports failure
107+
os-collect-config --one-time --debug ||
108+
notify_failure "failed to run os-collect-config"
109+
110+
# check that a valid metadata_url was set
111+
curl "$(grep metadata_url /etc/os-collect-config.conf |sed 's/metadata_url = //')" ||
112+
notify_failure "failed to connect to os-collect-config metadata_url"
113+
103114
cat /etc/os-collect-config.conf

0 commit comments

Comments
 (0)