# How to force Ansible to update PATH?

**URL:** <https://forum.ansible.com/t/how-to-force-ansible-to-update-path/29060>\
**Category:** Ansible Project\
**Created:** [November 19, 2018, 2:23am UTC](https://forum.ansible.com/t/how-to-force-ansible-to-update-path/29060 "2018-11-19T02:23:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitriy\_Panteleyev](https://avatars.discourse-cdn.com/v4/letter/d/a87d85/32.png) [@Dmitriy\_Panteleyev](https://forum.ansible.com/u/Dmitriy_Panteleyev)\
**Post date:** [November 19, 2018, 2:23am UTC](https://forum.ansible.com/t/how-to-force-ansible-to-update-path/29060/1 "2018-11-19T02:23:22Z")

</div>

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 “ 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?
