Browse Source

Changes to support customization to data and log dirs

pull/6/head
Farzad Battiwalla 6 years ago
parent
commit
445a1fad13
4 changed files with 44 additions and 4 deletions
  1. +26
    -0
      README.rst
  2. +2
    -2
      mongodb/files/mongodb.conf
  3. +8
    -2
      mongodb/map.jinja
  4. +8
    -0
      mongodb/server.sls

+ 26
- 0
README.rst View File

admin: admin:
username: admin username: admin
password: magicunicorn password: magicunicorn
shared_key: |
bEoUQ4QKB8RsJt1cBnO8/2fni3CG+/L2CrGQ+RNJuA5cpIoeehHmWG1ir5mTUx9N
OLLDvtHT6423395tmGBAJAISv5LXY8PNB6/m1LxsfEDEfjlLwo62z2pMG94ZBPX6
pGy5YRlii77fi9l5/+d/ULFQSFy6uq5Py0qeFF1IsYsmeSP8GrCExw/9oxWj+Tmv
qHcmRtm1EdaTKpAS2O07NMZTUxTO3SkaXzLZZF1QmflROcZq3ZteuM4jKBtOjKIt
MlkkJ0rcIcahTw6x+iWQNDdip5uLS2Xc7i77ZMC4RZmeYVwQ16QtwNdNsTcnoeFC
FfNIUXCckbZikhyUWlRUZd7NQ6YnQLGKi1Bs0YV0QLmocHFssiB9wnsNynMSgd4i
zJ/joOlrqmIAmF8BJsa1D+szA4cHc0roWRiCfXvkVjL5fsPNXQpqu0ghPJXigoHJ
7//HVsmNzX+Tb2hrHdHE+fnQgVmOgPbUPaPqTqwv9lfDeZj7kwn6pwrHZpcVLoTi
ynv7Obl1dHJptRBXqEGBoYcJ2gDNBzuAN9QDpgueVn89s1x/LhHItItBRAwwlsMA
T++Imel/9qA68kCSzjoj1GZw7CKAAoi9lZSKy5xVzo03K5ZYfaHdPFFG9wqncfH6
tONxYHv1faQosjPJGQFcwPRqFYzPNzlIOnWYbFUwTJAvXGRcWui/XjpsjAwO7Ba/
/7hDvlCBgAeor3dPo1d47eCH8ZjCc1pwd8v0fj2q3FvUTEJUsIjH4y3smlzZWR27
Xx6lINe/i+OhwWH8538U4MWku52lbLn2G3pta7TJpVeVoZcNjs9tYWWeMjOmrcJH
tPSe9zc5i+ZbD17npXRTlngaTP5ANKo6PlT2r2tzV06iYaSLyqVPoBA6evHwggcY
AVw1v99wilvOisIP0n5QgTxpTLA8JHr3Erq7CCDDc+uUbrp0gAf+WATrM5HSNd2M
YIaOzbYo5Mp71ofF8Xem/ce8GoCCypdWzvrT1DJMDxyt48DF
database: database:
dbname: dbname:
enabled: true enabled: true


mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()" mongo 127.0.0.1:27017/admin -u admin -p magicunicorn --eval "rs.status()"



The shared_key can be generated through the use of the following open_ssl command:

.. code-block:: bash

openssl rand -base64 756


Read more Read more
========= =========


* http://docs.mongodb.org/manual/ * http://docs.mongodb.org/manual/
* http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ * http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
* http://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/
* https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise * https://www.linode.com/docs/databases/mongodb/creating-a-mongodb-replication-set-on-ubuntu-12-04-precise


Documentation and Bugs Documentation and Bugs

+ 2
- 2
mongodb/files/mongodb.conf View File

port={{ server.bind.port }} port={{ server.bind.port }}
bind_ip={{ server.bind.address }} bind_ip={{ server.bind.address }}


logpath=/var/log/mongodb/mongod.log
logpath={{ server.logging.log_dir }}/mongod.log
logappend=true logappend=true


dbpath=/var/lib/mongodb
dbpath={{ server.data_dir }}
journal=true journal=true


{%- if server.authorization.get('enabled', False) %} {%- if server.authorization.get('enabled', False) %}

+ 8
- 2
mongodb/map.jinja View File

'Debian': { 'Debian': {
'pkgs': ['mongodb-server', 'mongodb', 'mongodb-clients'], 'pkgs': ['mongodb-server', 'mongodb', 'mongodb-clients'],
'service': 'mongodb', 'service': 'mongodb',
'data_dir': "/var/lib/mongodb",
'lock_dir': "/var/lock/mongodb", 'lock_dir': "/var/lock/mongodb",
'logging': {},
'logging': {
'log_dir': "/var/log/mongodb",
},
'bind': { 'bind': {
'address': '127.0.0.1', 'address': '127.0.0.1',
'port': 27017 'port': 27017
'RedHat': { 'RedHat': {
'pkgs': ['mongodb-server', 'mongodb', 'mongodb-clients'], 'pkgs': ['mongodb-server', 'mongodb', 'mongodb-clients'],
'service': 'mongod', 'service': 'mongod',
'data_dir': "/var/lib/mongodb",
'lock_dir': "/var/lock/mongodb", 'lock_dir': "/var/lock/mongodb",
'logging': {},
'logging': {
'log_dir': "/var/log/mongodb",
},
'bind': { 'bind': {
'address': '127.0.0.1', 'address': '127.0.0.1',
'port': 27017 'port': 27017

+ 8
- 0
mongodb/server.sls View File

- service: mongodb_service - service: mongodb_service
{%- endif %} {%- endif %}


{{ server.data_dir }}:
file.directory:
- makedirs: true

{{ server.lock_dir }}: {{ server.lock_dir }}:
file.directory: file.directory:
- makedirs: true - makedirs: true


{{ server.logging.log_dir }}:
file.directory:
- makedirs: true

mongodb_service: mongodb_service:
service.running: service.running:
- name: {{ server.service }} - name: {{ server.service }}

Loading…
Cancel
Save