I've installed ansible via the ubuntu apt package ansible
, I am trying to use the npm module which is an extras module, which is provided only in the ansible-modules-extras
Github repository.
How do I install ansible-modules-extras?
Looking at where files were installed as part of the ansible apt package, I would guess I have to merge some of the source codes folders to like /usr/share/ansible
or somewhere under /usr/lib/python2.7/dist-packages/ansible
.
I ask this as I get this error from the Ansible output:
msg: Failed to find required executable npm
The quickest way is to simply have a folder called library/ in the same folder as your playbook. Inside this folder, place the python script for the Ansible Module. You should now have a corresponding task available to your playbook.
To begin, choose the package manager on your local computer. For instance, if you're going to write your Ansible instructions (a "playbook," as it's called in Ansible) on a laptop running Fedora, start with the dnf module. If you're writing on Elementary OS, use the apt module, and so on.
ansible/plugins/modules/ /usr/share/ansible/plugins/modules/
Ansible extras are included in the Ubuntu ansible
apt package.
The target machine must have npm installed, apt package npm
, can be installed like so via Ansible:
tasks:
- name: install npm
apt: pkg=npm state=present
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With