# Copyright 2020, Andrew Klychkov # 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