templates/packer: Allow token url to be set by cloud-init vars

Hardcoding the token url renders the image useless if it ever needs to
be changed.
This commit is contained in:
Sanne Raymaekers 2022-09-21 17:41:52 +02:00 committed by Ondřej Budai
parent 8f97c4788c
commit 5c12076b4f
3 changed files with 10 additions and 2 deletions

View file

@ -20,7 +20,7 @@ rm -f /tmp/client-credentials.json
sudo tee -a /etc/osbuild-worker/osbuild-worker.toml > /dev/null << EOF
[authentication]
oauth_url = "https://identity.api.openshift.com/auth/realms/rhoas/protocol/openid-connect/token"
oauth_url = "${TOKEN_URL:-https://identity.api.openshift.com/auth/realms/rhoas/protocol/openid-connect/token}"
client_id = "${CLIENT_ID}"
client_secret = "/etc/osbuild-worker/client-secret"
EOF

View file

@ -19,7 +19,7 @@ rm -f /tmp/offline-token.json
sudo tee -a /etc/osbuild-worker/osbuild-worker.toml > /dev/null << EOF
[authentication]
oauth_url = "https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token"
oauth_url = "${TOKEN_URL:-https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token}"
client_id = "rhsm-api"
offline_token = "/etc/osbuild-worker/offline-token"
EOF