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

Ubuntu 16.04 Could not find the requested service mongod: host #36

Open
unfii opened this issue Jul 7, 2017 · 3 comments
Open

Ubuntu 16.04 Could not find the requested service mongod: host #36

unfii opened this issue Jul 7, 2017 · 3 comments

Comments

@unfii
Copy link

unfii commented Jul 7, 2017

When configure almost finish on Ubuntu 16.04 I have such error

TASK [Stouts.mongodb : Ensure mongodb is started] >

{"changed": false, "failed": true, "msg": "Could not find the requested service mongod: host"}

my playbook

---
- name: Mongodb servers
  hosts: dbservers
  sudo: true
  vars:
    mongodb_conf_replSet: rs1/mongodb-test1:27017,mongodb-test2:27017
    mongodb_shell:
      db-name:
        - rs.initiate()
  roles:
  - Stouts.mongodb

@ArtemSkliar
Copy link

ArtemSkliar commented Jul 11, 2017

This help for me:

pre_tasks:
    # fix mongo service config
    - name: install mongo systemd service (fix)
      copy:
        src: ./templates/mongod.service.j2
        dest: /etc/systemd/system/mongod.service

It's like: https://github.com/Stouts/Stouts.mongodb/blob/master/tasks/install.xenial.yml
but this file run only when: ansible_os_family == 'Debian' and ansible_distribution_release == 'xenial'

- include: install.xenial.yml

@zapaz
Copy link

zapaz commented Aug 25, 2017

or you can make a daemon-reload before

- service: name=mongod state=started daemon-reload=true

@SBerda
Copy link

SBerda commented Oct 10, 2018

Hi,

I'm having the same issue, have tried to add :

- service: name=mongod state=started daemon-reload=true

in task/configure.yml just before - name: Ensure mongodb is started

also tried to add :

 - name: just force systemd to reread configs (2.4 and above)
  systemd: daemon_reload=yes 

anyone solved the issue ?

Thanks you

Simon

zachmullen added a commit to girder/ansible-role-girder-mongodb that referenced this issue Sep 22, 2020
This was necessary to avoid errors that were appearing on my installation. This fix was suggested here: Stouts/Stouts.mongodb#36
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

4 participants