Skip to content

Commit

Permalink
Merge pull request #316 from slawqo/neutron-sriov-agent
Browse files Browse the repository at this point in the history
Add edpm role to deploy Neutron SRIOV agent
  • Loading branch information
openshift-merge-robot committed Sep 16, 2023
2 parents c50da82 + 3deb095 commit 99661ed
Show file tree
Hide file tree
Showing 23 changed files with 623 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/molecule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- edpm_container_standalone
- edpm_logrotate_crond
- edpm_network_config
- edpm_neutron_sriov
- edpm_nftables
- edpm_nodes_validation
- edpm_nova_compute
Expand Down
11 changes: 11 additions & 0 deletions playbooks/neutron_sriov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Deploy EDPM Neutron SR-IOV agent
hosts: all
strategy: linear
become: true
tasks:
- name: Neutron SR-IOV agent
import_role:
name: osp.edpm.edpm_neutron_sriov
tags:
- edpm_neutron_sriov
8 changes: 8 additions & 0 deletions roles/edpm_neutron_sriov/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See the OWNERS docs at https://go.k8s.io/owners
approvers:
- slawqo
- network-approvers

reviewers:
- slawqo
- network-approvers
71 changes: 71 additions & 0 deletions roles/edpm_neutron_sriov/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


# All variables intended for modification should be placed in this file.

# All variables within this role should have a prefix of "edpm_neutron_sriov_agent"
edpm_neutron_sriov_agent_config_dir: "/var/lib/config-data/ansible-generated/neutron-sriov-agent"
edpm_neutron_sriov_image: "quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified"

edpm_neutron_sriov_common_volumes:
- /lib/modules:/lib/modules:ro
- /dev:/dev
- "{{ edpm_neutron_sriov_agent_config_dir }}:/etc/neutron:z"
- /var/lib/neutron:/var/lib/neutron:shared,z
- /var/lib/kolla/config_files/neutron_sriov_agent.json:/var/lib/kolla/config_files/config.json:ro
- /var/log/containers/neutron:/var/log/neutron:z

# neutron.conf
# DEFAULT
edpm_neutron_sriov_DEFAULT_debug: false
edpm_neutron_sriov_DEFAULT_rpc_response_timeout: 60
edpm_neutron_sriov_DEFAULT_transport_url: ''
edpm_neutron_sriov_DEFAULT_host: '{{ ansible_facts["nodename"] }}'
# oslo_concurrency
edpm_neutron_sriov_oslo_concurrency_lock_patch: '$state_path/lock'
# oslo_messaging_rabbit
edpm_neutron_sriov_oslo_messaging_rabbit_heartbeat_timeout_threshold: 60
# oslo_middleware
edpm_neutron_sriov_oslo_middleware_enable_proxy_headers_parsing: 60

# rootwrap.conf
# DEFAULT
edpm_neutron_sriov_rootwrap_DEFAULT_filters_path: '/etc/neutron/rootwrap.d,/usr/share/neutron/rootwrap'
edpm_neutron_sriov_rootwrap_DEFAULT_exec_dirs: '/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin,/etc/neutron/kill_scripts'
edpm_neutron_sriov_rootwrap_DEFAULT_use_syslog: 'False'
edpm_neutron_sriov_rootwrap_DEFAULT_syslog_log_facility: 'syslog'
edpm_neutron_sriov_rootwrap_DEFAULT_syslog_log_level: 'ERROR'
edpm_neutron_sriov_rootwrap_DEFAULT_daemon_timeout: 600
edpm_neutron_sriov_rootwrap_DEFAULT_rlimit_nofile: 1024

