diff --git a/roles/hubs/tasks/main.yml b/roles/hubs/tasks/main.yml index 6f858e896f..7a6bf6ad18 100644 --- a/roles/hubs/tasks/main.yml +++ b/roles/hubs/tasks/main.yml @@ -37,15 +37,31 @@ notify: "hubs configuration change" -- name: Configure application to authenticate with iddev.fedorainfracloud.org - command: - oidc-register - --output-file {{ hubs_conf_dir }}/client_secrets.json - https://{{ hubs_oidc_url }}/ {{ hubs_url }} - args: - creates: "{{ hubs_conf_dir }}/client_secrets.json" +- name: Configure application to authenticate with the OIDC provider (dev) + block: + - dnf: name=python3-flask-oidc state=present + - command: + oidc-register + --output-file {{ hubs_conf_dir }}/client_secrets.json + https://{{ hubs_oidc_url }}/ {{ hubs_url }} + args: + creates: "{{ hubs_conf_dir }}/client_secrets.json" + notify: "hubs configuration change" + when: inventory_hostname == 'hubs-dev.fedorainfracloud.org' -- name: Set permissions on the oidc credentials file + +- name: Configure application to authenticate with the OIDC provider + template: + src: oidc_client_secrets.json + dest: "{{ hubs_conf_dir }}/client_secrets.json" + owner: root + group: "{{ main_user }}" + mode: 0640 + notify: "hubs configuration change" + when: inventory_hostname != 'hubs-dev.fedorainfracloud.org' + + +- name: Fix the permissions on the OIDC secrets file file: path: "{{ hubs_conf_dir }}/client_secrets.json" owner: root diff --git a/roles/hubs/templates/oidc_client_secrets.json b/roles/hubs/templates/oidc_client_secrets.json new file mode 100644 index 0000000000..7ea0e9b021 --- /dev/null +++ b/roles/hubs/templates/oidc_client_secrets.json @@ -0,0 +1,13 @@ +{ + "web": { + "client_id": "hubs", + "auth_uri": "https://id.stg.fedoraproject.org/openidc/Authorization", + "issuer": "https://id.stg.fedoraproject.org/openidc/", + "client_secret": "{{ hubs_stg_oidc_secret }}", + "token_uri": "https://id.stg.fedoraproject.org/openidc/Token", + "userinfo_uri": "https://id.stg.fedoraproject.org/openidc/UserInfo", + "redirect_uris": [ + "https://hubs.stg.fedoraproject.org/oidc_callback" + ] + } +}