distro: Move RHEL 8 SAP config data into sap.go
This can be shared between cloud providers so move it out of the EC2 SAP config into its own file and drop the X86_64 from the name (there is nothing arch specific in it, even if it is only ever used on X86).
This commit is contained in:
parent
bff6403b37
commit
ed7aaec12d
2 changed files with 119 additions and 109 deletions
|
|
@ -1319,115 +1319,7 @@ func newDistro(distroName string) distro.Distro {
|
|||
}
|
||||
|
||||
// default EC2-SAP image config (x86_64)
|
||||
defaultEc2SapImageConfigX86_64 := &distro.ImageConfig{
|
||||
SELinuxConfig: &osbuild.SELinuxConfigStageOptions{
|
||||
State: osbuild.SELinuxStatePermissive,
|
||||
},
|
||||
// RHBZ#1960617
|
||||
Tuned: osbuild.NewTunedStageOptions("sap-hana"),
|
||||
// RHBZ#1959979
|
||||
Tmpfilesd: []*osbuild.TmpfilesdStageOptions{
|
||||
osbuild.NewTmpfilesdStageOptions("sap.conf",
|
||||
[]osbuild.TmpfilesdConfigLine{
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.sap*",
|
||||
},
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.hdb*lock",
|
||||
},
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.trex*lock",
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// RHBZ#1959963
|
||||
PamLimitsConf: []*osbuild.PamLimitsConfStageOptions{
|
||||
osbuild.NewPamLimitsConfStageOptions("99-sap.conf",
|
||||
[]osbuild.PamLimitsConfigLine{
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// RHBZ#1959962
|
||||
Sysctld: []*osbuild.SysctldStageOptions{
|
||||
osbuild.NewSysctldStageOptions("sap.conf",
|
||||
[]osbuild.SysctldConfigLine{
|
||||
{
|
||||
Key: "kernel.pid_max",
|
||||
Value: "4194304",
|
||||
},
|
||||
{
|
||||
Key: "vm.max_map_count",
|
||||
Value: "2147483647",
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// E4S/EUS
|
||||
DNFConfig: []*osbuild.DNFConfigStageOptions{
|
||||
osbuild.NewDNFConfigStageOptions(
|
||||
[]osbuild.DNFVariable{
|
||||
{
|
||||
Name: "releasever",
|
||||
Value: rd.osVersion,
|
||||
},
|
||||
},
|
||||
nil,
|
||||
),
|
||||
},
|
||||
}
|
||||
defaultEc2SapImageConfigX86_64 = defaultEc2SapImageConfigX86_64.InheritFrom(defaultEc2ImageConfigX86_64)
|
||||
defaultEc2SapImageConfigX86_64 := SapImageConfig(rd).InheritFrom(defaultEc2ImageConfigX86_64)
|
||||
|
||||
ec2SapImgTypeX86_64 := imageType{
|
||||
name: "ec2-sap",
|
||||
|
|
|
|||
118
internal/distro/rhel8/sap.go
Normal file
118
internal/distro/rhel8/sap.go
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
package rhel8
|
||||
|
||||
import (
|
||||
"github.com/osbuild/osbuild-composer/internal/distro"
|
||||
"github.com/osbuild/osbuild-composer/internal/osbuild"
|
||||
)
|
||||
|
||||
// SapImageConfig returns the SAP specific ImageConfig data
|
||||
func SapImageConfig(rd distribution) *distro.ImageConfig {
|
||||
return &distro.ImageConfig{
|
||||
SELinuxConfig: &osbuild.SELinuxConfigStageOptions{
|
||||
State: osbuild.SELinuxStatePermissive,
|
||||
},
|
||||
// RHBZ#1960617
|
||||
Tuned: osbuild.NewTunedStageOptions("sap-hana"),
|
||||
// RHBZ#1959979
|
||||
Tmpfilesd: []*osbuild.TmpfilesdStageOptions{
|
||||
osbuild.NewTmpfilesdStageOptions("sap.conf",
|
||||
[]osbuild.TmpfilesdConfigLine{
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.sap*",
|
||||
},
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.hdb*lock",
|
||||
},
|
||||
{
|
||||
Type: "x",
|
||||
Path: "/tmp/.trex*lock",
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// RHBZ#1959963
|
||||
PamLimitsConf: []*osbuild.PamLimitsConfStageOptions{
|
||||
osbuild.NewPamLimitsConfStageOptions("99-sap.conf",
|
||||
[]osbuild.PamLimitsConfigLine{
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNofile,
|
||||
Value: osbuild.PamLimitsValueInt(1048576),
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@sapsys",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeHard,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
{
|
||||
Domain: "@dba",
|
||||
Type: osbuild.PamLimitsTypeSoft,
|
||||
Item: osbuild.PamLimitsItemNproc,
|
||||
Value: osbuild.PamLimitsValueUnlimited,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// RHBZ#1959962
|
||||
Sysctld: []*osbuild.SysctldStageOptions{
|
||||
osbuild.NewSysctldStageOptions("sap.conf",
|
||||
[]osbuild.SysctldConfigLine{
|
||||
{
|
||||
Key: "kernel.pid_max",
|
||||
Value: "4194304",
|
||||
},
|
||||
{
|
||||
Key: "vm.max_map_count",
|
||||
Value: "2147483647",
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
// E4S/EUS
|
||||
DNFConfig: []*osbuild.DNFConfigStageOptions{
|
||||
osbuild.NewDNFConfigStageOptions(
|
||||
[]osbuild.DNFVariable{
|
||||
{
|
||||
Name: "releasever",
|
||||
Value: rd.osVersion,
|
||||
},
|
||||
},
|
||||
nil,
|
||||
),
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue