Brian,
Thanks for your help. Your suggestion worked. However, I am having trouble with the pattern in my contain. My file content is
jdbc:oracle:thin:@dev1d111.xxxxxxx.com:1521/AAAA.xxxxxx.com
I have tried various combinations for my contain parameter and I still cannot get a matched file. Please note my definition:
- name: Checking if database URL needs to be changed
find:
paths: '/home/rnair'
pattern: 'test.txt'
contains: "*dev1d111*"
use_regex: true
register: result
become: yes
become_user: root
- debug:
var: result
OUTPUT
TASK [par : debug] *************************************************************
ok: [xxxxx.xx.com] => {
"result": {
"changed": false,
"examined": 10,
"files": [],
"matched": 0,
"msg": ""
}
}
Any idea what is missing?
Thanks in advance
----------------------------