From 0e06476d74dd90c5f6bc4830970113e9fcc1ce56 Mon Sep 17 00:00:00 2001 From: ionutboangiu Date: Fri, 8 Aug 2025 20:51:21 +0300 Subject: [PATCH] fix Ansible 2.19 conditional compatibility in github_ssh role Fixes 'Conditional result was 'true' of type 'str'' errors. See: https://ansible.readthedocs.io/projects/ansible-core/devel/porting_guides/porting_guide_core_2.19.html#broken-conditionals --- data/ansible/roles/github_ssh/tasks/main.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/data/ansible/roles/github_ssh/tasks/main.yaml b/data/ansible/roles/github_ssh/tasks/main.yaml index e9f6c1869..8b91889fe 100644 --- a/data/ansible/roles/github_ssh/tasks/main.yaml +++ b/data/ansible/roles/github_ssh/tasks/main.yaml @@ -59,15 +59,15 @@ body: title: "{{ github_ssh_key_name }}" key: "{{ github_ssh_public_key.content | b64decode | trim }}" - read_only: "{{ github_ssh_deploy_key_read_only }}" + read_only: "{{ github_ssh_deploy_key_read_only | bool }}" status_code: [201, 422] # 201 = created, 422 = key already exists register: github_deploy_key_result failed_when: false when: - - github_ssh_use_deploy_keys - - github_ssh_token != "" - - github_ssh_repo_owner != "" - - github_ssh_repo_name != "" + - github_ssh_use_deploy_keys | bool + - github_ssh_token | length > 0 + - github_ssh_repo_owner | length > 0 + - github_ssh_repo_name | length > 0 - name: Add SSH key to GitHub user account ansible.builtin.uri: @@ -84,8 +84,8 @@ register: github_user_key_result failed_when: false when: - - not (github_ssh_use_deploy_keys) - - github_ssh_token != "" + - not (github_ssh_use_deploy_keys | bool) + - github_ssh_token | length > 0 - name: Create SSH config for GitHub ansible.builtin.blockinfile: