Skip to content

DEPRECATION WARNING with mariadb_tls_files on ansible version 2.12 #88

Closed
@roumano

Description

@roumano

Describe the bug
If we set mariadb_tls_files variables,these tasks will be executed :

  • setup_cluster | create TLS certificates directory
  • setup_cluster | copy TLS CA cert, server cert & private key

The when condition on them are badly written and we receive a DEPRECATION WARNING on them :

TASK [ansible-mariadb-galera-cluster : setup_cluster | create TLS certificates directory] ****************************************************************************************************
[DEPRECATION WARNING]: evaluating 'mariadb_tls_files' as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the future. Also see 
CONDITIONAL_BARE_VARS configuration toggle. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

TASK [ansible-mariadb-galera-cluster : setup_cluster | copy TLS CA cert, server cert & private key] ******************************************************************************************
[DEPRECATION WARNING]: evaluating 'mariadb_tls_files' as a bare variable, this behaviour will go away and you might need to add |bool to the expression in the future. Also see 
CONDITIONAL_BARE_VARS configuration toggle. This feature will be removed in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

To Reproduce
Steps to reproduce the behaviour:

  1. Set the variable mariadb_tls_files
    like in my example :
mariadb_tls_files:
  ca_cert:
    name: "ca.pem"
    content: "{{ lookup('file', 'files/STAR..ca') }}"
  server_key:
    name: "server-key.pem"
    content: "{{ lookup('file', 'STAR.key') }}"
  server_cert:
    name: "server-cert.pem"
    content: "{{ lookup('file', 'files/STAR.crt') }}"
  1. run the playbook
  2. See the warning

Expected behavior
A clear and concise description of what you expected to happen.
A better when condution on these tasks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions