Hi Readers, this document deals with how to setup ansible role for mongodb server.
Ansible is open source software that automates software provisioning, configuration management, and application deployment. Ansible connects via SSH, remote PowerShell or via other remote APIs.
Here is the setup.
Initialize role set up for MongoDB server using ansible galaxy
once the command is executed, folder structures are automatically created for the role.
create repository file for MongoDB
Create a handler for restarting the service
Create task files for MongoDB
Create task file for centos mongodbserver/tasks/centos.yml
Create task file for debian
Create Template files having monodb configuration.
For centos mongodbserver/templates/mongodc.j2
For debian mongodbserver/templates/mongodd.j2
create bind variable mongodbserver/vars/main.yml
Finally create the playbook for MongoDB mongodb.yml
Finally run the create playbook by executing following command,
© 2018, Techrunnr. All rights reserved.