Fix logic of discovering hosts by service
For quite some time, we relate usage of --by-service flag for nova-manage cell_v2 discover_hosts command to the used nova_virt_type. However, we run db_post_setup tasks only once and delegating to the conductor host. With latest changes to the logic, when this task in included from the playbook level it makes even less sense, since definition of nova_virt_type for conductor is weird and wrong. Instead, we attempt to detect if ironic is in use by checking hostvars of all compute nodes for that. It will include host_vars, group_vars, all sort of extra variables, etc. Thus, ironic hosts should be better discovered now with nova-manage command. Related-Bug: #2034583 Change-Id: I3deea859a4017ff96919290ba50cb375c0f960ea
This commit is contained in:
Dmitriy Rabotyagov
committed by
Dmitriy Rabotyagov
parent
32867052d7
commit
4aa65eb606
3 changed files with 11 additions and 1 deletions
@@ -22,7 +22,7 @@
- name:Perform a cell_v2 discover
command:>-
{{ _db_nova_bin }}/nova-manage cell_v2 discover_hosts{{ (debug | bool) | ternary(' --verbose', '') }}{{
(nova_virt_type == 'ironic') | ternary(' --by-service', '') }}
(nova_ironic_used | bool) | ternary(' --by-service', '') }}
become:yes
become_user:"{{ _db_nova_system_user_name }}"
changed_when:false
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.