|
| 1 | +tequila-nodejs |
| 2 | +============== |
| 3 | + |
| 4 | +This repository holds an `Ansible <http://www.ansible.com/home>`_ role |
| 5 | +that is installable using ``ansible-galaxy``. This role depends upon |
| 6 | +`geerlingguy/nodejs |
| 7 | +<https://github.com/geerlingguy/ansible-role-nodejs>`_ and contains |
| 8 | +tasks used to build the front-end assets for a Django web app. It |
| 9 | +exists primarily to support the `Caktus Django project template |
| 10 | +<https://github.com/caktus/django-project-template>`_. |
| 11 | + |
| 12 | +More complete documenation can be found in `caktus/tequila |
| 13 | +<https://github.com/caktus/tequila>`_. |
| 14 | + |
| 15 | + |
| 16 | +License |
| 17 | +------- |
| 18 | + |
| 19 | +This Ansible role is released under the BSD License. See the `LICENSE |
| 20 | +<https://github.com/caktus/tequila-nodejs/blob/master/LICENSE>`_ file for |
| 21 | +more details. |
| 22 | + |
| 23 | + |
| 24 | +Contributing |
| 25 | +------------ |
| 26 | + |
| 27 | +If you think you've found a bug or are interested in contributing to |
| 28 | +this project check out `tequila-nodejs on Github |
| 29 | +<https://github.com/caktus/tequila-nodejs>`_. |
| 30 | + |
| 31 | +Development sponsored by `Caktus Consulting Group, LLC |
| 32 | +<http://www.caktusgroup.com/services>`_. |
| 33 | + |
| 34 | + |
| 35 | +Dependencies |
| 36 | +------------ |
| 37 | + |
| 38 | +- `geerlingguy/nodejs <https://github.com/geerlingguy/ansible-role-nodejs>`_ |
| 39 | + |
| 40 | + |
| 41 | +Installation |
| 42 | +------------ |
| 43 | + |
| 44 | +Create an ``ansible.cfg`` file in your project directory to tell |
| 45 | +Ansible where to install your roles (optionally, set the |
| 46 | +``ANSIBLE_ROLES_PATH`` environment variable to do the same thing, or |
| 47 | +allow the roles to be installed into ``/etc/ansible/roles``) :: |
| 48 | + |
| 49 | + [defaults] |
| 50 | + roles_path = deployment/roles/ |
| 51 | + |
| 52 | +Create a ``requirements.yml`` file in your project's deployment |
| 53 | +directory. It is recommended to include `tequila-common |
| 54 | +<https://github.com/caktus/tequila-common>`_, which sets up the |
| 55 | +project directory structure and users; `tequila-django |
| 56 | +<https://github.com/caktus/tequila-django>`_, which checks out your |
| 57 | +project and installs it as a Django web app; and also include and |
| 58 | +explicitly pin the version of `geerlingguy/nodejs |
| 59 | +<https://github.com/geerlingguy/ansible-role-nodejs>`_, which this |
| 60 | +role depends on to install nodejs and any front-end packages that your |
| 61 | +project requires :: |
| 62 | + |
| 63 | + --- |
| 64 | + # file: deployment/requirements.yml |
| 65 | + - src: https://github.com/caktus/tequila-common |
| 66 | + version: v0.8.0 |
| 67 | + |
| 68 | + - src: https://github.com/caktus/tequila-django |
| 69 | + version: v0.9.11 |
| 70 | + |
| 71 | + - src: geerlingguy.nodejs |
| 72 | + version: 4.1.2 |
| 73 | + name: nodejs |
| 74 | + |
| 75 | + - src: https://github.com/caktus/tequila-nodejs |
| 76 | + version: v0.8.0 |
| 77 | + |
| 78 | +Run ``ansible-galaxy`` with your requirements file :: |
| 79 | + |
| 80 | + $ ansible-galaxy install -r deployment/requirements.yml |
| 81 | + |
| 82 | +or, alternatively, run it directly against the url :: |
| 83 | + |
| 84 | + $ ansible-galaxy install git+https://github.com/caktus/tequila-nodejs |
| 85 | + |
| 86 | +The project then should have access to the ``tequila-nodejs`` role in |
| 87 | +its playbooks. |
| 88 | + |
| 89 | + |
| 90 | +Variables |
| 91 | +--------- |
| 92 | + |
| 93 | +The following variables are used by the ``tequila-nodejs`` role: |
| 94 | + |
| 95 | +- ``project_name`` **required** |
| 96 | +- ``root_dir`` **default:** ``"/var/www/{{ project_name }}"`` |
| 97 | +- ``source_dir`` **default:** ``"{{ root_dir }}/src"`` |
| 98 | +- ``project_user`` **default:** ``"{{ project_name }}"`` |
| 99 | +- ``ignore_devdependencies`` **default:** ``false`` |
| 100 | +- ``nodejs_package_json_path`` **required**, typically should be ``"{{ |
| 101 | + source_dir }}"`` |
| 102 | + |
| 103 | +Due to `some <https://github.com/npm/npm/issues/17471>`_ `issues |
| 104 | +<https://github.com/ansible/ansible/issues/29234>`_ discovered with |
| 105 | +npm not managing package installation when new packages are added to |
| 106 | +the ``devDependencies`` object in package.json, tequila-nodejs checks |
| 107 | +for the presence of any packages in this variable and will throw an |
| 108 | +error if found. This behavior can be disabled by setting |
| 109 | +``ignore_devdependencies`` to ``true``. Any such packages found |
| 110 | +should almost certainly be moved to the ``dependencies`` object |
| 111 | +instead. |
| 112 | + |
| 113 | + |
| 114 | +Notes |
| 115 | +----- |
| 116 | + |
| 117 | +See `geerlingguy/nodejs |
| 118 | +<https://github.com/geerlingguy/ansible-role-nodejs>`_ for the |
| 119 | +expected Ansible configuration variables for that role. |
0 commit comments