library/roles/mongodb-org-3.2, library/roles/mongodb-org-3: Enable ganglia authentication against mongo.

d4science-ghn-cluster/group_vars/mongo_cluster_prod/ganglia.yml: Enable authentication.
This commit is contained in:
Andrea Dell'Amico 2016-03-21 18:38:45 +01:00
parent 4067c73b99
commit 24e7fe23e7
4 changed files with 27 additions and 0 deletions

View File

@ -23,3 +23,8 @@ mongodb_allowed_hosts:
mongodb_cluster_enabled: False
mongodb_replicaset: storagedev
mongodb_replica_keyfile: '{{ mongodb_dbpath }}/replica_keyfile'
mongodb_ganglia_auth_enabled: False
mongodb_ganglia_db: admin
mongodb_ganglia_auth_mechanism: MONGODB-CR
# User and password are stored in the variables mongo_monitoring_u and mongo_monitoring_pwd

View File

@ -3,10 +3,18 @@ modules {
name = "mongodb"
language = "python"
param server_status {
{% if mongodb_ganglia_auth_enabled %}
value = "mongo --quiet --authenticationMechanism {{ mongodb_ganglia_auth_mechanism }} -u {{ mongo_monitoring_u }} -p {{ mongo_monitoring_pwd }} --eval 'printjson(db.serverStatus())' {{ mongodb_ganglia_db }}"
{% else %}
value = "mongo --quiet --eval 'printjson(db.serverStatus())'"
{% endif %}
}
param rs_status {
{% if mongodb_ganglia_auth_enabled %}
value = "mongo --quiet --authenticationMechanism {{ mongodb_ganglia_auth_mechanism }} -u {{ mongo_monitoring_u }} -p {{ mongo_monitoring_pwd }} --eval 'printjson(rs.status())' {{ mongodb_ganglia_db }}"
{% else %}
value = "mongo --quiet --eval 'printjson(rs.status())'"
{% endif %}
}
}
}

View File

@ -23,3 +23,9 @@ mongodb_allowed_hosts:
mongodb_cluster_enabled: False
mongodb_replicaset: storagedev
mongodb_replica_keyfile: '{{ mongodb_dbpath }}/replica_keyfile'
mongodb_ganglia_auth_enabled: False
mongodb_ganglia_db: admin
mongodb_ganglia_auth_mechanism: MONGODB-CR
# User and password are stored in the variables mongo_monitoring_u and mongo_monitoring_pwd

View File

@ -3,10 +3,18 @@ modules {
name = "mongodb"
language = "python"
param server_status {
{% if mongodb_ganglia_auth_enabled %}
value = "mongo --quiet --authenticationMechanism {{ mongodb_ganglia_auth_mechanism }} -u {{ mongo_monitoring_u }} -p {{ mongo_monitoring_pwd }} --eval 'printjson(db.serverStatus())' {{ mongodb_ganglia_db }}"
{% else %}
value = "mongo --quiet --eval 'printjson(db.serverStatus())'"
{% endif %}
}
param rs_status {
{% if mongodb_ganglia_auth_enabled %}
value = "mongo --quiet --authenticationMechanism {{ mongodb_ganglia_auth_mechanism }} -u {{ mongo_monitoring_u }} -p {{ mongo_monitoring_pwd }} --eval 'printjson(rs.status())' {{ mongodb_ganglia_db }}"
{% else %}
value = "mongo --quiet --eval 'printjson(rs.status())'"
{% endif %}
}
}
}