I have Ansible role "db" with a simple task:
- name: Check repos apt_repository: repo="{{ item.repo }}" state={{ item.state }} with_items: - "{{ apt_repos }}"
In / defaults / mail.yml:
apt_repos:
# Percona - { state: present, repo: 'deb http://repo.percona.com/apt wheezy main', keyserver: 'keyserver.ubuntu.com', key: '1C4CBDCDCD2EFD2A', needkey: True } - { state: present, repo: 'deb-src http://repo.percona.com/apt wheezy main', needkey: False }
When I try to run this boot book:
--- - hosts: test roles: - db
I see an error:
fatal: [10.10.10.10] => One or more undefined variables: 'unicode object' has no attribute 'repo' FATAL: all hosts have already failed -- aborting
But I have another role with the same task and variable, and it works great. What's wrong?
source share