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

Is it possible to create uploguser with mongodb_user #126

Open
litewhatever opened this issue Aug 29, 2018 · 1 comment
Open

Is it possible to create uploguser with mongodb_user #126

litewhatever opened this issue Aug 29, 2018 · 1 comment

Comments

@litewhatever
Copy link
Contributor

litewhatever commented Aug 29, 2018

Hello

When looking into library/mongodb_user_fixed.py I found the following:

- mongodb_user:
    login_user: root
    login_password: root_password
    database: admin
    user: oplog_reader
    password: oplog_reader_password
    state: present
    replica_set: belcher
    roles:
      - db: local
        role: read

But when trying to use it as follows:

mongodb_users:
  - {
    name: oploguser,
    password: passw0rd,
    database: admin,
    roles: 
      - db: local
        role: read
}

Ansible gives YAML syntax error.

PLAY [apply common configuration to all nodes] *********************************************************************************************************************************************************************************************************************************
ERROR! Syntax Error while loading YAML.
  did not find expected node content

The error appears to have been in '/etc/ansible/group_vars/mongodb': line 40, column 7, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

    roles:
      - db: local
      ^ here

Please advise if it is currently possible to create a oplog user in admin database with read access into local database.

@diasjorge
Copy link

You have a mix of syntax here:

it should be

roles: [{db: 'local', role: 'read'}]

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