Hello, I'm getting a module failure when trying to use 'replace' and
with_together.
Is there something wrong with my script? thank you.
Tasks:
- name: Gather Current DB Settings - Database Name
shell: grep -v "|" /tmp/directory{{ date }}/{{ item
}}/application/config/production/database.php | grep "'database'" | awk
'{print $3}' | sed "s/\
;//g" | sed "s/'//g"
with_items:
- "{{ products }}"
register: db_name
- name: Update DB Settings - Database Name
replace:
dest: /tmp/directory{{ date }}/{{ item.0
}}/application/config/production/database.php
regexp: '{{ item.1 }}'
replace: '{{ item.2 }}'
with_together:
- "{{ products }}"
- db_name.results
- "{{ database_name_update }}"
Error:
An exception occurred during task execution. The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible_DptbqW/ansible_module_replace.py", line 169, in
<module>
main()
File "/tmp/ansible_DptbqW/ansible_module_replace.py", line 145, in main
mre = re.compile(params['regexp'], re.MULTILINE)
File "/usr/lib64/python2.7/re.py", line 190, in compile
return _compile(pattern, flags)
File "/usr/lib64/python2.7/re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: unexpected end of regular expression
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/12168e06-8121-47a3-ad8a-b5f426b2196d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.