jeremmfr / terraform-provider-junos

Terraform provider for Junos devices
https://registry.terraform.io/providers/jeremmfr/junos
MIT License
62 stars 22 forks source link

Feature request: serial secondary cluster node #587

Closed arjenvri closed 9 months ago

arjenvri commented 11 months ago

Description

Would it be possible to expand the current system information datasource to provide the serial number of the secondary node in a chassis cluster?

New or Affected Resource(s)

jeremmfr commented 11 months ago

Hi :wave:

This information is not available in system-information response.

Have you try to configure a secondary provider with management IP of secondary node to read this information ?

provider "junos" {
  ip = "<primary_ip>"
}
data "junos_system_information" "primary" {}
output "primary_serial_number" {
  value = data.junos_system_information.primary.serial_number
}

provider "junos" {
  alias = "secondary"

  ip    = "<secondary_ip>"
}
data "junos_system_information" "secondary" {
  provider = junos.secondary
}
output "secondary_serial_number" {
  value = data.junos_system_information.secondary.serial_number
}
arjenvri commented 10 months ago

thank you for that suggestion and your time! In our case we connect only using the shared cluster ip for administrative reasons. Sorry for confusing my request, but i hope you are willing to consider supporting a new data source for show chassis hardware that contains the chassis serial of all nodes.

> show chassis hardware
node0:
--------------------------------------------------------------------------
Hardware inventory:
Item             Version  Part number  Serial number     Description
Chassis                                JNXXXXXXX     SRXx00
...
node1:
--------------------------------------------------------------------------
Hardware inventory:
Item             Version  Part number  Serial number     Description
Chassis                                JNXXXXXXX     SRXx00
...
jeremmfr commented 10 months ago

Hi :wave:

After some tests, a RPC request <get-chassis-inventory> equivalent to the command show chassis hardware can provide a data source.

I'll take care of adding that.