File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ namespace: ai-bot
2424# NEVER commit real values here.
2525github_app_id : " CHANGE_ME"
2626github_private_key_path : " /path/to/github-app.pem"
27+ github_private_key_local_path : " /path/to/github-app.pem"
2728webhook_secret : " CHANGE_ME"
2829admin_token : " CHANGE_ME"
2930
Original file line number Diff line number Diff line change 148148 register : apply_network_policies
149149 changed_when : " 'created' in apply_network_policies.stdout or 'configured' in apply_network_policies.stdout"
150150
151+ - name : Copy GitHub App private key to remote
152+ ansible.builtin.copy :
153+ src : " {{ github_private_key_local_path }}"
154+ dest : /tmp/github-app.pem
155+ mode : " 0600"
156+
151157 - name : Apply github-app secret
152- ansible.builtin.command :
153- cmd : k3s kubectl apply -f -
154- stdin : |
155- apiVersion: v1
156- kind: Secret
157- metadata:
158- name: github-app
159- namespace: {{ namespace }}
160- type: Opaque
161- stringData:
162- GITHUB_APP_ID: "{{ github_app_id }}"
163- GITHUB_PRIVATE_KEY: |
164- {{ lookup('ansible.builtin.file', github_private_key_path) | indent(14, false) }}
165- register : apply_secret_github_app
166- changed_when : " 'created' in apply_secret_github_app.stdout or 'configured' in apply_secret_github_app.stdout"
167- # no_log: true
158+ ansible.builtin.shell : |
159+ k3s kubectl -n {{ namespace }} delete secret github-app --ignore-not-found
160+ k3s kubectl -n {{ namespace }} create secret generic github-app \
161+ --from-literal=GITHUB_APP_ID={{ github_app_id }} \
162+ --from-file=GITHUB_PRIVATE_KEY=/tmp/github-app.pem
163+ no_log : true
164+
165+ - name : Remove temporary key file
166+ ansible.builtin.file :
167+ path : /tmp/github-app.pem
168+ state : absent
168169
169170 - name : Apply github-webhook-secret
170171 ansible.builtin.command :
You can’t perform that action at this time.
0 commit comments