This article explains how to edit the installation.yml file for the Operations Manager using the API endpoint.
Caution- Use extreme caution when performing this procedure as it may result in the loss of Pivotal Cloud Foundry deployment. It is recommended to engage the Pivotal Support for the precautionary measures.
1. If you would like to copy and paste commands from this procedure, then start by setting these environmental variables:
export OPSURL="operations manager url"
2. Open a terminal and run the following UAAC commands to acquire an access token.
A). Target Operations Manager UAA endpoint:
uaac target ${OPSURL}/uaa
I. If Operations Manager is not integrated with SAML, proceed to this next step:
uaac token owner get Client ID: opsman Client secret: <Leave Blank> User name: <Username to log into OpsManager> Password: <Password to log into OpsManager>
II. If Operations Manager is integrated with SAML, then follow this step and acquire a passcode from https://${OPSMANWEB}/uaa/passcode endpoint:
uaac token sso get Client ID: opsman Client secret: <Leave Blank> Passcode: <paste from /uaa/passcode endpoint>
3. Now that we have successfully obtained an access token, we need to put it into an environment variable for easy access.
A). Run this command to print your access token:
# uaac context access_token: ..... token_type: bearer expires_in: 43199 scope: clients.read password.write clients.secret clients.write uaa.admin scim.write scim.read jti: ....
4. Export the access token into an environmental variable:
export TOKEN="access token from ops manager response"
A). Download the installation settings from Operations Manager endpoint:
curl -s -k -H 'Accept: application/json;charset=utf-8' -H "Content-Type: application/json" -H "Authorization: bearer $TOKEN" https://${OPSURL}/api/installation_settings | python -m json.tool > installsettings.json
B). Make a backup copy of the installation settings:
cp installsettings.json installsettings.json.original
C). Make the desired changes to installsettings.json.
D). Post the installsettings.json file to Operations Manager to commit the changes:
curl -s -k -H 'Accept: application/json;charset=utf-8' -H "Content-Type: multipart/form-data" -H "Authorization: bearer $TOKEN" https://${OPSURL}/api/installation_settings -X POST -F "installation[file][email protected]"
E). Log in to Operations Manager and confirm that the changes were committed.
F). If something appears to be wrong with the changes, then use the following command to restore the backup install settings file created in step 4.B). before you click "apply changes":
curl -s -k -H 'Accept: application/json;charset=utf-8' -H "Content-Type: multipart/form-data" -H "Authorization: bearer $TOKEN" ${OPSURL}/api/installation_settings -X POST -F "installation[file][email protected]"
Impact
We recommend utilizing guidance from Pivotal Support when using this procedure. Following are the risks associated with this procedure: