Hi I am trying solve this from past 2 days, Please help

details :

[WARNING]: log file at /var/log/ansible.log is not writeable and we cannot 
create it, aborting
ansible 2.4.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/usr/share/my_modules']
  ansible python module location = 
/usr/local/lib/python2.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 
20160609]

--------------------------------------------------
---
 - name: Clear gathered facts from all currently targeted hosts
   meta: refresh_inventory

 - name: Generating LEAF-BGP configuration
   template:
      src="/etc/ansible/leaf_bgp/templates/leaf_bgp_template.j2"
      dest=/etc/ansible/leaf_bgp/files/{{item.host_ip}}_leaf_bgp.cfg
   when:
      - item.host_ip |string  in 
hostvars[inventory_hostname].inventory_hostname
   with_items:
     - "{{ leaf_bgp }}"
#     - "{{ all_vars }}"

----------------------------------------------------
---
# defaults file for leaf_bgp
all_vars:
  [
  local_as : '65111',
  peer_as : '65101',
  evpn_as : '65100',
  spine_lo0 : '172.21.0.11',
  ]
-----------------------------------------------
#Vars file
leaf_bgp:                                                                  
                             
                                                                            
                              
   #4_Member Leaf TOA                                                      
                               
                                                                            
                              
   - {'host_ip' : '135.182.175.7',                                          
                              
      'host_name' : 'something',                                            
                            
      'loopback0' : '172.21.0.1',                                          
                               
                                                                            
                              
      'spine_neighbor' : '10.11.1.1',                                      
                               
      'spinev6_neighbor' : 'Something',                                    
              
                                                                            
                              
     }     

-----------------------------------------------

With "bgp/vars/main.yaml'" its working fine. But when i change to 
defaults/main.yaml, I am getting error. 

The error is  "msg": "AnsibleUndefinedVariable: 'dict object' has no 
attribute 'local_as'"

Please solve


-- 
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/e5297058-f846-4af9-8500-243932105ad7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to