Installing mongodb using ansible

0 votes
I'm trying to install MongoDB using ansible. How will my playbook look?
Mar 15, 2019 in Ansible by Neel
2,044 views

1 answer to this question.

0 votes

Your mongodb role should look something like this:

- name: MongoDB - Import public key
  apt_key:
    keyserver: hkp://keyserver.ubuntu.com:80
    id: EA312927

- name: MongoDB - Add repository
  apt_repository:
    filename: '/etc/apt/sources.list.d/mongodb-org-3.2.list'
    repo: 'deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse'
    state: present
    update_cache: yes

- name: MongoDB - Install MongoDB
  apt:
    name: mongodb-org
    state: present
    update_cache: yes

- name: MongoDB - Running state
  service:
    name: mongod
    state: started
answered Mar 15, 2019 by Purva

Related Questions In Ansible

0 votes
1 answer

style.css not getting executed while installing lamp stack using ansible

Hey @Kishore make sure, your folder directory ...READ MORE

answered Feb 9, 2019 in Ansible by Monish
97 views
0 votes
1 answer

Installing nodejs using ansible

Your role should look something like this: - ...READ MORE

answered Mar 15, 2019 in Ansible by Hari
3,036 views
0 votes
1 answer

How to install mongodb on centos 7 using ansible

Hi@Shashi, I think for MongoDB you need to ...READ MORE

answered Sep 16 in Ansible by MD
• 78,830 points
160 views
0 votes
1 answer

I am having issues installing basic packages using ansible

Hi@akhtar, Every application has some dependencies. Then only ...READ MORE

answered 1 day ago in Ansible by MD
• 78,830 points
9 views
0 votes
1 answer

How can I create a new user using ansible ploybook?

You're switching from the root user. Root ...READ MORE

answered Mar 29, 2018 in Ansible by DareDev
• 6,870 points
267 views
+1 vote
3 answers
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
805 views
+2 votes
1 answer