From 2db1ba3c05b0b807b28c491c2bc178e71d599ad2 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Wed, 9 Aug 2023 12:10:24 +0200 Subject: [PATCH] Fix handling of missing sections This commit makes sure that a missing section in an older toml configuration file does not break the deployment. --- deployment/roles/oidc_demo_application/tasks/main.yml | 1 + deployment/roles/oidc_idp/tasks/main.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/deployment/roles/oidc_demo_application/tasks/main.yml b/deployment/roles/oidc_demo_application/tasks/main.yml index a6f371a..ee72e82 100644 --- a/deployment/roles/oidc_demo_application/tasks/main.yml +++ b/deployment/roles/oidc_demo_application/tasks/main.yml @@ -116,6 +116,7 @@ demoapp_client_secret: "{{ lookup('ansible.builtin.ini', 'client-secret', section='oidc', file='demoapp_config-from-vagrant.toml') | from_json }}" demoapp_auth_key: "{{ lookup('ansible.builtin.ini', 'auth-key', section='session', file='demoapp_config-from-vagrant.toml') | from_json }}" demoapp_enc_key: "{{ lookup('ansible.builtin.ini', 'enc-key', section='session', file='demoapp_config-from-vagrant.toml') | from_json }}" + ignore_errors: true when: demoapp_config_st.stat.exists diff --git a/deployment/roles/oidc_idp/tasks/main.yml b/deployment/roles/oidc_idp/tasks/main.yml index fbb7d47..e272c2c 100644 --- a/deployment/roles/oidc_idp/tasks/main.yml +++ b/deployment/roles/oidc_idp/tasks/main.yml @@ -101,6 +101,7 @@ idp_csrf_key: "{{ lookup('ansible.builtin.ini', 'csrf.key', section='security', file='idp_config-from-vagrant.toml') | from_json }}" idp_auth_key: "{{ lookup('ansible.builtin.ini', 'auth-key', section='session', file='idp_config-from-vagrant.toml') | from_json }}" idp_enc_key: "{{ lookup('ansible.builtin.ini', 'enc-key', section='session', file='idp_config-from-vagrant.toml') | from_json }}" + ignore_errors: true when: idp_config_st.stat.exists