File tree Expand file tree Collapse file tree 6 files changed +85
-4
lines changed Expand file tree Collapse file tree 6 files changed +85
-4
lines changed Original file line number Diff line number Diff line change 27
27
DISTRIBUTION=ubuntu-upstart
28
28
DIST_VERSION=12.04
29
29
MONGODB_VERSION=2.6
30
+ - >
31
+ DISTRIBUTION=centos
32
+ DIST_VERSION=6
33
+ MONGODB_VERSION=2.6
34
+ - >
35
+ DISTRIBUTION=centos
36
+ DIST_VERSION=6
37
+ MONGODB_VERSION=3.0
38
+ - >
39
+ DISTRIBUTION=centos
40
+ DIST_VERSION=6
41
+ MONGODB_VERSION=3.2
42
+ - >
43
+ DISTRIBUTION=centos
44
+ DIST_VERSION=7
45
+ MONGODB_VERSION=2.6
46
+ - >
47
+ DISTRIBUTION=centos
48
+ DIST_VERSION=7
49
+ MONGODB_VERSION=3.0
50
+ - >
51
+ DISTRIBUTION=centos
52
+ DIST_VERSION=7
53
+ MONGODB_VERSION=3.2
30
54
# - >
31
55
# distribution=ubuntu-upstart
32
56
# version=12.04
Original file line number Diff line number Diff line change 1
1
---
2
2
3
- - include_vars : " {{ansible_distribution}}.yml"
4
-
5
3
- name : Check if running on systemd
6
4
command : cat /proc/1/cmdline
7
5
register : systemd
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ - name : Add YUM repository
4
+ template :
5
+ src : mongodb.repo.j2
6
+ dest : /etc/yum.repos.d/mongodb.repo
7
+ mode : 0644
8
+ with_items : " {{ mongodb_version[0:3] }}"
9
+ when : mongodb_package == 'mongodb-org'
10
+
11
+ - name : Install MongoDB package
12
+ yum :
13
+ name : " {{ item }}"
14
+ state : present
15
+ with_items :
16
+ - " {{ mongodb_package }}"
17
+ - numactl
18
+
19
+ - name : Install PyMongo package
20
+ yum :
21
+ name : python-pymongo
22
+ state : latest
23
+ when : not mongodb_pymongo_from_pip
24
+
25
+ - name : Install PIP
26
+ yum :
27
+ name : " {{ item }}"
28
+ with_items :
29
+ - python-devel
30
+ - python-pip
31
+ when : mongodb_pymongo_from_pip
32
+
33
+ - name : Install PyMongo from PIP
34
+ pip :
35
+ name : pymongo
36
+ state : latest
37
+ when : mongodb_pymongo_from_pip
Original file line number Diff line number Diff line change 1
1
---
2
2
3
+ - name : Include OS-specific variables
4
+ include_vars : " {{ item }}"
5
+ with_first_found :
6
+ - " {{ ansible_distribution }}.yml"
7
+ - " {{ ansible_os_family }}.yml"
8
+
3
9
- name : Include installation on Debian-based OS
4
- include : install.deb.yml
5
- when : ansible_os_family == 'Debian'
10
+ include : " install.{{ ansible_os_family | lower }}.yml"
6
11
tags : [mongodb]
7
12
8
13
- name : Include configuration.yml
Original file line number Diff line number Diff line change
1
+ [mongodb-org-{{ mongodb_version }}]
2
+ name=MongoDB {{ mongodb_version }} Repository
3
+ baseurl={{ mongodb_repository[item] }}
4
+ gpgcheck={{ mongodb_repository_gpgkey[item] is defined | ternary(1,0) }}
5
+ {% if mongodb_repository_gpgkey [item ] is defined %}
6
+ gpgkey={{ mongodb_repository_gpgkey[item] }}
7
+ {% endif %}
8
+ enabled=1
Original file line number Diff line number Diff line change
1
+ ---
2
+
3
+ mongodb_repository :
4
+ " 2.6 " : " http://downloads-distro.mongodb.org/repo/redhat/os/$basearch/"
5
+ " 3.0 " : " https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/$basearch/"
6
+ " 3.2 " : " https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/$basearch/"
7
+
8
+ mongodb_repository_gpgkey :
9
+ " 3.2 " : " https://www.mongodb.org/static/pgp/server-3.2.asc"
You can’t perform that action at this time.
0 commit comments