Skip to content

Commit

Permalink
[ocp4_workload_nmstate] Configure ocp4_workload_nmstate to enable the…
Browse files Browse the repository at this point in the history
… creation of NNCP (#8882)

* Configure ocp4_workload_nmstate to enable the creation of NNCP

* Update main.yml
  • Loading branch information
agonzalezrh authored Dec 13, 2024
1 parent e4e73c4 commit a723098
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,8 @@ ocp4_workload_nmstate_catalog_snapshot_image: quay.io/gpte-devops-automation/olm

# Catalog snapshot image tag
ocp4_workload_nmstate_catalog_snapshot_image_tag: "v4.15_2024_05_27"

# Flag to decide if configure NodeNetworkConfigurationPolicy
ocp4_workload_nmstate_configure_nncp: false
ocp4_workload_nmstate_nncp_bridge_name: br-flat
ocp4_workload_nmstate_nncp_interface_name: enp3s0
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
state: present
definition: "{{ lookup('file', 'nmstate.yaml') }}"

- name: Configure NodeNetworkConfigurationPolicy
when: ocp4_workload_nmstate_configure_nncp | default(false)
kubernetes.core.k8s:
state: present
definition: "{{ lookup('template', 'nncp.yaml') }}"

# Leave this as the last task in the playbook.
- name: Workload tasks complete
when: not silent|bool
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: nmstate.io/v1
kind: NodeNetworkConfigurationPolicy
metadata:
name: {{ ocp4_workload_nmstate_nncp_bridge_name }}
spec:
nodeSelector:
node-role.kubernetes.io/worker: ""
desiredState:
interfaces:
- name: {{ ocp4_workload_nmstate_nncp_bridge_name }}
description: Linux bridge with {{ ocp4_workload_nmstate_nncp_interface_name }} as a port
type: linux-bridge
state: up
ipv4:
dhcp: false
enabled: false
bridge:
options:
stp:
enabled: false
port:
- name: {{ ocp4_workload_nmstate_nncp_interface_name }}

0 comments on commit a723098

Please sign in to comment.