ansible/test/integration/targets/setup_mongodb_v4/tasks/setup_mongodb.yml
Andrew Klychkov 0bb2d67562
add new module mongodb_info (#67846)
* add new module mongodb_info

* fix doc and examples

* add GPL info

* use LooseVersion in the function doc string
2020-02-29 15:37:52 +01:00

34 lines
946 B
YAML

# Copyright 2020, Andrew Klychkov <aaklychkov@mail.ru>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
- name: Set up repo
yum_repository:
name: '{{ mongodb_repo_name }}'
description: '{{ mongodb_repo_descr }}'
baseurl: '{{ mongodb_repo_link }}'
gpgkey: '{{ mongodb_gpgkey }}'
gpgcheck: yes
- name: Install MongoDB packages
yum:
name: '{{ mongodb_pkgs }}'
state: present
notify: Remove MongoDB packages
- name: Install pymongo
shell: git clone '{{ pymongo_repo }}' pymongo && cd pymongo/ && python setup.py install
- name: Start MongoDB
systemd:
name: mongod.service
state: started
notify: Stop MongoDB
- name: Create admin user
mongodb_user:
login_port: '{{ mongodb_default_port }}'
database: '{{ mongodb_default_db }}'
name: '{{ mongodb_admin_user }}'
password: '{{ mongodb_admin_password }}'
roles: root
state: present