packer: move worker-config creation to ansible
I think it untangles the initialization a bit and allows me to do some more refactorings. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
2a4d4c4d49
commit
2e7815bf53
5 changed files with 16 additions and 3 deletions
|
|
@ -0,0 +1 @@
|
|||
base_path = "/api/image-builder-worker/v1"
|
||||
|
|
@ -9,6 +9,5 @@ echo "Writing offline token."
|
|||
--endpoint-url "${SECRETS_MANAGER_ENDPOINT_URL}" \
|
||||
--secret-id "${OFFLINE_TOKEN_ARN}" | jq -r ".SecretString" > /tmp/offline-token.json
|
||||
|
||||
mkdir /etc/osbuild-worker
|
||||
jq -r ".offline_token" /tmp/offline-token.json > /etc/osbuild-worker/offline-token
|
||||
rm -f /tmp/offline-token.json
|
||||
|
|
|
|||
|
|
@ -4,8 +4,7 @@ source /tmp/cloud_init_vars
|
|||
|
||||
echo "Setting up worker services."
|
||||
|
||||
sudo tee /etc/osbuild-worker/osbuild-worker.toml > /dev/null << EOF
|
||||
base_path = "/api/image-builder-worker/v1"
|
||||
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"
|
||||
offline_token = "/etc/osbuild-worker/offline-token"
|
||||
|
|
|
|||
|
|
@ -9,5 +9,8 @@
|
|||
# Configure worker initialization service.
|
||||
- include_tasks: worker-initialization-service.yml
|
||||
|
||||
# Configure the worker.
|
||||
- include_tasks: worker-config.yml
|
||||
|
||||
- name: Ensure SELinux contexts are updated
|
||||
command: restorecon -Rv /etc
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- name: Create osbuild-worker config directory
|
||||
file:
|
||||
path: /etc/osbuild-worker/
|
||||
state: directory
|
||||
|
||||
- name: Copy worker config stub
|
||||
copy:
|
||||
src: "{{ playbook_dir }}/roles/common/files/osbuild-worker.toml"
|
||||
dest: /etc/osbuild-worker/osbuild-worker.toml
|
||||
Loading…
Add table
Add a link
Reference in a new issue