The platform uses the /opt/ispsystem/dci/etc/location.yaml configuration file to configure the docker containers on the location server. The Docker Compose format is used to describe the configuration.
You can edit the configuration by using the patch (modification) mechanism. Patches allow you to add files, environment variables and additional services to docker containers.
Example of creating a patch
This example shows how to change the IMPITOOL_PATH environment variable. After performing these actions in the eservice_handler docker container, the /usr/bin/ipmitool_1.8.19 file will be used to run the ipmitool utility.
- Connect to the location server via SSH.
-
Create a patch.yaml file with the following content:
patch.yamlversion: "3.5" services: eservice_handler: environment: IPMITOOL_PATH: "/usr/bin/ipmitool_1.8.19"
-
Encode the contents of patch.yaml as per Base64:
echo -ne "patch.yaml" | base64
Save the command response.
Example of responsecGF0Y2gueWFtbA==
- Get the authorization token:
curl -k -X POST -H "accept: application/json" -H "Content-Type: application/json" 'https://domain.com/auth/v4/public/token' -d '{"email": "admin_email", "password": "admin_pass"}'
Comments to the commandIn response, you will get the message in the form:
Example of response in JSON{ "confirmed": true, "expires_at": null, "id": "6", "token": "4-e9726dd9-61d9-2940-add3-914851d2cb8a" }
Save the received token value.
-
Execute the API request:
curl -k -# -d '{"patches":[{"name":"<patch_name>","patch":"<patch_base64>"}]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
Comments to the commandDCImanager 6 will start setting up the location, taking into account the created patch.
Managing patches
You can manage patches through API queries.
curl -k -# -d '{"patches":[{"name":"<patch1_name>","patch":"<patch1_base64>"},{"name":"<patch2_name>","patch":"<patch2_base64>"},{"name":"<patch3_name>","patch":"<patch3_base64>"}]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
curl -k -# -X GET -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>"
The response of the command will contain the patches parameter with data about the patches.
curl -k -# -d '{"patches":[]}' -H "Cookie: ses6=<token>" -H "x-xsrf-token: <token>" -o- "https://domain.com/dci/v3/location/<location_id>/setup"
Managing modified containers
Use the script /opt/ispsystem/dci/etc/location_compose.sh to start and stop the modified containers on the location server. The platform generates a script automatically and includes information about all the patches that need to be run on the location. If you do not use the script, the current patches will be deleted when you restart the containers.
/opt/ispsystem/dci/etc/location_compose.sh up -d
/opt/ispsystem/dci/etc/location_compose.sh down