|
38 | 38 | description = "Additional options to pass to `check_ipmi_sensor`.";
|
39 | 39 | type = types.str;
|
40 | 40 | };
|
| 41 | + manageAdminUserName = mkOption { |
| 42 | + default = true; |
| 43 | + description = "Manage the admin user name (setting it to `ADMIN`)."; |
| 44 | + type = types.bool; |
| 45 | + }; |
41 | 46 | };
|
42 | 47 | };
|
43 | 48 |
|
|
82 | 87 | serviceConfig.RemainAfterExit = true;
|
83 | 88 | path = [ pkgs.ipmitool ];
|
84 | 89 | wantedBy = [ "basic.target" ];
|
85 |
| - script = '' |
86 |
| - ipmitool lan set 1 ipsrc static |
87 |
| - sleep 1 |
88 |
| - ipmitool lan set 1 ipaddr ${ipmi_addr} |
89 |
| - sleep 1 |
90 |
| - ipmitool lan set 1 netmask ${ipmi_netmask} |
91 |
| - sleep 1 |
92 |
| - ipmitool lan set 1 defgw ipaddr ${ipmi_gw} |
93 |
| - sleep 1 |
94 |
| - ipmitool sol set non-volatile-bit-rate 115.2 1 |
95 |
| - sleep 1 |
96 |
| - ipmitool sol set volatile-bit-rate 115.2 1 |
97 |
| - sleep 1 |
98 |
| - ipmitool user set name 2 ADMIN |
99 |
| - # See https://serverfault.com/questions/361940/configuring-supermicro-ipmi-to-use-one-of-the-lan-interfaces-instead-of-the-ipmi/677087 |
100 |
| - # Ensure BMC is set to failover (SuperMicro only) |
101 |
| - if ipmitool mc info | grep Supermicro > /dev/null ; then |
102 |
| - ipmitool raw 0x30 0x70 0x0c 1 2 || true |
103 |
| - fi |
104 |
| - ''; |
| 90 | + script = |
| 91 | + '' |
| 92 | + ipmitool lan set 1 ipsrc static |
| 93 | + sleep 1 |
| 94 | + ipmitool lan set 1 ipaddr ${ipmi_addr} |
| 95 | + sleep 1 |
| 96 | + ipmitool lan set 1 netmask ${ipmi_netmask} |
| 97 | + sleep 1 |
| 98 | + ipmitool lan set 1 defgw ipaddr ${ipmi_gw} |
| 99 | + sleep 1 |
| 100 | + ipmitool sol set non-volatile-bit-rate 115.2 1 |
| 101 | + sleep 1 |
| 102 | + ipmitool sol set volatile-bit-rate 115.2 1 |
| 103 | + sleep 1 |
| 104 | + '' |
| 105 | + + (lib.optionalString cfg.ipmi.manageAdminUserName '' |
| 106 | + ipmitool user set name 2 ADMIN |
| 107 | + '') |
| 108 | + + '' |
| 109 | + # See https://serverfault.com/questions/361940/configuring-supermicro-ipmi-to-use-one-of-the-lan-interfaces-instead-of-the-ipmi/677087 |
| 110 | + # Ensure BMC is set to failover (SuperMicro only) |
| 111 | + if ipmitool mc info | grep Supermicro > /dev/null ; then |
| 112 | + ipmitool raw 0x30 0x70 0x0c 1 2 || true |
| 113 | + fi |
| 114 | + ''; |
105 | 115 | };
|
106 | 116 |
|
107 | 117 | flyingcircus.passwordlessSudoPackages = [
|
|
0 commit comments