I am trying to use the replace module, and I see all of these examples with \1 and \2 in them. I assume these are for backrefs or soemthing? Can someone explain it to me? I am trying to append “sss” to my passwd and group lines in my nsswitch file. I haven’t tested my code yet, but I would still like to know what \1 \2 mean. Maybe someone can point me to some documentation as I can’t seem to find anything on it myself.
`
- name: Update nsswitch.conf
replace:
path: /etc/nsswitch.conf
regexp: {{item.regexp}}
replace: {{item.replace}}
with_items: - {regexp: ‘^passwd.*’
replace: “\1 sss” }, - {regexp: ‘^group.*’
replace: “\1 sss” }
`