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

routeros_system_user_group keeps detecting changes #544

Closed
Barsonax opened this issue Aug 22, 2024 · 3 comments · Fixed by #547
Closed

routeros_system_user_group keeps detecting changes #544

Barsonax opened this issue Aug 22, 2024 · 3 comments · Fixed by #547
Labels
bug Something isn't working released

Comments

@Barsonax
Copy link

Describe the bug
When running terraform apply 2 times I would expect the second time to detect no changes.

To Reproduce

  1. Use routeros_system_user_group:
resource "routeros_system_user_group" "prometheus" {
  name   = "prometheus"
  policy = ["api", "read", "winbox", "test"]
}
  1. Run terraform apply, the group will be created
  2. Run terraform apply again and it will detect changes which shouldn't be there:
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # routeros_system_user_group.prometheus will be updated in-place
  ~ resource "routeros_system_user_group" "prometheus" {
        id     = "*4"
        name   = "prometheus"
      ~ policy = [
          - "!ftp",
          - "!local",
          - "!password",
          - "!policy",
          - "!reboot",
          - "!rest-api",
          - "!romon",
          - "!sensitive",
          - "!sniff",
          - "!ssh",
          - "!telnet",
          - "!web",
          - "!write",
            # (4 unchanged elements hidden)
        ]
        # (1 unchanged attribute hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Expected behavior
No changes detected the second time

@Barsonax Barsonax added the bug Something isn't working label Aug 22, 2024
@vaerh
Copy link
Collaborator

vaerh commented Aug 23, 2024

Thanks for the information!
The fix will take some time as MT is returning more data than the provider expects. I don't have a quick fix for the problem yet.

@Barsonax
Copy link
Author

Barsonax commented Aug 23, 2024

Np, I did found a workaround and that is to put all values in your .tf file, so also the flags you don't enable like !write

vaerh added a commit that referenced this issue Aug 27, 2024
…etUnset` values

Added policy set processing for user groups. To work correctly, we need to analyze incoming changes and modify outgoing policy set values at the same time.
The minimum version for the provider build go `v1.21`, since the `slices.Contains()` function is used.
Fixes #544
vaerh added a commit that referenced this issue Aug 27, 2024
…etUnset` values (#547)

Added policy set processing for user groups. To work correctly, we need to analyze incoming changes and modify outgoing policy set values at the same time.
The minimum version for the provider build go `v1.21`, since the `slices.Contains()` function is used.
Fixes #544
@vaerh
Copy link
Collaborator

vaerh commented Aug 27, 2024

🎉 This issue has been resolved in version 1.61.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@vaerh vaerh added the released label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants