Variables

The following variables are supported:

packages_js

List of packages to install via yarn.

This list can be modified by passing a packages_js array when including the role on a playbook or via –extra-vars from a terminal.

If you want to install a specific package version, then specify name and version attributes for the package.

This variable is empty by default.

# Including from terminal.
ansible localhost -m include_role -a name=constrict0r.jsnode -K -e \
    "{packages_js: [node-red, {name: requests, version: 2.22.0}]}"

# Including on a playbook.
- hosts: servers
  roles:
    - role: constrict0r.jsnode
      packages_js:
        - node-red
        - name: requests
          version: 2.22.0

# To a playbook from terminal.
ansible-playbook -i tests/inventory tests/test-playbook.yml -K -e \
    "{packages_js: [node-red, {name: requests, version: 2.22.0}]}"

configuration

Absolute file path or URL to a .yml file that contains all or some of the variables supported by this role.

It is recommended to use a .yml or .yaml extension for the configuration file.

This variable is empty by default.

# Using file path.
ansible localhost -m include_role -a name=constrict0r.jsnode -K -e \
    "configuration=/home/username/my-config.yml"

# Using URL.
ansible localhost -m include_role -a name=constrict0r.jsnode -K -e \
    "configuration=https://my-url/my-config.yml"

To see how to write a configuration file see the YAML file format section.