Skip to content

Instantly share code, notes, and snippets.

@DMeechan
Last active July 26, 2018 15:12
Show Gist options
  • Save DMeechan/f76a5735c94b30051b24468049cd8e9e to your computer and use it in GitHub Desktop.
Save DMeechan/f76a5735c94b30051b24468049cd8e9e to your computer and use it in GitHub Desktop.
DevOps Course Chapter 2 - Ansible
---
- hosts: mygroup
become: yes
become_method: sudo
vars:
NODEJS_VERSION: "10"
ansible_become_pass: devops
gecko_version: 0.17.0
tasks:
- name: Installs Git if it's not already installed
apt:
name: git
state: present
update_cache: yes
- name: Install GPG key for Node.js
apt_key:
url: "https://deb.nodesource.com/gpgkey/nodesource.gpg.key"
state: present
- name: Install the Node.js LTS repository
apt_repository:
repo: "deb https://deb.nodesource.com/node_{{ NODEJS_VERSION }}.x {{ ansible_distribution_release }} main"
state: present
update_cache: yes
- name: Install Node.js
apt:
name: nodejs
state: present
- name: Download the gecko driver
get_url:
url="https://github.com/mozilla/geckodriver/releases/download/v{{ gecko_version }}/geckodriver-v{{ gecko_version }}-linux64.tar.gz" dest=/tmp mode=0777
- name: Install the gecko driver
unarchive:
src="/tmp/geckodriver-v{{ gecko_version }}-linux64.tar.gz"
dest=/usr/local/bin/
mode=0700
copy=no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment