diff --git a/techniques/system/common/1.0/failsafe.st b/techniques/system/common/1.0/failsafe.st index 5b49914bb..1d57dae27 100644 --- a/techniques/system/common/1.0/failsafe.st +++ b/techniques/system/common/1.0/failsafe.st @@ -246,7 +246,7 @@ body action WarnOnly body file_select exclude(name) { - leaf_name => { "$(name)"}; + leaf_name => { "${name}"}; file_result => "!leaf_name"; } diff --git a/techniques/system/common/1.0/process_matching.st b/techniques/system/common/1.0/process_matching.st index a6ee8dff5..9a0f5ac9f 100644 --- a/techniques/system/common/1.0/process_matching.st +++ b/techniques/system/common/1.0/process_matching.st @@ -40,51 +40,6 @@ bundle agent process_matching "restart_cf" expression => "Hr05.Min00_05"; - processes: - - windows:: - # Always stop cf-monitord - "${g.escaped_workdir}\/bin\/cf-monitord" signals => { "${stop_signal}" }; - - !windows:: - # Always stop cf-monitord - "${sys.workdir}/bin/cf-monitord" signals => { "${stop_signal}" }; - - restart_cf.!policy_server:: - "${cf_components}" signals => { "${stop_signal}" }; - - # Policy servers have both Nova and Community, don't blindly kill the wrong processes - restart_cf.policy_server:: - "${sys.workdir}/bin/${cf_components}" signals => { "${stop_signal}" }; - - restart_cf.!windows:: - "${sys.workdir}/bin/cf-execd" signals => { "${stop_signal}" }; - - # Note: cron will get restarted automatically by init (respawn directive in inittab) - aix.rudder_aix_crontab_insertion:: - "^/usr/sbin/cron" signals => { "${stop_signal}" }; - - commands: - - restart_cf.!windows:: - - "${sys.cf_serverd}"; - "${sys.cf_execd}"; - -&if(NOVA)& - services: - - restart_cf.windows:: - "CfengineNovaExec" - service_policy => "stop", - comment => "Stop the executor service, part of scheduled restart"; - - "CfengineNovaExec" - service_policy => "start", - comment => "Start the executor service, part of scheduled restart"; - -&endif& - files: linux:: @@ -127,6 +82,51 @@ bundle agent process_matching classes => rudder_common_classes("rudder_aix_crontab_insertion"), comment => "Insert an AIX-compatible user crontab to run /opt/rudder/bin/check-rudder-agent"; + processes: + + windows:: + # Always stop cf-monitord + "${g.escaped_workdir}\/bin\/cf-monitord" signals => { "${stop_signal}" }; + + !windows:: + # Always stop cf-monitord + "${sys.workdir}/bin/cf-monitord" signals => { "${stop_signal}" }; + + restart_cf.!policy_server:: + "${cf_components}" signals => { "${stop_signal}" }; + + # Policy servers have both Nova and Community, don't blindly kill the wrong processes + restart_cf.policy_server:: + "${sys.workdir}/bin/${cf_components}" signals => { "${stop_signal}" }; + + restart_cf.!windows:: + "${sys.workdir}/bin/cf-execd" signals => { "${stop_signal}" }; + + # Note: cron will get restarted automatically by init (respawn directive in inittab) + aix.rudder_aix_crontab_insertion:: + "^/usr/sbin/cron" signals => { "${stop_signal}" }; + +&if(NOVA)& + services: + + restart_cf.windows:: + "CfengineNovaExec" + service_policy => "stop", + comment => "Stop the executor service, part of scheduled restart"; + + "CfengineNovaExec" + service_policy => "start", + comment => "Start the executor service, part of scheduled restart"; + +&endif& + + commands: + + restart_cf.!windows:: + + "${sys.cf_serverd}"; + "${sys.cf_execd}"; + reports: restart_cf:: diff --git a/techniques/system/common/1.0/promises.st b/techniques/system/common/1.0/promises.st index 7bd971f9b..5c17d0b26 100644 --- a/techniques/system/common/1.0/promises.st +++ b/techniques/system/common/1.0/promises.st @@ -200,12 +200,6 @@ bundle agent check_disable_agent ########################################################## bundle agent clean_red_button() { - commands: - safe.policy_server:: - "${sys.workdir}/bin/cf-runagent" - args => "-Dsafe", - comment => "Propagate the safe information to children"; - files: safe.policy_server:: "${g.rudder_var}/share/[a-f0-9A-F\-]+/rules/cfengine-(community|nova)/stopFile" @@ -217,6 +211,12 @@ bundle agent clean_red_button() delete => tidy, comment => "Deleting the stop file, cfengine is good to go"; + commands: + safe.policy_server:: + "${sys.workdir}/bin/cf-runagent" + args => "-Dsafe", + comment => "Propagate the safe information to children"; + reports: safe:: "@@Common@@result_repaired@@&TRACKINGKEY&@@Red Button@@None@@${g.execRun}##${g.uuid}@#Authorizing Cfengine to restart"; @@ -568,19 +568,19 @@ bundle agent check_rsyslog_version { reports: rsyslogd.!check_rsyslog_version_present:: - "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@$(g.execRun)##$(g.uuid)@#The file ${g.rudder_tools}/check_rsyslog_version is missing"; + "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@${g.execRun}##${g.uuid}@#The file ${g.rudder_tools}/check_rsyslog_version is missing"; rsyslog_limit_error:: - "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@$(g.execRun)##$(g.uuid)@#Could not remove limitation of message in rsyslog"; + "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@${g.execRun}##${g.uuid}@#Could not remove limitation of message in rsyslog"; rsyslog_limit_repaired:: - "@@Common@@log_repaired@@&TRACKINGKEY&@@Log system for reports@@None@@$(g.execRun)##$(g.uuid)@#Updated the rsyslog configuration to remove limitation of messages"; + "@@Common@@log_repaired@@&TRACKINGKEY&@@Log system for reports@@None@@${g.execRun}##${g.uuid}@#Updated the rsyslog configuration to remove limitation of messages"; rsyslog_restarted:: - "@@Common@@log_repaired@@&TRACKINGKEY&@@Log system for reports@@None@@$(g.execRun)##$(g.uuid)@#Configured logging system for report centralization"; + "@@Common@@log_repaired@@&TRACKINGKEY&@@Log system for reports@@None@@${g.execRun}##${g.uuid}@#Configured logging system for report centralization"; cant_restart_rsyslog:: - "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@$(g.execRun)##$(g.uuid)@#Could not restart the logging system"; + "@@Common@@result_error@@&TRACKINGKEY&@@Log system for reports@@None@@${g.execRun}##${g.uuid}@#Could not restart the logging system"; diff --git a/techniques/system/common/1.0/rudder_agent_community_cron.st b/techniques/system/common/1.0/rudder_agent_community_cron.st index 579413d12..df25b8be0 100644 --- a/techniques/system/common/1.0/rudder_agent_community_cron.st +++ b/techniques/system/common/1.0/rudder_agent_community_cron.st @@ -12,4 +12,4 @@ # Add a decent PATH to the environment before triggering anything PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ -e ${g.rudder_base}/bin/check-rudder-agent ]; then ${g.rudder_base}/bin/check-rudder-agent; else if [ ! -e ${g.rudder_base}/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "${sys.workdir}/bin/(cf-execd|cf-agent)" | grep -v grep | wc -l` -eq 0 ]; then ${sys.workdir}/bin/cf-agent -f failsafe.cf >/dev/null 2>\&1 \&\& ${sys.workdir}/bin/cf-agent >/dev/null 2>\&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on $(hostname)."; fi; fi; fi; fi +0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ -e ${g.rudder_base}/bin/check-rudder-agent ]; then ${g.rudder_base}/bin/check-rudder-agent; else if [ ! -e ${g.rudder_base}/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "${sys.workdir}/bin/(cf-execd|cf-agent)" | grep -v grep | wc -l` -eq 0 ]; then ${sys.workdir}/bin/cf-agent -f failsafe.cf >/dev/null 2>\&1 \&\& ${sys.workdir}/bin/cf-agent >/dev/null 2>\&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on ${hostname}."; fi; fi; fi; fi diff --git a/techniques/system/common/1.0/rudder_agent_nova_cron.st b/techniques/system/common/1.0/rudder_agent_nova_cron.st index ffe6d7b35..6569871b0 100644 --- a/techniques/system/common/1.0/rudder_agent_nova_cron.st +++ b/techniques/system/common/1.0/rudder_agent_nova_cron.st @@ -12,4 +12,4 @@ # Add a decent PATH to the environment before triggering anything PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ ! -e ${g.rudder_base}/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "${sys.workdir}/bin/(cf-execd|cf-agent))" | grep -v grep | wc -l` -eq 0 ]; then ${sys.workdir}/bin/cf-agent -f failsafe.cf >/dev/null 2>\&1 \&\& ${sys.workdir}/bin/cf-agent >/dev/null 2>\&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on $(hostname)."; fi; fi; fi +0,5,10,15,20,25,30,35,40,45,50,55 * * * * root . /etc/profile; if [ ! -e ${g.rudder_base}/etc/disable-agent -a `ps -efww | grep -E "(cf-execd|cf-agent)" | grep -E "${sys.workdir}/bin/(cf-execd|cf-agent))" | grep -v grep | wc -l` -eq 0 ]; then ${sys.workdir}/bin/cf-agent -f failsafe.cf >/dev/null 2>\&1 \&\& ${sys.workdir}/bin/cf-agent >/dev/null 2>\&1; if [ $? != 0 ]; then if [ -f /opt/rudder/etc/rudder-restart-message.txt ]; then cat /opt/rudder/etc/rudder-restart-message.txt; else echo "Rudder agent was unable to restart on ${hostname}."; fi; fi; fi diff --git a/techniques/system/common/1.0/rudder_lib.st b/techniques/system/common/1.0/rudder_lib.st index eee70b870..91a7b9d75 100644 --- a/techniques/system/common/1.0/rudder_lib.st +++ b/techniques/system/common/1.0/rudder_lib.st @@ -65,9 +65,9 @@ body copy_from scp(from, server,compare,trustkey,preserve,purge) # running on a policy server instead of copying from a localhost remote blindly. body copy_from rudder_copy_from(from, server,compare,trustkey,preserve,purge) { - source => "$(from)"; + source => "${from}"; - compare => "$(compare)"; + compare => "${compare}"; encrypt => "true"; verify => "true"; trustkey => "${trustkey}"; @@ -475,7 +475,7 @@ body package_method rudder_yum package_list_version_regex => "^\S+?\s(\S+?)\s\S+$"; package_list_arch_regex => "^\S+?\s\S+?\s(\S+)$"; package_installed_regex => ".*"; - package_name_convention => "$(name)"; + package_name_convention => "${name}"; package_list_update_command => "/usr/bin/yum --quiet check-update"; package_list_update_ifelapsed => "240"; package_patch_name_regex => "([^.]+).*"; diff --git a/techniques/system/common/1.0/rudder_stdlib.st b/techniques/system/common/1.0/rudder_stdlib.st index 1f659eb77..749685a46 100644 --- a/techniques/system/common/1.0/rudder_stdlib.st +++ b/techniques/system/common/1.0/rudder_stdlib.st @@ -126,28 +126,28 @@ body file_select rudder_common_minutes_old(minutes) bundle edit_line rudder_ensure_section_content(section_start, section_end, content) { vars: - "csection" string => canonify("$(section_start)"); + "csection" string => canonify("${section_start}"); "escaped_section_start" string => escape(${section_start}); "escaped_section_end" string => escape(${section_end}); classes: # Detect if section is already there - "has_$(csection)" expression => regline("${escaped_section_start}", "$(edit.filename)"); + "has_${csection}" expression => regline("${escaped_section_start}", "${edit.filename}"); delete_lines: ".*" select_region => rudder_section_selector("${escaped_section_start}", "${escaped_section_end}"), - ifvarclass => "has_$(csection)"; + ifvarclass => "has_${csection}"; insert_lines: # Insert new, empty section if it doesn't exist already. "${section_start} ${section_end}" insert_type => "preserve_block", - ifvarclass => "!has_$(csection)"; + ifvarclass => "!has_${csection}"; # Insert missing lines into the section - "$(content)" + "${content}" select_region => rudder_section_selector("${escaped_section_start}", "${escaped_section_end}"); } diff --git a/techniques/system/common/1.0/update.st b/techniques/system/common/1.0/update.st index a2e7b125b..7bd19618c 100644 --- a/techniques/system/common/1.0/update.st +++ b/techniques/system/common/1.0/update.st @@ -230,6 +230,16 @@ bundle agent update_action config.!windows:: "cf-execd" restart_class => "start_exec"; +&if(NOVA)& + services: + windows:: + "CfengineNovaExec" + service_policy => "start", + service_method => u_bootstart, + classes => outcome("executor"), + comment => "Start the executor windows service now and at boot time"; +&endif& + commands: start_exec.!windows:: "${sys.cf_execd}" @@ -247,16 +257,6 @@ bundle agent update_action classes => outcome("server"); ######################################################### -&if(NOVA)& - services: - windows:: - "CfengineNovaExec" - service_policy => "start", - service_method => u_bootstart, - classes => outcome("executor"), - comment => "Start the executor windows service now and at boot time"; -&endif& - reports: server_ok:: "@@Common@@log_repaired@@&TRACKINGKEY&@@Update@@None@@${g.execRun}##${g.uuid}@#Started the server (cf-serverd)"; @@ -349,7 +349,7 @@ body service_method u_bootstart body perms u_mog(mode,user,group) { -owners => { "$(user)" }; -groups => { "$(group)" }; -mode => "$(mode)"; +owners => { "${user}" }; +groups => { "${group}" }; +mode => "${mode}"; } diff --git a/techniques/system/distributePolicy/1.0/initCheck.st b/techniques/system/distributePolicy/1.0/initCheck.st index 31a21243e..c59dcecf3 100644 --- a/techniques/system/distributePolicy/1.0/initCheck.st +++ b/techniques/system/distributePolicy/1.0/initCheck.st @@ -133,6 +133,15 @@ bundle agent generic_process_check_bootstart(binary, initscript, name) { "check_command" string => "/sbin/chkconfig --list ${initscript} | grep -q on"; "bootstart_command" string => "/sbin/chkconfig ${initscript} on"; + files: + + debian:: + + "/etc/rc2.d/S.*${initscript}.*" + create => "true", + action => WarnOnly, + classes => if_else("service_bootstarted_${canoname}", "service_unbootstarted_${canoname}"); + commands: (SuSE|redhat):: @@ -156,15 +165,6 @@ bundle agent generic_process_check_bootstart(binary, initscript, name) { ifvarclass => "service_unbootstarted_${canoname}", comment => "Set the service ${name} to start on boot"; - files: - - debian:: - - "/etc/rc2.d/S.*${initscript}.*" - create => "true", - action => WarnOnly, - classes => if_else("service_bootstarted_${canoname}", "service_unbootstarted_${canoname}"); - reports: cfengine:: diff --git a/techniques/system/distributePolicy/1.0/passwordCheck.st b/techniques/system/distributePolicy/1.0/passwordCheck.st index 2ed4e2bcd..664401799 100644 --- a/techniques/system/distributePolicy/1.0/passwordCheck.st +++ b/techniques/system/distributePolicy/1.0/passwordCheck.st @@ -321,10 +321,6 @@ bundle edit_line root_password_check_file_pgpass(parameter) "indices" slist => getindices(${parameter}); - insert_lines: - - "localhost:5432:rudder:${${parameter}[4]}:${${parameter}[5]}"; - field_edits: "localhost:5432:rudder:.*" @@ -332,4 +328,8 @@ bundle edit_line root_password_check_file_pgpass(parameter) # Set field of the file to parameter edit_field => col(":","${indices}","${${parameter}[${indices}]}","set"); + insert_lines: + + "localhost:5432:rudder:${${parameter}[4]}:${${parameter}[5]}"; + } diff --git a/techniques/system/distributePolicy/1.0/postgresCheck.st b/techniques/system/distributePolicy/1.0/postgresCheck.st index bbad4d4b4..39d7cc2c3 100644 --- a/techniques/system/distributePolicy/1.0/postgresCheck.st +++ b/techniques/system/distributePolicy/1.0/postgresCheck.st @@ -25,15 +25,6 @@ bundle agent root_postgres_check "configuration_statements" slist => { "host all rudder ::1/128 md5", "host all rudder 127.0.0.1/32 md5" }; - commands: - - SuSE:: - - "/etc/init.d/postgresql" - args => "restart", - classes => kept_if_else("psql_restart_ok", "psql_restart_ok", "psql_restart_error"), - ifvarclass => "psql_conf_updated"; - files: SuSE:: @@ -44,6 +35,15 @@ bundle agent root_postgres_check classes => kept_if_else("psql_conf_ok", "psql_conf_updated", "psql_conf_update_error"), comment => "Edit the SuSE postgresql configuration to enable account-less logins"; + commands: + + SuSE:: + + "/etc/init.d/postgresql" + args => "restart", + classes => kept_if_else("psql_restart_ok", "psql_restart_ok", "psql_restart_error"), + ifvarclass => "psql_conf_updated"; + reports: SuSE:: diff --git a/techniques/system/distributePolicy/1.0/rsyslogConf.st b/techniques/system/distributePolicy/1.0/rsyslogConf.st index c07a184f4..43377d9a5 100644 --- a/techniques/system/distributePolicy/1.0/rsyslogConf.st +++ b/techniques/system/distributePolicy/1.0/rsyslogConf.st @@ -62,110 +62,110 @@ bundle agent setup_debian_backports bundle agent install_rsyslogd { - vars: - - root_server:: - "rsyslog_source_file" string => "rudder-rsyslog-root.conf"; - - policy_server.!root_server:: - "rsyslog_source_file" string => "rudder-rsyslog-relay.conf"; - - packages: - - policy_server.debian_5.!SuSE:: - "rsyslog" - package_policy => "add", - package_method => debian_backports, - classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), - comment => "Installing rsyslog using apt backports"; - - "rsyslog-pgsql" - package_policy => "add", - package_method => debian_backports, - classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), - comment => "Installing rsyslog_pgsql using apt backports"; - - policy_server.!debian_5.!SuSE.!redhat:: - "rsyslog" - package_policy => "add", - package_method => generic, - classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), - comment => "Installing rsyslog using apt backports"; - - "rsyslog-pgsql" - package_policy => "add", - package_method => generic, - classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), - comment => "Installing rsyslog_pgsql using apt backports"; - - policy_server.!debian_5.!SuSE.redhat:: - "rsyslog" - package_policy => "add", - package_method => rudder_yum, - classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), - comment => "Installing rsyslog using apt backports"; - - "rsyslog-pgsql" - package_policy => "add", - package_method => rudder_yum, - classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), - comment => "Installing rsyslog_pgsql using apt backports"; - - files: - - policy_server:: - - "/etc/rsyslog.d/rudder.conf" - create => "true", - edit_defaults => empty, - edit_line => expand_template("${sys.workdir}/inputs/distributePolicy/rsyslog.conf/${rsyslog_source_file}"), - classes => cf2_if_else("rudder_rsyslog_conf_copied", "cannot_copy_rudder_rsyslog_conf"), - comment => "Copying rsyslog conf"; - - "/etc/rsyslog.conf" - edit_line => append_if_no_lines("$IncludeConfig /etc/rsyslog.d/*.conf"), + vars: + + root_server:: + "rsyslog_source_file" string => "rudder-rsyslog-root.conf"; + + policy_server.!root_server:: + "rsyslog_source_file" string => "rudder-rsyslog-relay.conf"; + + files: + + policy_server:: + + "/etc/rsyslog.d/rudder.conf" + create => "true", + edit_defaults => empty, + edit_line => expand_template("${sys.workdir}/inputs/distributePolicy/rsyslog.conf/${rsyslog_source_file}"), + classes => cf2_if_else("rudder_rsyslog_conf_copied", "cannot_copy_rudder_rsyslog_conf"), + comment => "Copying rsyslog conf"; + + "/etc/rsyslog.conf" + edit_line => append_if_no_lines("$IncludeConfig /etc/rsyslog.d/*.conf"), edit_defaults => noempty_backup, - comment => "Add the rsyslog.conf.d include if not already present", - classes => cf2_if_else("rsyslog_inc_ok" , "rsyslog_inc_failed"); + comment => "Add the rsyslog.conf.d include if not already present", + classes => cf2_if_else("rsyslog_inc_ok" , "rsyslog_inc_failed"); - policy_server.debian:: - "/etc/rsyslog.d/pgsql.conf" - edit_line => comment_all(), + policy_server.debian:: + "/etc/rsyslog.d/pgsql.conf" + edit_line => comment_all(), edit_defaults => noempty_backup, - classes => cf2_if_else("rudder_rsyslog_pgsql", "cannot_update_rudder_rsyslog_pgsql"), - comment => "Removing the logging of all in the database"; + classes => cf2_if_else("rudder_rsyslog_pgsql", "cannot_update_rudder_rsyslog_pgsql"), + comment => "Removing the logging of all in the database"; + + packages: + + policy_server.debian_5.!SuSE:: + "rsyslog" + package_policy => "add", + package_method => debian_backports, + classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), + comment => "Installing rsyslog using apt backports"; + + "rsyslog-pgsql" + package_policy => "add", + package_method => debian_backports, + classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), + comment => "Installing rsyslog_pgsql using apt backports"; + + policy_server.!debian_5.!SuSE.!redhat:: + "rsyslog" + package_policy => "add", + package_method => generic, + classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), + comment => "Installing rsyslog using apt backports"; + + "rsyslog-pgsql" + package_policy => "add", + package_method => generic, + classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), + comment => "Installing rsyslog_pgsql using apt backports"; + + policy_server.!debian_5.!SuSE.redhat:: + "rsyslog" + package_policy => "add", + package_method => rudder_yum, + classes => cf2_if_else("rsyslog_installed", "cant_install_rsyslog"), + comment => "Installing rsyslog using apt backports"; + + "rsyslog-pgsql" + package_policy => "add", + package_method => rudder_yum, + classes => cf2_if_else("rsyslog_pgsql_installed", "cant_install_rsyslog_pgsql"), + comment => "Installing rsyslog_pgsql using apt backports"; - commands: + commands: - policy_server.(rsyslog_installed|rsyslog_pgsql_installed|rudder_rsyslog_conf_copied|rudder_rsyslog_pgsql).!SuSE:: - "/etc/init.d/rsyslog" - args => "restart", + policy_server.(rsyslog_installed|rsyslog_pgsql_installed|rudder_rsyslog_conf_copied|rudder_rsyslog_pgsql).!SuSE:: + "/etc/init.d/rsyslog" + args => "restart", classes => cf2_if_else("rsyslog_restarted", "cant_restart_rsyslog"), comment => "restarting rsyslog"; - policy_server.(rsyslog_installed|rsyslog_pgsql_installed|rudder_rsyslog_conf_copied|rudder_rsyslog_pgsql).SuSE:: - "/etc/init.d/syslog" - args => "restart", + policy_server.(rsyslog_installed|rsyslog_pgsql_installed|rudder_rsyslog_conf_copied|rudder_rsyslog_pgsql).SuSE:: + "/etc/init.d/syslog" + args => "restart", classes => cf2_if_else("rsyslog_restarted", "cant_restart_rsyslog"), comment => "restarting rsyslog"; - reports: - cant_install_rsyslog|cant_install_rsyslog_pgsql:: - "Fatal : Can't install rsyslog or rsyslog_pgsql on the Rudder root server !"; + reports: + cant_install_rsyslog|cant_install_rsyslog_pgsql:: + "Fatal : Can't install rsyslog or rsyslog_pgsql on the Rudder root server !"; - cannot_copy_rudder_rsyslog_conf:: - "Fatal : Can't copy the rsyslog configuration !"; + cannot_copy_rudder_rsyslog_conf:: + "Fatal : Can't copy the rsyslog configuration !"; - rsyslog_inc_failed:: - "Fatal : Can't enable the rsyslog include directory !"; + rsyslog_inc_failed:: + "Fatal : Can't enable the rsyslog include directory !"; - cant_restart_rsyslog:: - "Fatal : Can't restart rsyslog !"; + cant_restart_rsyslog:: + "Fatal : Can't restart rsyslog !"; - cannot_update_rudder_rsyslog_pgsql:: - "Fatal : Cannot update the pgsql configuration !"; + cannot_update_rudder_rsyslog_pgsql:: + "Fatal : Cannot update the pgsql configuration !"; - rsyslog_restarted:: - "Info : Restarted rsyslog"; + rsyslog_restarted:: + "Info : Restarted rsyslog"; } @@ -180,7 +180,7 @@ body package_method debian_backports package_list_version_regex => "ii\s+[^\s]+\s+([^\s]+).*"; package_installed_regex => ".*"; # all reported are installed package_name_convention => "${name}"; - package_list_update_ifelapsed => "240"; # 4 hours + package_list_update_ifelapsed => "240"; # 4 hours debian.have_aptitude:: package_add_command => "/usr/bin/env DEBIAN_FRONTEND=noninteractive LC_ALL=C /usr/bin/aptitude -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef -o Aptitude::Delete-Unused=false -t lenny-backports --assume-yes install"; diff --git a/techniques/system/inventory/1.0/fetchFusionTools.st b/techniques/system/inventory/1.0/fetchFusionTools.st index 52b2d1f32..b793a17f2 100644 --- a/techniques/system/inventory/1.0/fetchFusionTools.st +++ b/techniques/system/inventory/1.0/fetchFusionTools.st @@ -23,21 +23,6 @@ bundle agent fetchFusionTools { - packages: - - debian:: - "curl" - package_policy => "add", - package_method => apt, - classes => rudder_common_classes("fetchFusionTools_install_curl"), - comment => "Installing curl using apt"; - redhat:: - "curl" - package_policy => "add", - package_method => rudder_yum, - classes => rudder_common_classes("fetchFusionTools_install_curl"), - comment => "Installing curl using yum"; - &if(NOVA)& files: @@ -53,6 +38,21 @@ bundle agent fetchFusionTools comment => "Copying PERL userland"; &endif& + packages: + + debian:: + "curl" + package_policy => "add", + package_method => apt, + classes => rudder_common_classes("fetchFusionTools_install_curl"), + comment => "Installing curl using apt"; + redhat:: + "curl" + package_policy => "add", + package_method => rudder_yum, + classes => rudder_common_classes("fetchFusionTools_install_curl"), + comment => "Installing curl using yum"; + reports: fusion_tools_copied:: "@@Inventory@@log_info@@&TRACKINGKEY&@@tools@@None@@${g.execRun}##${g.uuid}@#Copied fusion related utilities"; diff --git a/techniques/system/inventory/1.0/fusionAgent.st b/techniques/system/inventory/1.0/fusionAgent.st index a77e01bd8..9592037a5 100644 --- a/techniques/system/inventory/1.0/fusionAgent.st +++ b/techniques/system/inventory/1.0/fusionAgent.st @@ -59,12 +59,6 @@ bundle agent doInventory expression => "any", comment => "This dummy class is just used for ordering the report using !uuid_valid below"; - commands: - - "${download_command}" - comment => "Getting the uuid from the server", - classes => if_else("uuid_succesfully_downloaded","could_not_download_uuid"); - methods: uuid_valid.force_inventory:: @@ -87,6 +81,12 @@ bundle agent doInventory "any" usebundle => moveInventoryToFinalDestination; "any" usebundle => sendInventory; + commands: + + "${download_command}" + comment => "Getting the uuid from the server", + classes => if_else("uuid_succesfully_downloaded","could_not_download_uuid"); + reports: could_not_download_uuid:: "@@Inventory@@result_error@@&TRACKINGKEY&@@inventory@@None@@${g.execRun}##${g.uuid}@#Could not retrieve the UUID of the policy server"; @@ -227,6 +227,20 @@ bundle agent fusionAgent # CAUTION : Issue with path containing a whitespace, it's not working with windows bundle agent listInstalledVM { + files: + VirtualBoxInstalled:: + "${virtualMachines.VBoxListFile}" + create => "true", + edit_line => xmlify(${virtualMachines.VBoxAttr}), + comment => "Converting file into pseudo XML"; + + VMWareInstalled:: + "${virtualMachines.VMWareListFile}" + create => "true", + edit_line => xmlify(${virtualMachines.VMWareAttr}), + comment => "Converting file into pseudo XML"; + + commands: !windows.VirtualBoxInstalled:: "/usr/bin/VBoxManage" @@ -260,20 +274,6 @@ bundle agent listInstalledVM comment => "Generating file with list of VM"; &endif& - files: - VirtualBoxInstalled:: - "${virtualMachines.VBoxListFile}" - create => "true", - edit_line => xmlify(${virtualMachines.VBoxAttr}), - comment => "Converting file into pseudo XML"; - - VMWareInstalled:: - "${virtualMachines.VMWareListFile}" - create => "true", - edit_line => xmlify(${virtualMachines.VMWareAttr}), - comment => "Converting file into pseudo XML"; - - reports: cant_list_vm:: "@@Inventory@@log_warn@@&TRACKINGKEY&@@inventory@@None@@${g.execRun}##${g.uuid}@#Could not list installed VMWare machines"; @@ -325,11 +325,11 @@ bundle agent generateExtraInformations !rudder_inventory_userlist_tool_present:: - "@@Inventory@@log_debug@@&TRACKINGKEY&@@inventory@@None@@$(g.execRun)##$(g.uuid)@#The user list generation tool is not present yet. Skipping..."; + "@@Inventory@@log_debug@@&TRACKINGKEY&@@inventory@@None@@${g.execRun}##${g.uuid}@#The user list generation tool is not present yet. Skipping..."; !rudder_inventory_cpuid_tool_present:: - "@@Inventory@@log_debug@@&TRACKINGKEY&@@inventory@@None@@$(g.execRun)##$(g.uuid)@#The CPUID generation tool is not present yet. Skipping..."; + "@@Inventory@@log_debug@@&TRACKINGKEY&@@inventory@@None@@${g.execRun}##${g.uuid}@#The CPUID generation tool is not present yet. Skipping..."; }