I'm confused why I'm getting a 'variable undefined' error with this 
playbook, anyone have any idea?

- hosts: localhost
  connection: local
  gather_facts: yes

  tasks:
  - name: Generate a temporary random password for template/os customization
    set_fact: 
      randopass: 
"{{ lookup('password', '/dev/null length=24 chars=ascii_letters') }}"
  
... I use '{{ randopass }}' somewhere else in this play and its fine... but 
then I get to this part:

- hosts: staging
  vars:
      ansible_user: Administrator
      ansible_password: '{{ randopass }}'
  gather_facts: yes

ERROR:
The field 'password' has an invalid value, which includes an undefined 
variable. The error was: 'randopass' is undefined

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1a0e91d7-88fe-4d3f-96b4-115de45f29f6%40googlegroups.com.

Reply via email to