Bug #16156
closedForeman Salt - duplication issue
Description
Same host showed multiple times.
It happens when I execute highstate or restart minion for example.
We use saltstack with foreman and the smart proxy.
Foreman host-
foreman-1.12.1-1.el7.noarch
tfm-rubygem-foreman_salt-6.0.0-1.fm1_12.el7.noarch
Salt master, Foreman Proxy
foreman-proxy-1.12.1-1.el6.noarch
rubygem-smart_proxy_salt-2.1.6-1.el6.noarch
salt-master-2016.3.1-1.el6.noarch
salt-ssh-2016.3.1-1.el6.noarch
salt-2016.3.1-1.el6.noarch
salt-api-2016.3.1-1.el6.noarch
Updated by Ido Kaplan over 8 years ago
Hi,
Is the bug will be fixed this week?
Thanks!
Ido
Updated by Stephen Benjamin about 8 years ago
- Status changed from New to Need more information
I don't get duplicate hosts at all on Foreman 1.12.1 and the latest salt plugin.
You would have to give me more info. Logs, more detailed information about what you did, etc.
Updated by Ido Kaplan about 8 years ago
Hi,
I have found that if I delete the search domain from "/etc/resolv.conf", the issue is solved.
Is it helps that understand the issue?
Thanks,
Ido
Updated by Stephen Benjamin about 8 years ago
- Assignee deleted (
Simon Mügge)
Maybe but I've asked several times now for you to give more information. You can see here http://www.catb.org/esr/faqs/smart-questions.html#beprecise the kinds of things I need to know. I have very little information to go on.
What OS are you using?
What command causes the duplicate host to be created?
What's in /var/log/foreman/production.log?
What shows up in /var/log/foreman-proxy/proxy.log?
How many duplicate hosts do you have? Do you always get duplicate hosts?
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?
What is the configuration of your minions? Do you have anything special in /etc/salt/minion on them?
Updated by Ido Kaplan about 8 years ago
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
Updated by Stephen Benjamin about 8 years ago
- Is duplicate of Bug #11870: Multiple hosts created when saltstack minion_id differs from FQDN. added
Updated by Stephen Benjamin about 8 years ago
- Status changed from Need more information to Duplicate
Same issue as #11870, currently minion ids need to be the same as a host fqdn.