How to force Ansible to update PATH?

10 views
Skip to first unread message

Dmitriy Panteleyev

unread,
Nov 18, 2018, 9:23:22 PM11/18/18
to Ansible Project
I am installing snapd via Ansible on *buntu.

After installation, snap binaries are linked from `/snap/bin`.  When snapd is installed, it adds a script to `/etc/profile.d/` that basically add /snap/bin to bash PATH.

My problem is that I cannot find a way to force Ansible to refresh the path, so subsequent roles/tasks fail with "<name of snap executable> command not found in PATH"

I have tried:

1. Ansible `meta: reset_connection` task -- fails with message "unable to reset this type of connection" (local)
2. In playbook: `environment: PATH: '/snap/bin:{{ ansible_env.PATH }}' -- no effect
3. In role: `shell: 'export PATH=$PATH:/snap/bin'` -- no effect

Short of forcing a reboot mid-way through a playbook, any other ideas?
Reply all
Reply to author
Forward
0 new messages