Project

General

Profile

Actions

Bug #2729

closed

initial promises for node are not properly set.

Added by Vincent MEMBRÉ over 11 years ago. Updated over 11 years ago.

Status:
Released
Priority:
2
Assignee:
Nicolas PERRON
Category:
System techniques
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:

Description

Every time a node runs cf-agent, it tries to run promises common/1.0/cf-serverd.cf.

But, when ran for the first time, the promises always have an error as it tries to run a server configuration promises.

As it is not configured for the node, that promise can't be parse by cf-agent, so the execution is stopped before anything can be done and we can't do anything with that node.

When removing that promises from the inputs in "promises.cf", the agent runs perfectly and the promises are repaired.

We should have a system that prevents a node from calling that initial promises.

Actions #1

Updated by Nicolas PERRON over 11 years ago

As you said, the initial promises for the nodes can't be executed:

[root@centos-6-64 ~]# /var/rudder/cfengine-community/bin/cf-agent -KI
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cf-served.cf:71,4: syntax error, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,2: Something defined outside of a block or missing punctuation in input, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,2: syntax error, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,32: Something defined outside of a block or missing punctuation in input, near token 'POLICY_SERVER_ALLOWE'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,32: syntax error, near token 'POLICY_SERVER_ALLOWE'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,33: Something defined outside of a block or missing punctuation in input, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,33: syntax error, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,34: Something defined outside of a block or missing punctuation in input, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:1,34: syntax error, near token '%'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:2,3: Something defined outside of a block or missing punctuation in input, near token '}'
rudder> /var/rudder/cfengine-community/inputs/common/1.0/cfengine_stdlib.cf:2,3: syntax error, near token '}'
Fatal cfengine error: Too many errors
cf-agent was not able to get confirmation of promises from cf-promises, so going to failsafe
Can't stat /var/rudder/share/$(g.uuid)/rules/cfengine-community in files.copyfrom promise

It seems that the promises set in the inputs included some promises which shouldn't have to be executed for the nodes but are parsed.

Actions #2

Updated by Nicolas PERRON over 11 years ago

  • Status changed from New to Pending technical review
  • % Done changed from 0 to 100

It works

Actions #3

Updated by Matthieu CERDA over 11 years ago

Looks OK, and seems to work on a vagrant test VM.

Actions #7

Updated by Nicolas PERRON over 11 years ago

Initially, %POLICY_SERVER_HOSTNAME% was set in the initial promise of cf-served.cf . This can't work since %POLICY_SERVER_HOSTNAME% is a template variable replaced by the use of rudder-init.sh which is only used on server. Besides, writing the same hostname several times is not DRY at all.

I have modified the code in order to use the cfserverd variable from update.st which is correctly set at once for the nodes (from /var/rudder/cfengine-community/policy_server.dat) and the server (initially %POLICY_SERVER_HOSTNAME% and set by rudder-init.sh).

Actions #8

Updated by Jonathan CLARKE over 11 years ago

  • Status changed from Pending technical review to Released
  • Target version changed from 2.4.0~beta3 to 2.4.0~beta5

Looks good to me, thanks Nicolas!

Actions

Also available in: Atom PDF