Coder Social home page Coder Social logo

Comments (3)

treydock avatar treydock commented on July 17, 2024

I think something like $custom_config would work. My only hesitation with $custom_fragment is the word fragment because that's only a valid idea with concat module and no real reason to use concat module here, instead can just deploy a second config file and make it behave like the one provided from this module. One pattern that is useful is making it two parameters, custom_config_source and custom_config_content , both being undef and so a site can choose to provide a plain file or content (template).

from puppet-module-keycloak.

danifr avatar danifr commented on July 17, 2024

My initial idea was to add something like this to the config.cli.erb:

...
<%- if scope['keycloak::custom_config'] -%>
<%= scope['keycloak::custom_config'] %>
<%- end -%>

And then people can do:

class { 'keycloak':
  ...
  custom_config => epp('apps/keycloak/custom.config'),
  ...
}

Also they can pass a simple string and that will work too.

I am not sure about having more than one config.cli files though. This might add complexity since we will need to run https://github.com/treydock/puppet-module-keycloak/blob/master/manifests/config.pp#L66 twice. Also it would make things more difficult to debug, since there are 2 different files changing the config in the standalone.xml.

from puppet-module-keycloak.

treydock avatar treydock commented on July 17, 2024

I think what makes the most sense to only execute the jboss CLI once is this:

concat { "${keycloak::install_base}/config.cli":
  ...
  notify    => Exec['jboss-cli.sh --file=config.cli']
 }
concat::fragment { 'config.cli-keycloak':
      target => "${keycloak::install_base}/config.cli",
      content => template('keycloak/config.cli.erb'),
      order     => '00',
}
if $custom_config_content or $custom_config_source {
  concat::fragment { 'config.cli-custom':
      target => "${keycloak::install_base}/config.cli",
      content => $custom_config_content,
      source   => $custom_config_source,
      order     => '01',
  }
}

This way a site can choose to provide custom_config_source => 'puppet:///site_modules/profile/keycloak.cli' or like your example they can provide a epp or erb template via custom_config_content.

from puppet-module-keycloak.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.