generated from oracle-devrel/repo-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from bgraef/main
add vlan deployment
- Loading branch information
Showing
9 changed files
with
548 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
# Copyright (c) 2024 Oracle and/or its affiliates. | ||
# This software is made available to you under the terms of the Universal Permissive License (UPL), Version 1.0. | ||
# The Universal Permissive License (UPL), Version 1.0 (see COPYING or https://oss.oracle.com/licenses/upl) | ||
# See LICENSE.TXT for details. | ||
|
||
- name: Create network_security_group | ||
oracle.oci.oci_network_security_group: | ||
compartment_id: "{{ my_compartment_id }}" | ||
vcn_id: "{{ my_vcn_id }}" | ||
display_name: "Linuxvirt VLAN NSG" | ||
register: result | ||
retries: 10 | ||
delay: 30 | ||
until: result is not failed | ||
|
||
- name: Set network_security_group id | ||
ansible.builtin.set_fact: | ||
my_nsg_id: "{{ result.network_security_group.id }}" | ||
|
||
- name: Perform action add on network_security_group_security_rule | ||
oracle.oci.oci_network_security_group_security_rule_actions: | ||
network_security_group_id: "{{ my_nsg_id }}" | ||
action: add | ||
security_rules: | ||
- | ||
direction: "EGRESS" | ||
protocol: "all" | ||
destination_type: "CIDR_BLOCK" | ||
destination: "0.0.0.0/0" | ||
- | ||
direction: "INGRESS" | ||
protocol: "all" | ||
source_type: "CIDR_BLOCK" | ||
source: "10.0.0.0/16" | ||
register: result | ||
retries: 10 | ||
delay: 30 | ||
until: result is not failed | ||
|
||
- name: Create a vlan | ||
oracle.oci.oci_network_vlan: | ||
availability_domain: "{{ my_availability_domain }}" | ||
cidr_block: "{{ vlan_cidr_block }}" | ||
compartment_id: "{{ my_compartment_id }}" | ||
display_name: "Linuxvirt VLAN" | ||
# route_table_id: "{{ rt_id }}" | ||
# vlan_tag: "10" | ||
nsg_ids: | ||
- "{{ my_nsg_id }}" | ||
vcn_id: "{{ my_vcn_id }}" | ||
register: result | ||
retries: 10 | ||
delay: 30 | ||
until: result is not failed | ||
|
||
- name: Set vlan id | ||
ansible.builtin.set_fact: | ||
my_vlan_id: "{{ result.vlan.id }}" | ||
|
||
- name: Print vlan details | ||
ansible.builtin.debug: | ||
msg: "Created a new vlan {{ result }}" | ||
when: debug_enabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.