diff options
author | 2016-12-01 01:02:54 +0000 | |
---|---|---|
committer | 2017-04-04 22:31:58 -0400 | |
commit | 5e934cd9b8b17c62a2f8729a1e6f50b9b9001ff8 (patch) | |
tree | 56fecf0892790d0982ba2b9127ec816d4126d76a /deployed-server/scripts | |
parent | 1b09a3d6e295f602c118c6656d1abce8614f915c (diff) |
Use the local collector to bootstrap deployed servers
os-collect-config is already configured to use json files in
/var/lib/os-collect-config/local-data/ as a data source, so this can
be used in the deployed-server get-occ-config.sh to copy in the
required json to generate the required os-collect-config.conf.
Co-Authored-By: James Slagle <jslagle@redhat.com>
Closes-Bug: #1679705
Change-Id: Ibde9e6bf360277d4ff64f66d637a5c7f0360e754
Diffstat (limited to 'deployed-server/scripts')
-rwxr-xr-x | deployed-server/scripts/get-occ-config.sh | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/deployed-server/scripts/get-occ-config.sh b/deployed-server/scripts/get-occ-config.sh index d0cc4dff..28f038ce 100755 --- a/deployed-server/scripts/get-occ-config.sh +++ b/deployed-server/scripts/get-occ-config.sh @@ -89,16 +89,16 @@ for role in $OVERCLOUD_ROLES; do done echo "======================" - echo "$role$i os-collect-config.conf configuration:" + echo "$role$i deployed-server.json configuration:" - config=" -[DEFAULT] -collectors=request -command=os-refresh-config -polling_interval=30 - -[request] -metadata_url=$deployed_server_metadata_url" + config="{ + \"os-collect-config\": { + \"collectors\": [\"request\", \"local\"], + \"request\": { + \"metadata_url\": \"$deployed_server_metadata_url\" + } + } +}" echo "$config" echo "======================" @@ -108,12 +108,11 @@ metadata_url=$deployed_server_metadata_url" host= eval host=\${${role}_hosts_a[i]} if [ -n "$host" ]; then - # Delete the os-collect-config.conf template so our file won't get - # overwritten - ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo /bin/rm -f /usr/libexec/os-apply-config/templates/etc/os-collect-config.conf - ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host "echo \"$config\" > os-collect-config.conf" - ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo cp os-collect-config.conf /etc/os-collect-config.conf - ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo systemctl restart os-collect-config + ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host "echo '$config' > deployed-server.json" + ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo mkdir -p -m 0700 /var/lib/os-collect-config/local-data/ || true + ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo cp deployed-server.json /var/lib/os-collect-config/local-data/deployed-server.json + ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo systemctl start os-collect-config + ssh $SSH_OPTIONS -i $SUBNODES_SSH_KEY $host sudo systemctl enable os-collect-config fi let i+=1 |