Debian Codegraph @

ansible_collections/community/mongodb/roles/mongodb_mongod/README.md

raw
1 mongodb_mongod
2 ==============
3
4 A simple role to aid in the setup of a MongoDB replicaset.
5
6 Role Variables
7 --------------
8
9 * `mongod_port`: The port used by the mongod process. Default `27017`.
10 * `mongod_service`: The name of the mongod service. Default `mongod`.
11 * `mongodb_user`: The Linux OS user for MongoDB. Default `mongod`.
12 * `mongodb_group`: The Linux OS user group for MongoDB. Default `mongod`.
13 * `bind_ip`: The IP address mongod will bind to. Default `0.0.0.0`.
14 * `bind_ip_all`: Have mongod bind to all IP addresses instead of specifying `bind_ip`. Default `false`.
15 * `log_path`: Path of the log file. Default: `/var/log/mongodb/mongod.log`.
16 * `repl_set_name`: The name of the replicaset the member will participate in. Default `rs0`.
17 * `authorization`: Enable authorization. Default `enabled`.
18 * `openssl_keyfile_content`: The keyfile content that MongoDB uses to authenticate within a replicaset. Generate with cmd: openssl rand -base64 756.
19 * `openssl_keyfile_path`: Put the openssl_keyfile at this path. Default: `/etc/keyfile`.
20 * `mongodb_admin_user`: MongoDB admin username. Default `admin`.
21 * `mongodb_admin_pwd`: MongoDB admin password. Default `admin`.
22 * `mongod_package`: The mongod package to install. Default `mongodb-org-server`.
23 * `replicaset`: When enabled add a replication section to the configuration. Default `true`.
24 * `sharding`: If this replicaset member will form part of a sharded cluster. Default `false`.
25 * `net_compressors`: If this is set, this sets `net.compression.compressors` in mongod.conf.
26 * `mongod_config_template`: If defined allows to override path to mongod config template with custom configuration. Default `mongod.conf.j2`.
27 * `skip_restart`: If set to `true` will skip restarting mongod service when config file or the keyfile content changes. Default `true`.
28 * `db_path`: Path to database data location. Default `/var/lib/mongodb` on Debian based distributions, `/var/lib/mongo` for others.
29 * `mongodb_use_tls`: Whether to use tls. Default `false`.
30 * `mongodb_disabled_tls_protocols`: The tls protocols to be disabled. Leave blank to let MongoDB decide which protocols to allow according to the ones available on the system; check the [official docs](https://www.mongodb.com/docs/v6.0/reference/configuration-options/#mongodb-setting-net.tls.disabledProtocols) for details. Default "".
31 * `mongodb_allow_connections_without_certificates`: When enabled allows to bypass the certificate validation for clients that do not present a certificate, if a certificate is provided it _must_ be valid. Default `false`.
32 * `mongodb_certificate_key_file`: Path to the PEM-file containing the certficate and private key.
33 * `mongodb_certificate_ca_file`: Path to the CA-file.
34 * `mongodb_logrotate_enabled`: Add logrotate configuration. Default: `false`.
35 * `mongodb_logrotate_template`: Jinja template for the logrotate configuration. Default `mongodb.logrotate.j2`.
36 * `mongodb_systemd_service_override`: Content of a file to override systemd configuration.
37
38 IMPORTANT NOTE: It is expected that `mongodb_admin_user` & `mongodb_admin_pwd` values be overridden in your own file protected by Ansible Vault. These values are primary included here for Molecule/Travis CI integration. Any production environments should protect these values. For more information see [Ansible Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html)
39
40 Dependencies
41 ------------
42
43 mongodb_repository
44
45 Example Playbook
46 ----------------
47
48 Install MongoDB preparing hosts for a Sharded Cluster.
49
50 ```yaml
51 - hosts: servers
52 roles:
53 - { role: mongodb_repository }
54 - { role: mongodb_mongod, mongod_port: 27018, sharding: true }
55 ```
56
57 License
58 -------
59
60 BSD
61
62 Author Information
63 ------------------
64
65 Rhys Campbell (https://github.com/rhysmeister)