opendut
opendut copied to clipboard
Use CLEO setup string to create configuration for CLEO
A user wants to manage peers in an automated workflow. For this automation she wants to use CLEO and create peers, cluster-configurations and cluster-deployments via commandline. With authentication in place, a client id and secret is required to connect to the backend OpenDuT-CARL. Issue #190 introduced a new CLEO setup string ot assist in the setup of a new CLEO instance.
Tasks
Add a subcommand to CLEO that creates a configuration file.
- [ ] Get CLEO setup string
- [ ] Write configuration of CLEO to file if requested by argument
--persistent. Use fields CARL url, client id, client secret. User configuration directory is located in~/.config/opendut/cleo/config.toml. - [ ] Write certificate authority to file to a known location. Add path to CLEOs configuration file.
- [ ] Provide an option to print the environment variables to the terminal instead of writing the configuration file
- [ ] Add custom certificate field to CLEO's configuration that contains the content of the certificate
Details
- Importing it to the system CA's should not be necessary and should not be done.
- In case a custom certificate authority is used, it may be required to provide the certificate authority from an environment variable (certificate content is content of the environment variable).
- For automation in CI/CD it may be easier to use environment variables (provisioned by secrets). Therefore it may come in handy to have an option to create a set of environment variables to connect to the CARL instance defined in the setup string.
- It may be useful to define the configuration location (user ~/.config/opendut/cleo/config.toml, system /etc/opendut/cleo.toml).