Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial provision does not boot mongod server, but second provision attempt does - does anyone know why? #225

Open
niftylettuce opened this issue Jul 3, 2020 · 11 comments

Comments

@niftylettuce
Copy link

Ubuntu 18.04 with defaults:

RUNNING HANDLER [mongodb restart] **********************************************
fatal: [my.secret.hostname]: FAILED! => {"changed": false, "msg": "Could not find the requested service mongod: host"}

NO MORE HOSTS LEFT *************************************************************

PLAY RECAP *********************************************************************
my.secret.hostname : ok=57   changed=42   unreachable=0    failed=1    skipped=10   rescued=0    ignored=0

Then when I try it again, it works fine and failed=0.

@niftylettuce
Copy link
Author

Here's some more verbose output, a slightly different warning message. Curious if @UnderGreen has seen this?

RUNNING HANDLER [wait when mongodb is started] *********************************
failed: [XX] (item=127.0.0.1) => {"ansible_loop_var": "item", "changed": false, "elapsed": 120, "item": "127.0.0.1", "msg": "Timeout when waiting for 127.0.0.1:27017"}
failed: [XX] (item=1.2.3.4) => {"ansible_loop_var": "item", "changed": false, "elapsed": 120, "item": "1.2.3.4", "msg": "Timeout when waiting for 1.2.3.4:27017"}

RUNNING HANDLER [mongodb restart] **********************************************

Second boot works fine. 1.2.3.4 is an actual IP, I just renamed it for privacy.

@niftylettuce
Copy link
Author

@niftylettuce
Copy link
Author

It seems like this is missing somewhere:

sudo systemctl enable mongod
sudo systemctl start mongod

@MemberIT
Copy link
Contributor

MemberIT commented Jul 3, 2020

@niftylettuce
Hi, you can try to use the fork of role
https://github.com/sportsru/ansible-role-mongodb
and maybe you should set mongodb_manage_systemd_unit: false by starting the installation again.

@niftylettuce
Copy link
Author

@MemberIT is this issue solved too?

#103

@MemberIT
Copy link
Contributor

MemberIT commented Jul 3, 2020

@MemberIT is this issue solved too?

#103

No

@niftylettuce
Copy link
Author

@MemberIT I just tried your fork. It does not work.

RUNNING HANDLER [wait when mongodb is started] *********************************
ok: [HIDDEN] => (item=127.0.0.1)

Stuck on this.

@MemberIT
Copy link
Contributor

MemberIT commented Jul 3, 2020

@MemberIT I just tried your fork. It does not work.

RUNNING HANDLER [wait when mongodb is started] *********************************
ok: [HIDDEN] => (item=127.0.0.1)

Stuck on this.

I think you need to use pymongo from pip, because pymongo from deb not support mongodb 4.2.
https://pypi.org/project/pymongo/3.6.1/
https://github.com/forwardemail/forwardemail.net/blob/master/ansible/playbooks/mongo.yml#L9

@niftylettuce
Copy link
Author

That seemed to fix it!!!! THANK YOU!

If you have PayPal or BTC, please email me [email protected] - would love to comp you for your help.

@MemberIT
Copy link
Contributor

MemberIT commented Jul 3, 2020

@MemberIT is this issue solved too?
#103

No

@niftylettuce Although no, I was mistaken, resolved here
f8142e6

@niftylettuce
Copy link
Author

@MemberIT I still see that even your fork has this issue on first boot/provision:

RUNNING HANDLER [wait when mongodb is started] *********************************

Re-running provision fixes it. Do you know what's wrong??

@niftylettuce niftylettuce reopened this Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants