-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook.yml
40 lines (35 loc) · 1.13 KB
/
playbook.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
- name: archbit.io playbook
hosts: webservers
gather_facts: yes
become: true
become_user: root
become_method: sudo
tasks:
- name: Distribution
debug: msg="{{ ansible_distribution }}{{ ansible_distribution_version }}"
- name: Update package cache and upgrade system
apt:
update_cache: yes
upgrade: dist
- name: Install required packages (gnupg, curl, and redis-server)
apt:
name:
- gnupg
- curl
- redis-server
state: present
update_cache: yes
- name: Download and install MongoDB GPG key
shell: curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
args:
warn: false
- name: Add MongoDB APT repository
apt_repository:
repo: 'deb [ signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main'
state: present
- name: Install Mongodb-org server
package:
name:
- "mongodb-org-server"
state: latest
update_cache: yes