Ansible role that installs and configures mongodb
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

- block:
- name: Create the acme hooks directory if it does not yet exist
dest: '{{ letsencrypt_acme_services_scripts_dir }}'
state: directory
owner: root
group: root
- name: Install a script that fix the letsencrypt certificate for mongodb and then reload the service
dest: '{{ letsencrypt_acme_services_scripts_dir }}/mongodb'
owner: root
group: root
mode: 4555
- name: Create the mongodb certificate directory
dest: '{{ mongodb_ssl_cert_dir }}'
state: directory
owner: root
group: mongodb
mode: 0750
- name: Verify if the mongodb pem file exists
path: '{{ mongodb_ssl_certkey_file }}'
register: mongodb_pem
- name: Copy the certificate and its key where the mongo server expects it
command: "{{ letsencrypt_acme_services_scripts_dir }}/mongodb"
when: not mongodb_pem.stat.exists
- mongodb_ssl_letsencrypt_managed
- letsencrypt_acme_install
tags: [ 'mongodb', 'letsencrypt', 'mongodb_letsencrypt' ]