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

Set custom vhost parameters. for example Basic Auth #196

Merged
merged 2 commits into from
Feb 19, 2018

Conversation

c33s
Copy link
Member

@c33s c33s commented Dec 12, 2017

currently it is not possible to add custom parameters to the vhost created for puppetboard.
to configure a simple Auth Basic the whole vhost has to be created by oneself.

with this PR it is possible to pipe all ::apache::vhost parameters through ::puppetboard::apache::vhost with $custom_apache_parameters

puppetboard::apache::vhost::vhost_name: "%{facts.networking.fqdn}"
puppetboard::apache::vhost::port:       443
puppetboard::apache::vhost::ssl:        true
puppetboard::apache::vhost::ssl_cert:   /etc/ssl/localcerts/xxx.crt
puppetboard::apache::vhost::ssl_key:    /etc/ssl/private/xxx.key
puppetboard::apache::vhost::custom_apache_parameters:
  directories:
    -
      provider: Directory
      path:  '/srv/puppetboard/puppetboard'
      custom_fragment: |
        AuthType Basic
        AuthName "Restricted Files"
        AuthBasicProvider file
        AuthUserFile "/etc/apache2/htpasswd"
        Require user admin
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None

@@ -87,7 +87,8 @@
Optional[String] $ldap_bind_dn = undef,
Optional[String] $ldap_bind_password = undef,
Optional[String] $ldap_url = undef,
Optional[String] $ldap_bind_authoritative = undef
Optional[String] $ldap_bind_authoritative = undef,
Optional[Hash] $custom_apache_parameters = {},
Copy link
Member

Choose a reason for hiding this comment

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

Since it has a default, maybe this should just be Hash?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ekohl i can change this if you want

Copy link
Contributor

Choose a reason for hiding this comment

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

@ekohl why using {} instead of undef ? When using {} then every optional string would IMHO need '' instead of undef to be consistent. But then the parameters aren't Optional anymore because IMHO the empty string or the empty hash is already a value.

Choose a reason for hiding this comment

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

@vinzent because it gets used in a * => $custom_apache_parameters notation - you can't give undef as an argument to * so this would cause compilation failure - defaulting to {} is a lot cleaner than having to wrap things in conditionals... I do agree however that the use of Optional is not needed

@v4ld3r5
Copy link

v4ld3r5 commented Feb 19, 2018

Hi,
Would like to know if you do expect to merge this feature soon.
We're linking Puppetboard against an Active Directory and the current LDAP capability provided by the module isn't sufficient. I'm thinking on just setting puppetboard::apache::vhost::enable_ldap_auth: false, and instead feed the parameters through this new puppetboard::apache::vhost::custom_apache_parameters

Best regards,

@bastelfreak
Copy link
Member

Hi @c33s, thanks for the PR!

@bastelfreak bastelfreak merged commit 47cefd0 into voxpupuli:master Feb 19, 2018
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.

None yet

6 participants