Skip to content
This repository has been archived by the owner on Jan 17, 2018. It is now read-only.

Commit

Permalink
Initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
jnv committed Apr 26, 2015
1 parent ad7107c commit 14e19d0
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 2 additions & 0 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# handlers file for iojs-debian
21 changes: 21 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -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: []

20 changes: 20 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
# vars file for iojs-debian

0 comments on commit 14e19d0

Please sign in to comment.