From 21178c2d8fad2c30a1d9876eec23b052cafe9dc9 Mon Sep 17 00:00:00 2001 From: Jaganathan Palanisamy Date: Wed, 20 Nov 2019 15:37:09 +0530 Subject: [PATCH] Derive Pci passthrough whitelist disable option This change is to add the option to disable the derive pci passthrough whitelist automation logic in sriov deployments if required. Change-Id: Ib2d5b019e3064acf50c06da071d9eb77fe0d10dd Closes-Bug: #1841041 (cherry picked from commit 227c516aa2d7de60cec2cc2a77b74221b4c7bc4a) --- .../neutron-sriov-agent-container-puppet.yaml | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml index c6d5230690..e355676174 100644 --- a/deployment/neutron/neutron-sriov-agent-container-puppet.yaml +++ b/deployment/neutron/neutron-sriov-agent-container-puppet.yaml @@ -83,6 +83,21 @@ parameters: default: 5672 description: The network port for messaging backend type: number + DerivePciWhitelistEnabled: + default: true + description: Whether to enable or not the pci passthrough whitelist automation. + type: boolean + tags: + - role_specific + +conditions: + + derive_pci_whitelist_enabled: + or: + - and: + - equals: [{get_param: DerivePciWhitelistEnabled}, true] + - equals: [{get_param: [RoleParameters, DerivePciWhitelistEnabled]}, ''] + - equals: [{get_param: [RoleParameters, DerivePciWhitelistEnabled]}, true] resources: @@ -195,20 +210,24 @@ outputs: name: virt_sandbox_use_netlink persistent: yes state: yes - - name: "creating directory" - file: - state: directory - path: /var/lib/pci_passthrough_whitelist_scripts - owner: root - group: root - mode: 0750 - - name: derive pci passthrough whitelist - copy: - content: {get_file: ./derive_pci_passthrough_whitelist.py} - dest: '/var/lib/pci_passthrough_whitelist_scripts/derive_pci_passthrough_whitelist.py' - mode: 0700 - - name: run derive_pci_passthrough_whitelist.py - command: /var/lib/pci_passthrough_whitelist_scripts/derive_pci_passthrough_whitelist.py + - + if: + - derive_pci_whitelist_enabled + - - name: "creating directory" + file: + state: directory + path: /var/lib/pci_passthrough_whitelist_scripts + owner: root + group: root + mode: 0750 + - name: derive pci passthrough whitelist + copy: + content: {get_file: ./derive_pci_passthrough_whitelist.py} + dest: '/var/lib/pci_passthrough_whitelist_scripts/derive_pci_passthrough_whitelist.py' + mode: 0700 + - name: run derive_pci_passthrough_whitelist.py + command: /var/lib/pci_passthrough_whitelist_scripts/derive_pci_passthrough_whitelist.py + - [] metadata_settings: get_attr: [NeutronBase, role_data, metadata_settings] upgrade_tasks: []