alces-software / metalware

Tools and conventions for improving bare metal machine management
Other
2 stars 0 forks source link

Allow --answers for metal configure local #445

Closed ColonelPanicks closed 6 years ago

ColonelPanicks commented 6 years ago

For some reason every configure command except local allows --answers

[root@gateway ~]# metal configure local --help

  NAME:

    configure local

  SYNOPSIS:

    metal configure local [options]

  DESCRIPTION:

    Configures the node that metalware is running on. This is treated as the metalware master node. This must be ran to configure
metalware to match the system environment. This command is intended to only be ran once.

[root@gateway ~]# metal configure domain --help

  NAME:

    configure domain

  SYNOPSIS:

    metal configure domain [options]

  DESCRIPTION:

    Asks a sequence of questions defined in the current repository to configure the domain for this Metalware installation. The
configuration answers will then be used when rendering templates.

  OPTIONS:

    -a ANSWERS_MAPPING, --answers ANSWERS_MAPPING
        Given a JSON mapping of question identifiers to answer values, the given answers will be saved instead of asking the
configure questions and saving user input.

[root@gateway ~]# metal configure group --help

  NAME:

    configure group

  SYNOPSIS:

    metal configure group GROUP_NAME [options]

  DESCRIPTION:

    Asks a sequence of questions defined in the current repository to configure a group for this Metalware installation. The
configuration answers will then be used when rendering templates.

  OPTIONS:

    -a ANSWERS_MAPPING, --answers ANSWERS_MAPPING
        Given a JSON mapping of question identifiers to answer values, the given answers will be saved instead of asking the
configure questions and saving user input.

[root@gateway ~]# metal configure node --help

  NAME:

    configure node

  SYNOPSIS:

    metal configure node NODE_NAME [options]

  DESCRIPTION:

    Asks a sequence of questions defined in the current repository to configure a node for this Metalware installation. The
configuration answers will then be used when rendering templates.

  OPTIONS:

    -a ANSWERS_MAPPING, --answers ANSWERS_MAPPING
        Given a JSON mapping of question identifiers to answer values, the given answers will be saved instead of asking the
configure questions and saving user input.
bobwhitelock commented 6 years ago

For some reason every configure command except local allows --answers

Looks like this is because configure local was added after the others and this option was not defined for it - compare https://github.com/alces-software/metalware/blob/e2282826d7b04581a60a20da79602534bc232a6a/src/cli_helper/config.yaml#L96,L103 to https://github.com/alces-software/metalware/blob/e2282826d7b04581a60a20da79602534bc232a6a/src/cli_helper/config.yaml#L93,L94.

Once this option is added to configure local it should Just Work, as the option itself is handled at the command level: https://github.com/alces-software/metalware/blob/e2282826d7b04581a60a20da79602534bc232a6a/src/command_helpers/configure_command.rb#L50,L52. PRs welcome :slightly_smiling_face:.

bobwhitelock commented 6 years ago

Fixed by https://github.com/alces-software/metalware/issues/447.