summaryrefslogtreecommitdiffstats
path: root/xci
diff options
context:
space:
mode:
Diffstat (limited to 'xci')
-rw-r--r--xci/README.rst23
-rw-r--r--xci/Vagrantfile50
-rwxr-xr-xxci/config/pinned-versions4
-rw-r--r--xci/playbooks/configure-opnfvhost.yml3
-rw-r--r--xci/playbooks/configure-targethosts.yml6
-rw-r--r--xci/playbooks/roles/configure-network/tasks/main.yml6
-rw-r--r--xci/playbooks/roles/configure-network/templates/debian/compute00.interface.j2 (renamed from xci/template/compute.interface.j2)2
-rw-r--r--xci/playbooks/roles/configure-network/templates/debian/controller00.interface.j2 (renamed from xci/template/controller.interface.j2)2
-rw-r--r--xci/playbooks/roles/configure-network/templates/debian/opnfv.interface.j2 (renamed from xci/template/opnfv.interface.j2)2
-rw-r--r--xci/playbooks/roles/configure-nfs/tasks/main.yml74
-rw-r--r--xci/playbooks/roles/configure-nfs/vars/debian.yml11
11 files changed, 139 insertions, 44 deletions
diff --git a/xci/README.rst b/xci/README.rst
index 4df2aaef..462fffd1 100644
--- a/xci/README.rst
+++ b/xci/README.rst
@@ -186,13 +186,17 @@ Once a working version is identified, the versions of the upstream components
are then bumped in releng-xci repo.
==================
-XCI developer tips
+XCI Developer Tips
==================
+XCI Development Mode
+--------------------
+
It is possible to run XCI in development mode, in order to test the
latest changes. When deploying on this mode, the script will use the working
directories for releng-xci/bifrost/OSA, instead of cloning the whole repositories
on each run.
+
To enable it, you need to export the different DEV_PATH vars:
- export OPNFV_RELENG_DEV_PATH=/opt/releng-xci/
@@ -204,6 +208,23 @@ Please note the trailing slahses.
This will cause the deployment to pick the development copies stored at the
specified directories, and use them instead of cloning those on every run.
+Using a Different Version of OSA
+--------------------------------
+
+XCI pins OSA version based on upstream OSA CI & OPNFV XCI tests in order to have
+well tested/working versions for the developers, users, and more extensive CI loops,
+such as daily and weekly.
+
+If you change the OSA version by setting environment variables OPENSTACK_OSA_VERSION or
+manually in pinned-versions file, then it's likely to face incompatibilities with the
+dependent roles in ansible-role-requirements.yml file.
+
+If you run into this situation, then your best bet is to replace the XCI
+ansible-role-requirements.yml file with the upstream one from
+http://git.openstack.org/cgit/openstack/openstack-ansible/plain/ansible-role-requirements.yml.
+You also need to set OPNFV_RELENG_DEV_PATH as explained above in order for this file to be
+used throughout the deployment.
+
===========================================
Limitations, Known Issues, and Improvements
===========================================
diff --git a/xci/Vagrantfile b/xci/Vagrantfile
index cdcd705a..d58ed62e 100644
--- a/xci/Vagrantfile
+++ b/xci/Vagrantfile
@@ -87,4 +87,54 @@ Vagrant.configure(2) do |config|
}
end
end
+
+ config.vm.define "opensuse422" do |leap422|
+ leap422.disksize.size = disk_size
+ leap422.vm.box = "opensuse/openSUSE-42.2-x86_64"
+ leap422.vm.provision "shell" do |s|
+ # NOTE(hwoarang) The parted version in Leap 42.2 can't do an online
+ # partition resize so we must create a new one and attach it to the
+ # btrfs filesystem.
+ s.privileged = true,
+ s.inline = <<-SHELL
+ cd /vagrant
+ echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
+ PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
+ resizepart /dev/sda 2 $PART_END
+ btrfs fi resize max /
+ export XCI_FLAVOR=${XCI_FLAVOR:-mini}
+ export VM_CPU=${VM_CPU:-2}
+ export VM_DISK=${VM_DISK:-40}
+ export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
+ export VM_DOMAIN_TYPE=qemu
+ [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
+ ./xci-deploy.sh
+ SHELL
+ end
+ end
+
+ config.vm.define "opensuse423" do |leap423|
+ leap423.disksize.size = disk_size
+ leap423.vm.box = "opensuse/openSUSE-42.3-x86_64"
+ leap423.vm.provision "shell" do |s|
+ # NOTE(hwoarang) The parted version in Leap 42.3 can't do an online
+ # partition resize so we must create a new one and attach it to the
+ # btrfs filesystem.
+ s.privileged = true,
+ s.inline = <<-SHELL
+ cd /vagrant
+ echo -e 'd\n2\nn\np\n\n\n\nn\nw' | fdisk /dev/sda
+ PART_END=$(fdisk -l /dev/sda | grep ^/dev/sda2 | awk '{print $4}')
+ resizepart /dev/sda 2 $PART_END
+ btrfs fi resize max /
+ export XCI_FLAVOR=${XCI_FLAVOR:-mini}
+ export VM_CPU=${VM_CPU:-2}
+ export VM_DISK=${VM_DISK:-40}
+ export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-2048}
+ export VM_DOMAIN_TYPE=qemu
+ [[ ! -e ${HOME}/.ssh/id_rsa ]] && ssh-keygen -q -P '' -f ${HOME}/.ssh/id_rsa
+ ./xci-deploy.sh
+ SHELL
+ end
+ end
end
diff --git a/xci/config/pinned-versions b/xci/config/pinned-versions
index e1c110c6..c4e30d94 100755
--- a/xci/config/pinned-versions
+++ b/xci/config/pinned-versions
@@ -6,6 +6,10 @@
# not work as expected. You can set the versions you want to use before running
# the main script on your shell as shown on the examples below.
#
+# If you intend to change OPENSTACK_OSA_VERSION, please ensure you update the
+# OSA ansible role versions as well. Take a look at README.rst file to see how
+# this can be done.
+#
# It is important to be consistent between branches you use for OpenStack
# projects OPNFV XCI uses.
#
diff --git a/xci/playbooks/configure-opnfvhost.yml b/xci/playbooks/configure-opnfvhost.yml
index 53e34418..7bc434d7 100644
--- a/xci/playbooks/configure-opnfvhost.yml
+++ b/xci/playbooks/configure-opnfvhost.yml
@@ -48,8 +48,7 @@
- ../var/flavor-vars.yml
- ../var/opnfv.yml
roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, when: ansible_distribution_release == "xenial", src: "../template/opnfv.interface.j2", dest: "/etc/network/interfaces" }
+ - role: configure-network
tasks:
- name: generate SSH keys
shell: ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N ""
diff --git a/xci/playbooks/configure-targethosts.yml b/xci/playbooks/configure-targethosts.yml
index 50da1f22..88da1312 100644
--- a/xci/playbooks/configure-targethosts.yml
+++ b/xci/playbooks/configure-targethosts.yml
@@ -13,8 +13,7 @@
- ../var/{{ ansible_os_family }}.yml
- ../var/flavor-vars.yml
roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" }
+ - role: configure-network
# we need to force sync time with ntp or the nodes will be out of sync timewise
- role: synchronize-time
@@ -24,8 +23,7 @@
- ../var/{{ ansible_os_family }}.yml
- ../var/flavor-vars.yml
roles:
- # TODO: this only works for ubuntu/xenial and need to be adjusted for other distros
- - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" }
+ - role: configure-network
# we need to force sync time with ntp or the nodes will be out of sync timewise
- role: synchronize-time
diff --git a/xci/playbooks/roles/configure-network/tasks/main.yml b/xci/playbooks/roles/configure-network/tasks/main.yml
index aafadf71..df1580e5 100644
--- a/xci/playbooks/roles/configure-network/tasks/main.yml
+++ b/xci/playbooks/roles/configure-network/tasks/main.yml
@@ -27,8 +27,8 @@
shell: "/bin/rm -rf /etc/network/interfaces.d/*"
- name: ensure interfaces file is updated
template:
- src: "{{ src }}"
- dest: "{{ dest }}"
+ src: "{{ ansible_os_family | lower }}/{{ ansible_hostname }}.interface.j2"
+ dest: "/etc/network/interfaces"
- name: restart network service
shell: "/sbin/ifconfig {{ interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a"
- when: ansible_distribution_release == "xenial"
+ when: ansible_os_family | lower == "debian"
diff --git a/xci/template/compute.interface.j2 b/xci/playbooks/roles/configure-network/templates/debian/compute00.interface.j2
index 094544c3..6d6a3835 100644
--- a/xci/template/compute.interface.j2
+++ b/xci/playbooks/roles/configure-network/templates/debian/compute00.interface.j2
@@ -1,3 +1,5 @@
+# {{ ansible_managed }}
+
# The loopback network interface
auto lo
iface lo inet loopback
diff --git a/xci/template/controller.interface.j2 b/xci/playbooks/roles/configure-network/templates/debian/controller00.interface.j2
index 638e78e1..5d42a5d2 100644
--- a/xci/template/controller.interface.j2
+++ b/xci/playbooks/roles/configure-network/templates/debian/controller00.interface.j2
@@ -1,3 +1,5 @@
+# {{ ansible_managed }}
+
# The loopback network interface
auto lo
iface lo inet loopback
diff --git a/xci/template/opnfv.interface.j2 b/xci/playbooks/roles/configure-network/templates/debian/opnfv.interface.j2
index e9f8649c..42826414 100644
--- a/xci/template/opnfv.interface.j2
+++ b/xci/playbooks/roles/configure-network/templates/debian/opnfv.interface.j2
@@ -1,3 +1,5 @@
+# {{ ansible_managed }}
+
# The loopback network interface
auto lo
iface lo inet loopback
diff --git a/xci/playbooks/roles/configure-nfs/tasks/main.yml b/xci/playbooks/roles/configure-nfs/tasks/main.yml
index c52da0bf..51a2d43a 100644
--- a/xci/playbooks/roles/configure-nfs/tasks/main.yml
+++ b/xci/playbooks/roles/configure-nfs/tasks/main.yml
@@ -7,37 +7,43 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
-# TODO: this is for xenial and needs to be adjusted for different distros
-- block:
- - name: make NFS directories
- file:
- dest: "{{ item }}"
- mode: 0777
- state: directory
- with_items:
- - "/images"
- - "/volumes"
- - name: configure NFS service
- lineinfile:
- dest: /etc/services
- state: present
- create: yes
- line: "{{ item }}"
- with_items:
- - "nfs 2049/tcp"
- - "nfs 2049/udp"
- - name: configure NFS exports
- lineinfile:
- dest: /etc/exports
- state: present
- create: yes
- line: "{{ item }}"
- with_items:
- - "/images *(rw,sync,no_subtree_check,no_root_squash)"
- - "/volumes *(rw,sync,no_subtree_check,no_root_squash)"
- # TODO: the service name might be different on other distros and needs to be adjusted
- - name: restart ubuntu xenial NFS service
- service:
- name: nfs-kernel-server
- state: restarted
- when: ansible_distribution_release == "xenial"
+
+- name: Gather variables for each operating system
+ include_vars: "{{ item }}"
+ with_first_found:
+ - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
+ - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
+ - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
+ - "{{ ansible_distribution | lower }}.yml"
+ - "{{ ansible_os_family | lower }}.yml"
+- name: make NFS directories
+ file:
+ dest: "{{ item }}"
+ mode: 0777
+ state: directory
+ with_items:
+ - "/images"
+ - "/volumes"
+- name: configure NFS service
+ lineinfile:
+ dest: /etc/services
+ state: present
+ create: yes
+ line: "nfs 2049/{{ item }}"
+ regexp: "^[[:space:]]*nfs[[:space:]]*2049/{{ item }}"
+ with_items:
+ - "tcp"
+ - "udp"
+- name: configure NFS exports
+ lineinfile:
+ dest: /etc/exports
+ state: present
+ create: yes
+ line: "{{ item }}"
+ with_items:
+ - "/images *(rw,sync,no_subtree_check,no_root_squash)"
+ - "/volumes *(rw,sync,no_subtree_check,no_root_squash)"
+- name: restart ubuntu xenial NFS service
+ service:
+ name: "{{ nfs_server_service }}"
+ state: restarted
diff --git a/xci/playbooks/roles/configure-nfs/vars/debian.yml b/xci/playbooks/roles/configure-nfs/vars/debian.yml
new file mode 100644
index 00000000..8d3c6561
--- /dev/null
+++ b/xci/playbooks/roles/configure-nfs/vars/debian.yml
@@ -0,0 +1,11 @@
+---
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2017 Ericsson AB 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
+##############################################################################
+
+nfs_server_service: "nfs-kernel-server"