On Friday, 8 December 2017 12.33.09 CET cmoul...@redhat.com wrote:
> ansible playbook reports an error when one of the value of the yaml config 
> file imported as var is passed on the command line using -e
> 
> Yaml Config File
> 
> #
> # Istio
> #
> istio:
>   github_url: https://api.github.com/repos
>   repo: istio/istio
> 
>   # Could be a tag "0.2.12" version or be empty "", then in this case, the 
> latest release will be downloaded
>   release_tag_name: "0.2.12"
>   
>   # Folder where you want to install the distro on your machine. By 
> default, we will install it here ~/.istio
>   dest: "$HOME/.istio"
> 
> 
> 
> Command
> 
> ansible-playbook ansible/main.yml --extra-vars "{'istio': 
> {'release_tag_name': 0.3.0}}" -t install-istio -v
> 
> 
> Result
> 
> TASK [Define var containing Istio dir] 
> *************************************************************************************************************************************************************************************************************************
> fatal: [localhost]: FAILED! => {"failed": true, "msg": "The task includes 
> an option with an undefined variable. The error was: 'dict object' has no 
> attribute 'dest'\n\nThe error appears to have been in 
> '/Users/dabou/Code/istio/installation/ansible/istio/set_istio_distro_dir.yml':
>  
> line 7, column 3, but may\nbe elsewhere in the file depending on the exact 
> syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Define 
> var containing Istio dir\n  ^ here\n\nexception type: <class 
> 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object' has no 
> attribute 'dest'"}
> 
> So, for a reason that I don't know, ansible is not able to find the 
> istio.dest variable

Because you overwritten the variable on the command line.


> The playbook doesn't report error when no '-e' var is passed to the 
> command  !!!!!

I guess it has default dict that include dest.


> What could be the issue ?

When you overwrite a dict you need to provide everything since it's not 
possible to just change part of it.

-- 
Kai Stian Olstad

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1682242.5DCYqKPhi8%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to