Skip to content
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

Need to keep the secret key #387

Open
jza34 opened this issue Aug 3, 2023 · 4 comments
Open

Need to keep the secret key #387

jza34 opened this issue Aug 3, 2023 · 4 comments

Comments

@jza34
Copy link

jza34 commented Aug 3, 2023

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.25.0
  • Ruby:
  • Distribution: Debian bullseye
  • Module version: 9.0.0

How to reproduce (e.g Puppet code you use)

Setup puppetboard with the puppet module puppet-puppetboard
Set a SECRET_KEY in settings.py
Reload the agent with puppet agent -t

What are you seeing

SECRET_KEY is removed by the puppet agent

What behaviour did you expect instead

The SECRET_KEY is kept

Output log

Info: Applying configuration version '1691050084'
Notice: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]/content: 
--- /srv/puppetboard/puppetboard/settings.py	2023-08-03 09:20:20.477874187 +0200
+++ /tmp/puppet-file20230803-3834-1i1ihw4	2023-08-03 10:08:14.761189408 +0200
@@ -10,4 +10,3 @@
 OFFLINE_MODE = False
 DEFAULT_ENVIRONMENT = 'production'
 REPORTS_COUNT = 10
-SECRET_KEY = 'ihiouiuhiuhiuhiuh'

Notice: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]/content: 

Notice: /Stage[main]/Puppetboard/File[/srv/puppetboard/puppetboard/settings.py]/content: content changed '{sha256}8fee6afb11b6d03bb1df7e0bde817b791747fa8ac244537ffe5a9da0d1af597b' to '{sha256}cc309ef7c7ff7450f421c7ed56764cda060dbbdfe8b1fe0938219e9960d5990d' (corrective)

Any additional information you'd like to impart

Could be great to ask for a secret key when installing the module or to give a module parameter to set the key in the manifest

@sid3windr
Copy link

You can set the key when calling the class like this:

  class { 'puppetboard':
    extra_settings => {
      'SECRET_KEY' => "'12345abcde'",
    }

I agree it could be done in a more elegant way...

@gdubicki
Copy link
Member

gdubicki commented Aug 7, 2023

I agree it could be done in a more elegant way...

(Arguably) a more elegant way has been added in #375, we just need a new module release to make it available.

Can you do a release, please @smortex or @bastelfreak ?

@bastelfreak
Copy link
Member

I would like to include #388 in the release but I currently don't know why the tests fail.

@ic248
Copy link

ic248 commented Sep 21, 2023

extra_settings route works perfect, but would be good to get a release so that we can just secret key as an option

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

No branches or pull requests

5 participants