-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongodb.yml
executable file
·105 lines (92 loc) · 3.09 KB
/
mongodb.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# 核心任务
- name: MongoDB
hosts: all
become: yes
become_method: sudo
gather_facts: True
vars_files:
- vars/main.yml
vars_prompt:
- name: 'mongodb_version_selection'
prompt: "\nPlease choose the number for MongoDB version [ 1/2/3/4] \n\n
1: MongoDB3.0(support Ubuntu16 and redhat)\n
2: MongoDB3.2(support Ubuntu16 and redhat)\n
3: MongoDB3.3(support Ubuntu16)\n
4: MongoDB3.4(support Ubuntu16 and redhat)\n
5: MongoDB3.5(support Ubuntu16 )\n
6: MongoDB3.6(support Ubuntu16|18 and redhat)\n
7: MongoDB3.7(support Ubuntu16)\n
8: MongoDB4.0(support Ubuntu16|18 and redhat)\n
9: MongoDB4.2(support Ubuntu16|18 and redhat)\n
10: MongoDB4.4(support Ubuntu16|18|20 and redhat)\n
11: MongoDB5.0(support Ubuntu16|18|20 and redhat)\n"
private: no
default: 4
- name: 'mongodb_server_selection'
prompt: "\nMongoDB Community or MongoDB Enterprise? [ 1/2 ] \n\n
1: MongoDB Community\n
2: MongoDB Enterprise\n"
private: no
default: 1
- name: 'mongodb_remote_selection'
prompt: "\nDo you want to enable MongoDB remote connection? [ 1/2 ] \n\n
1: Yes\n
2: No\n"
private: no
default: 1
- name: 'mongodb_authentication_selection'
prompt: "\nDo you want to enable authentication (add administrator user) for MongoDB? [ 1/2 ] \n\n
1: Yes\n
2: No\n"
private: no
default: 1
- name: 'mongodb_adminmongo_selection'
prompt: "\nDo you want to install adminMongo of Docker? [ 1/2 ] \n\n
1: Yes\n
2: No\n"
private: no
default: 1
vars:
mongodb_version_select:
'1': '3.0'
'2': '3.2'
'3': '3.3'
'4': '3.4'
'5': '3.5'
'6': '3.6'
'7': '3.7'
'8': '4.0'
'9': '4.2'
'10': '4.4'
'11': '5.0'
mongodb_server_select:
'1': 'community'
'2': 'enterprise'
mongodb_remote_select:
'1': True
'y': True
'2': False
'n': False
mongodb_authentication_select:
'1': True
'y': True
'2': False
'n': False
mongodb_adminmongo_select:
'1': True
'y': True
'2': False
'n': False
mongodb_version: "{{mongodb_version_select[mongodb_version_selection]}}"
mongodb_server: "{{mongodb_server_select[mongodb_server_selection]}}"
mongodb_remote: "{{mongodb_remote_select[mongodb_remote_selection]}}"
mongodb_authentication: "{{mongodb_authentication_select[mongodb_authentication_selection]}}"
mongodb_adminmongo: "{{mongodb_adminmongo_select[mongodb_adminmongo_selection]}}"
roles:
- {role: role_common, tags: "role_common"}
- {role: role_cloud, tags: "role_cloud"}
- {role: role_mongodb, tags: "role_mongodb"}
- {role: role_docker, tags: "role_docker", when: mongodb_adminmongo}
- {role: role_init, tags: "role_init"}
- {role: role_preend, tags: "role_preend"}
- {role: role_end, tags: "role_end"}