File tree Expand file tree Collapse file tree 5 files changed +62
-2
lines changed
Expand file tree Collapse file tree 5 files changed +62
-2
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ git_excludes =
2929
3030[centpkg-sig.distgit]
3131apibaseurl = https://gitlab.com
32- token = {{ vault.packit_service.authentication['gitlab.com'] .token }}
32+ {% set gitlab_forge = git_forges | selectattr ('name' , 'equalto' , 'gitlab.com' ) | first %}
33+ {% set gitlab_fields = gitlab_forge ['fields' ] | items 2dict (key_name ='name' ) %}
34+ token = {{ gitlab_fields['token:key'] }}
Original file line number Diff line number Diff line change @@ -5,6 +5,29 @@ fas_user: packit
55keytab_path: /secrets/fedora.keytab
66validate_webhooks: true
77
8+ # {{ ansible_managed }}
9+ # Please adjust the values in the respective logins in the Bitwarden Vault
10+ authentication:
11+ {% for forge in git_forges %}
12+ {% set fields = forge ['fields' ] | items 2dict (key_name ='name' ) %}
13+ {{ forge['name'] }}:
14+ instance_url: {{ forge['login'] ['uris'] [0] .uri }}
15+ # Login: {{ forge['login'] ['username'] }}
16+ # Token name: {{ fields.get('token:name') }}
17+ # Scope: {{ fields.get('token:permissions') }}
18+ # Expiration: {{ fields.get('token:expiration') }}
19+ token: {{ fields.get('token:key') }}
20+ {% if 'type' in fields and 'github_app' in fields ['type' ] %}
21+ # GitHub App set up
22+ github_app_id: '{{ fields.get('app_id') }}'
23+ github_app_private_key_path: {{ fields.get('app_private_key_path') }}
24+ {% endif %}
25+ {% if 'token:type' in fields %}
26+ type: {{ fields.get('token:type') }}
27+ {% endif %}
28+
29+ {% endfor %}
30+
831{{ vault.packit_service | to_nice_yaml }}
932
1033testing_farm_api_url: https://api.testing-farm.io/v0.1/
Original file line number Diff line number Diff line change @@ -29,4 +29,6 @@ git_excludes =
2929
3030[centpkg-sig.distgit]
3131apibaseurl = https://gitlab.com
32- token = {{ vault.packit_service.authentication['gitlab.com'] .token }}
32+ {% set gitlab_forge = git_forges | selectattr ('name' , 'equalto' , 'gitlab.com' ) | first %}
33+ {% set gitlab_fields = gitlab_forge ['fields' ] | items 2dict (key_name ='name' ) %}
34+ token = {{ gitlab_fields['token:key'] }}
Original file line number Diff line number Diff line change @@ -6,6 +6,29 @@ keytab_path: /secrets/fedora.keytab
66comment_command_prefix: "/packit-stg"
77validate_webhooks: true
88
9+ # {{ ansible_managed }}
10+ # Please adjust the values in the respective logins in the Bitwarden Vault
11+ authentication:
12+ {% for forge in git_forges %}
13+ {% set fields = forge ['fields' ] | items 2dict (key_name ='name' ) %}
14+ {{ forge['name'] }}:
15+ instance_url: {{ forge['login'] ['uris'] [0] .uri }}
16+ # Login: {{ forge['login'] ['username'] }}
17+ # Token name: {{ fields.get('token:name') }}
18+ # Scope: {{ fields.get('token:permissions') }}
19+ # Expiration: {{ fields.get('token:expiration') }}
20+ token: {{ fields.get('token:key') }}
21+ {% if 'type' in fields and 'github_app' in fields ['type' ] %}
22+ # GitHub App set up
23+ github_app_id: '{{ fields.get('app_id') }}'
24+ github_app_private_key_path: {{ fields.get('app_private_key_path') }}
25+ {% endif %}
26+ {% if 'token:type' in fields %}
27+ type: {{ fields.get('token:type') }}
28+ {% endif %}
29+
30+ {% endfor %}
31+
932{{ vault.packit_service | to_nice_yaml }}
1033
1134# temporarily unavailable, use production in the meanwhile
Original file line number Diff line number Diff line change 4747 - always
4848 ansible.builtin.set_fact :
4949 redis_hostname : " {{ kv_database }}"
50+
51+ - name : Set Bitwarden URI
52+ ansible.builtin.set_fact :
53+ bw_uri : " ansible://{{ service }}/{{ deployment }}"
54+
55+ - name : Fetch git forges
56+ tags :
57+ - always
58+ ansible.builtin.set_fact :
59+ git_forges : " {{ lookup('community.general.bitwarden', bw_uri + '/git', search='') }}"
You can’t perform that action at this time.
0 commit comments