I can ssh to the remote host and do a source /home/username/.bashrc - everything works fine. However if I do:
source /home/username/.bashrc
- name: source bashrc sudo: no
The right way should be:
- hosts: all tasks: - name: source bashrc file shell: "{{ item }}" with_items: - source ~/.bashrc - your other command
Note: it's test in ansible 2.0.2 version
ansible 2.0.2