Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: terraform-routeros/terraform-provider-routeros
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.77.3
Choose a base ref
...
head repository: terraform-routeros/terraform-provider-routeros
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.78.0
Choose a head ref
  • 7 commits
  • 10 files changed
  • 4 contributors

Commits on Mar 13, 2025

  1. chore(deps): bump golang.org/x/net from 0.34.0 to 0.36.0

    Bumps [golang.org/x/net](https://github.com/golang/net) from 0.34.0 to 0.36.0.
    - [Commits](golang/net@v0.34.0...v0.36.0)
    
    ---
    updated-dependencies:
    - dependency-name: golang.org/x/net
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 13, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    7faac6f View commit details
  2. Merge pull request #694 from terraform-routeros/dependabot/go_modules…

    …/golang.org/x/net-0.36.0
    
    chore(deps): bump golang.org/x/net from 0.34.0 to 0.36.0
    vaerh authored Mar 13, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    dca01fa View commit details

Commits on Mar 14, 2025

  1. feat(system): Add /system/note resource

    ricardbejarano committed Mar 14, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    6e588b3 View commit details

Commits on Mar 15, 2025

  1. fixed "attribute name not found" test failures

    ricardbejarano committed Mar 15, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    bc4c548 View commit details

Commits on Mar 17, 2025

  1. test: Add a minimum version for testing

    vaerh authored Mar 17, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    8f747f0 View commit details
  2. Merge pull request #695 from ricardbejarano/add-system-note

    feat(system): Add `/system/note` resource
    vaerh authored Mar 17, 2025

    Verified

    This commit was signed with the committer’s verified signature.
    alexeagle Alex Eagle
    Copy the full SHA
    36c064f View commit details
  3. chore(release): 1.78.0

    semantic-release-bot committed Mar 17, 2025

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    eccc99f View commit details
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [1.78.0](https://github.com/terraform-routeros/terraform-provider-routeros/compare/v1.77.3...v1.78.0) (2025-03-17)

### Features

* **system:** Add /system/note resource ([6e588b3](https://github.com/terraform-routeros/terraform-provider-routeros/commit/6e588b319ecea978178cfc3fdc10af2dd74f7b1f))

## [1.77.3](https://github.com/terraform-routeros/terraform-provider-routeros/compare/v1.77.2...v1.77.3) (2025-03-12)

### Bug Fixes
33 changes: 33 additions & 0 deletions docs/resources/system_note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# routeros_system_note (Resource)


## Example Usage
```terraform
resource "routeros_system_note" "test" {
note = "For authorized use only."
show_at_login = true
show_at_cli_login = true
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `note` (String) Note that will be displayed.

### Optional

- `show_at_cli_login` (Boolean) Whether to show system note before telnet login prompt.
- `show_at_login` (Boolean) Whether to show system note on each login.

### Read-Only

- `id` (String) The ID of this resource.

## Import
Import is supported using the following syntax:
```shell
terraform import routeros_system_note.test .
```
1 change: 1 addition & 0 deletions examples/resources/routeros_system_note/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import routeros_system_note.test .
5 changes: 5 additions & 0 deletions examples/resources/routeros_system_note/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "routeros_system_note" "test" {
note = "For authorized use only."
show_at_login = true
show_at_cli_login = true
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ require (
github.com/zclconf/go-cty v1.16.2 // indirect
golang.org/x/crypto v0.36.0
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/net v0.36.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/text v0.23.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -235,8 +235,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=
golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k=
golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "terraform-provider-routeros",
"version": "1.77.3",
"version": "1.78.0",
"repository": {
"type": "git",
"url": "https://github.com/terraform-routeros/terraform-provider-routeros"
1 change: 1 addition & 0 deletions routeros/provider.go
Original file line number Diff line number Diff line change
@@ -238,6 +238,7 @@ func Provider() *schema.Provider {
"routeros_system_led_settings": ResourceSystemLedSettings(),
"routeros_system_logging": ResourceSystemLogging(),
"routeros_system_logging_action": ResourceSystemLoggingAction(),
"routeros_system_note": ResourceSystemNote(),
"routeros_system_ntp_client": ResourceSystemNtpClient(),
"routeros_system_ntp_server": ResourceSystemNtpServer(),
"routeros_system_routerboard_button_mode": ResourceSystemRouterboardButtonMode(),
53 changes: 53 additions & 0 deletions routeros/resource_system_note.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package routeros

import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

/*
{
"note": "For authorized use only.",
"show-at-login": "true",
"show-at-cli-login": "false"
}
*/

// https://help.mikrotik.com/docs/spaces/ROS/pages/40992863/Note
func ResourceSystemNote() *schema.Resource {
resSchema := map[string]*schema.Schema{
MetaResourcePath: PropResourcePath("/system/note"),
MetaId: PropId(Id),

"note": {
Type: schema.TypeString,
Required: true,
Description: "Note that will be displayed.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"show_at_login": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to show system note on each login.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
"show_at_cli_login": {
Type: schema.TypeBool,
Optional: true,
Description: "Whether to show system note before telnet login prompt.",
DiffSuppressFunc: AlwaysPresentNotUserProvided,
},
}

return &schema.Resource{
CreateContext: DefaultSystemCreate(resSchema),
ReadContext: DefaultSystemRead(resSchema),
UpdateContext: DefaultSystemUpdate(resSchema),
DeleteContext: DefaultSystemDelete(resSchema),

Importer: &schema.ResourceImporter{
StateContext: schema.ImportStatePassthroughContext,
},

Schema: resSchema,
}
}
80 changes: 80 additions & 0 deletions routeros/resource_system_note_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package routeros

import (
"fmt"
"testing"

"github.com/hashicorp/terraform-plugin-testing/helper/resource"
)

// console - added "show-at-cli-login" option to display a note before telnet login;
const testSystemNoteTaskMinVersion = "7.14"
const testSystemNoteTask = "routeros_system_note.test"

const testSystemNoteNote = "For authorized use only."

func TestAccSystemNoteTest_basic(t *testing.T) {
if !testCheckMinVersion(t, testSystemNoteTaskMinVersion) {
t.Logf("Test skipped, the minimum required version is %v", testSystemNoteTaskMinVersion)
return
}

for _, name := range testNames {
t.Run(name, func(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testSetTransportEnv(t, name)
},
ProviderFactories: testAccProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccSystemNoteConfig(testSystemNoteNote, false, false),
Check: resource.ComposeTestCheckFunc(
testResourcePrimaryInstanceId(testSystemNoteTask),
resource.TestCheckResourceAttr(testSystemNoteTask, "note", testSystemNoteNote),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_login", "false"),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_cli_login", "false"),
),
},
{
Config: testAccSystemNoteConfig(testSystemNoteNote, true, false),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testSystemNoteTask, "note", testSystemNoteNote),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_login", "true"),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_cli_login", "false"),
),
},
{
Config: testAccSystemNoteConfig(testSystemNoteNote, false, true),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testSystemNoteTask, "note", testSystemNoteNote),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_login", "false"),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_cli_login", "true"),
),
},
{
Config: testAccSystemNoteConfig(testSystemNoteNote, true, true),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(testSystemNoteTask, "note", testSystemNoteNote),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_login", "true"),
resource.TestCheckResourceAttr(testSystemNoteTask, "show_at_cli_login", "true"),
),
},
},
})

})
}
}

func testAccSystemNoteConfig(note string, showAtLogin bool, showAtCliLogin bool) string {
return fmt.Sprintf(`%v
resource "routeros_system_note" "test" {
note = "%v"
show_at_login = %v
show_at_cli_login = %v
}
`, providerConfig, note, showAtLogin, showAtCliLogin)
}