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
3,952 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


Hope this helps!!

To know more about Mongodb, go for Mongodb training online without fail.

Thanks!

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
829 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
5,898 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, 2020 in Ansible by MD
• 95,460 points
3,849 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 Nov 24, 2020 in Ansible by MD
• 95,460 points
726 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,890 points
903 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 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,040 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP