From f73e24e32b3ffde56fd4044fc6dba22819633b77 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 19 Nov 2015 18:10:24 +0100 Subject: [PATCH] d4science-ghn-cluster: Fix the mongo variables for the mongo_cluster_prod group. dnet-eagle: New mongodb server. library/roles/mongodb-org: Fix the mongod template. It had fixed paths, now they are all managed by variables. library/roles/redmine: Remove the rules for not working plugins. --- mongodb-org/defaults/main.yml | 4 ++- mongodb-org/tasks/main.yml | 11 ++---- mongodb-org/templates/mongod-2.6.conf.j2 | 19 ++++++---- redmine/defaults/main.yml | 2 ++ redmine/tasks/redmine-plugins.yml | 45 +++--------------------- 5 files changed, 24 insertions(+), 57 deletions(-) diff --git a/mongodb-org/defaults/main.yml b/mongodb-org/defaults/main.yml index f259b683..eed15b2b 100644 --- a/mongodb-org/defaults/main.yml +++ b/mongodb-org/defaults/main.yml @@ -2,7 +2,8 @@ mongodb_install_from_external_repo: True mongodb_install_packages: True mongodb_install_conf: True -mongodb_latest_version: True +# Set to 'latest' if you want to get the latest available package +mongodb_pkg_state: installed mongodb_start_server: 'no' mongodb_tcp_port: 27017 mongodb_http_interface: False @@ -21,3 +22,4 @@ mongodb_allowed_hosts: mongodb_cluster_enabled: False mongodb_replicaset: storagedev +mongodb_replica_keyfile: '{{ mongodb_dbpath }}/replica_keyfile' diff --git a/mongodb-org/tasks/main.yml b/mongodb-org/tasks/main.yml index 1b34470b..3dd55847 100644 --- a/mongodb-org/tasks/main.yml +++ b/mongodb-org/tasks/main.yml @@ -11,20 +11,13 @@ register: external_repo tags: mongodb -- name: Update the apt cache - apt: update_cache=yes - when: ( external_repo | changed ) - ignore_errors: True - tags: mongodb - - name: Install the latest version of mongodb server - apt: pkg={{ item }} state=latest + apt: pkg={{ item }} state={{ mongodb_pkg_state }} update_cache=yes with_items: - mongodb-org when: - mongodb_install_from_external_repo - mongodb_install_packages - - mongodb_latest_version tags: mongodb - name: Install the mongodb defaults file @@ -49,7 +42,7 @@ - name: Install the cron job that manages log files rotation template: src=mongo_log_rotate.sh.j2 dest=/etc/cron.daily/mongo_log_rotate owner=root group=root mode=0555 - tags: mongodb + tags: [ 'mongodb', 'mongo_logrotate' ] - name: Ensure mongodb is started service: name=mongod state=started enabled=yes diff --git a/mongodb-org/templates/mongod-2.6.conf.j2 b/mongodb-org/templates/mongod-2.6.conf.j2 index ee5265d7..9e6d541d 100644 --- a/mongodb-org/templates/mongod-2.6.conf.j2 +++ b/mongodb-org/templates/mongod-2.6.conf.j2 @@ -5,14 +5,15 @@ # Note: if you run mongodb as a non-root user (recommended) you may # need to create and set permissions for this directory manually, # e.g., if the parent directory isn't mutable by the mongodb user. -dbpath=/data/mongo_home +dbpath={{ mongodb_dbpath }} +directoryperdb={{ mongodb_directoryperdb }} #where to log -logpath=/data/mongo_log.txt +logpath={{ mongodb_logpath }} logappend=true -port = 27017 +port = {{ mongodb_tcp_port }} # Listen to local interface only. Comment out to listen on all interfaces. #bind_ip = 127.0.0.1 @@ -48,8 +49,11 @@ port = 27017 # Ignore query hints #nohints = true -# Enable the HTTP interface (Defaults to port 28017). -#httpinterface = true + +{% if not mongodb_http_interface %} +# Disable the HTTP interface (Defaults to localhost:28017). +nohttpinterface = true +{% endif %} # Turns off server-side scripting. This will result in greatly limited # functionality @@ -64,12 +68,15 @@ port = 27017 # Specify .ns file size for new databases. # nssize = +{% if mongodb_cluster_enabled %} # Replication Options # in replicated mongo databases, specify the replica set name here -replSet=storagedev +replSet = {{ mongodb_replicaset }} # maximum size in megabytes for replication operation log #oplogSize=1024 # path to a key file storing authentication info for connections # between replica set members keyFile=/data/mongo_home/dev-d4science-keyfile +{% endif %} + diff --git a/redmine/defaults/main.yml b/redmine/defaults/main.yml index 2fddbab9..4173c8d4 100644 --- a/redmine/defaults/main.yml +++ b/redmine/defaults/main.yml @@ -22,6 +22,8 @@ redmine_glob_group: www-data redmine_glob_users_home_base: /srv/redmine-home # Plugins +rm_embedded_tabs_plugin: False +rm_recurring_tasks_plugin: False redmine_install_agile_plugin: False rm_scrum_plugin: False rm_advanced_roadmap_plugin: False diff --git a/redmine/tasks/redmine-plugins.yml b/redmine/tasks/redmine-plugins.yml index 42d7c93e..d9374637 100644 --- a/redmine/tasks/redmine-plugins.yml +++ b/redmine/tasks/redmine-plugins.yml @@ -67,31 +67,20 @@ - redmine - redmine_plugins -# This one causes problems on redmine 2.5.2 -# - name: Install the backlogs plugin -# git: repo=https://github.com/backlogs/redmine_backlogs.git dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_backlogs update=no -# notify: -# - Bundle install and reconfigure redmine -# - apache2 reload -# tags: -# - redmine - - name: Install the embedded tab plugin git: repo=https://github.com/jamtur01/redmine_tab.git dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_tab update=no notify: - apache2 reload when needed - Reload unicorn when needed - tags: - - redmine - - redmine_plugins + when: rm_embedded_tabs_plugin + tags: [ 'redmine', 'redmine_plugins', 'rm_embedded_tabs' ] - name: Install the recurring-tasks plugin git: repo=https://github.com/nutso/redmine-plugin-recurring-tasks.git dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/recurring_tasks update=no notify: - Bundle install and reconfigure redmine - tags: - - redmine - - redmine_plugins + when: rm_recurring_tasks_plugin + tags: [ 'redmine', 'redmine_plugins', 'rm_recurring_tasks' ] - name: Redmine agile plugin. Free version from www.redminecrm.com unarchive: src=redmine_agile.zip dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins creates={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/redmine_agile/init.rb @@ -136,32 +125,6 @@ - redmine_plugins - redmine_plugins_ar -#- name: Get the scrum2b plugin -# get_url: url=https://github.com/scrum2b/scrum2b/archive/master.zip dest={{ redmine_glob_root_dir }}/plugins_download/scrum2b-2-1-stable.zip validate_certs=no -# when: rm_scrum2b_plugin -# tags: -# - redmine -# - redmine_plugins -# - redmine_plugins_scrum2b -# -#- name: Unarchive the scrum2b plugin -# unarchive: src={{ redmine_glob_root_dir }}/plugins_download/scrum2b-2-1-stable.zip dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins copy=no owner=root group=root creates={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/scrum2b/init.rb -# when: rm_scrum2b_plugin -# tags: -# - redmine -# - redmine_plugins -# - redmine_plugins_scrum2b -# -#- name: Rename the scrum plugin -# shell: mv "{{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/scrum2b-master" {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/scrum2b creates={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/scrum2b/init.rb -# when: rm_scrum2b_plugin -# notify: -# - Bundle install and reconfigure redmine -# tags: -# - redmine -# - redmine_plugins -# - redmine_plugins_scrum2b - - name: Install the redmine scrum2b plugin git: repo=https://github.com/scrum2b/scrum2b version=2-1-stable dest={{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}/plugins/scrum2b update=no when: rm_scrum2b_plugin