Update cloud-init script to fetch from updated NEWTON location

The latest upstream patch changed the date for NEWTON metadata
so update the cloud-init script to reflect the current value.
This commit is contained in:
Rob Crittenden 2016-07-21 21:13:58 +00:00
parent 2f8c17127b
commit 58c7a06bc8
1 changed files with 1 additions and 1 deletions

View File

@ -1 +1 @@
{"cloud-init": "#cloud-config\npackages:\n - python-simplejson\n - ipa-client\n - ipa-admintools\n - openldap-clients\nwrite_files:\n - content: |\n #!/bin/sh\n \n # Get the instance hostname out of the metadata\n #data=`curl http://169.254.169.254/openstack/latest/meta_data.json 2>/dev/null`\n data=`curl http://169.254.169.254/openstack/2016-04-30/vendor_data2.json 2>/dev/null`\n if [[ $? != 0 ]] ; then\n echo \"Unable to retrieve metadata\"\n exit 1\n fi\n \n # Hacky, need to get the join value specifically\n fqdn=`echo $data | python -m json.tool | grep '\"hostname\"' | awk '{ print $2 }' | sed 's/,//' | sed 's/\"//g'`\n \n if [ -z \"$fqdn\" ]; then\n echo \"Unable to determine hostname\"\n exit 1\n fi\n \n # Hacky, also need to fetch join here\n otp=`echo $data | python -m json.tool | grep '\"ipaotp\"' | awk '{ print $2 }' | sed 's/,//' | sed 's/\"//g'`\n\n # run ipa-client-install\n ipa-client-install -U -w $otp --hostname $fqdn\n path: /root/setup-ipa-client.sh\n permissions: '0700'\n owner: root:root\nruncmd:\n- sh -x /root/setup-ipa-client.sh > /var/log/setup-ipa-client.log 2>&1"}
{"cloud-init": "#cloud-config\npackages:\n - python-simplejson\n - ipa-client\n - ipa-admintools\n - openldap-clients\nwrite_files:\n - content: |\n #!/bin/sh\n \n # Get the instance hostname out of the metadata\n #data=`curl http://169.254.169.254/openstack/latest/meta_data.json 2>/dev/null`\n data=`curl http://169.254.169.254/openstack/2016-10-06/vendor_data2.json 2>/dev/null`\n if [[ $? != 0 ]] ; then\n echo \"Unable to retrieve metadata\"\n exit 1\n fi\n \n # Hacky, need to get the join value specifically\n fqdn=`echo $data | python -m json.tool | grep '\"hostname\"' | awk '{ print $2 }' | sed 's/,//' | sed 's/\"//g'`\n \n if [ -z \"$fqdn\" ]; then\n echo \"Unable to determine hostname\"\n exit 1\n fi\n \n # Hacky, also need to fetch join here\n otp=`echo $data | python -m json.tool | grep '\"ipaotp\"' | awk '{ print $2 }' | sed 's/,//' | sed 's/\"//g'`\n\n # run ipa-client-install\n ipa-client-install -U -w $otp --hostname $fqdn\n path: /root/setup-ipa-client.sh\n permissions: '0700'\n owner: root:root\nruncmd:\n- sh -x /root/setup-ipa-client.sh > /var/log/setup-ipa-client.log 2>&1"}