Comments (12)
Yea. One thing I would not want to see is the pattern where some modules accept an erb path directly, don't do that please.
The end product should look like this I think:
# Put loadbalanced webs in the MOTD for fun
file { '/etc/motd.ctmpl':
content => 'I serve these webs: {{range service "web"}}{{.Node}} {{end}}'
} ->
consul::template { '/etc/motd':
target => '/etc/motd', # (redundant)
source => '/etc/motd.ctmpl',
command => "wall 'MOTD IS CHANGED!!! RELOGIN TO SEE IT ASAP!!!'"
}
I guess if you wanted to be super fancy you could support a "content" parameter directly into the define, and it would store it in a temp location. content and source would be mutually exclusive I guess. That would allow people use use erbs directly if they really wanted to.
Do we want to support the "once" method of creation instead of daemon? Would anyone really want that? (you get the slowness of puppet and the dynamic-ness of consul?)
from puppet-consul.
How about if the resource simply accepts content =>
, and then the caller can call with content => template("mymodule/mytemplate.erb")
or content => file("mymodule/myfile")
?
I definitely agree that the daemon mode is more exciting that the "once" mode, but I could see it being useful. Maybe you've already got puppet code configuring some service, and you want to stick some variables into that config that comes from consul. (Never mind that this particular example could also be implemented as a custom function letting you do consul lookups from inside puppet, which we could also write.) If it's straightforward to also do once
, then we should do that too; if it's tricky (e.g. idk how you create a temporary file with puppet) then I'd be fine taking our time for once
and just doing daemon
mode now.
from puppet-consul.
Yea, I guess in a sense we are writing a thing that replaces the "file" type, so we should respond to the same types of arguments.
This means content
or source
. You can't do just content=>file()
without a third party module...
from puppet-consul.
Apparently the file() stuff is still not resolved
https://tickets.puppetlabs.com/browse/PUP-1214
from puppet-consul.
https://github.com/Intelliplan/puppet-consul_template is s module that already does that .. it could be intergrated id neede.
from puppet-consul.
I like the idea of making a thin wrapper around the module that @KrisBuytaert mentioned, so a consul::template
resource would create a consul_template::template
resource.
We could even have our consul::template
resource include the consul_template
class, setting class parameters (consul agent host and port) based on parameters to our consul
class.
This thin wrapper wouldn't quite provide the API I was hoping for (with the content
parameter):
Do note that putting the ctmpl file in place place is outside of this module scope. It can e.g. be done in the profile.
I think I can live with that.
from puppet-consul.
Has there been any traction on this. I think it would be worth while to have this support self contained in one module without having chained dependencies for this functionality. It would also be nice to possibly add support for consul replicate
as well.
from puppet-consul.
Nope, mostly just waiting for someone with the need to do it.
@EvanKrall with your most recent project, I know you used templates, did you use that consul_template module or did you do something else?
from puppet-consul.
I'm approaching the need right now so I might add it, I'll wait to hear back from @EvanKrall on what he used.
from puppet-consul.
Is it still planned? an amazing-to-have feature
from puppet-consul.
I think that this probably make sense as a separate module and I've been using this one:
https://github.com/gdhbashton/puppet-consul_template
from puppet-consul.
Yea, I don't think we should re-invent the wheel. I agree that this would be best as a separate module, as it has a different install/config/service/etc.
from puppet-consul.
Related Issues (20)
- Drop EoL Amazon Linux support
- Drop EoL Fedora 25/26/27 support
- Drop EoL FreeBSD 10 support
- Drop support for old SLES/SLED versions
- Drop support for EoL Puppet 5
- Migrate from master to main HOT 2
- migrate module to Vox Pupuli? HOT 6
- Module Release?
- RFC: refactor to include official hashicorp package repos HOT 1
- Systemd service does't work for 'package' install_method HOT 6
- RFC: change dependency camp2camp/systemd module to voxpupuli/systemd
- legacy ACL v1 no longer working starting from Consul version 1.11 HOT 9
- Add ability to manage consul log directory HOT 1
- Status of the project HOT 1
- Adding ACLS / Policies failes with unable to get local issuer certificate -> Puppet 6 / LetsEncrypt HOT 2
- alternative commands to Consul Reload
- module doesn't support grpc checks
- systemd Failed to parse service type, ignoring: exec
- How to access the secret_id of tokens HOT 1
- Allow to not restart consul when updating the binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-consul.