Skip to content

Configuration generator #516

Closed
Closed

Description

@jesperpedersen

Create a tool that can generate an initial configuration file (pgmoneta.conf) based on user inputs.

Could be from console, or (more difficult) from command line parameters

Activity

  1. added
    feature
    community
    on Mar 12, 2025
  2. jesperpedersen commented on Mar 12, 2025

    @jesperpedersen
    MemberAuthor
  3. Mohab96 commented on Mar 13, 2025

    @Mohab96
    Collaborator

    If I’m not mistaken, doesn’t the function pgmoneta_init_configuration perform the same task?

  4. jesperpedersen commented on Mar 13, 2025

    @jesperpedersen
    MemberAuthor

    This is a command line tool that build configuration files for the various components (core, walinfo, cli, ...)

  5. Arnabdaz commented on Mar 17, 2025

    @Arnabdaz

    I would like to work on this issue
    cc @jesperpedersen

  6. jesperpedersen commented on Mar 17, 2025

    @jesperpedersen
    MemberAuthor

    @Arnabdaz Go for it !

  7. Arnabdaz commented on Mar 17, 2025

    @Arnabdaz

    I am thinking of implementing it as follows:

    1. user would use command pgmoneta configure
    • this time user opens the interactive mode
    • if the config file does not exist then it is created in the current dir
    • if it exists we edit it (interactive mode only edits the options we have entered in interactive mode not others, it does not update predefined values with default ones)
    1. pgmoneta configure -c <config_file_loc>
    • again we open interactive mode
    • but this time instead of current directory we use the file from the given location
    • if file not found we just go with the current directory file creation
    1. pgmoneta configure -h
    • opens the help dialog i.e. manual

    for all next options if -c is given we use that location file else current directory

    1. pgmoneta configure --set <section> <key>:<value>
    • if file exists update the value
    • if not create file and set default values for other options
    1. pgmoneta configure --set <section> <key1>:<value1> <key2>:<value2>
    • same as point 4 but only for multiple options in one section
    1. pgmoneta configure --set <section1> <key1>:<value1> <key2>:<value2> --set <section2> <key3>:<value3>
    • same as point 4 but has multiple sections eg ([pgmoneta], [primary]..etc) and multiple key value pair each section
    • just an extended version of point 4 & 5
    1. pgmoneta configure --show
    • list the configuration
    • we can also expand it functionality to show specific configuration values

    If we visualize it simply as help dialog or a manual it would be like:

    Usage:
      pgmoneta configure [ -c <config_file> ] [options]
    
    Interactive mode:
      pgmoneta configure
      pgmoneta configure -c <config_file>
    
    Flag mode (update keys):
      pgmoneta configure [ -c <config_file> ] --set <section> <key>:<value> [<key>:<value> ...] [--set <section> <key>:<value> ...]
    
    Options:
      -c <config_file>    Specify configuration file (default: pgmoneta.conf in current directory)
      -h                  Show this help message
      --set               Set / Update configurations
      --show              List configurations
    

    wdyt @jesperpedersen

  8. jesperpedersen commented on Mar 17, 2025

    @jesperpedersen
    MemberAuthor

    Yes, looks good - just do a separate binary pgmoneta-config so we don'r confuse it with the run-time configuration settings.

    We will have multiple configuration files in the future - one for each binary

  9. Arnabdaz commented on Mar 17, 2025

    @Arnabdaz

    Sounds good to me

    In the interactive mode I will give only options to setup the basic stuff (initially) as in example pgmoneta.conf so that new users are not confused.

    And for other options users can setup them using --set

  10. jesperpedersen commented on Mar 17, 2025

    @jesperpedersen
    MemberAuthor

    Yes, it should just be enough to help a user configure a running configuration against one server.

    Then you can provide set and get operations for the rest -- you don't have to use --

  11. Mohab96 commented on Mar 17, 2025

    @Mohab96
    Collaborator

    Shouldn't this tool implemented after the configuration split?

  12. jesperpedersen commented on Mar 17, 2025

    @jesperpedersen
    MemberAuthor

    @Mohab96 No, we can start on it now

  13. Sakshii-27 commented on Apr 8, 2026

    @Sakshii-27
    Contributor

    Hi @jesperpedersen, I noticed this issue is still open and hasn't had updates for some time. I'd like to work on this

  14. jesperpedersen commented on Apr 8, 2026

    @jesperpedersen
    MemberAuthor

    @Sakshii-27 Go for it !

  15. added 3 commits that reference this issue on Apr 10, 2026
  16. added a commit that references this issue on Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

communityfeature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions