I am currently working on implementing puppet in our environment, however, I have a request I dont know if puppet itself can fill.
If I have a configuration under /etc/myconfig.conf. And I want it to be written only if it doesnt already exist; I can use the onlyif function. But is there any way that I can get puppet to do something, a notify() or something if it detect a change in a file..?
I dont want it to actually change the file, only notify me that the file is not the way it want it to be..
There is really no examples or anything in this question, but I hope someone is able to push me in the right direction here. If I create a solution for this based on tips, I will post the answer myself for others to learn from.
Thanks
For only creating a file if it doesn't exist, try setting replace to false, like so:
file { "/etc/myconfig.conf":
ensure => present,
source => "puppet:///modules/${module_name}/myconfig.conf",
replace => false,
}
Docs for that are here: http://docs.puppetlabs.com/references/2.7.0/type.html#file
For the notification, puppet auditing will do what you need:
http://puppetlabs.com/blog/all-about-auditing-with-puppet/
It sounds like you want puppet to alert you of any changes it WOULD do rather than do them.
For this, just run with noop (--noop)
it will tell you every change it is going to do but not perform them.
Related
I am a student and in the school website, what I want to do is that I want to busy wait on the certain URL and check if the class i want to register for is open or not. I was wondering if there was a way to constantly check on the website(busy waiting or otherwise) to see if the class is open or not. There is a table Rem where it shows the number of places remaining in the User Interface.
Also what language would you use to solve this problem?
Yes you can. but for that you will probably need to create a script that fetches the value of data from that table.
So something like web scraping should work.
I would definately use php for this stuff.
Google web scraping and you can code the script.
I am not sure if this is the exact thing that will help you, but what you need to do is something similar - See Here
I would like to update and maintain my configurations in hiera_hash files. Already, The Hiera_Hash file holds some predefined values. Based on users input I would like to add/ update the new configurations in the hiera_hash file. To do that, I am trying to write it in Factor level and puppet code level. But No idea whether it will work or not.
Guys, Please let me know Whether my scenario is possible / not.
Any help would be much appreciated !!!
Is there a way to know whether a call to StorageArea.remove actually removed something (and if it did, how many items)?
The documentation doesn't seem to say anything about it, and I'm hoping there is some way to do that that doesn't require calling get first to check whether something is there.
Since, as you can see from the docs, the callback has no parameters - no, nothing is reported, except for errors through an API variable.
The route with get first is the right one.
Semantically, remove is "make sure those elements aren't there". That's exactly what it does.
I'm trying to find a better way to move my Expression Engine 2 sites from development to live servers. I have a checklist that I go through, starting with running a find and replace for the old/new URLs and server paths, then I update the database config file. This however misses out a huge amount of settings that I then have to go through and change manually, but I don't see why I should need to (unless these are encrypyed somewhere).
For example, I have to change the "Basepath to Template File Directory" in the Global Template Settings manually, along with member settings and a handful of others. There must be a file or entry with these in somewhere that I can change before I upload but I can't find it.
Does anyone know where these are stored?
Those are stored in the database, unless you are using global config variables.
I would highly recommend looking into some sort of config bootstrap. There are quite a few solutions to this, but it's really up to you to pick what's right for your development style / environment(s).
Take a look at the following articles:
http://eeinsider.com/articles/creating-a-robust-config.php-file/
http://boblet.tumblr.com/post/68095239/ee-localhost
http://eeinsider.com/articles/multi-server-setup-for-ee-2/
I've tried those solutions, but in my opinion the best option is NSM config bootstrap.
Check it out here: [http://ee-garage.com/nsm-config-bootstrap][4]
The only thing (currently) missing from these solutions are new config vars regarding file upload paths and locations. You can add those to any of these solutions by adding the variables detailed in this article:
http://expressionengine.com/user_guide/cp/content/files/file_upload_preferences.html#overriding-upload-paths-and-urls-using-configuration-variables
I know I'm late on this one, but for anyone else searching, this plugin is very useful and I have used it on numerous occasions.
ExpressionEngine stores your website URL and Server Path in a ridiculous number of places.
REElocate helps you update these in one simple step.
https://github.com/expressodev/reelocate
I have a request form I'm working on, wherein different departemnts need to be able to update it. To minimize overlap and lost changes I'd like to be able to submit data from the new form to different lists, but I cannot find a way to do this.
Does anyone have any experience trying to do anything similar?
If you're familiar with JQuery andSPServices I could envisage a way to do this.
In the EditForm.aspx, add the JQuery and SPServices libraries. using the $.(document).Ready function, I'd do a quick item update with the SPServices and just copy a column with the same data, so in effect no change looks to have taken place. I'd add in the edit comments something like "Pseduo checkout to [name], [date_time]".
Then allow the user to edit the form as normal but in the code you've added, you trap the PreSave Action and check that the person trying to do the save is the same as the last modified - if it is, save as normal, otherwise, return false on the PreSave and it will be denied. When you actually allow the save, set the edit comments to something sensible.
To complete this, check before doing the pseudo checkout, that the last comments don't contain the psuedo checkout phrase so that you can prevent anyone opening/editing the form whilst somebody else is in the middle of an edit.
This gives a cheap and relatievly easy to implement Check-In/Check-Out for a list. Not perfect of course but should work well in most scenarios (not in datasheet though, so you might need to prevent that type of edit).
If you have two lists would you not then have the problem of potentially two requests for the same thing?
Does none of the version control options for the list solve the problem of potentially multiple concurrent editors?
While SPService is certainly a solution, but you will have to build a UI of ur own.
Try writing a event receiver, which can copy over item to another list as soon as it is created.
It will be nice if you can tell why you really want to have a copy of item in another list
i.e. Auditing purpose etc. , you can get a perfect solution for this in Forum