How to setup PATH variable in an Ansible task using the environment module?

I’m running Ansble v2.4.0.0 in a RHEL7.2 box.

I’m trying to setup the PATH variable with the following simple task, but I’m getting a syntax error.

`
tasks/main.yml

environment is NOT a module, its a keyword that test the environment
for your task/action.

Doesn’t this say that it is?

http://docs.ansible.com/ansible/latest/playbooks_environment.html

I asked the same question in Stack Overflow How to set existing linux environment variables with ansible? and the answer there makes sense, which is the same answer Brian was alluding to. Thanks!