Project

General

Profile

Bug #7655

Host update for grub pass on first report received after upgrade

Added by Dominic Cleal almost 5 years ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

After upgrading to post #2127, the first Puppet report received from each host is triggering an update to populate grub_pass on the host object, which also generates an audit log entry.

This probably should be handled with a DB migration instead.

Started POST "/api/reports" for 192.168.122.130 at 2014-09-26 14:05:41 +0100
Processing by Api::V2::ReportsController#create as JSON
  Parameters: {"report"=>"[FILTERED]", "apiv"=>"v2"}
  User Load (0.2ms)  SELECT "users".* FROM "users" WHERE "users"."login" = 'foreman_api_admin' LIMIT 1
Setting current user thread-local variable to foreman_api_admin
processing report for puppet.example.com
Report: {"host"=>"puppet.example.com", "reported_at"=>"2014-09-26 13:05:37 UTC", "status"=>{"applied"=>0, "restarted"=>0, "failed"=>0, "failed_restarts"=>0, "skipped"=>0, "pending"=>0}, "metrics"=>{"events"=>{"failure"=>0, "success"=>0, "total"=>0}, "changes"=>{"total"=>0}, "time"=>{"config_retrieval"=>#<BigDecimal:a686280,'0.9577279090 88135E0',18(27)>, "filebucket"=>0.000102, "total"=>#<BigDecimal:a686168,'0.9578299090 88135E0',18(27)>}, "resources"=>{"changed"=>0, "failed"=>0, "failed_to_restart"=>0, "out_of_sync"=>0, "restarted"=>0, "scheduled"=>0, "skipped"=>0, "total"=>1}}, "logs"=>[{"log"=>{"sources"=>{"source"=>"Puppet"}, "messages"=>{"message"=>"Local environment: \"production\" doesn't match server specified node environment \"example\", switching agent to \"example\"."}, "level"=>"warning"}}, {"log"=>{"sources"=>{"source"=>"Puppet"}, "messages"=>{"message"=>"Retrieving pluginfacts"}, "level"=>"info"}}, {"log"=>{"sources"=>{"source"=>"Puppet"}, "messages"=>{"message"=>"Retrieving plugin"}, "level"=>"info"}}, {"log"=>{"sources"=>{"source"=>"Puppet"}, "messages"=>{"message"=>"Caching catalog for puppet.example.com"}, "level"=>"info"}}, {"log"=>{"sources"=>{"source"=>"Puppet"}, "messages"=>{"message"=>"Applying configuration version '1411736740'"}, "level"=>"info"}}]}
  Host::Base Load (0.2ms)  SELECT "hosts".* FROM "hosts" WHERE "hosts"."certname" = 'puppet.example.com' LIMIT 1
   (0.0ms)  begin transaction
  Host::Managed Load (0.2ms)  SELECT "hosts".* FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."id" = 82 LIMIT 1
   (10.1ms)  SELECT MAX("audits"."version") AS max_id FROM "audits" WHERE "audits"."auditable_id" = 82 AND "audits"."auditable_type" = 'Host'
Binary data inserted for `string` type on column `remote_address`
  SQL (1.5ms)  INSERT INTO "audits" ("action", "associated_id", "associated_name", "associated_type", "auditable_id", "auditable_name", "auditable_type", "audited_changes", "comment", "created_at", "remote_address", "user_id", "user_type", "username", "version") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  [["action", "update"], ["associated_id", nil], ["associated_name", nil], ["associated_type", nil], ["auditable_id", 82], ["auditable_name", "puppet.example.com"], ["auditable_type", "Host"], ["audited_changes", "---\ngrub_pass:\n- ''\n- $1$afsT5fik$a7li4l1vdHCHsjG.rhScb1\n"], ["comment", nil], ["created_at", Fri, 26 Sep 2014 13:05:41 UTC +00:00], ["remote_address", "192.168.122.130"], ["user_id", nil], ["user_type", nil], ["username", "API Admin"], ["version", 255]]
   (0.1ms)  UPDATE "hosts" SET "last_report" = '2014-09-26 13:05:37.000000', "grub_pass" = '$1$afsT5fik$a7li4l1vdHCHsjG.rhScb1', "updated_at" = '2014-09-26 13:05:41.443732' WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."id" = 82
   (42.6ms)  commit transaction

Related issues

Related to Foreman - Feature #2127: Support newer hash schemes for root passwordsClosed2013-01-15

History

#1 Updated by Dominic Cleal almost 5 years ago

  • Related to Feature #2127: Support newer hash schemes for root passwords added

#2 Updated by Dominic Cleal almost 5 years ago

  • Target version set to 1.7.2

#3 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) deleted (21)

#4 Updated by Tomer Brisker about 1 year ago

  • Target version deleted (1.7.2)

Also available in: Atom PDF