Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network offering: set default network offering #5

Open
fprojetto opened this issue May 28, 2020 · 4 comments
Open

Network offering: set default network offering #5

fprojetto opened this issue May 28, 2020 · 4 comments
Labels
waiting waiting for feedback

Comments

@fprojetto
Copy link

Expected behaviour
It should be possible to create a CloudStack network with a default network offering when a zone uses basic networking.

Current behaviour
It fails with error: Network offering 'DefaultSharedNetworkOffering' not found

cs_network:
  name: "{{ guest_network_name }}"
  zone: "{{ zone_name }}"
  display_text: "{{ guest_network_name }}"
  network_offering: DefaultSharedNetworkOffering
  state: present

Possible solution

Modify the get_network_offering to get the default network offerings as well as the network offerings specific with the zone, merge the two sets, and final loop over the newly created set of network offerings.

Steps to reproduce

# zone
- name: Ensure the zone is created.
  cs_zone:
    name: "{{ zone_name }}"
    dns1: "{{ dns_external }}"
    internal_dns1: "{{ dns_internal }}"
    network_type: Basic
    state: present

# physical network
- name: Ensure the physical network is created.
  cs_physical_network:
    name: "{{ phy_network_name }}"
    zone: "{{ zone_name }}"
    nsps_enabled:
      - VirtualRouter
    state: present

- name: Ensure traffic type Guest is created.
  cs_traffic_type:
    physical_network: "{{ phy_network_name }}"
    zone: "{{ zone_name }}"
    traffic_type: Guest
    state: present

- name: Ensure traffic type Management is created.
  cs_traffic_type:
    physical_network: "{{ phy_network_name }}"
    zone: "{{ zone_name }}"
    traffic_type: Management
    state: present

- name: Ensure the physical network is enabled.
  cs_physical_network:
    name: "{{ phy_network_name }}"
    zone: "{{ zone_name }}"
    nsps_enabled:
      - VirtualRouter
    state: enabled

# guest network
- name: Ensure Guest Network is created.
  form3_cs_network:
    name: "{{ guest_network_name }}"
    zone: "{{ zone_name }}"
    display_text: "{{ guest_network_name }}"
    network_offering: DefaultSharedNetworkOffering
    state: present

Environment
Running the version of the module provided with ansible 2.9.6.
Running CloudStack 4.13.

@resmo
Copy link
Member

resmo commented Jun 9, 2020

Thanks for reporting this issue. Seems you already have a fix in place, may I ask you to make a PR with the fix?

@fprojetto
Copy link
Author

Sure. I need to add an integration test for it and I will make a PR.

@resmo
Copy link
Member

resmo commented Aug 10, 2020

Hi @FilippoProjetto, if you want to get this in 2.10, the fix should be made before 18th of august.

@resmo
Copy link
Member

resmo commented Aug 9, 2021

@filippoprojetto anything I can help you with?

@resmo resmo added the waiting waiting for feedback label Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting waiting for feedback
Projects
None yet
Development

No branches or pull requests

2 participants