Always disable libvirt default network
Currently, autostart for libvirt default network is disabled only when this network is active during nova playbook execution. It's an incorrect behavior because in some cases this network may not be active from the beginning. Autostart should be always disabled to ensure that this network will not be unexpectedly marked as active in the future(during package upgrade, host reboot etc.). Closes-Bug: #2042369 Change-Id: I697234bda1601b534ce1b6ab186fa98f83179ee8 (cherry picked from commit feb15af75b1d38fdfa2c670c55a6d0f4c95c5ad7)
This commit is contained in:
parent
280b5f9936
commit
4750a15978
@ -13,16 +13,16 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
- name: Check for libvirt default network
|
||||
shell: "virsh net-list | awk '/default/'"
|
||||
- name: Get information about libvirt default network
|
||||
command: "virsh net-info default"
|
||||
changed_when: false
|
||||
register: default_net
|
||||
failed_when: (default_net_info.rc != 0) and ('Network not found' not in default_net_info.stderr)
|
||||
register: default_net_info
|
||||
|
||||
- name: Disable libvirt default network
|
||||
command: "virsh net-autostart default --disable"
|
||||
failed_when: false
|
||||
when: default_net.stdout.find('default') != -1
|
||||
when: default_net_info.stdout | regex_search('Autostart:\s+yes')
|
||||
|
||||
- name: Destroy libvirt default network
|
||||
command: "virsh net-destroy default"
|
||||
when: default_net.stdout.find('default') != -1
|
||||
when: default_net_info.stdout | regex_search('Active:\s+yes')
|
||||
|
Loading…
x
Reference in New Issue
Block a user