Ansible lineinfile module: unsupported parameter for module: path
Is Ansible giving you the error
unsupported parameter for module: path when you’re using
Check your Ansible-version!
You probably used path (as of version 2.3) instead of dest.
$ ansible --version ansible 184.108.40.206 config file = configured module search path = Default w/o overrides
As the Ansible documentation states:
As of Ansible 2.3, the
destoption has been changed to
pathas default, but
deststill works as well.
This fixed it for me. Now I can ensure composer is in my path.
# file composer.yml # add composer to $PATH - lineinfile: regexp: 'export PATH=".*/project/vendor/bin.*"' line: 'export PATH="$PATH:/project/vendor/bin"' state: present dest: /home/vagrant/.bashrc
Explanation of the parts:
- regexp: the regular expression to look for. The line that matches will be used for
- line: this is the line that will be inserted/replaced into the file
- state: whether or not
lineshould be there. Tip: for advanced usage, look at
backrefsfor changing parts of the line.
- dest: the file we want the line in