# neutron-sriov-agent.ini
# DEFAULT
edpm_neutron_sriov_agent_DEFAULT_state_path: '/var/lib/neutron'
# AGENT
edpm_neutron_sriov_agent_AGENT_root_helper: 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf'
edpm_neutron_sriov_agent_AGENT_report_interval: 300
edpm_neutron_sriov_agent_AGENT_extensions: 'qos'
edpm_neutron_sriov_agent_AGENT_polling_interval: 2
# SRIOV_NIC
edpm_neutron_sriov_agent_SRIOV_NIC_physical_device_mappings: ''
edpm_neutron_sriov_agent_SRIOV_NIC_exclude_devices: ''
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_bandwidths: ''
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_hypervisors: ''
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_default_hypervisor: ''
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_inventory_defaults: 'allocation_ratio:1.0,min_unit:1,step_size:1,reserved:0'
# SRIOV_DRIVER
edpm_neutron_sriov_agent_SRIOV_DRIVER_vnic_type_prohibit_list: ''
Empty file.
22 changes: 22 additions & 0 deletions roles/edpm_neutron_sriov/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: restart neutron-sriov-agent container
become: true
ansible.builtin.systemd:
state: restarted
name: "edpm_neutron_sriov_agent.service"
listen: "restart neutron-sriov-agent"
126 changes: 126 additions & 0 deletions roles/edpm_neutron_sriov/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
argument_specs:
# ./roles/edpm_neutron_sriov/tasks/main.yml entry point
main:
short_description: The main entry point for the edpm_neutron_sriov role.
options:
edpm_neutron_sriov_agent_config_dir:
default: "/var/lib/config-data/ansible-generated/neutron-sriov-agent"
description: |
The path to the directory containing Neutron SRIOV NIC agent config
files.
type: str
edpm_neutron_sriov_image:
default: "quay.io/podified-antelope-centos9/openstack-neutron-sriov-agent:current-podified"
description: Neutron SRIOV NIC agent container image.
type: str
edpm_neutron_sriov_common_volumes:
default:
- /lib/modules:/lib/modules:ro
- /dev:/dev
- "{{ edpm_neutron_sriov_agent_config_dir }}:/etc/neutron:z"
- /var/lib/neutron:/var/lib/neutron:shared,z
- /var/lib/kolla/config_files/neutron_sriov_agent.json:/var/lib/kolla/config_files/config.json:ro
- /var/log/containers/neutron:/var/log/neutron:z
description: List of volumes in a mount point form.
type: list
edpm_neutron_sriov_DEFAULT_debug:
default: false
description: "Enable or disable DEBUG mode in the Neutron agent"
type: bool
edpm_neutron_sriov_DEFAULT_rpc_response_timeout:
default: 60
description: ''
type: int
edpm_neutron_sriov_DEFAULT_transport_url:
default: ''
description: ''
type: str
edpm_neutron_sriov_DEFAULT_host:
default: '{{ ansible_facts["nodename"] }}'
description: ''
type: str
edpm_neutron_sriov_oslo_concurrency_lock_patch:
default: '$state_path/lock'
description: ''
type: str
edpm_neutron_sriov_oslo_messaging_rabbit_heartbeat_timeout_threshold:
default: 60
description: ''
type: int
edpm_neutron_sriov_oslo_middleware_enable_proxy_headers_parsing:
default: 60
description: ''
type: int
edpm_neutron_sriov_rootwrap_DEFAULT_filters_path:
default: '/etc/neutron/rootwrap.d,/usr/share/neutron/rootwrap'
edpm_neutron_sriov_rootwrap_DEFAULT_exec_dirs:
default: '/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin,/etc/neutron/kill_scripts'
edpm_neutron_sriov_rootwrap_DEFAULT_use_syslog:
default: false
description: ''
type: bool
edpm_neutron_sriov_rootwrap_DEFAULT_syslog_log_facility:
default: 'syslog'
description: ''
type: str
edpm_neutron_sriov_rootwrap_DEFAULT_syslog_log_level:
default: 'ERROR'
description: ''
type: str
edpm_neutron_sriov_rootwrap_DEFAULT_daemon_timeout:
default: 600
description: ''
type: int
edpm_neutron_sriov_rootwrap_DEFAULT_rlimit_nofile:
default: 1024
description: ''
type: int
edpm_neutron_sriov_agent_DEFAULT_state_path:
default: '/var/lib/neutron'
description: ''
type: str
edpm_neutron_sriov_agent_AGENT_root_helper:
default: 'sudo neutron-rootwrap /etc/neutron/rootwrap.conf'
description: ''
type: str
edpm_neutron_sriov_agent_AGENT_report_interval:
default: 300
description: ''
type: int
edpm_neutron_sriov_agent_AGENT_extensions:
default: 'qos'
description: ''
type: str
edpm_neutron_sriov_agent_AGENT_polling_interval:
default: 2
description: ''
type: int
edpm_neutron_sriov_agent_SRIOV_NIC_physical_device_mappings:
default: ''
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_NIC_exclude_devices:
default: ''
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_bandwidths:
default: ''
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_hypervisors:
default: ''
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_default_hypervisor:
default: ''
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_NIC_resource_provider_inventory_defaults:
default: 'allocation_ratio:1.0,min_unit:1,step_size:1,reserved:0'
description: ''
type: str
edpm_neutron_sriov_agent_SRIOV_DRIVER_vnic_type_prohibit_list:
default: ''
description: ''
type: str
43 changes: 43 additions & 0 deletions roles/edpm_neutron_sriov/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.


galaxy_info:
author: OpenStack
description: EDPM OpenStack Role -- edpm_neutron_sriov
company: Red Hat
license: Apache-2.0
min_ansible_version: '2.14'
namespace: openstack
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: 'EL'
versions:
- '8'
- '9'

galaxy_tags:
- edpm


# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []
3 changes: 3 additions & 0 deletions roles/edpm_neutron_sriov/molecule/default/collections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
collections:
- name: community.general
22 changes: 22 additions & 0 deletions roles/edpm_neutron_sriov/molecule/default/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

- name: Converge
hosts: all
roles:
- role: "edpm_neutron_sriov"
vars:
edpm_neutron_sriov_DEFAULT_transport_url: "fake:/"
31 changes: 31 additions & 0 deletions roles/edpm_neutron_sriov/molecule/default/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
dependency:
name: galaxy
options:
role-file: collections.yml
driver:
name: podman
platforms:
- command: /sbin/init
dockerfile: ../../../../molecule/common/Containerfile.j2
image: ${EDPM_ANSIBLE_MOLECULE_IMAGE:-"ubi9/ubi-init"}
name: fake-sriov-compute-1
privileged: true
registry:
url: ${EDPM_ANSIBLE_MOLECULE_REGISTRY:-"registry.access.redhat.com"}
ulimits:
- host
provisioner:
log: true
name: ansible
scenario:
test_sequence:
- dependency
- destroy
- create
- prepare
- converge
- verify
- destroy
verifier:
name: ansible
22 changes: 22 additions & 0 deletions roles/edpm_neutron_sriov/molecule/default/prepare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# Copyright 2023 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
- name: Prepare test_deps
hosts: all
roles:
- role: ../../../../molecule/common/test_deps
test_deps_extra_packages:
- iproute
- podman
Loading

0 comments on commit 99661ed

Please sign in to comment.