Skip to content
  • - name: Combine
      hosts: localhost
      gather_facts: false
      vars:
        rke2_config: |
          kube-apiserver-arg:
            - oidc-issuer-url=1
            - oidc-client-id=2
        extra_args:
          - oidc-issuer-url=3
          - audit-log-maxbackup=20
      tasks:
        - name: Debug
          ansible.builtin.debug:
            msg: "{{ (rke2_config | from_yaml)['kube-apiserver-arg'] + extra_args }}"

    The output is:

    PLAY [Combine] **********************************************************************************************************************************************************************************************************************************************************************
    
    TASK [Debug] ************************************************************************************************************************************************************************************************************************************************************************
    ok: [localhost] => {
        "msg": [
            "oidc-issuer-url=1",
            "oidc-client-id=2",
            "oidc-issuer-url=3",
            "audit-log-maxbackup=20"
        ]
    }
    
    PLAY RECAP **************************************************************************************************************************************************************************************************************************************************************************
    localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0 
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment