Open asobeeh opened 3 years ago
Hi, I was first not able to get replication working. If you look closer, you will see it is a json object in a list
Check the example below which is working for ALMA8 with a 3 node cluster: test01-03
- hosts: mongo
gather_facts: yes
vars:
mongodb_net_bindip: "127.0.0.1,{{ ansible_default_ipv4.address }}"
mongodb_storage_dbpath: /var/lib/mongo
mongodb_replication_replset: rs0
mongodb_user_admin_name: siteUserAdmin
mongodb_user_admin_password: xxxxxx
mongodb_root_admin_name: siteRootAdmin
mongodb_root_admin_password: xxxxxx
mongodb_root_backup_name: backupuser
mongodb_root_backup_password: xxxxxx
mongodb_security_authorization: "enabled"
mongodb_users:
- {
name: graylog,
password: xxxxxx,
roles: readWrite,
database: admin
}
- {
name: graylog,
password: xxxxxx,
roles: readWrite,
database: graylog
}
mongodb_login_host: test01
mongodb_replication_params:
- {
host_name: test01,
host_port: "{{ mongodb_net_port }}",
host_type: replica,
}
- {
host_name: test02,
host_port: "{{ mongodb_net_port }}",
host_type: replica,
}
- {
host_name: test03,
host_port: "{{ mongodb_net_port }}",
host_type: replica,
}
mongodb_keyfile_content: |
zMMfneGjUdOwBTcmdd1VZvjWWHFjhzOcECgvEygVVprbwPikijvZywhR6GCFRnnL
XxL8rd4iT4AEuuSAiaHj7OXCyJK6h1K7UtVEPZK56MaD4fwRrLaMAn0aAVx0hUU6
ZBRQ6g1l/nbwwxFKoX3dXu4UmzcwycYYhb3RlFxeuCftAzbd43SUEb4x7NajpFM6
p0td0GVPyVYh1cBoxIdxWgCnarvP4mf03npeiLng037ZN6kxx9i7Yov6mjZ6v1Em
ecHJBaybUblpi/DGr1ZI1I+IavFE0WbFQqtSHPSa3X81oz+6Y/EghIzdXyAkVSzN
+wtzQMKolTJra/m0WQjynk/V4JXQcSZjfzhfQzpvIPaW4RTShF/TPT+hc8cMk6rQ
8ZTcu4q9xlHdravR/GmKXpNPiqJZWvhtpZzL/O8wvbzzd9jIKCFYyQMQrhFLQa1Q
izVjEY8N/aPLKv/opNxGVOctPK50Y+pzSB7rRWk8S3Q5MsFxN4TF5VdN0Kod3Onh
ZZIsQ3n9lvi3Svv9stK5PTFTwMMstiaY8Wcs+J3UJDWRtDOFR/xRvgPfixC8phHC
1FFJlEWGFKe5ivHoEcHdCoiA8a15g6WEU2IVKG7WwFdy1BJ9GdgsGj+O875aitxH
S5KKe/zngYsX36AbyVV3IRgxhlvsgtexhfgE9i1yXUbyFMr0HIZCkEIbNKV9IxN5
W44wtXOwkejfbVXauUYPYSUeq+VPcU0XSIz9NVJd6lhVkX0ETiCQpk6tKteWRfPQ
3YJXHVC3myLRbXSID4O90XisJESe0i82XyWK7AzTkMO+4XXClHAqnFITbkea5Dst
YNVKIOC7Yiyx0T4t6o8XN9YPTf18ySyzjiX2crg7YzKEbRowFyhpQ5nB+398HoWn
MGHNUopczKplv3Rriy74GpayDWLotr13lvRHNDTDijPe76GFlIOhd6wI+olNeoFt
LxxmU1y9YMg5RYCEKKIFbB5X0BHS
roles:
- role: undergreen.mongodb
Cheers Chris
sorry about that, but I am new with ansible and I want to call this playbook in my playbook as a role. and I want to know how to use this playbook, were to define the hosts, what should I do, can you please define a how-to, to explain in steps how to run it and where is the values should I change and where to change, and for the replica how to enable it, and how to make it a single deployment or replica deployment with attribute I know that it may be a clear thing but sorry for that.
can you please help me with this
I tried the below to call it a role and pass the var from my playbook but it give me the below error
I tried to use the below also,