Change behaviour

This commit is contained in:
Kirill Klenov 2015-01-07 14:31:53 +03:00
parent 8feff52662
commit f11f7886f7
5 changed files with 23 additions and 23 deletions

View File

@ -15,14 +15,15 @@ Ansible role which manage [MongoDB](http://www.mongodb.org/)
```yaml
mongodb_enabled: yes
mongodb_from_mongodb_repo: yes # If yes, install using MongoDB repo, else use system default repo
mongodb_package: mongodb-org
mongodb_additional_packages:
- python-selinux
- python-pymongo
- python-selinux
- python-pymongo
mongodb_user: mongodb
mongodb_daemon_name: "{{ 'mongod' if (mongodb_from_mongodb_repo | bool) else 'mongodb' }}"
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' == mongodb_package) else 'mongodb' }}"
mongodb_conf_auth: no # Run with security
mongodb_conf_bind_ip: 127.0.0.1 # Comma separated list of ip addresses to listen on

View File

@ -1,14 +1,15 @@
---
mongodb_enabled: yes
mongodb_from_mongodb_repo: yes # If yes, install using MongoDB repo, else use system default repo
mongodb_package: mongodb-org
mongodb_additional_packages:
- python-selinux
- python-pymongo
- python-selinux
- python-pymongo
mongodb_user: mongodb
mongodb_daemon_name: "{{ 'mongod' if (mongodb_from_mongodb_repo | bool) else 'mongodb' }}"
mongodb_daemon_name: "{{ 'mongod' if ('mongodb-org' == mongodb_package) else 'mongodb' }}"
mongodb_conf_auth: no # Run with security
mongodb_conf_bind_ip: 127.0.0.1 # Comma separated list of ip addresses to listen on

View File

@ -1,24 +1,16 @@
---
- include_vars: "{{ansible_distribution}}.yml"
- name: Add APT key
apt_key: url=http://docs.mongodb.org/10gen-gpg-key.asc id=7F0CEB10
when: mongodb_from_mongodb_repo | bool
when: mongodb_package == 'mongodb-org'
- name: Add APT repository (Ubuntu)
apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' update_cache=yes
when: ansible_distribution == 'Ubuntu' and (mongodb_from_mongodb_repo | bool)
- name: Add APT repository
apt_repository: repo="{{mongodb_repository}}" update_cache=yes
- name: Add APT repository (Debian)
apt_repository: repo='deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' update_cache=yes
when: ansible_distribution == 'Debian' and (mongodb_from_mongodb_repo | bool)
- name: Install MongoDB package from MongoDB repo
apt: pkg=mongodb-org state=present
when: mongodb_from_mongodb_repo | bool
- name: Install MongoDB package from Ubuntu or Debian official repo
apt: pkg=mongodb state=present
when: not (mongodb_from_mongodb_repo | bool)
- name: Install MongoDB package
apt: pkg={{mongodb_package}} state=present
- name: Install additional packages
apt: pkg={{item}}

3
vars/Debian.yml Normal file
View File

@ -0,0 +1,3 @@
---
mongodb_repository: deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

3
vars/Ubuntu.yml Normal file
View File

@ -0,0 +1,3 @@
---
mongodb_repository: deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen