Hi,

Accually I think is still not working as expected:

[vagrant@devopsadmin dir01]$ ansible --version
ansible 1.4.3

Playbook:
- name: Common | Ping all hosts
  gather_facts: no
  hosts: all
  user: "{{ ssh_user }}"
  sudo: yes

  vars_files:
    - vars/common_sshuser.yml

  # ---------------------------------
  # Add / Include specific task (will be run after roles)
  # ---------------------------------
  tasks:
  - ping:

0. If variable is not defined in 'vars/common_sshuser.yml' and not passed 
as variable in command line - ansible is trying connect with '{{ xxx }}' 
user to servers. 

1. Setup 'error_on_undefined_vars' in ansible.cfg
[vagrant@devopsadmin ansible]$ cat /etc/ansible/ansible.cfg | grep True
...
error_on_undefined_vars = True

Run ansible
TASK: [ping ] 
*****************************************************************
<srv01> ESTABLISH CONNECTION FOR USER: {{ssh_user}} on PORT 22
TO srv01
<srv02> ESTABLISH CONNECTION FOR USER: {{ssh_user}} on PORT 22
TO srv02

2. Use {{ssh_user | mandatory}} in play

Run absible
TASK: [ping ] 
*****************************************************************
<srv01> ESTABLISH CONNECTION FOR USER: {{ssh_user | mandatory}}
 on PORT 22 TO srv01
<srv02> ESTABLISH CONNECTION FOR USER: {{ssh_user | mandatory}}
 on PORT 22 TO srv02

So for me looks like user variable in playbook is not checking whether is 
defined or not. 

Best regards, 
Marcin Praczko

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to