0

So I have this playbook .yml

- name: "{{ __tpfx }}Configure LDAP | configure harbor ldap"
  become: yes
  uri:
    url: "{{ harbor_ldap__fqdn ~ '/api/v2.0/configurations' }}"
    url_username: "{{ harbor_ldap__url_username }}"
    url_password: "{{ harbor_ldap__url_password }}"
    validate_certs: no
    use_proxy: false
    method: PUT
    force_basic_auth: yes
  

Now I want to know where the variable "{{ harbor_ldap__url_password }}" is stored or located (directory), how can I find this?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
GBT55
  • 83
  • 5
  • 3
    You can always `grep -R "harbor_ldap__url_password" *` in the main playbook directory – Zumo de Vidrio Aug 19 '22 at 13:35
  • 1
    It really depends on various factors: if it's just a playbook or part of a role, etc ... Usually if it's in a Playbook it should be in the vars section or include_vars ... it also could be in the group_vars or host_vars directories ... As @ZumodeVidrio said, best to perform a grep in the tree to double check. – malpanez Aug 19 '22 at 14:05
  • The problem is idk where the main playbook directory is – GBT55 Aug 19 '22 at 14:27
  • 1
    its weird, because you provided your playbook.yml and you do not know whereyour playbook directory is located. @ZumodeVidrio comment is the best approach to figure that out. – P.... Aug 19 '22 at 14:42
  • Does the thread about "[How to find out where a variable comes from](https://stackoverflow.com/questions/72937001/)" answer your question? – U880D Aug 19 '22 at 22:05

1 Answers1

0

It might be in an inventory.yml file. Or at the top of your playbook.yml file in the vars: section.

Try to look for it.

U880D
  • 8,601
  • 6
  • 24
  • 40
Maxime
  • 19
  • 5
  • Or in many other places according [Variable precedence: Where should I put a variable?](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable) and [Understanding variable precedence](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#understanding-variable-precedence). – U880D Aug 24 '22 at 19:35