Skip to content

Instantly share code, notes, and snippets.

@afgane
Created June 23, 2016 23:11
Show Gist options
  • Save afgane/b113b4ea5b4cc1ecdcf50c024484021e to your computer and use it in GitHub Desktop.
Save afgane/b113b4ea5b4cc1ecdcf50c024484021e to your computer and use it in GitHub Desktop.
Setting up a server for CloudLaunch

Create an inventory file called hosts with the following content (adjusting the IP address++)

[ansible-hosts]
52.90.250.61 ansible_ssh_private_key_file=key_pair.pem  ansible_ssh_user=ubuntu  # Ubuntu target

From an Ansible-enabled machine, download playbook.yml and run it with

ansible-playbook -i hosts playbook.yml
---
- hosts: ansible-hosts
become: yes
become_user: root
tasks:
- name: Add Ansible PPA
apt_repository: repo={{ item }} update_cache=no
with_items:
- ppa:fkrull/deadsnakes
- ppa:ansible/ansible
- name: add NodeSource repository for Node.js 6.0
apt_repository: repo='{{ item }} https://deb.nodesource.com/node_6.x {{ ansible_distribution_release|lower }} main' state=present update_cache=no
with_items:
- deb
- deb-src
- name: Update APT cache
apt: update_cache=yes
- name: Install system packages
apt: pkg={{ item }} state=latest install_recommends=no force=yes
with_items:
- ansible
- gcc
- git-core
- libffi-dev
- libncurses5-dev
- libssl-dev
- nodejs
- python3.5
- python3.5-dev
- python-pip
- python-virtualenv
- python-setuptools
- software-properties-common
- wget
- vim
- name: Install global npm packages
npm: name={{ item }} global=yes
with_items:
- tsd
- typings
- name: Update python-setuptools
pip: name=setuptools version=23.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment