summaryrefslogtreecommitdiffstats
path: root/docs/testing/index.rst
blob: b795e6b8a78c678ed10a46c40cd8f0f9bf7eb70a (plain)
1
2
3
4
5
6
7
8
9
10
11
.. This work is licensed under a Creative Commons Attribution 4.0 International
.. License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) Cisco Systems, Inc

.. toctree::
   :maxdepth: 2

   developer/devguide/index
   user/configguide/index
   user/userguide/index
olor: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
---
- hosts: localhost
  tasks:
    - yum:
        name: "{{ item }}"
        state: present
      with_items:
        - python-lxml
        - libvirt-python
        - libguestfs-tools
    - 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
    - shell: cat /sys/module/kvm_intel/parameters/nested || true
      register: nested_result
      when: ansible_architecture == "x86_64"
    - name: reload kvm_intel
      block:
        - lineinfile:
            path: /etc/modprobe.d/kvm_intel.conf
            line: 'options kvm-intel nested=1'
            create: yes
        - modprobe:
            name: kvm_intel
            state: absent
        - modprobe:
            name: kvm_intel
            state: present
      when:
        - ansible_architecture == "x86_64"
        - "'Y' not in nested_result.stdout"
    - modprobe:
        name: ip6_tables
        state: present
    - modprobe:
        name: ip_tables
        state: present
    - 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