Re: Is "start" a reserved word?

2009-12-16 Thread bernd . adamowicz
Yes, indeed. That was the reason. There has been a 'body location start' inside the library.cf. I changed this to 'body location start_before' there and in the files calling this body and everything worked like a charm. Thanks Neil! Bernd Adamowicz From: nwat...@symcor.com To: bernd.ada

How to get local ip address

2009-12-16 Thread 高永超
HI, everyone, is there a way to get local ip address in cfengine3? ___ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine

Re: How to get local ip address

2009-12-16 Thread bernd . adamowicz
There's always a hard class defined representing your IP address. E.g. the address '172.31.102.56' will become the class '172_31_102_56'. As far as I know, there's no special function for retrieving the IP adress, but I might be wrong. Run 'cf-promises -v' to see the hard classes on your system

Re: How to get local ip address

2009-12-16 Thread Robert Markula
Hi unknown sender, help-cfengine-requ...@cfengine.org wrote: > HI, everyone, is there a way to get local ip address in cfengine3? You can get the local IP in form of a cfengine class, if you mean that. Try running cf-promises -v on the client and you can see the local IP-Address in the form 192

Re: How to get local ip address

2009-12-16 Thread 高永超
I am also aware the hard class name, but is there any way i can put the "classname" into a variable or a system variable such as sys.resolv? 2009/12/16 Robert Markula > Hi unknown sender, > > help-cfengine-requ...@cfengine.org wrote: > > HI, everyone, is there a way to get local ip address in cf

RE: How to get local ip address

2009-12-16 Thread Andreas Dan Larsson
> HI, everyone, is there a way to get local ip address in cfengine3? Hi, You could use the builtin variable for hostname $(sys.fqhost) and use that to get the ip from you nameservice Perhaps something in the lines of: "ip" string => execresult("host $(sys.fqhost) | sed -ne 's/$(sys.fqhost) ha

Re: How to get local ip address

2009-12-16 Thread 高永超
Er...It's my fault not explaining my demands clearly... I want to use cfengine3 to set my hostname which contains a part of the ip address... The only way i can find is using shell script to "grep" it from the output of "ifconfig", and someone tells me in cfengine2 there is a builtin variable so i

Re: How to get local ip address

2009-12-16 Thread NWatson
Can you tell us why you need to know the IP address? There might be another way to meet that end result. Sincerely, -- Neil Watson 416-673-3465 CONFIDENTIALITY WARNING This communication, including any attachments, is for the exclusive use of addressee and may contain proprietary and/or con

Re: How to get local ip address

2009-12-16 Thread Mark Burgess
Cfengine gives the address on the interface, like in the following from my host. There are too many possibilities to document in the manual -- each interface can have a different name/address etc $(sys.ipv4) 192.168.1.100 $(sys.ipv4[wlan0]) 192.168.1.100 $(sys.ipv4_1[wlan0]) 192

Adding and removing packages with yum/rpm

2009-12-16 Thread Patryk Lason
Hi, could you please paste a working example where it is possible to add and delete a package with its version and architecture? I.e. I'd like to add a package "jdk.x86_64" with version "2000:1.6.0_17-fcs" and keep it frozen. # yum list all | grep ^jdk.x86_64 jdk.x86_64

Re: Adding and removing packages with yum/rpm

2009-12-16 Thread Brendan Strejcek
Why don't you want to use package_version? I would try something like this (untested): vars: 'package_version[jdk.x86_64]' string => '2000:1.6.0_17-fcs'; 'package' slist => getindices('package_version'); packages: "${package}" package_policy => 'add', package_method

Re: state/cf_lock.db file?

2009-12-16 Thread Eystein Måløy Stenberg
I agree with Brendan.. You could also set ifelapsed to 0 in the promises you don't want to lock, see http://www.cfengine.org/manuals/cf3-reference.html#action-in-_002a. By the way, the purpose of all databases is described in the manual, http://www.cfengine.org/manuals/cf3-reference.html#Embedd

Re: How to get local ip address

2009-12-16 Thread flex
Thank you very much, it is useful! But there is no mention of this builtin variable in the "cf3-Reference.pdf", how could you find this? 2009/12/16 Mark Burgess > > Cfengine gives the address on the interface, like in the following from my > host. > There are too many possibilities to document i

Re: How to get local ip address

2009-12-16 Thread Erlend Leganger
2009/12/17 flex > > Thank you very much, it is useful! > But there is no mention of this builtin variable in the "cf3-Reference.pdf", > how could you find this? > sys.ipv4 is mentioned a couple of times en passent in the cf3 reference, see for example http://www.cfengine.org/manuals/cf3-reference

Re: How to get local ip address

2009-12-16 Thread Mark Burgess
I'll look into a workaround for this. Clearly it needs to be fixed. The documentation is built automatically from the code, so all the different interfaces make it tricky in this case. Erlend Leganger wrote: > 2009/12/17 flex >> Thank you very much, it is useful! >> But there is no mention of t

Re: How to get local ip address

2009-12-16 Thread flex
I browse the source code, and find it in sysinfo.c It seems "sys.ipv4" is the only missing one :) 2009/12/17 Mark Burgess > > I'll look into a workaround for this. Clearly it needs to be fixed. > > The documentation is built automatically from the code, so all the > different > interfaces make i