You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cobbler inventory script should ignore hosts with dns_name is None, not just dns_name == '' #24546
ansible 2.3.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
CONFIGURATION
No changes to ansible.cfg
OS / ENVIRONMENT
N/A
SUMMARY
The Cobbler inventory script discards hosts that have the empty string for a DNS name, but not those that fail to set the dns_name variable at all (ie. leave it as None).
STEPS TO REPRODUCE
Create a system in cobbler with a single static interface and no DNS name.
sudo cobbler system add --name=test --profile=centos7-x86_64 --interface=eth0 --static=1
Which causes Ansible to fail when it tries to load the inventory:
Traceback (most recent call last):
File "env/bin/ansible-playbook", line 109, in <module>
exit_code = cli.run()
File "env/lib/python2.7/site-packages/ansible/cli/playbook.py", line 128, in run
inventory = Inventory(loader=loader, variable_manager=variable_manager, host_list=self.options.inventory)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 98, in __init__
self.parse_inventory(host_list)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 175, in parse_inventory
for host in self.get_hosts(ignore_limits=True, ignore_restrictions=True):
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 247, in get_hosts
hosts = self._evaluate_patterns(patterns)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 345, in _evaluate_patterns
that = self._match_one_pattern(p)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 398, in _match_one_pattern
hosts = self._enumerate_matches(expr)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 489, in _enumerate_matches
matching_hosts = self._match_list(group.get_hosts(), 'name', pattern)
File "env/lib/python2.7/site-packages/ansible/inventory/__init__.py", line 220, in _match_list
if pattern.match(getattr(item, item_attr)):
TypeError: expected string or buffer
changed the title [-]Cobbler inventory script should ignore hosts with dns_name == None, not just == ''[/-][+]Cobbler inventory script should ignore hosts with dns_name is None, not just == ''[/+]on May 12, 2017
changed the title [-]Cobbler inventory script should ignore hosts with dns_name is None, not just == ''[/-][+]Cobbler inventory script should ignore hosts with `dns_name is None`, not just `dns_name == ''`[/+]on May 12, 2017
Activity
[-]Cobbler inventory script should ignore hosts with dns_name == None, not just == ''[/-][+]Cobbler inventory script should ignore hosts with dns_name is None, not just == ''[/+][-]Cobbler inventory script should ignore hosts with dns_name is None, not just == ''[/-][+]Cobbler inventory script should ignore hosts with `dns_name is None`, not just `dns_name == ''`[/+]Fix ansible#24546
movermeyer commentedon May 12, 2017
P.S: Can I ask why it is ignoring static interfaces anyway?
It seems to me that static interfaces could be assigned DNS names.
Fix #24546 (#24562)
Fix ansible#24546 (ansible#24562)