saltstack-formulas/mongodb-formula — pull request #6 by wdalmut (2014-09-01 19:19:27+00:00)
Title: Added sharding states

In order to create and orchestrate a mongodb shard we need Mongos (proxies) instances, config servers for coordination and different shards.

In this pull request i have added few options in order to obtain config servers and shard servers with pillars:

```yml
# In order to have a config server
config_svr: True

# In order to have a shard server
shard_svr: True
```

Effectively `config_srv` and `shards` are just `mongod` instances that replies on port 27019 for configs and 27018 for mongod shards; we can always override this settings with the `port` pillar.

Mongos are quite different because they doesn't need the database as query proxy only instances, for that reason i choose to create a separate section with pillars

```yml
mongos:
use_ppa: True
version: 2.6.4
settings:
config_svrs: "cfg1.domain.tld:27019,cfg2.domain.tld:27019,cfg3.domain.tld:27019"
```

In that we can install only the proxy without any mongod service.

As version 2.6.4 (the latest at today) there is no init script for mongos instances, for that reason i get the default upstart script and modified it in order to start a mongos instance from the configuration located at /etc/mognod.conf