On 13. mai 2017 00:23, [email protected] wrote:
I see this problem when running a custom fact that is trying to return an IP address string. Ansible reports an empty string, but I see the correct output when I run the fact manually on the target.Running Ansible 2.2.1.0 on Ubuntu 16.04. The Vagrant target is running Centos 6. (I've edited out the real IP address below.) The fact is written like this: #!/bin/bash KA_ROLE=$(cat /var/log/keepalived-state) IP_OWNED=$(ip addr | grep '/32' | grep -Po '(\d+\.){3}\d+') cat <<EOF { "role" : "$KA_ROLE", "vip" : "$IP_OWNED" } EOF
I first guess is that not all commands is in PATH when it's runs through Ansible.
Mot likely ip which in /sbin, use absolute path to the commands and see if that helps.
-- Kai Stian Olstad -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5f028a8b-8dc8-4fbd-f029-416338587a55%40olstad.com. For more options, visit https://groups.google.com/d/optout.
