Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zeitounator/115035ddab116e61fe5f598316b6318c to your computer and use it in GitHub Desktop.
Save zeitounator/115035ddab116e61fe5f598316b6318c to your computer and use it in GitHub Desktop.
$ 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