-
Notifications
You must be signed in to change notification settings - Fork 19
Adding new Container and Container.debian dockerfiles to enable rootl… #8
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
353c7dd
cb8c788
4b1eef3
52d59c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,6 +68,7 @@ ENV OPENVOXSERVER_JAVA_ARGS="-Xms1024m -Xmx1024m" \ | |
| OPENVOXSERVER_ENABLE_ENV_CACHE_DEL_API=true \ | ||
| ENVIRONMENTPATH=/etc/puppetlabs/code/environments \ | ||
| HIERACONFIG='$confdir/hiera.yaml' \ | ||
| HOME=/home/puppet \ | ||
| CSR_ATTRIBUTES='{}' | ||
|
|
||
| COPY docker-entrypoint.sh \ | ||
|
|
@@ -129,42 +130,6 @@ USER puppet | |
| RUN mkdir -p /home/puppet/.puppetlabs/etc/ && \ | ||
|
||
| ln -s /etc/puppetlabs/puppet/ /home/puppet/.puppetlabs/etc/puppet | ||
|
|
||
| ENV OPENVOXSERVER_JAVA_ARGS="-Xms1024m -Xmx1024m" \ | ||
| confdir=/etc/puppetlabs/puppet \ | ||
| PATH=$PATH:/opt/puppetlabs/server/bin:/opt/puppetlabs/puppet/bin:/opt/puppetlabs/bin \ | ||
| SSLDIR=/etc/puppetlabs/puppet/ssl \ | ||
| LOGDIR=/var/log/puppetlabs/puppetserver \ | ||
| OPENVOXSERVER_HOSTNAME="" \ | ||
| CERTNAME="" \ | ||
| DNS_ALT_NAMES="" \ | ||
| OPENVOXSERVER_PORT=8140 \ | ||
| AUTOSIGN=true \ | ||
| OPENVOXSERVER_MAX_ACTIVE_INSTANCES=1 \ | ||
| OPENVOXSERVER_MAX_REQUESTS_PER_INSTANCE=0 \ | ||
| CA_ENABLED=true \ | ||
| CA_TTL=157680000 \ | ||
| CA_HOSTNAME=puppet \ | ||
| CA_PORT=8140 \ | ||
| CA_ALLOW_SUBJECT_ALT_NAMES=false \ | ||
| INTERMEDIATE_CA=false \ | ||
| INTERMEDIATE_CA_BUNDLE=/etc/puppetlabs/intermediate/ca.pem \ | ||
| INTERMEDIATE_CRL_CHAIN=/etc/puppetlabs/intermediate/crl.pem \ | ||
| INTERMEDIATE_CA_KEY=/etc/puppetlabs/intermediate/key.pem \ | ||
| USE_OPENVOXDB=true \ | ||
| OPENVOXDB_SERVER_URLS=https://openvoxdb:8081 \ | ||
| OPENVOX_STORECONFIGS_BACKEND="puppetdb" \ | ||
| OPENVOX_STORECONFIGS=true \ | ||
| OPENVOX_REPORTS="puppetdb" \ | ||
| OPENVOXSERVER_GRAPHITE_EXPORTER_ENABLED=false \ | ||
| OPENVOXSERVER_GRAPHITE_PORT=9109 \ | ||
| OPENVOXSERVER_GRAPHITE_HOST=exporter \ | ||
| OPENVOXSERVER_ENVIRONMENT_TIMEOUT=unlimited \ | ||
| OPENVOXSERVER_ENABLE_ENV_CACHE_DEL_API=true \ | ||
| ENVIRONMENTPATH=/etc/puppetlabs/code/environments \ | ||
| HIERACONFIG='$confdir/hiera.yaml' \ | ||
| HOME=/home/puppet \ | ||
| CSR_ATTRIBUTES='{}' | ||
|
|
||
| #We need to tell puppet to use the default installation for the non-root user. | ||
| RUN echo 'confdir = /etc/puppetlabs/puppet' >> /etc/puppetlabs/puppet/puppet.conf | ||
|
|
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why a new file? Can't you use an argument for the base container just like
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The repo URL is a bit different. To me it makes since to separate out the files. You would also need an OS argument for: But you could do that and have a single file if desired. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the deb/rpm packages, it's
/opt/puppetlabs/server/data/puppetserverThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesnt matter if the HOME directory is
/opt/puppetlabs/server/data/puppetserver
or
/home/puppet
because it will still be interpolated as
/opt/puppetlabs/server/data/puppetserver/.puppetlabs/....or
/home/puppet/.puppetlabs/...I simply felt that
/home/puppet/.puppetlabs/...looks a lot cleaner. One could just as easily setup the SYMLINK for the opt folder as well, simply by changing this:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this can get simpler
However CADIR for a non-root user is set to:
Which conflicts that it should be /etc/puppetlabs/puppetserver/ca.
Also, I need to do a similar link for the OPT and VAR folders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed. I added a similar symlink to /opt.
I also fixed the incorrect non-root CA dir by adding:
puppet config set cadir /etc/puppetlabs/puppetserver/ca/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering why this is required at all. When systemd starts the normal puppetserver unit, it does that as
puppetuser, but it doesn't look for configs in its home.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Systemd doesn't exist in the container.
I dont have a puppetserver in front of me. But I would guess it's because the service runs as root.
https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#User=
And I'm guessing the environment in this case is setup for root, not puppet, even though the binaries are being ran as puppet.
I'm willing to bet if you actually ssh'd into a server as a non root user and ran the systemd unit without sudo (you would have to use the --user flag https://wiki.archlinux.org/title/Systemd/User) it would be a different story.