Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
Enable platform dependent bootstrap ignition files
Browse files Browse the repository at this point in the history
Some of the additions made should only be enabled for the
baremetal platform, so move these to data/data/bootstrap/baremetal
and adjust the code to conditionally read this depending on the
platform name.

Closes: #62
Related: #64
  • Loading branch information
Steven Hardy committed Jun 11, 2019
1 parent f92e7f9 commit eec38a3
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,24 @@ func (a *Bootstrap) Generate(dependencies asset.Parents) error {
if err != nil {
return err
}

// Check for optional platform specific directories
platform := installConfig.Config.Platform.Name()
platformFilePath := fmt.Sprintf("bootstrap/%s/files", platform)
if _, err := os.Stat(platformFilePath); !os.IsNotExist(err) {
err = a.addStorageFiles("/", platformFilePath, templateData)
if err != nil {
return err
}
}
platformUnitPath := fmt.Sprintf("bootstrap/%s/units", platform)
if _, err := os.Stat(platformUnitPath); !os.IsNotExist(err) {
err = a.addSystemdUnits(platformUnitPath, templateData)
if err != nil {
return err
}
}

a.addParentFiles(dependencies)

a.Config.Passwd.Users = append(
Expand Down

0 comments on commit eec38a3

Please sign in to comment.