mkouhei/ansible-role-includecsv

Module not picking updated CSV file

Opened this issue · 0 comments

Hello Kouhei Maeda,

Thanks for module, I wrote below code to execute the SQLPLUS against the remote DB. I have client schema names and connection string in CSV as below format.
"DB_SCHEMA","SYSTEM_USER","SYSTEM_PASSWORD","TNS_NAME","TNS_DESCRIPTION" "ClientSchema1","admin","password","server1","(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))" "ClientSchema_2","admin","password2","server2","(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server2)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))" "ClientSchema_3","admin","password2","server2","(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server2)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))"

- include_csv: src=/PATH_TO_CSV/client_schema_output.csv delimiter="," shell: source ~/.bash_profile && sqlplus -S '{{ item.SYSTEM_USER }}/{{ item.SYSTEM_PASSWORD }}@{{ item.TNS_DESCRIPTION }}' @"roles/my_role/files/client.sql" {{ item.DB_SCHEMA }} connection: local sudo: no with_items: "{{ client_schema_output }}"

However for some reason it's not picking dynamic CSV, I did see CSV got updated with latest entries but not my task, it's still running against old TNS entries.

changed: [10.202.98.198] => (item={u'DB_SCHEMA': u'ClientSchema_1', u'SYSTEM_PASSWORD': u'password', u'SYSTEM_USER': u'admin', u'TNS_DESCRIPTION': u'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))', u'TNS_NAME': u'server1'}) => { "changed": true, "cmd": "source ~/.bash_profile && sqlplus -S 'admin/password@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)))' @\"roles/MY_Role/files/hotfix_client.sql\" ClientSchema_1",

This is never getting changes even though I updated the CSV with new entries.
Please let me know if I am doing something wrong here.

Thank you

  • Raj