Project

General

Profile

Actions

Bug #24524

open

Auto-host creation without

Added by Nicolas Odermatt about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Creation of hosts in foreman via upload reports doesn't work without master_tops and external pillar configuration.

After I upgraded from Salt 2015 to 2018 the "master_tops" and "ext pillar" directives were missing in the /etc/salt config. Management of keys in Foreman UI was still working as expected but new hosts were no longer automatically added after running "upload reports". I was able to observe that the reports were sent and received by the Foreman host but not further processed. I posted this on the foreman community page [0] and Greg asked me to report this as a bug.


support@server1110:/etc/salt$ salt-master --version
salt-master 2018.3.2 (Oxygen)

Foreman production log /var/log/foreman/prod.log


2018-07-30T14:39:20 9e52e424 [app] [I] Started POST "/salt/api/v2/jobs/upload" for 10.35.147.110 at 2018-07-30 14:39:20 +0200
2018-07-30T14:39:20 9e52e424 [app] [I] Processing by ForemanSalt::Api::V2::JobsController#upload as JSON
2018-07-30T14:39:20 9e52e424 [app] [I]   Parameters: {"job"=>{"function"=>"state.highstate", "result"=>{"server1117.cs.technik.fhnw.ch"=>{"user_|-support2_|-support2_|-present"=>{"comment"=>"User support2 is present and up to date", "name"=>"support2", "start_time"=>"14:38:30.499847", "result"=>true, "duration"=>1.454, "__run_num__"=>1, "__sls__"=>"users/init", "changes"=>{}, "__id__"=>"support2"}, "pkg_|-install_network_packages_|-install_network_packages_|-installed"=>{"comment"=>"All specified packages are already installed", "name"=>"curl", "start_time"=>"14:38:29.825810", "result"=>true, "duration"=>673.05, "__run_num__"=>0, "__sls__"=>"nettools", "changes"=>{}, "__id__"=>"install_network_packages"}}}, "job_id"=>"20180730143824794936"}, "apiv"=>"v2"}
2018-07-30T14:39:20 9e52e424 [app] [I] Current user: foreman_api_admin (administrator)
2018-07-30T14:39:20 9e52e424 [app] [I] Processing job 20180730143824794936 from Salt.
2018-07-30T14:39:20 9e52e424 [app] [I] Completed 200 OK in 64ms (Views: 0.2ms | ActiveRecord: 11.5ms)

After added the missing pieces, my chain worked fine again:



master_tops:
  ext_nodes: /usr/bin/foreman-node

ext_pillar:
  - puppet: /usr/bin/foreman-node

[0] https://community.theforeman.org/t/auto-host-creation-of-salt-minion-in-foreman/10583

No data to display

Actions

Also available in: Atom PDF