---
- hosts: localhost
gather_facts: no
vars:
SVNRepName_Location: /mydata/myserver/ConServer1
tasks:
# copy config files to the backup folder it's working
- name: Copy each file to backupfolder
copy:
src: "{{ item }}"
dest: "{{ SVNRepName_Location}}/backup-October2019"
with_fileglob:
- "{{ SVNRepName_Location }}/conf/*"
# looking for line is in a file, or replace an existing line using a back-referenced regular expression.
- name: looking for password and replacing the field replace line in multiple files using lineinfile
lineinfile:
path: /mydata/myserver/ConServer1/conf/TMSS-KKKU.yml
#The String to Search for Password
regexp: 'Password\s+:\s+[a-zA-Z0-9{\s+}]+'
# The String to Replace
line: ' Password : {{ Password }}'
# backrefs: yes
state: present
Hi All,
I want to use the loop in task replace line in multiple files using lineinfile.
Instead of the path can I use dest: and provide the with_fileglob?
How do I use looping?
I have an example but I am not sure how to use it.
Thanks,
Nav