Programmatic Access and Automation: Difference between revisions
Jump to navigation
Jump to search
| Line 37: | Line 37: | ||
== Prepare instance via Ansible == | == Prepare instance via Ansible == | ||
To control and customize your default instance, you | To control and customize your default instance, you can use automated methods. | ||
* Create an access token/application credential as defined below. | * Create an access token/application credential as defined below. | ||
Revision as of 11:04, 24 September 2025
Applikations Zugangsdatei erzeugen
Applikations Zugangsdateien/ Token ermöglichen es Zugang zum Projekt zu vergeben und zu kontrollieren. Hierfür sind entsprechende Berechtigungen als Mitglied im Projekt notwendig.
Token erzeugen:
- Login im Dashboard. Indentität -> Applikations-Zugangsdaten
- Applikations-Zugangsdaten erstellen
- Die geöffnete Form ausfüllen. Z. B.: Name: token_test_login Geheimnis: ******************** Ablaufdatum: 12/31/20xx
- Applikations-Zugangsdaten erstellen
- openrc-Datei herunterladen
- Datei abspeichern. Z. B. als my_token.sh
- Das Geheimnis gesichert abspeichern.
- [Optional] In my_token.sh die Zeil eexportOS_APPLICATION_CREDENTIAL_SECRET=********************ersetzten durch echo "Passphrase: "read -sr os_credential_secret_input export OS_APPLICATION_CREDENTIAL_SECRET="$os_credential_secret_input"
Token Testen
Sourcen Sie die Zugangsdaten my_token.sh.
source my_token.sh
Führen Sie den folgenden Befehl aus. Sie sollten Ihre credential ID sehen.
curl \
-s \
-H "Content-Type: application/json" \
-d '{ "auth": { "identity": { "methods": ["application_credential"], "application_credential": { "id": "'${OS_APPLICATION_CREDENTIAL_ID}'", "secret": "'${OS_APPLICATION_CREDENTIAL_SECRET}'" }}}}' \
"${OS_AUTH_URL}/auth/tokens" \
| jq .token.application_credential
Sollte der curl Befehl nicht verfügbar sein, installieren Sie das entsprechende Paket mit Ihrem Paketmanager.
Prepare instance via Ansible
To control and customize your default instance, you can use automated methods.
- Create an access token/application credential as defined below.
- Tried and tested methods for automation are listed below. Use the Ansible template specified there. Follow the steps described there.
| Moethod | Usage |
|---|---|
| Terraform | This tool can be used to create an instance or a defined infrastructure. |
| Ansible | Create roles or tasks for all customizations that you make in an instance. For an easier start, you can use our template. |