Support #12438
closedThe minions doesn't appear in the hosts page
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!!
Updated by Stephen Benjamin over 9 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?
Updated by Stephen Benjamin over 9 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.
Updated by david L over 9 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
Updated by david L over 9 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!
Updated by Stephen Benjamin over 9 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?
Updated by Stephen Benjamin over 9 years ago
- Tracker changed from Bug to Support
Updated by david L over 9 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!
Updated by david L over 9 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'>
<div id="c">
Try this:
post '/api/v2/jobs/upload' do "Hello World" end
</div>
</body>
</html>
Updated by Stephen Benjamin over 9 years ago
/etc/salt/foreman.yaml is pointing at your proxy, it needs to point at the Foreman.