There are many way to do this, one of them is
- debug: msg="{{ item | regex_replace('^/logs/(.*)\.log$', '\\1') |
regex_replace('/', '_') }}"
with_items:
- /logs/other/dyn.log
- /logs/mx/mail.log
- /logs/apache-servers/other.log
- /logs/network/nas01.log
- /logs/mailouts/highvolume/mailout.log
--
Kai Stian Olstad