forked from Voronenko/ansible-developer_recipes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks_mongodb_3.yml
33 lines (28 loc) · 903 Bytes
/
tasks_mongodb_3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
# Parameters:
# prudentia_dir (provided)
- set_fact:
mongodb_service_name: mongod
- name: MongoDB | Check if is present
command: test -x /usr/bin/mongo
ignore_errors: yes
register: mongo_present
tags:
- mongodb3
- name: MongoDB | Add GPG key to apt keyring
apt_key: id=7F0CEB10 url=http://docs.mongodb.org/10gen-gpg-key.asc
become: yes
tags:
- mongodb3
- name: MongoDB | Add Debian apt repository
apt_repository: repo="deb http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/3.4 multiverse"
when: ansible_os_family == "Debian" and mongo_present|failed
become: yes
tags:
- mongodb3
- name: MongoDB | Install
apt: update-cache=yes force=yes state=present pkg=mongodb-org
when: ansible_os_family == "Debian" and mongo_present|failed
become: yes
tags:
- mongodb3