Compare commits
No commits in common. "master" and "feauture/20970" have entirely different histories.
master
...
feauture/2
|
@ -49,9 +49,9 @@ mongodb_directoryperdb: 'false'
|
||||||
mongodb_conf_file: /etc/mongod.conf
|
mongodb_conf_file: /etc/mongod.conf
|
||||||
mongodb_daemon: /usr/bin/mongod
|
mongodb_daemon: /usr/bin/mongod
|
||||||
mongod_additional_options: ""
|
mongod_additional_options: ""
|
||||||
# mongodb_allowed_hosts:
|
mongodb_allowed_hosts:
|
||||||
# - 127.0.0.1/8
|
- 127.0.0.1/8
|
||||||
# - '{{ ansible_default_ipv4.address }}/32'
|
- '{{ ansible_default_ipv4.address }}/32'
|
||||||
|
|
||||||
mongodb_storage_engine: wiredTiger
|
mongodb_storage_engine: wiredTiger
|
||||||
|
|
||||||
|
@ -81,11 +81,10 @@ mongodb_cluster_enabled: False
|
||||||
mongodb_authorization_enabled: False
|
mongodb_authorization_enabled: False
|
||||||
mongodb_replicaset: storagedev
|
mongodb_replicaset: storagedev
|
||||||
mongodb_replica_keyfile: '{{ mongodb_dbpath }}/replica_keyfile'
|
mongodb_replica_keyfile: '{{ mongodb_dbpath }}/replica_keyfile'
|
||||||
mongodb_oplog_size: 2000
|
|
||||||
|
|
||||||
# Prometheus metrics
|
# Prometheus metrics
|
||||||
mongodb_prometheus_exporter_enabled: false
|
mongodb_prometheus_exporter_enabled: False
|
||||||
mongodb_prometheus_exporter_version: '0.39.0'
|
mongodb_prometheus_exporter_version: '0.30.0'
|
||||||
mongodb_prometheus_exporter_dir: 'mongodb_exporter-{{ mongodb_prometheus_exporter_version }}.linux-amd64'
|
mongodb_prometheus_exporter_dir: 'mongodb_exporter-{{ mongodb_prometheus_exporter_version }}.linux-amd64'
|
||||||
mongodb_prometheus_exporter_file: '{{ mongodb_prometheus_exporter_dir }}.tar.gz'
|
mongodb_prometheus_exporter_file: '{{ mongodb_prometheus_exporter_dir }}.tar.gz'
|
||||||
mongodb_prometheus_exporter_download_url: 'https://github.com/percona/mongodb_exporter/releases/download/v{{ mongodb_prometheus_exporter_version }}/{{ mongodb_prometheus_exporter_file }}'
|
mongodb_prometheus_exporter_download_url: 'https://github.com/percona/mongodb_exporter/releases/download/v{{ mongodb_prometheus_exporter_version }}/{{ mongodb_prometheus_exporter_file }}'
|
||||||
|
|
|
@ -68,3 +68,13 @@
|
||||||
when: mongodb_prometheus_exporter_enabled
|
when: mongodb_prometheus_exporter_enabled
|
||||||
tags: [ 'mongodb', 'prometheus', 'mongodb_prometheus' ]
|
tags: [ 'mongodb', 'prometheus', 'mongodb_prometheus' ]
|
||||||
|
|
||||||
|
- name: No mongodb exporter
|
||||||
|
block:
|
||||||
|
- name: Ensure that prometheus mongodb_exporter is stopped and disabled
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: mongodb_exporter
|
||||||
|
state: stopped
|
||||||
|
enabled: no
|
||||||
|
|
||||||
|
when: not mongodb_prometheus_exporter_enabled
|
||||||
|
tags: [ 'mongodb', 'prometheus', 'mongodb_prometheus' ]
|
||||||
|
|
|
@ -44,7 +44,7 @@ security:
|
||||||
keyFile: {{ mongodb_replica_keyfile }}
|
keyFile: {{ mongodb_replica_keyfile }}
|
||||||
|
|
||||||
replication:
|
replication:
|
||||||
oplogSizeMB: {{ mongodb_oplog_size }}
|
oplogSizeMB: 2000
|
||||||
replSetName: {{ mongodb_replicaset }}
|
replSetName: {{ mongodb_replicaset }}
|
||||||
enableMajorityReadConcern: false
|
enableMajorityReadConcern: false
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -12,31 +12,17 @@ echo "$DATE" > $LE_LOG_DIR/mongodb.log
|
||||||
|
|
||||||
[ ! -d $MONGODB_CERTDIR ] && mkdir $MONGODB_CERTDIR
|
[ ! -d $MONGODB_CERTDIR ] && mkdir $MONGODB_CERTDIR
|
||||||
|
|
||||||
cat ${LE_CERTS_DIR}/{fullchain,privkey} > ${MONGODB_CERTFILE}.new
|
|
||||||
cmp ${MONGODB_CERTFILE}.new ${MONGODB_CERTFILE} 2>/dev/null
|
|
||||||
if [ $? -eq 0 ] ; then
|
|
||||||
echo "The certificate is up to date" >> $LE_LOG_DIR/mongodb.log
|
|
||||||
rm -f ${MONGODB_CERTFILE}.new
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Building the new certificate file" >> $LE_LOG_DIR/mongodb.log
|
echo "Building the new certificate file" >> $LE_LOG_DIR/mongodb.log
|
||||||
/bin/mv -f ${MONGODB_CERTFILE}.new ${MONGODB_CERTFILE}
|
cat ${LE_CERTS_DIR}/{cert,privkey} > ${MONGODB_CERTFILE}
|
||||||
chmod 440 ${MONGODB_CERTFILE}
|
chmod 440 ${MONGODB_CERTFILE}
|
||||||
chgrp mongodb ${MONGODB_CERTFILE}
|
chgrp mongodb ${MONGODB_CERTFILE}
|
||||||
|
|
||||||
{% if mongodb_ssl_enabled %}
|
{% if mongodb_ssl_enabled %}
|
||||||
echo "Restart the mongod service, reload is not supported" >> "$LE_LOG_DIR/mongodb.log"
|
echo "Reload the mongod service" >> "$LE_LOG_DIR/mongodb.log"
|
||||||
{% if mongodb_install_from_external_repo %}
|
{% if mongodb_install_from_external_repo %}
|
||||||
if [ -x /sbin/stop ] && [ -f /etc/init/mongod.conf ] ; then
|
service mongod stop >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
||||||
/sbin/stop mongod >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
sleep 10
|
||||||
sleep 10
|
service mongod start >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
||||||
/sbin/start mongod >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
|
||||||
else
|
|
||||||
service mongod stop >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
|
||||||
sleep 10
|
|
||||||
service mongod start >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
|
||||||
fi
|
|
||||||
{% else %}
|
{% else %}
|
||||||
systemctl stop mongodb >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
systemctl stop mongodb >> "$LE_LOG_DIR/mongodb.log" 2>&1
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
Loading…
Reference in New Issue