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_logging_action and default settings #517

Closed
durandguru opened this issue Jul 31, 2024 · 3 comments
Closed

routeros_system_logging_action and default settings #517

durandguru opened this issue Jul 31, 2024 · 3 comments
Assignees
Labels
bug Something isn't working released

Comments

@durandguru
Copy link
Contributor

Describe the bug
Setting 1 of the 4 predefined logging actions will give an error about that that action already exists.

To Reproduce
resource "routeros_system_logging_action" "syslog" {
name = "remote"
target = "remote"
bsd_syslog = true
remote = var.shared_settings.syslog_server
remote_port = "514"
src_address = var.device_settings.ip
syslog_facility = "daemon"
}

Error: PUT 'https://1.1.1.1:443/rest/system/logging/action' returned response code: 400, message: 'Bad Request', details: 'failure: action already exists with such a name'

│ with module.terraform-module-mikrotik.routeros_system_logging_action.syslog,
│ on .terraform\modules\terraform-module-mikrotik\routeros-system-logging-action.tf line 1, in resource "routeros_system_logging_action" "syslog":
│ 1: resource "routeros_system_logging_action" "syslog" {

Expected behavior
Import works. So that is no problem. But normally in this provider you can just set settings on predefined resources. This resource can be an exception, documentation must be changed then. Or it becomes possible to set the 4 predefined resoures.

**Predefined resources:
Flags: * - default
*0 * name="memory" target=memory memory-lines=1000 memory-stop-on-full=no

*1 * name="disk" target=disk disk-file-name="log" disk-lines-per-file=1000 disk-file-count=2
disk-stop-on-full=no

*2 * name="echo" target=echo remember=yes

*3 * name="remote" target=remote remote=1.1.1.1 remote-port=514 src-address=0.0.0.0 bsd-syslog=yes
syslog-time-format=bsd-syslog syslog-facility=local0 syslog-severity=auto

@durandguru durandguru added the bug Something isn't working label Jul 31, 2024
@vaerh
Copy link
Collaborator

vaerh commented Jul 31, 2024

Yes, it turns out to be a mix of normal and system resources. It is necessary to fix the logic of interaction, but it is not quick.

@durandguru
Copy link
Contributor Author

Take your time. Import works for me now. Especially because the id is always the same (on my devices).

@vaerh vaerh self-assigned this Aug 2, 2024
@vaerh vaerh closed this as completed in 1a5d02c Aug 2, 2024
@vaerh
Copy link
Collaborator

vaerh commented Aug 2, 2024

🎉 This issue has been resolved in version 1.58.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@vaerh vaerh added the released label Aug 2, 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

No branches or pull requests

2 participants