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

Allow multiple Cobbler as targets #3

Open
1 of 2 tasks
SchoolGuy opened this issue Oct 18, 2021 · 2 comments
Open
1 of 2 tasks

Allow multiple Cobbler as targets #3

SchoolGuy opened this issue Oct 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@SchoolGuy
Copy link
Member

SchoolGuy commented Oct 18, 2021

The old Python CLI can only be utilized for a single localhost Cobbler Server. This should change with this project.

Definition of Done: Cobbler Target Server is configurable through

  • global CLI Flags
  • Configuration File
@nodeg
Copy link
Member

nodeg commented Oct 18, 2021

Good idea. We have to supply 3 parameters to the CLI (e.g. via flags)

  • Cobbler server URL (default value: localhost)
  • username (default value: cobbler)
  • password (default value: cobbler)

@nodeg nodeg self-assigned this Oct 19, 2021
@nodeg
Copy link
Member

nodeg commented Oct 25, 2021

At the moment the Cobbler server is configurable in cobbler.yaml which should be copied to $HOME/.cobbler.yaml. Cobra is configured to use this default location:

cli/cmd/root.go

Lines 48 to 61 in 3f5f105

func initConfig() {
if cfgFile != "" {
// Use config file from the flag.
viper.SetConfigFile(cfgFile)
} else {
// Find home directory.
home, err := os.UserHomeDir()
cobra.CheckErr(err)
// Search config in home directory with name ".cobbler" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".cobbler")
}

@SchoolGuy SchoolGuy moved this to In progress in Golang CLI Jun 15, 2024
@SchoolGuy SchoolGuy moved this from In progress to To do in Golang CLI Jun 16, 2024
@SchoolGuy SchoolGuy added the enhancement New feature or request label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: To do
Development

No branches or pull requests

2 participants