What OS are you using?
Amazon 2016.03 (CentOS 6.8 AWS image)
What command causes the duplicate host to be created?
service salt-minion restart
salt-call state.highstate
What's in /var/log/foreman/production.log?
[app] [I] Completed 200 OK in 401ms (Views: 334.4ms | ActiveRecord: 19.7ms)
[app] [I] Started POST "/api/hosts/facts" for X.X.X.X at 2016-09-02 22:21:01 +0300
[app] [I] Processing by Api::V2::HostsController#facts as JSON
[app] [I] Parameters: {"facts"=>"[FILTERED]", "name"=>"nv-ec2-idotest-01-1a", "apiv"=>"v2", :host=>{"name"=>"nv-ec2-idotest-01-1a"}}
[app] [I] Import facts for 'nv-ec2-idotest-01-1a' completed. Added: 180, Updated: 0, Deleted 0 facts
[app] [I] Completed 201 Created in 1869ms (Views: 9.1ms | ActiveRecord: 358.9ms)
[app] [I] Started GET "/salt/node/nv-ec2-idotest-01-1a?format=yml" for X.X.X.X at 2016-09-02 22:21:04 +0300
[app] [I] Processing by ForemanSalt::MinionsController#node as YML
[app] [I] Parameters: {"id"=>"nv-ec2-idotest-01-1a"}
[app] [I] Completed 404 Not Found in 17ms (ActiveRecord: 3.4ms)
What shows up in /var/log/foreman-proxy/proxy.log?
Nothing
How many duplicate hosts do you have? Do you always get duplicate hosts?
Yes - Always
What happens if you run on the salt master: foreman-node <hostname> where <hostname> is the name of one of your minions? Does it create a duplicate host every time? Can you share the logs from when that happens?
Couldn't retrieve ENC data: Error retrieving node nv-ec2-idotest-01-1a: Net::HTTPNotFound
[app] [I] Started POST "/api/hosts/facts" for X.X.X.X at 2016-09-02 22:32:47 +0300
[app] [I] Processing by Api::V2::HostsController#facts as JSON
[app] [I] Parameters: {"facts"=>"[FILTERED]", "name"=>"nv-ec2-idotest-01-1a", "apiv"=>"v2", :host=>{"name"=>"nv-ec2-idotest-01-1a"}}
[app] [I] Import facts for 'nv-ec2-idotest-01-1a' completed. Added: 180, Updated: 0, Deleted 0 facts
[app] [I] Completed 201 Created in 2093ms (Views: 10.1ms | ActiveRecord: 354.6ms)
[app] [I] Started GET "/salt/node/nv-ec2-idotest-01-1a?format=yml" for X.X.X.X at 2016-09-02 22:32:50 +0300
[app] [I] Processing by ForemanSalt::MinionsController#node as YML
[app] [I] Parameters: {"id"=>"nv-ec2-idotest-01-1a"}
[app] [I] Completed 404 Not Found in 19ms (ActiveRecord: 4.2ms)
What is the configuration of your minions? Do you have anything special in /etc/salt/minion on them?
environment: infra
master_type: failover
master:
- salt01
- salt02
id: nv-ec2-idotest-01-1a
startup_states: highstate
Foreman audits logs
1. API Admin created Host: nv-ec2-idotest-01-1a
2. API Admin updated Host: nv-ec2-idotest-01-1a
Architecture changed from N/A to x86_64
Operatingsystem changed from N/A to Amazon 2016.03
Name changed from nv-ec2-idotest-01-1a to nv-ec2-idotest-01-1a.ec2.internal
The minion name that I see in Foreman is - nv-ec2-idotest-01-1a.ec2.internal
"nv-ec2-idotest-01-1a" is the minion id.
"ec2.internal" is the default domain in AWS servers.
If I delete the search domain "ec2.internal" from "/etc/resolv.conf", the issue is solved and the server name that I see in Foreman is "nv-ec2-idotest-01-1a", without "ec2.internal"
How minions are added t