You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is very easy to recreate. Setup MongoDB with authentication and replication. Change any configuration option, e.g. preferSSL to allowSSL. Something that should result in simple change of value in configuration file and (maybe) MongoDB restart.
What really happens is replay of full procedure to set authentication and replication. I think it's urgent and critical issue, because it looks like ansible is trying to destroy correctly running setup. And it will happen if someone in panic hit control-c here.
In my humble opinion, ansible shouldn't touch replication after it's already set. E.g. another task that checks replication status (check output of rs.conf).
TASK [undergreen.mongodb : Configure mongodb] **********************************
changed: [test-mongodb-a1-debian-stretch]
changed: [test-mongodb-a2-debian-stretch]
RUNNING HANDLER [undergreen.mongodb : mongodb restart] *************************
changed: [test-mongodb-a1-debian-stretch]
changed: [test-mongodb-a2-debian-stretch]
RUNNING HANDLER [undergreen.mongodb : service started] *************************
ok: [test-mongodb-a2-debian-stretch]
ok: [test-mongodb-a1-debian-stretch]
RUNNING HANDLER [undergreen.mongodb : wait when mongodb is started] ************
ok: [test-mongodb-a2-debian-stretch] => (item=127.0.0.1)
ok: [test-mongodb-a1-debian-stretch] => (item=127.0.0.1)
ok: [test-mongodb-a2-debian-stretch] => (item=172.18.0.8)
ok: [test-mongodb-a1-debian-stretch] => (item=172.18.0.7)
TASK [undergreen.mongodb : Replication configuration | 1st Pt.] ****************
skipping: [test-mongodb-a2-debian-stretch] => (item={u'host_port': 27017, u'host_type': u'replica', u'host_name': u'test-mongodb-a2-debian-stretch'})
failed: [test-mongodb-a1-debian-stretch] (item={u'host_port': 27017, u'host_type': u'replica', u'host_name': u'test-mongodb-a1-debian-stretch'}) => changed=false
item:
host_name: test-mongodb-a1-debian-stretch
host_port: 27017
host_type: replica
msg: 'Unable to initiate replica set: already initialized'
...ignoring
TASK [undergreen.mongodb : Use different mongod.conf for auth initialization] ***
skipping: [test-mongodb-a2-debian-stretch]
changed: [test-mongodb-a1-debian-stretch]
[WARNING]: flush_handlers task does not support when conditional
RUNNING HANDLER [undergreen.mongodb : mongodb restart] *************************
changed: [test-mongodb-a1-debian-stretch]
RUNNING HANDLER [undergreen.mongodb : wait when mongodb is started on localhost] ***
The text was updated successfully, but these errors were encountered:
TomaszUrugOlszewski
changed the title
Changing any MongoDB configuration option results in auth reconf
Changing any MongoDB configuration option results in replicaSet reconf
Aug 8, 2019
Problem exists, because MongoDB needs few seconds to 'catch up' after restart. In theory there is handler "wait when mongodb is started", but it's only checking if MongoDB is up, and that's not enough.
Simply adding "delay: 10" to task "wait when mongodb is started" helps in short term, but of course it's not correct solution.
Hi,
This issue is very easy to recreate. Setup MongoDB with authentication and replication. Change any configuration option, e.g. preferSSL to allowSSL. Something that should result in simple change of value in configuration file and (maybe) MongoDB restart.
What really happens is replay of full procedure to set authentication and replication. I think it's urgent and critical issue, because it looks like ansible is trying to destroy correctly running setup. And it will happen if someone in panic hit control-c here.
In my humble opinion, ansible shouldn't touch replication after it's already set. E.g. another task that checks replication status (check output of rs.conf).
The text was updated successfully, but these errors were encountered: