forked from openstack/openstack-helm-infra
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Id6dc555ba91531f49ba69f7019093a8ce515158e Partial-bug: #1767470 (cherry picked from commit f817ed5)
- Loading branch information
1 parent
881f606
commit d871e5f
Showing
7 changed files
with
261 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright 2017 The Openstack-Helm Authors. | ||
# | ||
# 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. | ||
|
||
- hosts: all | ||
vars_files: | ||
- vars.yaml | ||
vars: | ||
work_dir: "{{ zuul.project.src_dir }}/{{ zuul_osh_infra_relative_path | default('') }}" | ||
gather_facts: False | ||
become: yes | ||
roles: | ||
- setup-grub | ||
tags: | ||
- setup-grub |
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,65 @@ | ||
# enable IOMMU if sriov/vfio-dpdk is enabled | ||
- name: set grub file name | ||
stat: | ||
path: "/etc/default/grub" | ||
register: file_rc | ||
|
||
- name: set SRIOV data | ||
set_fact: | ||
contrail_modify_grub: 'True' | ||
contrail_grub_cmd_line: 'nomdmonddf nomdmonisw intel_iommu=on' | ||
when: "'contrail-vrouter-sriov' in group_names" | ||
|
||
- name: set VFIO-DPDK data | ||
set_fact: | ||
contrail_modify_grub: 'True' | ||
contrail_grub_cmd_line: 'intel_iommu=on iommu=pt' | ||
when: "'contrail-vrouter-dpdk' in group_names and | ||
(DPDK_UIO_DRIVER is defined and | ||
(DPDK_UIO_DRIVER == 'vfio_pci' or DPDK_UIO_DRIVER == 'vfio-pci'))" | ||
|
||
- name: Remove the SRIOV/VFIO config if present - to fix limiation in lineinfile | ||
replace: | ||
path: "/etc/default/grub" | ||
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=\"((.*))(( {{ contrail_grub_cmd_line}}))\"' | ||
replace: 'GRUB_CMDLINE_LINUX_DEFAULT="\1"' | ||
register: contrail_grub_restored | ||
when: contrail_modify_grub is defined and file_rc.stat.exists == true | ||
|
||
- name: Modify grub to include iommu for SRIOV and VFIO-DPDK | ||
replace: | ||
path: "/etc/default/grub" | ||
regexp: '^GRUB_CMDLINE_LINUX_DEFAULT=\"((.*))(( {{ contrail_grub_cmd_line}})|(?<! {{contrail_grub_cmd_line}}))\"' | ||
replace: 'GRUB_CMDLINE_LINUX_DEFAULT="\1 {{ contrail_grub_cmd_line }}"' | ||
register: contrail_grub_modified | ||
when: contrail_modify_grub is defined and file_rc.stat.exists == true | ||
|
||
- name: Add iommu for grub for SRIOV and VFIO-DPDK | ||
lineinfile: | ||
path: "/etc/default/grub" | ||
line: 'GRUB_CMDLINE_LINUX_DEFAULT=" {{contrail_grub_cmd_line}}"' | ||
insertafter: EOF | ||
register: contrail_grub_added | ||
when: contrail_modify_grub is defined and file_rc.stat.exists == true and contrail_grub_modified.changed == false | ||
|
||
- name: execute update-grub/sys | ||
command: update-grub | ||
register: gstat | ||
when: | ||
- contrail_modify_grub is defined | ||
- file_rc.stat.exists == true | ||
- ((contrail_grub_restored.changed == false and contrail_grub_modified.changed == true) or | ||
(contrail_grub_added.changed == true)) | ||
|
||
- name: restart server | ||
shell: sleep 2 && shutdown -r now "Ansible updates triggered" | ||
async: 1 | ||
poll: 0 | ||
become: true | ||
when: (contrail_modify_grub is defined and gstat is defined and gstat.changed) | ||
|
||
- name: wait for server to come back online | ||
wait_for_connection: | ||
delay: 30 | ||
timeout: 2400 | ||
when: (contrail_modify_grub is defined and gstat is defined and gstat.changed) |
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,74 @@ | ||
# Copyright 2017 The Openstack-Helm Authors. | ||
# | ||
# 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: | ||
children: | ||
primary: | ||
hosts: | ||
node1: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.13 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
nodes: | ||
children: | ||
contrail-controller: | ||
hosts: | ||
node2: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.14 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
node3: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.15 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
node4: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.16 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
openstack-compute: | ||
children: | ||
contrial-vrouter-kernel: | ||
hosts: | ||
node5: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.17 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
contrail-vrouter-dpdk: | ||
hosts: | ||
node6: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.18 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no | ||
vars: | ||
DPDK_UIO_DRIVER: vfio-pci | ||
contrail-vrouter-sriov: | ||
hosts: | ||
node7: | ||
ansible_port: 22 | ||
ansible_host: 10.10.10.19 | ||
ansible_user: ubuntu | ||
ansible_ssh_private_key_file: /home/ubuntu/.ssh/insecure.pem | ||
ansible_ssh_extra_args: -o StrictHostKeyChecking=no |
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,65 @@ | ||
# Copyright 2017 The Openstack-Helm Authors. | ||
# | ||
# 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. | ||
|
||
version: | ||
kubernetes: v1.9.3 | ||
helm: v2.7.2 | ||
cni: v0.6.0 | ||
|
||
kubernetes: | ||
network: | ||
default_device: enp0s8 | ||
cluster: | ||
cni: calico | ||
pod_subnet: 192.168.0.0/16 | ||
domain: cluster.local | ||
docker: | ||
insecure_registries: | ||
- "10.84.5.81:5000" | ||
|
||
nodes: | ||
labels: | ||
primary: | ||
- name: openstack-helm-node-class | ||
value: primary | ||
- name: openstack-control-plane | ||
value: enabled | ||
- name: ceph-mon | ||
value: enabled | ||
- name: ceph-osd | ||
value: enabled | ||
- name: ceph-mds | ||
value: enabled | ||
- name: ceph-rgw | ||
value: enabled | ||
- name: ceph-mgr | ||
value: enabled | ||
all: | ||
- name: openstack-helm-node-class | ||
value: general | ||
contrail-controller: | ||
- name: opencontrail.org/controller | ||
value: enabled | ||
openstack-compute: | ||
- name: openstack-compute-node | ||
value: enabled | ||
contrial-vrouter-kernel: | ||
- name: opencontrail.org/vrouter-kernel | ||
value: enabled | ||
contrail-vrouter-dpdk: | ||
- name: opencontrail.org/vrouter-dpdk | ||
value: enabled | ||
contrail-vrouter-sriov: | ||
- name: vrouter-sriov | ||
value: 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