No_log as a varible

You might find solace in the special variables presented by Automation Controller / AWX like awx_project_scm_branch and awx_job_scm_branch. You could bake that into how you evaluate the no_log task parameter.

- ansible.builtin.debug:
    var: my_sensitive_var
  no_log: >-
    {{
      true if awx_project_scm_branch == "main" else not ansible_verbosity
    }}
2 Likes