Add all files needed to bring up VM and run agaric.com locally

This commit is contained in:
benjamin melançon 2018-08-20 10:45:20 -04:00
parent 52c8b60bac
commit 4d2bc0ee24
742 changed files with 24037 additions and 0 deletions

View file

@ -0,0 +1,41 @@
---
- include: setup-RedHat.yml
when: ansible_os_family == 'RedHat'
- include: setup-Debian.yml
when: ansible_os_family == 'Debian'
- name: Define nodejs_install_npm_user
set_fact:
nodejs_install_npm_user: "{{ ansible_user | default(lookup('env', 'USER')) }}"
when: nodejs_install_npm_user is not defined
- name: Create npm global directory
file:
path: "{{ npm_config_prefix }}"
owner: "{{ nodejs_install_npm_user }}"
group: "{{ nodejs_install_npm_user }}"
state: directory
- name: Add npm_config_prefix bin directory to global $PATH.
template:
src: npm.sh.j2
dest: /etc/profile.d/npm.sh
mode: 0644
- name: Ensure npm global packages are installed.
npm:
name: "{{ item.name | default(item) }}"
version: "{{ item.version | default('latest') }}"
global: yes
state: latest
environment:
NPM_CONFIG_PREFIX: "{{ npm_config_prefix }}"
NODE_PATH: "{{ npm_config_prefix }}/lib/node_modules"
NPM_CONFIG_UNSAFE_PERM: "{{ npm_config_unsafe_perm }}"
with_items: "{{ nodejs_npm_global_packages }}"
- name: Install packages defined in a given package.json.
npm:
path: "{{ nodejs_package_json_path }}"
when: nodejs_package_json_path is defined and nodejs_package_json_path

View file

@ -0,0 +1,25 @@
---
- name: Ensure apt-transport-https is installed.
apt: name=apt-transport-https state=present
- name: Add Nodesource apt key.
apt_key:
url: https://keyserver.ubuntu.com/pks/lookup?op=get&fingerprint=on&search=0x1655A0AB68576280
id: "68576280"
state: present
- name: Add NodeSource repositories for Node.js.
apt_repository:
repo: "{{ item }}"
state: present
with_items:
- "deb https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
- "deb-src https://deb.nodesource.com/node_{{ nodejs_version }} {{ ansible_distribution_release }} main"
register: node_repo
- name: Update apt cache if repo was added.
apt: update_cache=yes
when: node_repo.changed
- name: Ensure Node.js and npm are installed.
apt: "name=nodejs={{ nodejs_version|regex_replace('x', '') }}* state=present"

View file

@ -0,0 +1,37 @@
---
- name: Set up the Nodesource RPM directory for Node.js > 0.10.
set_fact:
nodejs_rhel_rpm_dir: "pub_{{ nodejs_version }}"
when: nodejs_version != '0.10'
- name: Set up the Nodesource RPM variable for Node.js == 0.10.
set_fact:
nodejs_rhel_rpm_dir: "pub"
when: nodejs_version == '0.10'
- name: Import Nodesource RPM key (CentOS < 7).
rpm_key:
key: http://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
state: present
when: ansible_distribution_major_version|int < 7
- name: Import Nodesource RPM key (CentOS 7+)..
rpm_key:
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL
state: present
when: ansible_distribution_major_version|int >= 7
- name: Add Nodesource repositories for Node.js (CentOS < 7).
yum:
name: "http://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm"
state: present
when: ansible_distribution_major_version|int < 7
- name: Add Nodesource repositories for Node.js (CentOS 7+).
yum:
name: "https://rpm.nodesource.com/{{ nodejs_rhel_rpm_dir }}/el/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/nodesource-release-el{{ ansible_distribution_major_version }}-1.noarch.rpm"
state: present
when: ansible_distribution_major_version|int >= 7
- name: Ensure Node.js and npm are installed.
yum: "name=nodejs-{{ nodejs_version[0] }}.* state=present enablerepo='epel,nodesource'"