diff --git a/README.md b/README.md new file mode 100644 index 0000000..051c90b --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +# io.js Ansible Role for Debian and Ubuntu + +Setup [io.js](https://iojs.org/) repository and install binary package [provided by Nodesource](https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories). + +## Supported Distributions + +Only the latest versions of Ubuntu and Debian are supported by Nodesource. + +Ubuntu since version 14.04 (trusty). + +Debian since Jessie. + +## Requirements + +The role uses [apt_repository module](http://docs.ansible.com/apt_repository_module.html) which has additional dependencies. You can use [bootstrap-debian](https://github.com/cederberg/ansible-bootstrap-debian) role to setup common Ansible requirements on Debian-based systems. + +Furthermore the repository uses HTTPS, so make sure package `apt-transport-https` is available on your system. + +## Role Variables + +- `iojs_version`: Version of the io.js package to install. + - Default: `"1.8.*"` + - **Note**: Package version contains suffix, so make sure to always end the version specification with asterisk, e.g. `1.8.1*` +- `iojs_repo_base`: Base URL for the package repository. + - Default: `"https://deb.nodesource.com/iojs_1.x"` +- `iojs_repo_key_url`: Repository GPG key to install. + - Default: `"https://deb.nodesource.com/gpgkey/nodesource.gpg.key"` +- `iojs_repo_key_id`: ID of the GPG key to be installed to prevent needless download. + - Default: `"1655A0AB68576280"` + +## Example Playbook + + - hosts: servers + roles: + - { role: jnv.iojs-debian } + +## License + +[![CC0 Public Domain](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/) diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..27ddca9 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,6 @@ +--- +# defaults file for iojs-debian +iojs_version: 1.8.* +iojs_repo_base: https://deb.nodesource.com/iojs_1.x +iojs_repo_key_url: https://deb.nodesource.com/gpgkey/nodesource.gpg.key +iojs_repo_key_id: "1655A0AB68576280" diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..debfb01 --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for iojs-debian diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..072bc87 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,21 @@ +--- +galaxy_info: + author: Jan Vlnas + description: Setup io.js with repository from Nodesource + license: CC0 + min_ansible_version: 1.6 + platforms: + - name: Ubuntu + versions: + - trusty + - vivid + - utopic + - name: Debian + versions: + - jessie + - sid + categories: + - development + - system +dependencies: [] + diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..e1dc774 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,20 @@ +--- +# tasks file for iojs-debian + +- name: Setup Nodesource GPG key + apt_key: + url: "{{iojs_repo_key_url}}" + id: "{{iojs_repo_key_id}}" + state: present + +- name: Add the Nodesource repository + apt_repository: + # 'deb https://deb.nodesource.com/iojs_1.x ${DISTRO} main' + repo: "deb {{iojs_repo_base}} {{ansible_distribution_release}} main" + state: present + update_cache: yes + +- name: Install the iojs package + apt: + name: "iojs={{iojs_version}}" + state: present diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..d872d2f --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,2 @@ +--- +# vars file for iojs-debian