Tag Info

Hot answers tagged

9

bundle agent test { vars: "my_result" string => execresult("/bin/ls /tmp/test/","noshell"); reports: ubuntu:: "Output is : $(my_result)"; } See https://cfengine.com/manuals/cf3-solutions#Execresult-example


7

I don't think it's overkill if it gets you, and/or your team, in the [excellent] practice of configuration management. Any skills or insight you gain using these tools will scale up to, and become much more important in, managing larger systems. You may not need to build a 24-step-change-process for only 3 nodes, but understanding the need for such ...


7

You can use both tools for your use case. I don't know how powerful are your handhelds tablets, but you might be interested to know that : Cfengine agent uses about 15 MB of RAM (never seen it going over 30 MB on any of my servers) (and it's been reported working on a Nokia N900 phone) Puppet needs the Ruby stack to works, and according to documentations, ...


7

You could just run the command usermod -p '_hash_' root where hash is the hash of the password appropriate for that system. So a command like usermod -p '$1$aNwwp0wS$RzSqCt3ntYs.V2TxcXheA' root would make root have a password of password. If you want to do this the right way you would also generat a unique salt and a unique hash for each system. If it is ...


6

If you're looking for performance, Cfengine is the choice. In your case, you don't want to maintain a fully fledged Ruby+Puppet installation on handheld devices. That Puppet is "easier to use" is just a myth created by the Puppet people, go ahead and try Cfengine (also have a look at the open promise body library).


5

You don't. No really, don't directly edit /etc/shadow. For 20 servers, i would probably just log in and change the root password with passwd. what you can do if you have to do it often is use Expect and put it in a loop like: for i in `cat <file_with_server_names>` do ssh <user>@$i <expect stuff here> done Sorry for the ...


5

Blueprint can generate Puppet or Chef configurations from your existing servers, if you want to start using one of those two tools. Alternatively, etckeeper will help you keep the whole of /etc in a VCS, if that's all you need (with a little bit of config, you could then keep the repositories somewhere central).


4

cf-serverd is not a required component. There are people that use nfs, pull direct from version control, and probably a number of various other mechanisms. There are several benefits that you can take advantage of by using cf-serverd though. cf-serverd has proven to be very efficient with single servers reported to serve thousands of clients. It also allows ...


4

