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

Fact ipmitool fru #75

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

b4ldr
Copy link
Contributor

@b4ldr b4ldr commented Feb 13, 2024

This CR adds a new structured fact called ipmitool with two keys fru and
mc_info. fru is new data from ipmitool fru print. mc_info is the
current ipmi_mc_info fact. I have updated the ipmi_mc_info fact so
that it uses this new structured fact.

The new fact will look like the following:

{
  fru => {
    board_mfg_date => "Tue Mar  3 21:43:00 2015",
    board_mfg => "DELL",
    board_product => "PowerEdge R220",
    board_serial => "*********",
    board_part_number => "0DRXF5A04",
    product_manufacturer => "DELL",
    product_name => "Test",
    product_extra => "*********"
  },
  mc_info => {
    IPMI_Puppet_Service_Recommend => "running",
    Device ID => "32",
    Device Revision => "1",
    Firmware Revision => "2.65",
    IPMI Version => "2.0",
    Manufacturer ID => "674",
    Manufacturer Name => "DELL Inc",
    Product ID => "256 (0x0100)",
    Product Name => "Unknown (0x100)",
    Device Available => "yes",
    Provides Device SDRs => "yes"
  }
}

We are able to use commands like the following:
set the board_product with:

  • sudo ipmitool fru edit 0 field b 1

And the product_name with:

  • sudo ipmitool fru edit 0 field p 1

#enhancement

user: user correct quotes for password
@jhoblitt
Copy link
Owner

@b4ldr I'm fine with adding facts but I think I'd prefer a nested hierarchy rather than adding new top level facts.

@b4ldr b4ldr force-pushed the fact_ipmitool_fru branch from dac2837 to 26449ea Compare February 13, 2024 20:25
@b4ldr
Copy link
Contributor Author

b4ldr commented Feb 13, 2024

@b4ldr I'm fine with adding facts but I think I'd prefer a nested hierarchy rather than adding new top level facts.

Thanks updated (will fix test tomorrow)

@b4ldr b4ldr force-pushed the fact_ipmitool_fru branch 3 times, most recently from 11777e4 to ded7578 Compare February 14, 2024 14:04
@b4ldr
Copy link
Contributor Author

b4ldr commented Feb 14, 2024

@jhoblitt all updated and hoping test pass. I'm not sure how to add labels but otherwise let me know your thoughts

# ipmitool_mc_info: {"IPMI_Puppet_Service_Recommend"=>"stopped"}
# confine do
# Facter::Util::Resolution.which('ipmitool')
# end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if this is something worth pursuing or if you just want me to drop the comment.

@b4ldr b4ldr force-pushed the fact_ipmitool_fru branch from ded7578 to 274534d Compare February 14, 2024 14:15
This CR adds a new structured fact called ipmitool with two keys fru and
mc_info.  fru is new data from ipmitool fru print.  mc_info is the
current ipmi_mc_info  fact.  I have updated the ipmi_mc_info fact so
that it uses this new structured fact.

The new fact will look like the following:

```
{
  fru => {
    board_mfg_date => "Tue Mar  3 21:43:00 2015",
    board_mfg => "DELL",
    board_product => "PowerEdge R220",
    board_serial => "*********",
    board_part_number => "0DRXF5A04",
    product_manufacturer => "DELL",
    product_name => "Test",
    product_extra => "*********"
  },
  mc_info => {
    IPMI_Puppet_Service_Recommend => "running",
    Device ID => "32",
    Device Revision => "1",
    Firmware Revision => "2.65",
    IPMI Version => "2.0",
    Manufacturer ID => "674",
    Manufacturer Name => "DELL Inc",
    Product ID => "256 (0x0100)",
    Product Name => "Unknown (0x100)",
    Device Available => "yes",
    Provides Device SDRs => "yes"
  }
}
```

We are able to use commands like the following:
set the board_product with:
* sudo ipmitool fru edit 0 field b 1

And the product_name with:
* sudo ipmitool fru edit 0 field p 1
@b4ldr b4ldr force-pushed the fact_ipmitool_fru branch from 274534d to deeaad4 Compare February 14, 2024 14:17
@b4ldr
Copy link
Contributor Author

b4ldr commented Mar 11, 2024

@jhoblitt are you able to provide another review, thanks

@jhoblitt
Copy link
Owner

@b4ldr Sorry for the slow response. I've been intending to do some manual testing with this and I haven't gotten to it yet.

@b4ldr
Copy link
Contributor Author

b4ldr commented Mar 15, 2024

no worries thanks for the update.

@jhoblitt
Copy link
Owner

@b4ldr Hi, horrible maintainer here, finally thinking about this...

#78 added a top level ipmi hierarchical fact. E.g.

ipmi => {
  1 => {
    channel => 1,
    gateway => "10.10.134.254",
    ipaddress => "10.10.134.37",
    ipaddress_source => "Static Address",
    macaddress => "3c:ec:ef:76:88:56",
    subnet_mask => "255.255.255.0"
  },
  default => {
    channel => 1,
    gateway => "10.10.134.254",
    ipaddress => "10.10.134.37",
    ipaddress_source => "Static Address",
    macaddress => "3c:ec:ef:76:88:56",
    subnet_mask => "255.255.255.0"
  }
}
ipmi1_gateway => 10.10.134.254
ipmi1_ipaddress => 10.10.134.37
ipmi1_ipaddress_source => Static Address
ipmi1_lan_channel => 1
ipmi1_macaddress => 3c:ec:ef:76:88:56
ipmi1_subnet_mask => 255.255.255.0
ipmi_gateway => 10.10.134.254
ipmi_ipaddress => 10.10.134.37
ipmi_ipaddress_source => Static Address
ipmi_lan_channel => 1
ipmi_macaddress => 3c:ec:ef:76:88:56
ipmi_subnet_mask => 255.255.255.0
ipmitool_mc_info => {
  Device Available => "yes",
  Device ID => "32",
  Device Revision => "1",
  Firmware Revision => "1.01",
  IPMI Version => "2.0",
  IPMI_Puppet_Service_Recommend => "running",
  Manufacturer ID => "10876",
  Manufacturer Name => "Supermicro",
  Product ID => "7028 (0x1b74)",
  Product Name => "Unknown (0x1B74)",
  Provides Device SDRs => "no"
}

I believe that there can only be a single FRU, at least per ipmi char dev. Is that correct? If so, what do you think about adding fru as ipmi.fru? E.g.:

ipmi => {
  fru => {
    board_mfg => "Supermicro",
    board_mfg_date => "Fri Mar 19 20:22:00 2021",
    board_part_number => "H12SSW-NTR",
    board_product => "H12SSW-NTR",
    board_serial => "WM213S605003",
    chassis_part_number => "CSE-116TS-R706WBP5-N10",
    chassis_serial => "C1160LK10P10275",
    chassis_type => "Other",
    product_manufacturer => "Supermicro",
    product_part_number => "AS -1114S-WN10RT",
    product_serial => "S407507X1803754"
  }
}

I would be happy to see ipmi.mc as well but I think we should leave the existing ipmi.+ and ipmitool_mc_info facts in place in parallel with a cleaned up hierarchy for at least one major release cycle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants