vars:
script_file: "{{ path }
}"
tasks:
- name: rds_manage_user - run .sql script to alert and create new tables
shell: "mysql -h {{ item.host }
} -u {{ item.user }
} -p{{ item.password }
} < {{ script_file }
} >> /usr/local/testscript.log"
with_items:
- { host:
testhost1.com, user: testuser1, password: "testpass1" }
- { host:
testhost2.com, user: testuser2, password: "testpass2" }
This works and I get the desired output. But how do I pass these hostname, user and password from an external file and it can run through the file and get the script executed in all schemas.
Any help/suggestions would be greatly appreciated. Thanks in advance