Skip to content

Configuring Candlepin with environment variables#71

Closed
ehelms wants to merge 1 commit intotheforeman:masterfrom
ehelms:use-env
Closed

Configuring Candlepin with environment variables#71
ehelms wants to merge 1 commit intotheforeman:masterfrom
ehelms:use-env

Conversation

@ehelms
Copy link
Copy Markdown
Member

@ehelms ehelms commented Jan 16, 2025

I took one configuration option for candlepin.conf to see what it would look like to have an option we configure to be deployed as an environment variable.

candlepin_container_image: quay.io/ehelms/candlepin
candlepin_container_tag: 4.4.14

candlepin_db_user: candlepin
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like you were experimenting with something else and ended up committing it too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct - I started doing all of them and then decided to just do one to see what it looked and felt like.


candlepin.auth.oauth.enable=true
candlepin.auth.oauth.consumer.katello.secret={{ candlepin_oauth_secret }}
candlepin.auth.oauth.consumer.katello.secret="NOTTHEREALSECERT"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we even need to include this in the config file if we're not passing it? Right now I can see a failure mode where it somehow isn't provided/respected and the password ends up being NOTTHEREALSECERT. If you don't provide at all I'd hope that Candlepin has a sane default that refuses to work.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have it here to test whether the environment variables overwrite what's in the config. To see if that provides a way to ship defaults but know that we can provide a configuration option to users if need be by adding the environment variable.

If we went this route as a whole, the question would be do we include this in the .conf file available in the container. I could see for anything that is a "secret" we opt not to include it. For other elements, we include a sane default that can be overridden.

@ehelms ehelms marked this pull request as draft January 16, 2025 17:33
@ehelms
Copy link
Copy Markdown
Member Author

ehelms commented Feb 4, 2025

The programmatic configuration options detailed below do not appear to be able to be set via environment variables in the combinations I have tried. This would mean we'd still end up with having to deploy a config file.

org.quartz.jobStore.dataSource=myDS

org.quartz.dataSource.myDS.driver=org.postgresql.Driver
org.quartz.dataSource.myDS.user=candlepin
org.quartz.dataSource.myDS.password={{ candlepin_db_password }}
org.quartz.dataSource.myDS.maxConnections=5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants