Skip to content

Instantly share code, notes, and snippets.

@kharandziuk
Created June 12, 2015 11:37
Show Gist options
  • Save kharandziuk/c11beb0a826a1ec225f1 to your computer and use it in GitHub Desktop.
Save kharandziuk/c11beb0a826a1ec225f1 to your computer and use it in GitHub Desktop.
Playbook. Installs MongoDB 3.* with ansible
- name: Machine with mongodb 3
hosts: all
sudo: True
tasks:
- name: set locale
lineinfile: dest=/etc/default/locale line="LC_ALL=C"
- name: Add mongo ppa key
apt_key: >
keyserver=hkp://keyserver.ubuntu.com:80
id=7F0CEB10
state=present
- name: Add mongo sources list
lineinfile: >
line="deb http://repo.mongodb.org/apt/ubuntu {{ansible_lsb.codename}}/mongodb-org/3.0 multiverse"
dest=/etc/apt/sources.list.d/mongodb.list
state=present
create=yes
- name: Install mongo
apt: name=mongodb-org state=latest update_cache=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment