diff --git a/slapos/recipe/agent/__init__.py b/slapos/recipe/agent/__init__.py index 0ea8a163be9fbbf56113af7cf4104a961b40e1ea..6ea3a99ae742d06482b895d241aa6f7442e324e4 100644 --- a/slapos/recipe/agent/__init__.py +++ b/slapos/recipe/agent/__init__.py @@ -55,6 +55,7 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe): configuration.add_section("agent") configuration.set("agent", "portal_url", self.parameter_dict["portal_url"]) configuration.set("agent", "master_url", self.parameter_dict["master_url"]) + configuration.set("agent", "report_url", self.parameter_dict["report_url"]) key_filepath = os.path.join(self.work_directory, "key") key_file = open(key_filepath, "w") key_file.write(self.parameter_dict["key"]) @@ -78,11 +79,11 @@ class Recipe(BaseSlapRecipe, GenericSlapRecipe): state = open(self.options["state_file"], "w") state.write('') state.close() + configuration.set("agent", "path_file", self.options["path_file"]) configuration.add_section("software_uri") software_list = json.loads(self.parameter_dict["software_list"]) for software in software_list: configuration.set("software_uri", software, self.parameter_dict[software]) - configuration.write(open(configuration_path, "w")) agent_crond_path = os.path.join(self.crond, "agent") diff --git a/software/agent/instance.cfg b/software/agent/instance.cfg index 15ef5a0e46746f2dab8b5dce4aadf934555211f5..bf58f1b1826b55a6b5b47fa6d537228c46b308fb 100644 --- a/software/agent/instance.cfg +++ b/software/agent/instance.cfg @@ -9,17 +9,20 @@ develop-eggs-directory = ${buildout:develop-eggs-directory} [instance] recipe = ${instance-recipe:egg}:${instance-recipe:module} agent_binary = ${buildout:directory}/bin/agent +report_start = ${buildout:directory}/bin/report_start +report_stop = ${buildout:directory}/bin/report_stop dcrond_binary = ${dcron:location}/sbin/crond python_binary = ${python2.7:location}/bin/python -pidfile = $${buildout:directory}/agent.pid -log_directory = $${buildout:directory}/var/log -state_file = $${buildout:directory}/state.cfg +pidfile = $${rootdirectory:run}/agent.pid +log_directory = $${rootdirectory:agentlog} +state_file = $${rootdirectory:srv}/state.cfg [rootdirectory] recipe = slapos.cookbook:mkdirectory -etc = $${buildout:directory}/etc/ -run = $${rootdirectory:etc}/run/ -var = $${buildout:directory}/var/ -log = $${rootdirectory:var}/log/ -srv = $${buildout:directory}/srv/ -bin = $${buildout:directory}/bin/ +etc = $${buildout:directory}/etc +run = $${rootdirectory:etc}/run +var = $${buildout:directory}/var +log = $${rootdirectory:var}/log +agentlog = $${rootdirectory:log}/agent +srv = $${buildout:directory}/srv +bin = $${buildout:directory}/bin diff --git a/software/agent/software.cfg b/software/agent/software.cfg index 68f699448a74f8bd5718192235a4ba48e4d1ddfb..dee95a2a9bf1320d5e5739806522c86322e9e19b 100644 --- a/software/agent/software.cfg +++ b/software/agent/software.cfg @@ -1,8 +1,8 @@ [buildout] -# develop = -# /opt/slapdev -# /opt/slapos.toolbox +develop = + /opt/slapdev + /opt/slapos.toolbox extends = ../../component/dcron/buildout.cfg @@ -31,7 +31,7 @@ eggs = ${instance-recipe:egg} recipe = slapos.recipe.template url = ${:_profile_base_location_}/instance.cfg output = ${buildout:directory}/template.cfg -md5sum = 2e1a7a68b18de68b163e98a5f92cc776 +md5sum = 10d7cf082399948e8dfef1c4644b4425 mode = 0644 [eggs]