summaryrefslogtreecommitdiffstats
path: root/ansible/cpu_pin_setup.yaml
blob: 2a3fb5b3fc600273b5aae7343c6a432967cdf809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
---
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

- hosts: localhost
  roles:
    - cpu_pin_local_setup

- hosts: controller
  roles:
    - scheduler_default_filters_setup
    - restart_nova_scheduler

- hosts: compute
  roles:
    - vcpu_pin_set_setup
    - restart_nova_compute
lxml - libvirt-python - sysctl: name: net.ipv4.ip_forward state: present value: 1 sysctl_set: yes - systemd: name: dhcpd state: stopped enabled: no ignore_errors: yes - systemd: name: libvirtd state: started enabled: yes - systemd: name: openvswitch state: started enabled: yes - virt_net: command: define name: default xml: '{{ lookup("template", "virsh_network_default.xml.j2") }}' state: active autostart: yes - openvswitch_bridge: bridge: 'br-{{ item }}' state: present with_items: '{{ virsh_enabled_networks }}' - virt_net: state: present name: '{{ item }}' xml: '{{ lookup("template", "virsh_network_ovs.xml.j2") }}' with_items: '{{ virsh_enabled_networks }}' - virt_net: state: active name: '{{ item }}' autostart: yes with_items: '{{ virsh_enabled_networks }}' - virt_pool: name: default autostart: yes state: present xml: '{{ lookup("template", "virsh_pool.xml.j2") }}' - virt_pool: name: default autostart: yes state: active - lineinfile: path: /etc/modprobe.d/kvm_intel.conf line: 'options kvm-intel nested=1' create: yes when: ansible_architecture == "x86_64" - modprobe: name: "{{ item }}" state: present with_items: - kvm - kvm_intel when: ansible_architecture == "x86_64" - name: Generate SSH key for root if missing shell: test -e ~/.ssh/id_rsa || ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa - name: Check that /u/l/python3.4/site-packages/virtualbmc/vbmc.py exists stat: path: /usr/lib/python3.4/site-packages/virtualbmc/vbmc.py register: vbmc_py - name: Manually patch vmbc to work with python3.x lineinfile: line: " conn.defineXML(ET.tostring(tree, encoding='unicode'))" regexp: "tostring" path: /usr/lib/python3.4/site-packages/virtualbmc/vbmc.py when: vbmc_py.stat.exists == True - name: Add ssh retry to Ansible config ini_file: path: /etc/ansible/ansible.cfg section: ssh_connection option: retries value: 5