···
---
:proto: https
:host: wellkatellodev.niwa.local
:port: 443
:timeout: 60
:salt: /usr/bin/salt
:upload_grains: true
:ssl_ca: "/etc/puppet/ssl_ca.pem"
:ssl_cert: "/etc/puppet/client_cert.pem"
:ssl_key: "/etc/puppet/client_key.pem"
rebooted, and ran “Run salt” from the GUI - now the salt master log
/var/log/salt/master shows the foreman-node command working.
2016-03-31 09:17:36,100 [salt.loaded.int.module.cmdmod][INFO ][3314]
Executing command ‘/usr/bin/foreman-node wellminiondev.niwa.local’ in
directory ‘/root’
2016-03-31 09:17:36,558 [salt.utils.lazy ][DEBUG ][3300] LazyLoaded
local_cache.clean_old_jobs
2016-03-31 09:17:36,570 [salt.utils.lazy ][DEBUG ][3300] Could not
LazyLoad config.merge
2016-03-31 09:17:36,570 [salt.fileserver ][DEBUG ][3300] Updating roots
fileserver cache
2016-03-31 09:17:36,572 [salt.utils.verify][DEBUG ][3300] This
salt-master instance has accepted 2 minion keys.
2016-03-31 09:18:03,345 [salt.loaded.int.module.cmdmod][DEBUG ][3314]
output: —
classes:
- wget
parameters:
puppetmaster: wellkatellodev.niwa.local
organization: NIWA
root_pw:
puppet_ca: wellkatellodev.niwa.local
foreman_env: production
owner_name: Dylan Baars
owner_email: removed
foreman_subnets:
foreman_interfaces:
- mac: 00:50:56:85:14:ea
ip: 192.168.14.102
type: Interface
name: wellminiondev.niwa.local
attrs: {}
virtual: false
link: true
identifier: eno16780032
managed: true
primary: true
provision: true
subnet:
salt_master: wellkatellodev.niwa.local
kt_env:
kt_cv:
lifecycle_environment:
content_view:
environment: base
2016-03-31 09:18:03,418 [salt.utils.lazy ][DEBUG ][3310] LazyLoaded
roots.envs
2016-03-31 09:18:29,929 [salt.utils.lazy ][DEBUG ][3313] LazyLoaded
roots.envs
2016-03-31 09:18:32,121 [salt.utils.job ][INFO ][3313] Got return from
wellminiondev.niwa.local for job 20160331091735908119
2016-03-31 09:18:32,122 [salt.utils.event ][DEBUG ][3313] Sending event -
data = {‘fun_args’: , ‘jid’: ‘20160331091735908119’, ‘return’:
{‘pkg_|-wget_|-wget_|-installed’: {‘comment’: ‘Package wget is already
installed’, ‘name’: ‘wget’, ‘start_time’: ‘09:18:31.027404’, ‘result’:
True, ‘duration’: 983.601, ‘run_num’: 0, ‘changes’: {}},
‘pkg_|-httpd_|-httpd_|-installed’: {‘comment’: ‘Package httpd is already
installed’, ‘name’: ‘httpd’, ‘start_time’: ‘09:18:32.011344’, ‘result’:
True, ‘duration’: 2.162, ‘run_num’: 1, ‘changes’: {}},
‘pkg_|-nano_|-nano_|-installed’: {‘comment’: ‘Package nano is already
installed’, ‘name’: ‘nano’, ‘start_time’: ‘09:18:32.013822’, ‘result’:
True, ‘duration’: 1.076, ‘run_num’: 2, ‘changes’: {}}}, ‘retcode’: 0,
‘success’: True, ‘cmd’: ‘_return’, ‘_stamp’: ‘2016-03-30T20:18:32.121902’,
‘fun’: ‘state.highstate’, ‘id’: ‘wellminiondev.niwa.local’, ‘out’:
‘highstate’}
2016-03-31 09:18:36,632 [salt.config ][DEBUG ][3300] Reading
configuration from /etc/salt/master
On the minion /var/log/salt/minion
2016-03-31 09:18:31,027 [salt.state ][INFO ][29598] Running state
[wget] at time 09:18:31.027404
2016-03-31 09:18:31,028 [salt.state ][INFO ][29598] Executing
state pkg.installed for wget
2016-03-31 09:18:31,029 [salt.loaded.int.module.cmdmod][INFO ][29598]
Executing command [‘rpm’, ‘-qa’, ‘–queryformat’,
‘%{NAME}|-%{EPOCH}|-%{VERSION}|-%{RELEASE}|-%{ARCH}_|-(none)\n’] in
directory ‘/root’
2016-03-31 09:18:32,011 [salt.state ][INFO ][29598] Package wget
is already installed
2016-03-31 09:18:32,011 [salt.state ][INFO ][29598] Completed
state [wget] at time 09:18:32.011005
and in the foreman/katello GUI if I browse reports for that host
(wellminiondev) I see all 3 state files are applied (2 via top.sls, 1 via
foreman association). The VM may be under-powered (4vcpu, 6gb ram) for
running Katello and Salt, so that may be the cause of the timeout
Finally, running foreman-node manually works as well
[root@wellkatellodev foreman]# /usr/bin/foreman-node
wellminiondev.niwa.local
classes:
- wget
parameters:
puppetmaster: wellkatellodev.niwa.local
organization: NIWA
root_pw:
puppet_ca: wellkatellodev.niwa.local
foreman_env: production
owner_name: Dylan Baars
owner_email: removed
foreman_subnets:
foreman_interfaces:
- mac: 00:50:56:85:14:ea
ip: 192.168.14.102
type: Interface
name: wellminiondev.niwa.local
attrs: {}
virtual: false
link: true
identifier: eno16780032
managed: true
primary: true
provision: true
subnet:
salt_master: wellkatellodev.niwa.local
kt_env:
kt_cv:
lifecycle_environment:
content_view:
environment: base
[root@wellkatellodev foreman]#
Magic thanks heaps for your help!
Dylan
On Thursday, March 31, 2016 at 8:33:09 AM UTC+13, Dylan Baars wrote:
Oh, if I change the host to wellkatellodev.niwa.local (the
katello/salt-master - i.e. localhost really) I get this still…
but in production.log
Started GET “/node/wellkatellodev.niwa.local?format=yml” for
192.168.14.100 at 2016-03-31 08:27:26 +1300
2016-03-31 08:27:26 [app] [I] Processing by HostsController#externalNodes
as YML
2016-03-31 08:27:26 [app] [I] Parameters:
{“name”=>“wellkatellodev.niwa.local”}
2016-03-31 08:27:26 [app] [D] Verifying request from
[“wellkatellodev.niwa.local”] against [“wellkatellodev.niwa.local”]
2016-03-31 08:27:26 [app] [D] Setting current user thread-local variable to
API Admin
2016-03-31 08:27:26 [app] [I] Rendered text template (0.0ms)
2016-03-31 08:27:26 [app] [I] Completed 200 OK in 98ms (Views: 0.7ms |
ActiveRecord: 12.0ms)
2016-03-31 08:27:28 [app] [I]
Started POST “/api/hosts/facts” for 192.168.14.100 at 2016-03-31
08:27:28 +1300
2016-03-31 08:27:28 [app] [I] Processing by Api::V2::HostsController#facts
as JSON
2016-03-31 08:27:28 [app] [I] Parameters: {“facts”=>“[FILTERED]”,
“name”=>“wellkatellodev.niwa.local”,
“certname”=>“wellkatellodev.niwa.local”, “apiv”=>“v2”,
:host=>{“name”=>“wellkatellodev.niwa.local”,
“certname”=>“wellkatellodev.niwa.local”}}
2016-03-31 08:27:28 [app] [D] Setting current location thread-local
variable to none
2016-03-31 08:27:28 [app] [D] Setting current organization thread-local
variable to none
2016-03-31 08:27:28 [app] [D] Importer Katello::RhsmFactImporter does not
implement authorized_smart_proxy_features.
2016-03-31 08:27:28 [app] [D] Verifying request from
[“wellkatellodev.niwa.local”] against [“wellkatellodev.niwa.local”]
2016-03-31 08:27:28 [app] [D] Setting current user thread-local variable to
API Admin
2016-03-31 08:27:28 [app] [D] Merging facts for
‘wellkatellodev.niwa.local’: deleted 0 facts
2016-03-31 08:27:28 [app] [D] Merging facts for
‘wellkatellodev.niwa.local’: added 0 facts
2016-03-31 08:27:28 [app] [D] Merging facts for
‘wellkatellodev.niwa.local’: updated 7 facts
2016-03-31 08:27:28 [app] [I] Import facts for ‘wellkatellodev.niwa.local’
completed. Added: 0, Updated: 7, Deleted 0 facts
2016-03-31 08:27:28 [app] [D] skipping interface with identifier ‘lo’ since
it was matched by ‘ignored_interface_identifiers’ setting
2016-03-31 08:27:28 [app] [D] We have following interfaces ‘eno16780032’
based on facts
2016-03-31 08:27:28 [app] [D] Interface eno16780032 facts:
{“ipaddress”=>“192.168.14.100”, “macaddress”=>“00:50:56:85:50:23”,
“netmask”=>“255.255.255.0”, “mtu”=>“1500”, “network”=>“192.168.14.0”}
2016-03-31 08:27:28 [app] [D] Body:
{“architecture_id”:1,“build”:false,“certname”:“wellkatellodev.niwa.local”,“comment”:null,“compute_profile_id”:null,“compute_resource_id”:null,“content_source_id”:null,“content_view_id”:null,“created_at”:“2016-03-03T21:11:37Z”,“discovery_rule_id”:null,“disk”:null,“enabled”:true,“environment_id”:1,“global_status”:0,“grub_pass”:“”,“hostgroup_id”:null,“id”:1,“image_file”:“”,“image_id”:null,“installed_at”:null,“last_compile”:“2016-03-30T19:27:28Z”,“last_report”:“2016-03-30T18:57:25Z”,“lifecycle_environment_id”:null,“location_id”:24,“lookup_value_matcher”:“fqdn=wellkatellodev.niwa.local”,“managed”:false,“medium_id”:null,“model_id”:1,“name”:“wellkatellodev.niwa.local”,“operatingsystem_id”:1,“organization_id”:6,“otp”:null,“owner_id”:null,“owner_type”:null,“provision_method”:“build”,“ptable_id”:null,“puppet_ca_proxy_id”:1,“puppet_proxy_id”:1,“realm_id”:null,“root_pass”:null,“salt_environment_id”:null,“salt_proxy_id”:1,“updated_at”:“2016-03-30T19:27:28Z”,“use_image”:null,“uuid”:null}
2016-03-31 08:27:28 [app] [I] Completed 201 Created in 180ms (Views: 7.1ms
ActiveRecord: 0.0ms)
2016-03-31 08:27:28 [app] [I]
Started GET “/node/wellkatellodev.niwa.local?format=yml” for
192.168.14.100 at 2016-03-31 08:27:28 +1300
2016-03-31 08:27:28 [app] [I] Processing by HostsController#externalNodes
as YML
2016-03-31 08:27:28 [app] [I] Parameters:
{“name”=>“wellkatellodev.niwa.local”}
2016-03-31 08:27:28 [app] [D] Verifying request from
[“wellkatellodev.niwa.local”] against [“wellkatellodev.niwa.local”]
2016-03-31 08:27:28 [app] [D] Setting current user thread-local variable to
API Admin
2016-03-31 08:27:28 [app] [I] Rendered text template (0.0ms)
2016-03-31 08:27:28 [app] [I] Completed 200 OK in 146ms (Views: 1.2ms |
ActiveRecord: 17.0ms)
2016-03-31 08:27:29 [app] [I]
Started POST “/api/reports” for 192.168.14.100 at 2016-03-31 08:27:29
+1300
2016-03-31 08:27:29 [app] [I] Processing by
Api::V2::ReportsController#create as JSON
2016-03-31 08:27:29 [app] [I] Parameters: {“report”=>“[FILTERED]”,
“apiv”=>“v2”}
2016-03-31 08:27:29 [app] [D] Verifying request from
[“wellkatellodev.niwa.local”] against [“wellkatellodev.niwa.local”]
2016-03-31 08:27:29 [app] [D] Setting current user thread-local variable to
API Admin
2016-03-31 08:27:29 [app] [I] processing report for
wellkatellodev.niwa.local
2016-03-31 08:27:29 [app] [D] Report: {“host”=>“wellkatellodev.niwa.local”,
“reported_at”=>“2016-03-30 19:27:25 UTC”, “status”=>{“applied”=>0,
“restarted”=>0, “failed”=>0, “failed_restarts”=>0, “skipped”=>0,
“pending”=>0}, “metrics”=>{“resources”=>{“changed”=>0, “failed”=>0,
“failed_to_restart”=>0, “out_of_sync”=>0, “restarted”=>0, “scheduled”=>0,
“skipped”=>0, “total”=>1}, “time”=>{“config_retrieval”=>0.957657252,
“filebucket”=>0.000147465, “total”=>0.9578047169999999},
“changes”=>{“total”=>0}, “events”=>{“failure”=>0, “success”=>0,
“total”=>0}}, “logs”=>}
2016-03-31 08:27:29 [app] [I] Imported report for wellkatellodev.niwa.local
in 0.02 seconds
2016-03-31 08:27:29 [app] [I] Rendered api/v2/reports/create.json.rabl
(7.0ms)
2016-03-31 08:27:29 [app] [D] Body:
{“metrics”:{“resources”:{“changed”:0,“failed”:0,“failed_to_restart”:0,“out_of_sync”:0,“restarted”:0,“scheduled”:0,“skipped”:0,“total”:1},“time”:{“config_retrieval”:0.957657252,“filebucket”:0.000147465,“total”:0.9578047169999999},“changes”:{“total”:0},“events”:{“failure”:0,“success”:0,“total”:0}},“created_at”:“2016-03-30T19:27:29Z”,“updated_at”:“2016-03-30T19:27:29Z”,“id”:3024,“host_id”:1,“host_name”:“wellkatellodev.niwa.local”,“reported_at”:“2016-03-30T19:27:25Z”,“status”:{“applied”:0,“restarted”:0,“failed”:0,“failed_restarts”:0,“skipped”:0,“pending”:0},“logs”:,“summary”:“Success”}
2016-03-31 08:27:29 [app] [I] Completed 201 Created in 50ms (Views: 7.1ms |
ActiveRecord: 9.2ms)
Note I hadn’t set a salt environment for wellkatellodev at that point, so
did so, added the ‘wget’ salt state (which isn’t specified in top.sls) and
re-ran foreman-node wellkatellodev.niwa.local -
[root@wellkatellodev ~]# /usr/bin/foreman-node wellkatellodev.niwa.local
Couldn’t retrieve ENC data: execution expired
All I got in production.log this time is below
2016-03-31 08:30:12 [app] [I] Connecting to database specified by
database.yml
2016-03-31 08:30:12 [app] [I] Connecting to database specified by
database.yml
2016-03-31 08:30:45 [foreman-tasks/dynflow] [I] start terminating
throttle_limiter…
2016-03-31 08:30:45 [foreman-tasks/dynflow] [I] start terminating client
dispatcher…
2016-03-31 08:30:45 [foreman-tasks/dynflow] [I] stop listening for new
events…
2016-03-31 08:30:45 [foreman-tasks/dynflow] [I] start terminating clock…
2016-03-31 08:30:46 [foreman-tasks/dynflow] [I] start terminating
throttle_limiter…
2016-03-31 08:30:46 [foreman-tasks/dynflow] [I] start terminating client
dispatcher…
2016-03-31 08:30:46 [foreman-tasks/dynflow] [I] stop listening for new
events…
2016-03-31 08:30:46 [foreman-tasks/dynflow] [I] start terminating clock…
On Thursday, March 31, 2016 at 8:25:53 AM UTC+13, Dylan Baars wrote:
For completeness - here’s /etc/salt/foreman.yaml
:proto: https
:host: wellkatellodev.niwa.local
:port: 443
:timeout: 10
/usr/bin/salt
:upload_grains: true
:ssl_ca: “/etc/puppet/ssl_ca.pem”
:ssl_cert: “/etc/puppet/client_cert.pem”
:ssl_key: “/etc/puppet/client_key.pem”
and running foreman-node
[root@wellkatellodev ~]# /usr/bin/foreman-node wellminiondev.niwa.local
Couldn’t retrieve ENC data: execution expired
[root@wellkatellodev ~]#
nothing appeared in production.log at all. Just to prove I’m getting the
fqdn right -
[root@wellkatellodev ~]# hammer host list
—|---------------------------|------------------|------------|----------------|------------------
ID | NAME | OPERATING SYSTEM | HOST GROUP | IP
> MAC
—|---------------------------|------------------|------------|----------------|------------------
1 | wellkatellodev.niwa.local | CentOS 7.2 | |
192.168.14.100 | 00:50:56:85:50:23
2 | wellminiondev.niwa.local | CentOS 7.2 | |
192.168.14.102 | 00:50:56:85:14:ea
3 | wellsaltdev.niwa.local | CentOS 7.2 | |
192.168.14.101 | 00:50:56:85:76:19
—|---------------------------|------------------|------------|----------------|------------------
[root@wellkatellodev ~]#
On Thursday, March 31, 2016 at 8:18:22 AM UTC+13, stephen wrote:
Sorry I take that back, I see the execution expired error in the salt logs
but not in the foreman.
It’d be useful if you could still run foreman-node by itself and share the
production.log when you do.
Also /etc/salt/foreman.yaml, if you’ve made any changes since the first
message.
----- Original Message -----
From: “Stephen Benjamin” ste...@redhat.com
To: “Dylan Baars” baa...@gmail.com
Cc: “Foreman users” forema...@googlegroups.com
Sent: Wednesday, March 30, 2016 3:15:52 PM
Subject: Re: [foreman-users] Importing salt states fails ERF12-4701
I don’t see any errors here, it looks like Salt ran successfully, and
even
uploaded a report to Foreman.
Can you run foreman-node fqdn
like in your other message, and share the
production.log if you still get an error?
----- Original Message -----
From: “Dylan Baars” baa...@gmail.com
To: “Foreman users” forema...@googlegroups.com
Cc: ste...@redhat.com
Sent: Wednesday, March 30, 2016 1:40:58 PM
Subject: Re: [foreman-users] Importing salt states fails ERF12-4701
Morning,
with debug logging for foreman enabled - edited
/etc/foreman/settings.yaml
:logging:
:level: info
:level: debug
this is what is output when I hit “Run Salt” in the GUI
Started GET “/salt/run/wellminiondev.niwa.local” for 192.168.81.51
at
2016-03-31 06:30:45 +1300
2016-03-31 06:30:45 [app] [I] Processing by
ForemanSalt::MinionsController#run as HTML
2016-03-31 06:30:45 [app] [I] Parameters:
{“id”=>“wellminiondev.niwa.local”}
2016-03-31 06:30:45 [app] [D] Setting current user thread-local
variable to
Dylan Baars
2016-03-31 06:30:45 [app] [D] Setting current organization thread-local
variable to NIWA
2016-03-31 06:30:45 [app] [D] Setting current location thread-local
variable to none
2016-03-31 06:30:47 [app] [I] Redirected to
https://wellkatellodev.niwa.local/hosts/wellminiondev.niwa.local
2016-03-31 06:30:47 [app] [I] Completed 302 Found in 1288ms
(ActiveRecord:
16.9ms)
2016-03-31 06:30:47 [app] [I]
Started GET “/hosts/wellminiondev.niwa.local” for 192.168.81.51 at
2016-03-31 06:30:47 +1300
2016-03-31 06:30:47 [app] [I] Processing by HostsController#show as
HTML
2016-03-31 06:30:47 [app] [I] Parameters:
{“id”=>“wellminiondev.niwa.local”}
2016-03-31 06:30:47 [app] [D] Setting current user thread-local
variable to
Dylan Baars
2016-03-31 06:30:47 [app] [D] Setting current organization thread-local
variable to NIWA
2016-03-31 06:30:47 [app] [D] Setting current location thread-local
variable to none
2016-03-31 06:30:47 [app] [D] Deface: 1 overrides found for
‘hosts/show’
2016-03-31 06:30:47 [app] [D] Deface: ‘add_system_link_to_host’ matched
1
times with ‘td:first’
2016-03-31 06:30:47 [app] [I] Deface: [WARNING] No :original defined
for
‘add_system_link_to_host’, you should change its definition to include:
:original => ‘68201d5314be8a5aeb05b063bc5cd0afaf58a6c5’
2016-03-31 06:30:48 [app] [I] Rendered hosts/_metrics.html.erb
(1.2ms)
2016-03-31 06:30:48 [app] [I] Rendered hosts/show.html.erb within
layouts/application (948.3ms)
2016-03-31 06:30:48 [app] [I] Rendered home/_user_dropdown.html.erb
(239.2ms)
2016-03-31 06:30:48 [app] [I] Read fragment
views/tabs_and_title_records-4
(0.3ms)
2016-03-31 06:30:48 [app] [I] Rendered home/_topbar.html.erb
(242.4ms)
2016-03-31 06:30:48 [app] [I] Rendered layouts/base.html.erb
(246.2ms)
2016-03-31 06:30:48 [app] [I] Completed 200 OK in 1557ms (Views:
1416.4ms |
ActiveRecord: 27.6ms)
2016-03-31 06:30:49 [app] [I]
Started GET "/hosts/wellminiondev.niwa.local/overvie