Project

General

Profile

Actions

Support #12438

closed

The minions doesn't appear in the hosts page

Added by david L over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hi,

I tried to run salt '*' state.highstate on the master and salt '*' grains.items but the minions doesn't' appear.
Also, I execute upload-salt-reports and the next error appear:

Traceback (most recent call last):
File "/usr/sbin/upload-salt-reports", line 137, in <module>
upload(jobs_to_upload())
File "/usr/sbin/upload-salt-reports", line 79, in jobs_to_upload
jobs = run('jobs.list_jobs')
File "/usr/sbin/upload-salt-reports", line 75, in run
return ret['data'] if 'data' in ret else ret
TypeError: string indices must be integers, not str

Thanks!!

Actions #1

Updated by Stephen Benjamin over 8 years ago

Hey,

The error in upload-salt-reports looks like a bug, could you edit upload-salt-reports and change this line:

return ret['data'] if 'data' in ret else ret

to

return ret['data'] if isinstance(ret, dict) else ret

And try it again?

Actions #2

Updated by Stephen Benjamin over 8 years ago

And just calling the grains.items won't upload them, you need to use foreman-node as the ENC (ext_nodes) script as described in http://theforeman.org/plugins/foreman_salt/4.0/index.html#2.1.2SaltMasterConfiguration. It uploads cached grains whenever it runs.

Actions #3

Updated by david L over 8 years ago

Hi,
I changed the line but now the next error is appearing:

Traceback (most recent call last):
File "/usr/sbin/upload-salt-reports", line 137, in <module>
upload(jobs_to_upload())
File "/usr/sbin/upload-salt-reports", line 82, in jobs_to_upload
job_ids = [id for (id, value) in jobs.iteritems()
AttributeError: 'str' object has no attribute 'iteritems'

Thanks

Actions #4

Updated by david L over 8 years ago

I tried to execute foreman-node:

david@master:~$ foreman-node minion1
Couldn't retrieve ENC data: Error retrieving node minion1: Net::HTTPNotFound
Check Foreman's /var/log/foreman/production.log for more information.

I have nothing in production.log

thanks!

Actions #5

Updated by Stephen Benjamin over 8 years ago

What is the output when you run salt state.highstate for a node? It seems like salt is returning output we don't expect.

Also foreman-node error indicates maybe it's misconfigured? What does /etc/salt/foreman.yaml look like? Have you followed everything in http://theforeman.org/plugins/foreman_salt/4.0/index.html#2.Installation?

Actions #6

Updated by Stephen Benjamin over 8 years ago

  • Tracker changed from Bug to Support
Actions #7

Updated by david L over 8 years ago

When I do the state.highstate for a minion, I think the output it's correct:

david@master:~$ salt 'minion1' state.highstate
minion1:
----------
ID: zalter
Function: user.present
Result: True
Comment: User zalter is present and up to date
Started: 17:38:45.229082
Duration: 62.788 ms
Changes:
----------
ID: ironside
Function: user.present
Result: True
Comment: User ironside is present and up to date
Started: 17:38:45.291978
Duration: 1.032 ms
Changes:

Summary
------------
Succeeded: 2
Failed: 0
------------
Total states run: 2

This is the configuration of the foreman.yaml:

---
:proto: https
:host: master.salt.lan
:port: 8443
:ssl_ca: /var/lib/puppet/ssl/certs/ca.pem
:ssl_cert: /var/lib/puppet/ssl/certs/master.salt.lan.pem
:ssl_key: /var/lib/puppet/ssl/private_keys/master.salt.lan.pem
:timeout: 10
:salt: /usr/bin/salt
:upload_grains: true

I followed all the steps marked in the page.

Thanks!

Actions #8

Updated by david L over 8 years ago

Hi!

If I execute sudo upload-salt-reports now, I have this error:

Traceback (most recent call last):
File "/usr/sbin/upload-salt-reports", line 137, in <module>
upload(jobs_to_upload())
File "/usr/sbin/upload-salt-reports", line 80, in jobs_to_upload
jobs = run('jobs.list_jobs')
File "/usr/sbin/upload-salt-reports", line 75, in run
return ret['data'] if isinstance(ret, dict) else ret
KeyError: 'data'

And if I change the line as it was before (return ret['data'] if 'data' in ret else ret), the upload-salt-reports apparently runs but the next error appears:

Unable to upload job - aborting report upload
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body { text-align:center;font-family:helvetica,arial;font-size:22px;
color:#888;margin:20px}
#c {margin:0 auto;width:500px;text-align:left}
</style>
</head>
<body>
<h2>Sinatra doesn’t know this ditty.</h2>
<img src='https://master.salt.lan:8443/salt/__sinatra__/404.png&#039;>
<div id="c">
Try this:

post '/api/v2/jobs/upload' do
  "Hello World" 
end

</div>
</body>
</html>

Actions #9

Updated by Stephen Benjamin over 8 years ago

/etc/salt/foreman.yaml is pointing at your proxy, it needs to point at the Foreman.

Actions #10

Updated by david L over 8 years ago

It's running! thanks for all Stephen!

Actions #11

Updated by Stephen Benjamin over 8 years ago

  • Status changed from New to Resolved

No problem!

Actions

Also available in: Atom PDF