Puppet can manage users (and a plethora of other things). I would warmly recommend any admin with more than 3 servers integrating puppet into their environment. The wiki on puppetlabs.com has many articles that will help you get up and running quickly. The advantages are definitely worth your time. Consider writing this piece of code once: User {"sandra": ...


4

Some crazy person is trying to port Puppet to Windows, I believe, but apart from that you're basically stuffed -- some of the proprietary stuff says it can manage both Windows and Linux from a single point, but I've never found one that I didn't want to thermite the install CDs of. The systems are so different that you're best off just using the best ...


4

There's a new configuration management tool based on CFEngine that automates all the configurations. In a Web Interface, you define and parametrize the Directives you wish to see applied to group of nodes, and automagically, it generates CFEngine promises for these nodes. Then the cf-agent running nodes will fetch these promises, apply them, and send back ...


3

Here is a good blog entry on how to bootstrap puppet using cobbler. The author uses VirtualBox Virtual Machines, but you can easily adapt it to a physical server. http://number9.hellooperator.net/articles/2009/04/13/bootstrapping-puppet-from-cobbler Basically, you have a kickstarter server that runs puppetmasterd and cobbler. You customize a kickstart to ...


3

David, Are the updated files being copied, and the local cf-agent doesn't react to the changes? Or are the updated files not being copied until much later? The one reason I can think off the top of my head is that the clocks between the systems are out of sync. Check /var/cfengine/inputs/cf_promises_validated - this file is populated with the last time the ...


3

I've personally used Puppet and cfEngine are have found both to be good tools for this kind of task and I believe them to currently be the major players in the field. Puppet requires a little more care when you start trying to scale it but has a nicer syntax, cfEngine scales well but it can take a bit more time to learn the voodoo. If the no outside ...


2

Blueprint author here and it does exactly what you need. We like to say it reverse engineers a server - that is detects packages, source files and configurations tweaks, then packages it up in a reusable format. Check it out on github: https://github.com/devstructure/blueprint.


2

As of version 3.3.0, you can use the lsdir() function instead. vars: "result" slist => lsdir("/tmp/test", ".*", "false"); read more : https://cfengine.com/manuals/cf3-Reference#Function-lsdir


2

One way to achieve this would be to use the module protocol supported by CFEngine: https://cfengine.com/manuals/cf3-Reference#module-in-commands. With this, you can set arbitrary classes and variables from the script itself. For example, a script like this (untested): #!/bin/bash if git pull | grep -q 'Already up-to-date.'; then echo "+no_update" fi ...


2

This question looks a lot like that question To receive an email with cfengine 3, you need to use the cf-execd rather than the cf-agent, and define somewhere where to send the email : body executor control { mailfrom => "from@adress.org"; mailto => "to@adress.org"; smtpserver => "smtp.example.org"; exec_command => ...


2

You can use the function diskfree that return the available space on the partition Here is a simple example (yes, I have a lot of free space) : body common control { bundlesequence => { "test_free_space" }; } bundle agent test_free_space { vars: "free" int => diskfree("/home"); "min_free_space" int => "200000000"; ...


2

Here's how I did it. The repair_failed mnemonic doesn't really fit the "we detected there was less free disk space than you wanted" since it attempts no repair, but it seems to be the way to add a class as a result. It gives a perfectly fine explanation of the free disk space without the extra ohno class, but eventually I want to clear temp directories, ...


2

In cfengine 2, I used something like: processes: "httpd" restart "/etc/init.d/apache restart" In cfengine 3, restarting of processes must be coded as a separate commands. processes: "httpd" restart_class => "start_httpd"; commands: start_httpd:: "/etc/init.d/apache restart"; This will define the class "start_httpd" if httpd is not ...


2

Note that I have only used cfengine (v2) and not puppet/chef etc. All of these have pretty hefty learning curves to get your head fully wrapped around how to do things. Though these days there are many more examples on the net to look at. That said, there has been at least one paper that claims that cfengine is more lightweight. This facebook page from ...


2

It looks like you never got an answer to your question, so I'm posting this now in the spirit of "better late than never". You asked: What I would really like is to suppress messages when certain promises are repaired, particularly the one which deletes files in the outputs directory. It would essentially negate the -I option for that ...


2

As far as I know, if you just want to look for the "foobar" process, you don't need to use the process_select feature at all. Can't you just do this? processes: "foobar" restart_class => start_foobar; If you also need to match other criteria at the same time, like the user running it as you suggest, I would recommend either using a ...


1

I think I understand your question, but I'm not sure, so I hope this is appropriate! In your /var/cfengine/inputs directory, you will have at least promises.cf, which is the main input file for cf-agent. That file can call other files in Cfengine language. This directory is likely copied from a central server somehow. As to other files you may want to ...


1

Although this is an old question, I thought it'd be relevant to link to this recently-posted performance comparison between Puppet and Chef: http://www.blogcompiler.com/2012/09/30/scalability-of-cfengine-and-puppet-2/ Although it was done by a CFEngine employee, it is IMO fairly impartial, and all the details needed to reproduce the results are included. ...


1

Take a look at sshpass. You can do it by looping through an associative array with key is IP address and value is the correspond password. The password can be changed with: passwd <<EOF ch4ng#m3 ch4ng#m3 EOF You should clear history after doing this.


1

Instead of looking at the PID file directly, I'd try to let Cfengine 3 manage your selected service/process. For Cfengine 3 you can use the following code (it might not be perfect, but it works): body common control { version => "1.0"; bundlesequence => { "check_services" }; } bundle agent check_services { vars: "services" slist ...


1

The only way to know if it was source or target that changed is to use a time stamp, which cfengine does nicely. Maybe you are overthinking this. In general I think either you let cfengine manage or you do it by hand. Looking for a middle way lacks discipline and you will soon end up making a mistake. I would just go with the automation.


1

I'm not actually sure that cfengine provides "revision control". It's wikipedia entry makes no mention of revision control; for that you'd want something like etc-keeper. Instead cfengine offers a policy based system for configuration. Check out this video author's talk about the new version of cfengine, given at google. Active directory includes some tools ...



Only top voted, non community-wiki answers of a minimum length are eligible