Dick above gave a better answer, but just to have the original question literally answered:
- shell: grep -r 'PGPORT=' /opt/db/postgres/bin/ | cut -d: -f2 | cut -d= -f2 | tail -1 register: myport myport['stdout'] will have the value you want -- ---------- Brian Coca -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7egCkTuF0KK-aL_YBRM4MhY69rhud6xfKdqpq1RG623jw%40mail.gmail.com.