Created
July 20, 2020 15:36
-
-
Save zeitounator/115035ddab116e61fe5f598316b6318c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ansible localhost -m debug -a msg="{{ '127.0.0.1:cs;128.0.0.1:pd;129.0.0.1:sa;125.0.0.1:zd'.split(';') | map ('regex_replace', '(.*):(.*)', '\\g<1> - \\g<2>') | list }}" | |
localhost | SUCCESS => { | |
"msg": [ | |
"127.0.0.1 - cs", | |
"128.0.0.1 - pd", | |
"129.0.0.1 - sa", | |
"125.0.0.1 - zd" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment