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

Cannot add new entry to this path: user group #256

Closed
radokristof opened this issue Jan 29, 2024 · 9 comments · Fixed by #257
Closed

Cannot add new entry to this path: user group #256

radokristof opened this issue Jan 29, 2024 · 9 comments · Fixed by #257

Comments

@radokristof
Copy link

I cannot add user groups with the 'user group' API path:

FAILED! => {"changed": false, "msg": "Cannot add new entry name=\"admin\" to this path"}

Corresponding task:

- name: Configure User groups
  community.routeros.api_modify:
    path: user group
    handle_absent_entries: ignore
    handle_entries_content: remove_as_much_as_possible
    data:
      - name: admin 
        policy: local,telnet,ssh,ftp,reboot,read,write,policy,test,winbox,password,web,sniff,sensitive,api,romon,rest-api
      - name: operator
        policy: local,ssh,ftp,reboot,read,write,test,winbox,web,sniff,romon,!telnet,!policy,!password,!sensitive,!api,!rest-api
@radokristof
Copy link
Author

Also comment is not accepted here

@derdeagle
Copy link
Contributor

Confirmed on my end, I don't know why though. I have no related message on the device nor when passing -vvv to the ansible-playbook command.
Not giving up though.

@derdeagle
Copy link
Contributor

Ok, it is because of fixed_entries=True,. I cannot tell what the purpose of this parameter is and if it needs to stay there. I removed it for testing and couldn't tell any problem.
@felixfontein Could you please bring some light into this?

@felixfontein
Copy link
Collaborator

fixed_entries=True means that you cannot add, remove, or reorder entries in that path. You can only change (non-primary) values for existing entries.

@derdeagle
Copy link
Contributor

Ok so we should be fine removing it. I see nothing wrong in adding new groups via API and if a group should not be deleted RouterOS should prevent it.
Yet I don't know if I miss something. Would it be ok to just remove fixed_entries for the user group path?

@felixfontein
Copy link
Collaborator

I think it should be OK!

@radokristof
Copy link
Author

Great, thank you for both of you!

derdeagle added a commit to derdeagle/community.routeros that referenced this issue Feb 1, 2024
derdeagle added a commit to derdeagle/community.routeros that referenced this issue Feb 1, 2024
…add `comment` attribute`

Add changelog fragment
felixfontein added a commit that referenced this issue Feb 1, 2024
…bute (#257)

* Fixes #256: make path `user group` modifiable and add `comment` attribute`

Add changelog fragment

* Update changelogs/fragments/257-make-user_group-modifiable.yml

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Felix Fontein <[email protected]>
@derdeagle
Copy link
Contributor

derdeagle commented Feb 1, 2024

@radokristof The changes are now merged (but not yet released) so that user groups can be managed via this collection.

@radokristof
Copy link
Author

@derdeagle Thank you!

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

Successfully merging a pull request may close this issue.

3 participants