From 2dba294ff88b3c7fbf28802c5179c79292ab353e Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Mon, 9 Feb 2015 18:31:59 +0600 Subject: [PATCH] Fixed problem with values in mongod.conf Variables like "yes" where in conf file like "true". It's worked, but it's wrong. --- defaults/main.yml | 30 +++++++++++++++--------------- templates/mongod.conf.j2 | 24 ++++++++++++------------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 12b5d6c..a55bfa1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,6 @@ --- -mongodb_enabled: yes +mongodb_enabled: true mongodb_package: mongodb-org @@ -11,28 +11,28 @@ mongodb_additional_packages: mongodb_user: mongodb mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' in mongodb_package) else 'mongodb' }}" -mongodb_conf_auth: no # Run with security +mongodb_conf_auth: "no" # Run with security mongodb_conf_bind_ip: 127.0.0.1 # Comma separated list of ip addresses to listen on -mongodb_conf_cpu: yes # Periodically show cpu and iowait utilization +mongodb_conf_cpu: "yes" # Periodically show cpu and iowait utilization mongodb_conf_dbpath: /data/db # Directory for datafiles -mongodb_conf_fork: no # Fork server process -mongodb_conf_httpinterface: no # Enable http interface -mongodb_conf_ipv6: no # Enable IPv6 support (disabled by default) -mongodb_conf_journal: no # Enable journaling -mongodb_conf_logappend: yes # Append to logpath instead of over-writing +mongodb_conf_fork: "no" # Fork server process +mongodb_conf_httpinterface: "no" # Enable http interface +mongodb_conf_ipv6: "no" # Enable IPv6 support (disabled by default) +mongodb_conf_journal: "no" # Enable journaling +mongodb_conf_logappend: "yes" # Append to logpath instead of over-writing mongodb_conf_logpath: /var/log/mongodb/{{ mongodb_daemon_name }}.log # Log file to send write to instead of stdout mongodb_conf_maxConns: 1000000 # Max number of simultaneous connections -mongodb_conf_noprealloc: no # Disable data file preallocation -mongodb_conf_noscripting: no # Disable scripting engine -mongodb_conf_notablescan: no # Do not allow table scans +mongodb_conf_noprealloc: "no" # Disable data file preallocation +mongodb_conf_noscripting: "no" # Disable scripting engine +mongodb_conf_notablescan: "no" # Do not allow table scans mongodb_conf_port: 27017 # Specify port number -mongodb_conf_quota: no # Limits each database to a certain number of files +mongodb_conf_quota: "no" # Limits each database to a certain number of files mongodb_conf_quotaFiles: 8 # Number of quota files -mongodb_conf_syslog: no # Log to system's syslog facility instead of file +mongodb_conf_syslog: "no" # Log to system's syslog facility instead of file # Replica set options: mongodb_conf_replSet: # Enable replication [/] -mongodb_conf_replIndexPrefetch: all # specify index prefetching behavior (if secondary) [none|_id_only|all] +mongodb_conf_replIndexPrefetch: "all" # specify index prefetching behavior (if secondary) [none|_id_only|all] mongodb_shell: {} # Define mongo shell commands to run # Syntax: mongodb_shell: @@ -47,7 +47,7 @@ mongodb_mms_api_key: "" mongodb_mms_base_url: https://mms.mongodb.com # Log rotation -mongodb_logrotate: yes # Rotate mongodb logs. +mongodb_logrotate: true # Rotate mongodb logs. mongodb_logrotate_options: - compress - copytruncate diff --git a/templates/mongod.conf.j2 b/templates/mongod.conf.j2 index e167561..2da21a1 100644 --- a/templates/mongod.conf.j2 +++ b/templates/mongod.conf.j2 @@ -1,23 +1,23 @@ # {{ ansible_managed }} -auth = {{ mongodb_conf_auth|to_nice_json }} +auth = {{ mongodb_conf_auth }} bind_ip = {{ mongodb_conf_bind_ip }} -cpu = {{ mongodb_conf_cpu|to_nice_json }} +cpu = {{ mongodb_conf_cpu }} dbpath = {{ mongodb_conf_dbpath }} -fork = {{ mongodb_conf_fork|to_nice_json }} -httpinterface = {{ mongodb_conf_httpinterface|to_nice_json }} -ipv6 = {{ mongodb_conf_ipv6|to_nice_json }} -journal = {{ mongodb_conf_journal|to_nice_json }} -logappend = {{ mongodb_conf_logappend|to_nice_json }} +fork = {{ mongodb_conf_fork }} +httpinterface = {{ mongodb_conf_httpinterface }} +ipv6 = {{ mongodb_conf_ipv6 }} +journal = {{ mongodb_conf_journal }} +logappend = {{ mongodb_conf_logappend }} logpath = {{ mongodb_conf_logpath }} maxConns = {{ mongodb_conf_maxConns }} -noprealloc = {{ mongodb_conf_noprealloc|to_nice_json }} -noscripting = {{ mongodb_conf_noscripting|to_nice_json }} -notablescan = {{ mongodb_conf_notablescan|to_nice_json }} +noprealloc = {{ mongodb_conf_noprealloc }} +noscripting = {{ mongodb_conf_noscripting }} +notablescan = {{ mongodb_conf_notablescan }} port = {{ mongodb_conf_port }} -quota = {{ mongodb_conf_quota|to_nice_json }} +quota = {{ mongodb_conf_quota }} quotaFiles = {{ mongodb_conf_quotaFiles }} -syslog = {{ mongodb_conf_syslog|to_nice_json }} +syslog = {{ mongodb_conf_syslog }} {% if mongodb_conf_replSet %} # Replica set options: