Hello,
i want to fill items from file. example below work nice, but if i tried items fill from separate file, then it doesnt work.
postgresql_user:
db: "{{ item.db }}"
name: "{{ item.name }}"
password: "{{ item.password }}"
port: "{{ item.port }}"
with_items:
postgresql_privs:
role: "{{ item.name }}"
database: "{{ item.database }}"
privs: "{{ item.privs }}"
type: "{{ item.type }}"
obj: "{{ item.obj }}"
with_items:
i tried example below but it doesnt work as i expect. I also tried to include file, but it didnt help too
role/name/vars/main.yml
users:
role/name/tasks/main.yml
result:
fatal: [default]: FAILED! => {"msg": "The task includes an option
with an undefined variable. The error was: 'dict object' has no
attribute 'password'\n\nThe error appears to have been in
'/home/m/Documents/Vagrant/postgresql/tests/roles/psql/tasks/main.yml':
line 6, 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-
postgresql_user:\n ^ here\n\nexception type: <class
'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object'
has no attribute 'password'"}
thank you