Skip to content

Commit

Permalink
fix: set network name
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobdotcosta committed Dec 12, 2023
1 parent 8ff985a commit 2009d08
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion molecule/github/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
ansible.builtin.set_fact:
openstack:
vm:
network: "{{ rhos_network_list.networks[0].name | default('') }}"
network: "{{ openstack_defaults.vm.network }}"
image: "{{ rhos_image_list.images[0].name | default(openstack_defaults.vm.image) }}"
flavor: "{{ openstack_vm_flavor }}"
openstack_security_group: "{{ rhos_security_group_list.security_groups[0].id | default('') }}"
Expand Down
2 changes: 1 addition & 1 deletion molecule/github/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ openstack_defaults:
image: Fedora-Cloud-Base-37
key_name: "{{ hostname }}"
flavor: m1.small
network: default_network
network: public
security_group: default_security_group
# Array of items with 2 attributes, name and size
# volumes: []
Expand Down
12 changes: 1 addition & 11 deletions molecule/github/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
file: defaults/main.yml
# name: role_defaults

- name: List all networks
openstack.cloud.networks_info:
auth: "{{ rhos_auth }}"
auth_type: "{{ rhos_auth_type }}"
register: rhos_network_list

- name: "Set openstack VM network fact"
ansible.builtin.set_fact:
openstack_vm_network: "{{ rhos_network_list.networks[0].name | default('') }}"

tasks:

- name: "Get VM information"
Expand Down Expand Up @@ -52,7 +42,7 @@

- name: "Collect host fixed IP v4 address"
ansible.builtin.set_fact:
openstack_vm_ipv4_address: "{{ openstack_server_info_output.servers[0].addresses[ openstack_vm_network ] | community.general.json_query(type_n_version_query) }}"
openstack_vm_ipv4_address: "{{ openstack_server_info_output.servers[0].addresses[ openstack_defaults.vm.network ] | community.general.json_query(type_n_version_query) }}"
vars:
type_n_version_query: "[?\"OS-EXT-IPS:type\" == 'fixed' && version == `4`]"

Expand Down

0 comments on commit 2009d08

Please sign in to comment.