It now contains a mirror of the design-center repo. Now executing the runfile with: /var/cfengine/bin/cf-agent -f /var/cfengine/inputs/standalone-cf-sketch-runfile.cfĬheck in /tmp/design-center. Generated standalone run file /var/cfengine/inputs/standalone-cf-sketch-runfile.cf Now let’s run our sketches, to make sure they work OK: cf-sketch> run Let’s check the configuration: cf-sketch> list -v The documentation is not yet available from within the cf-sketch shell but this will be added next year. All sketches get installed under /var/cfengine/inputs/sketches/ and come with documentation. If you have any questions about what the parameters mean, the sketch is documented in /var/cfengine/inputs/sketches/VCS/vcs_mirror/README.md. We set it to “not any” which means, always wipe local differences. nowipe refers to saving local differences.Or “Wednesday” if we wanted this policy to only run on Wednesdays. If we wanted to limit this policy to linux servers, we could have put “linux” there. “any” is a special context that is always true. activated refers to the context of the promise - where does it apply.runas is the user CFEngine will run the command as.Note the “#1”, that means this an instance of the sketch - you can have more than one instance. The sketch is now configured and ready for use. Please enter runas [getenv("USER", "128"): cfengine Parameter 'runas' must be a NON_EMPTY_STRING. Parameter 'branch' must be a NON_EMPTY_STRING. Parameter 'origin' must be a HTTP_URL|PATH. Please enter the requested parameters (enter STOP to abort): cf-sketch> configure VCS::vcs_mirrorĮntering interactive configuration for sketch VCS::vcs_mirror. Let’s say we want to mirror the master branch to /tmp/design-center. The Design Center contains sketches, examples and tools, and is at So let’s say we want to clone the CFEngine Design Center. You have to specify the path that you want the clone to be, the origin, and the branch to keep the working tree checked out on. “List” now shows the vcs_mirror sketch is installed but not configured: cf-sketch> list Let’s try VCS::vcs_mirror - its purpose is to keep a git (or Subversion) clone up to date and clean.įirst, let’s install it: cf-sketch> install VCS::vcs_mirror ![]() After all, our civilization will be running on configuration management tools and policies! However, sketches are closely reviewed and curated by CFEngine staff to ensure high quality. The "info all" command will show you all available sketches - there are 28 sketches available today. Use list -v to show the activation parameters. The "list" command shows cf-sketch ships with the CFEngine standard library, same version as in the main RPM: cf-sketch> list I could then fire up cf-sketch with no complaints: # cf-sketchĮnter any command to cf-sketch, use 'help' for help, or 'quit' or '^D' to quit. Yes | perl -MCPAN -e 'install LWP::Protocol::https' Perl -MCPAN -e 'install Term::ReadLine::Gnu' I also installed the other Perl modules cf-sketch complained about: echo "install File::Path" | perl -MCPAN -e 'shell' I’m doing this on CentOS 5.8, and my perl File::Path module wasn’t up to date, so cf-sketch wouldn’t run until I updated File::Path. Tar zxvf # download cf-sketch add-onĬf-sketch is prototyped in Perl. Rpm -ihv cfengine-community-3.4.1.rpm # install RPM or dpkg I invite you to follow along in a VM: # Run these commands to get cf-sketch installed Let’s start by installing CFEngine and the add-on tool, cf-sketch, which allows us to handle sketches. DemonstrationĪllow me to demonstrated how easy CFEngine makes to implement a design pattern using sketches. This is still 1.0 and being worked on but I’m very excited about what I’ve seen so far. You can’t use the sketch by itself, it is incomplete. The reason it’s called a “sketch” is because you take a design pattern (such as configuring sshd to increase security) and fill it with data (the exact settings you want at your site or for a particular group of machines) and only then do you have something usable. That’s what we really care about, isn’t it? In other words, the DSL is abstracted, and the configuration becomes data driven.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |