This is a collection of Ansible-deployed workshop environments. Use it in combination with the student workbook content, from the repo at https://github.com/RedHatGov/redhatgov.github.io
According to the regex notation used in Ansible documentation, shorthand characters and backreferences used in regex filter should be preceded by two backslashes (\\) in YAML. According to the same documentation:
Prior to ansible 2.0, if “regex_replace” filter was used with variables inside YAML arguments (as opposed to simpler ‘key=value’ arguments), then you needed to escape backreferences (for example, \\1) with 4 backslashes (\\\\) instead of 2 (\\).
So it appears that the source of your troubles with regex_replace is the number of backslashes. This is not surprising as it is a little different from the the notation used in Perl or even in the Python script in the rest of the project.
According to the regex notation used in Ansible documentation, shorthand characters and backreferences used in regex filter should be preceded by two backslashes (
\\
) in YAML. According to the same documentation:So it appears that the source of your troubles with
regex_replace
is the number of backslashes. This is not surprising as it is a little different from the the notation used in Perl or even in the Python script in the rest of the project.