Call to ansible -m shell isn't pulling in the correct PATH setting.

Hey Gal’s N Guy’s,

Ansible isn’t sourcing .bashrc or .bash_profile when running -m shell. But when I login via ssh, there isn’t any issues. The shell PATH is set correctly in .bashrc and now also in .bash_profile . As usual /bin/sh points to bash .

Is there another option or a configuration to allow for this? This is a vanilla Ansible install on CentOS 7 .

This has nothing to do with Ansible and everything to do with how shells work.
It has been on the list a few times, search for interactive and non-interactive shell.

Short summary, a non-interactive shell doesn't read those files.
For more, type "man bash" and read the section INVOCATION.