Questions tagged [cfengine]

CFEngine is a configuration management tool that allows you to automate system configuration and administration.

CFEngine is a configuration management tool that allows you to automate system configuration and administration. It is lightweight and scalable. CFEngine 3 is a completely redone version of the tool, with a new configuration language that makes it easier to extend and use the language.

36 questions
1
vote
1 answer

Manage authorized_keys using cfengine

I'm trying to manage OpenSSH's authorized_keys using cfengine. It's easy to add/delete special lines in authorized_keys, but I cannot figure out how to delete unwanted lines. e.g. I need to add pubkey_one, pubkey_two, pubkey_three to authorized_key,…
yegle
  • 5,795
  • 6
  • 39
  • 61
0
votes
1 answer

bind zone file inside cfengine

I have some zone files that uses bind specific $GENERATE directive like this $GENERATE 50-100 srv-${-50,3,d} A 10.34.38.$ Now when I add this to cfengine, it tries to expand ${...} and gives an error. I can escape this ${ with \${ and that passes…
j4v4m4n
  • 101
  • 8
0
votes
1 answer

CFEngine 3.12: how to propagate templates to hosts?

CFEngine is great but I can't figure out how to copy the templates defined on the policy servers to the related hosts. For example, I'm looking to deploy an nginx.conf, I made a policy on my main server: bundle agent loadbalancers{ files: …
Akidd
  • 5
  • 2
0
votes
1 answer

ExecShellResult doesn't like my pipes

I wrote the following ExecShellResult fragment in cfengine v2.2.1a: control: active_interface_mac = ( ExecShellResult(/sbin/ifconfig ${active_interface} | /usr/bin/grep 'ether ' | /usr/bin/cut -f2 -d' ') ) ... time_drift = (…
Virgil Gheorghiu
  • 493
  • 1
  • 4
  • 13
0
votes
1 answer

cfEngine3 - class if package is installed

how can i set a class if a package is installed ? Background : i want to trigger a file modification only if a package is installed (optional in a specific version). My (example) code unfortunately doesn't work : vars: "cfengine_rpm" data =>…
domi27
  • 6,903
  • 2
  • 21
  • 33
0
votes
2 answers

CFEngine - set variable if a specific package version is installed

A script needs to support two servers, Fedora and Centos, with different versions of httpd (Apache). CFEngine is used to create the configuration file and it needs to put different sections to the file depending on which httpd version is installed…
Greg
  • 8,230
  • 5
  • 38
  • 53
0
votes
0 answers

how to cf-agent run with -D custom classes

I started to configure cfengine3. I got difficulties when I tried to figured out, how should the first run works on client side. I created promises for the first run on the server masterfile for e.g.: bundle agent populate_instance { files: …
peep
  • 15
  • 4
0
votes
1 answer

CFE syntax errors

Trying to write a cfengine3 promise that will take an entire directory and move it down one level. I've used my policy hub to distribute the promise, but I've not yet folded it into my active promise.cf Here's the promise: body common control { …
Louis Gillette
  • 65
  • 1
  • 1
  • 7
0
votes
1 answer

Learning CFEngine from 3.5 manual and operating in a 3.7 enviornment

**Edited 4/15/2016 Using the absolute path to reference the stdlib got my promise to execute, now the errors I'm experiencing changed. See last code block for that error output. Using this reference material for CFEngine 3.5 (it's what i've got from…
Louis Gillette
  • 65
  • 1
  • 1
  • 7
0
votes
4 answers

How to use parametrized bundles in cf-serverd?

In my cf-serverd's promises.cf I have a bundle like bundle server host_rules(key, host) { access: "/srv/cfengine3/$(host)" admit_keys => { "$(key)" }; } I tried to instanciate it with body common control { …
ensc
  • 6,704
  • 14
  • 22
0
votes
1 answer

Is there any way around the "no dots in hostnames" rule in CFEngine?

With our cfengine setup I keep wanting to define classes consisting of groups of hosts, and we have lots of hosts with 4-part hostnames in which the short name is non-unique. I've repeatedly read docs that say not to use dots in hostnames, but it…
steev
  • 916
  • 10
  • 24
0
votes
1 answer

How to check current user with cfengine

We are just started with cfengine and want to use the current logged in username of Ubuntu in our scripts. "cur_user" string => execresult("/usr/bin/id -un","noshell") This returns the current user. But as you now cfengine runs in the background as…
Joeri Feyen
  • 65
  • 1
  • 1
  • 9
0
votes
1 answer

Challenge response from CFEngine Server Failure while conencting cygwin to CFEngine

when i run from windows-7 with cygwin to connect CFEngine bersion 3.4.2 cf-agent -Bs 217.64.173.210 Challenge response from server 217.64.173.210/217.64.173.210 was incorrect! I: Made in version 'not specified' of…
0
votes
2 answers

How can CFEngine check that an upgrade is available for a package

This is a cfengine2 and 3 question. I am trying to get an alert to trigger if a package is installed and it can be upgraded. Is there a way for this to be done? Like in cfengine3 below. classes: "pkginstalled" expression =>…
Nvasion
  • 620
  • 1
  • 8
  • 14
0
votes
1 answer

CFEngine. I want to distribute a set of files which are different for different versions of ubuntu for eg 13.04 and 14.04.

I googled it up and read through but did'nt find any answer. I am using cfengine-community 3.5 version on ubuntu.
shivam
  • 9
  • 2