Adopt info modules fetch to collection 2.0
With ansible-collection version 2.0 return of project_info module has changed. We need to adopt usage of module return to the new format. We also add security group rule for dhcp, since in case DHCP is enabled for the network, it won't be provided in metadata on config-drive anymore. Change-Id: I861797fdddbf2c82ef7b1409df577475e7424414
This commit is contained in:
parent
4a686acc56
commit
aeebb5bdd4
@ -86,7 +86,7 @@
|
||||
project_domain_name: "{{ octavia_service_project_domain_id }}"
|
||||
state: absent
|
||||
region_name: "{{ octavia_service_region }}"
|
||||
name: "{{ get_image_info.openstack_image.id }}"
|
||||
name: "{{ get_image_info.images[0].id }}"
|
||||
interface: admin
|
||||
verify: "{{ not keystone_service_adminuri_insecure }}"
|
||||
register: remove_old_image
|
||||
@ -94,4 +94,4 @@
|
||||
retries: 5
|
||||
delay: 10
|
||||
when:
|
||||
- get_image_info.openstack_image.id is defined
|
||||
- get_image_info.images | length > 0
|
||||
|
@ -68,7 +68,7 @@
|
||||
|
||||
- name: Set Octavia flavor UUID fact
|
||||
set_fact:
|
||||
octavia_nova_flavor_uuid: "{{ get_flavor_info.openstack_flavors[0].id }}"
|
||||
octavia_nova_flavor_uuid: "{{ get_flavor_info.flavors[0].id }}"
|
||||
|
||||
- name: Set octavia_neutron_management_network_uuid if it is not already set
|
||||
delegate_to: "{{ octavia_service_setup_host }}"
|
||||
@ -105,7 +105,7 @@
|
||||
vars:
|
||||
ansible_python_interpreter: "{{ octavia_service_setup_host_python_interpreter }}"
|
||||
when:
|
||||
- octavia_amp_image_owner_id is not defined
|
||||
- octavia_amp_image_owner_id is not defined or not octavia_amp_image_owner_id
|
||||
block:
|
||||
- name: Get octavia service project details
|
||||
openstack.cloud.project_info:
|
||||
@ -127,7 +127,7 @@
|
||||
|
||||
- name: Set Octavia amp image owner UUID fact
|
||||
set_fact:
|
||||
octavia_amp_image_owner_id: "{{ get_project_info.openstack_projects[0].id }}"
|
||||
octavia_amp_image_owner_id: "{{ get_project_info.projects[0].id }}"
|
||||
|
||||
- name: Drop octavia Config(s)
|
||||
openstack.config_template.config_template:
|
||||
|
@ -123,3 +123,28 @@
|
||||
delay: 10
|
||||
when:
|
||||
- debug | bool
|
||||
|
||||
- name: Create security group rule for dhcp
|
||||
openstack.cloud.security_group_rule:
|
||||
auth:
|
||||
auth_url: "{{ keystone_service_adminurl }}"
|
||||
username: "{{ octavia_service_user_name }}"
|
||||
password: "{{ octavia_service_password }}"
|
||||
project_name: "{{ octavia_service_project_name }}"
|
||||
user_domain_name: "{{ octavia_service_user_domain_id }}"
|
||||
project_domain_name: "{{ octavia_service_project_domain_id }}"
|
||||
state: present
|
||||
security_group: "{{ octavia_security_group_name }}"
|
||||
protocol: udp
|
||||
port_range_min: 67
|
||||
port_range_max: 67
|
||||
direction: egress
|
||||
remote_ip_prefix: "{{ octavia_security_group_rule_cidr }}"
|
||||
interface: admin
|
||||
verify: "{{ not keystone_service_adminuri_insecure }}"
|
||||
register: add_security_group_rule
|
||||
until: add_security_group_rule is success
|
||||
retries: 5
|
||||
delay: 10
|
||||
when:
|
||||
- octavia_management_net_dhcp | bool
|
||||
|
Loading…
x
Reference in New Issue
Block a user