AnsibleUndefinedVariable: 'dict object' has no attribute u'ansible_eth1

System:
`

Vagrant with ubuntu xenial 64 box
`

Task:

`
TASK [memcached : Copying over config.json files for services]

`

/usr/local/share/kolla-ansible/ansible/roles/memcached/tasks/config.yml

`

  • name: Ensuring config directories exist
    file:
    path: “{{ node_config_directory }}/{{ item }}”
    state: “directory”
    recurse: yes
    with_items:

  • “memcached”

  • name: Copying over config.json files for services
    template:
    src: “{{ item }}.json.j2”
    dest: “{{ node_config_directory }}/{{ item }}/config.json”
    register: memcached_config_json
    with_items:

  • “memcached”
    notify: Restart memcached container

  • name: Check memcached container
    vars:
    service: “{{ memcached_services.memcached }}”
    kolla_docker:
    action: “compare_container”
    common_options: “{{ docker_common_options }}”
    name: “{{ service.container_name }}”
    image: “{{ service.image }}”
    volumes: “{{ service.volumes }}”
    register: check_memcached_container
    when:

  • inventory_hostname in groups[service.group]

  • service.enabled | bool

  • action != “config”
    notify: Restart memcached container
    `

Ful error:

TASK [memcached : Copying over config.json files for services] ***************** task path: /usr/local/share/kolla-ansible/ansible/roles/memcached/tasks/config.yml:10 <localhost> ESTABLISH LOCAL CONNECTION FOR USER: root <localhost> EXEC /bin/sh -c 'echo ~ && sleep 0' <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p " echo /home/vagrant/.ansible/tmp/ansible-tmp-1524554119.15-234223887769910 " && echo ansible-tmp-1524554119.15-234223887769910=" echo /home/vagrant/.ansible/tmp/ansible-tmp-1524554119.15-234223887769910 `" ) && sleep 0’
EXEC /bin/sh -c ‘rm -f -r /home/vagrant/.ansible/tmp/ansible-tmp-1524554119.15-234223887769910/ > /dev/null 2>&1 && sleep 0’
failed: [localhost] (item=memcached) => {
“changed”: false,
“item”: “memcached”,
“msg”: “AnsibleUndefinedVariable: ‘dict object’ has no attribute u’ansible_eth1’”
}
to retry, use: --limit @/usr/local/share/kolla-ansible/ansible/site.retry

PLAY RECAP *********************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=1

Command failed ansible-playbook -i /usr/local/share/kolla-ansible/ansible/inventory/all-in-one -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=deploy /usr/local/share/kolla-ansible/ansible/site.yml --verbose --verbose --verbose --verbose

`

Playbook /usr/local/share/kolla-ansible/ansible/inventory/all-in-one

`

These initial groups are the only groups required to be modified. The

additional groups are for more control of the environment.

[control]
localhost ansible_connection=local

[network]
localhost ansible_connection=local

[compute]
localhost ansible_connection=local

[storage]
localhost ansible_connection=local

[monitoring]
localhost ansible_connection=local

[deployment]
localhost ansible_connection=local

You can explicitly specify which hosts run each project by updating the

groups in the sections below. Common services are grouped together.

[chrony-server:children]
haproxy

[chrony:children]
network
compute
storage
monitoring

[collectd:children]
compute

[baremetal:children]
control

[grafana:children]
monitoring

[etcd:children]
control
compute

[karbor:children]
control

[kibana:children]
control

[telegraf:children]
compute
control
monitoring
network
storage

[elasticsearch:children]
control

[haproxy:children]
network

[hyperv]
#hyperv_host

[hyperv:vars]
#ansible_user=user
#ansible_password=password
#ansible_port=5986
#ansible_connection=winrm
#ansible_winrm_server_cert_validation=ignore

[mariadb:children]
control

[rabbitmq:children]
control

[outward-rabbitmq:children]
control

[qdrouterd:children]
control

[mongodb:children]
control

[keystone:children]
control

[glance:children]
control

[nova:children]
control

[neutron:children]
network

[openvswitch:children]
network
compute
manila-share

[opendaylight:children]
network

[cinder:children]
control

[cloudkitty:children]
control

[freezer:children]
control

[memcached:children]
control

[horizon:children]
control

[swift:children]
control

[barbican:children]
control

[heat:children]
control

[murano:children]
control

[ceph:children]
control

[ironic:children]
control

[influxdb:children]
monitoring

[magnum:children]
control

[sahara:children]
control

[solum:children]
control

[mistral:children]
control

[manila:children]
control

[panko:children]
control

[gnocchi:children]
control

[ceilometer:children]
control

[aodh:children]
control

[congress:children]
control

[tacker:children]
control

Tempest

[tempest:children]
control

[senlin:children]
control

[vmtp:children]
control

[trove:children]
control

[watcher:children]
control

[rally:children]
control

[searchlight:children]
control

[octavia:children]
control

[designate:children]
control

[placement:children]
control

[bifrost:children]
deployment

[zun:children]
control

[skydive:children]
monitoring

[redis:children]
control

Additional control implemented here. These groups allow you to control which

services run on which hosts at a per-service level.

what is your template looks like ? you don’t have ansible_eth1