Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: 0.10.4, 0.10.8
-
Fix Version/s: None
-
Component/s: Chef Server
-
Labels:
-
Environment:
Tested on:
1. Debian 6.0 + chef installed from deb packages (0.10.8)
2. Ubuntu 10.04 LTS + chef installed from ruby gems (0.10.4 and 0.10.8)
Description
I have a problem with search functionality using key words 'role' and 'roles'.
I have defined 3 roles: zookeeper, ha-infra, base. The role ha-infra includes zookeeper and base. The role zookeeper includes base.
I have three nodes
1. chef-client-1 - run_list contains role ha-infra
2. chef-client-2 - run_list contains role ha-infra
3. chef-client-3 - run_list contains role zookeeper
These nodes are assigned to environment test:
name "test"
description "The test environment"
override_attributes(
"failover_ip" => {
"ha-infra" => "1.2.3.4"
}
)
The problem is occurring when I use search as follows:
root@chef-server:~# knife search node "chef_environment:test AND roles:ha-infra"
3 items found
Node Name: chef-client-1
Environment: test
FQDN:
IP: 192.168.56.102
Run List: role[ha-infra]
Roles: zookeeper, ha-infra, base
Recipes: iptables, iptables::icmp, iptables::ssh, iptables::zk_replication, iptables::zk_server
Platform: debian 6.0.4
Node Name: chef-client-2
Environment: test
FQDN:
IP: 192.168.56.104
Run List: role[ha-infra]
Roles: zookeeper, ha-infra, base
Recipes: iptables, iptables::icmp, iptables::ssh, iptables::zk_replication, iptables::zk_server
Platform: debian 6.0.4
Node Name: chef-client-3
Environment: test
FQDN:
IP: 192.168.56.103
Run List: role[zookeeper]
Roles: zookeeper, base
Recipes: iptables, iptables::icmp, iptables::ssh, iptables::zk_replication, iptables::zk_server
Platform: debian 6.0.4
The last node chef-client-3 shouldn't be in result.
And the most strange part of bug: everything is working ok when I remove attribute ['failover_ip']['ha-infra'] or simply change the hashmap key 'ha-infra' to something different that the name of role.
When I use query "chef_environment:test AND role:ha-infra" everything is ok:
root@chef-server:~# knife search node "chef_environment:test AND role:ha-infra"
2 items found
Node Name: chef-client-1
Environment: test
FQDN:
IP: 192.168.56.102
Run List: role[ha-infra]
Roles: zookeeper, ha-infra, base
Recipes: iptables, iptables::icmp, iptables::ssh, iptables::zk_replication, iptables::zk_server
Platform: debian 6.0.4
Node Name: chef-client-2
Environment: test
FQDN:
IP: 192.168.56.104
Run List: role[ha-infra]
Roles: zookeeper, ha-infra, base
Recipes: iptables, iptables::icmp, iptables::ssh, iptables::zk_replication, iptables::zk_server
Platform: debian 6.0.4
But I need a functionality to search over 'roles'.
BR,
Michal Semeniuk
Do you also have a nested attribute whose name is "roles"? For instance an attribute like:
If so, this could be the cause of the extra node showing up on your search for roles.