diff options
Diffstat (limited to 'prototypes/xci')
21 files changed, 288 insertions, 216 deletions
diff --git a/prototypes/xci/file/exports b/prototypes/xci/file/exports deleted file mode 100644 index af64d618d..000000000 --- a/prototypes/xci/file/exports +++ /dev/null @@ -1,14 +0,0 @@ -# /etc/exports: the access control list for filesystems which may be exported -# to NFS clients. See exports(5). -# -# Example for NFSv2 and NFSv3: -# /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) -# -# Example for NFSv4: -# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) -# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) -# -# glance images are stored on compute host and made available to image hosts via nfs -# see image_hosts section in openstack_user_config.yml for details -/images *(rw,sync,no_subtree_check,no_root_squash) - diff --git a/prototypes/xci/file/ha/flavor-vars.yml b/prototypes/xci/file/ha/flavor-vars.yml index 3cd1d6246..167502c95 100644 --- a/prototypes/xci/file/ha/flavor-vars.yml +++ b/prototypes/xci/file/ha/flavor-vars.yml @@ -1,37 +1,39 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'controller01': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', + 'MGMT_IP': '172.29.236.12', + 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, 'controller02': { - 'MGMT_IP': '172.29.236.13', 'VLAN_IP': '192.168.122.5', + 'MGMT_IP': '172.29.236.13', + 'VXLAN_IP': '172.29.240.13', 'STORAGE_IP': '172.29.244.13' }, 'compute00': { - 'MGMT_IP': '172.29.236.14', 'VLAN_IP': '192.168.122.6', - 'STORAGE_IP': '172.29.244.14', - 'VLAN_IP_SECOND': '173.29.241.1', - 'VXLAN_IP': '172.29.240.14' + 'MGMT_IP': '172.29.236.14', + 'VXLAN_IP': '172.29.240.14', + 'STORAGE_IP': '172.29.244.14' }, 'compute01': { - 'MGMT_IP': '172.29.236.15', 'VLAN_IP': '192.168.122.7', - 'STORAGE_IP': '172.29.244.15', - 'VLAN_IP_SECOND': '173.29.241.2', - 'VXLAN_IP': '172.29.240.15' + 'MGMT_IP': '172.29.236.15', + 'VXLAN_IP': '172.29.240.15', + 'STORAGE_IP': '172.29.244.15' } } diff --git a/prototypes/xci/file/ha/openstack_user_config.yml b/prototypes/xci/file/ha/openstack_user_config.yml index 0c43702cb..09fb734c1 100644 --- a/prototypes/xci/file/ha/openstack_user_config.yml +++ b/prototypes/xci/file/ha/openstack_user_config.yml @@ -138,7 +138,7 @@ image_hosts: container_vars: limit_container_types: glance glance_nfs_client: - - server: "172.29.244.15" + - server: "172.29.244.14" remote_path: "/images" local_path: "/var/lib/glance/images" type: "nfs" @@ -148,7 +148,7 @@ image_hosts: container_vars: limit_container_types: glance glance_nfs_client: - - server: "172.29.244.15" + - server: "172.29.244.14" remote_path: "/images" local_path: "/var/lib/glance/images" type: "nfs" @@ -158,7 +158,7 @@ image_hosts: container_vars: limit_container_types: glance glance_nfs_client: - - server: "172.29.244.15" + - server: "172.29.244.14" remote_path: "/images" local_path: "/var/lib/glance/images" type: "nfs" @@ -218,28 +218,37 @@ storage_hosts: container_vars: cinder_backends: limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "172.29.244.11" + nfs_volume: + volume_backend_name: NFS_VOLUME1 + volume_driver: cinder.volume.drivers.nfs.NfsDriver + nfs_mount_options: "rsize=65535,wsize=65535,timeo=1200,actimeo=120" + nfs_shares_config: /etc/cinder/nfs_shares + shares: + - ip: "172.29.244.14" + share: "/volumes" controller01: ip: 172.29.236.12 container_vars: cinder_backends: limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "172.29.244.12" + nfs_volume: + volume_backend_name: NFS_VOLUME1 + volume_driver: cinder.volume.drivers.nfs.NfsDriver + nfs_mount_options: "rsize=65535,wsize=65535,timeo=1200,actimeo=120" + nfs_shares_config: /etc/cinder/nfs_shares + shares: + - ip: "172.29.244.14" + share: "/volumes" controller02: ip: 172.29.236.13 container_vars: cinder_backends: limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "172.29.244.13" + nfs_volume: + volume_backend_name: NFS_VOLUME1 + volume_driver: cinder.volume.drivers.nfs.NfsDriver + nfs_mount_options: "rsize=65535,wsize=65535,timeo=1200,actimeo=120" + nfs_shares_config: /etc/cinder/nfs_shares + shares: + - ip: "172.29.244.14" + share: "/volumes" diff --git a/prototypes/xci/file/install-ansible.sh b/prototypes/xci/file/install-ansible.sh new file mode 100644 index 000000000..daa7f516d --- /dev/null +++ b/prototypes/xci/file/install-ansible.sh @@ -0,0 +1,136 @@ +#!/bin/bash +# NOTE(hwoarang): Most parts of this this file were taken from the +# bifrost repository (scripts/install-deps.sh). This script contains all +# the necessary distro specific code to install ansible and it's dependencies. + +set -eu + +declare -A PKG_MAP + +CHECK_CMD_PKGS=( + libffi + libopenssl + net-tools + python-devel +) + +# Check zypper before apt-get in case zypper-aptitude +# is installed +if [ -x '/usr/bin/zypper' ]; then + OS_FAMILY="Suse" + INSTALLER_CMD="sudo -H -E zypper install -y" + CHECK_CMD="zypper search --match-exact --installed" + PKG_MAP=( + [gcc]=gcc + [git]=git + [libffi]=libffi-devel + [libopenssl]=libopenssl-devel + [net-tools]=net-tools + [python]=python + [python-devel]=python-devel + [venv]=python-virtualenv + [wget]=wget + ) + EXTRA_PKG_DEPS=( python-xml ) + # NOTE (cinerama): we can't install python without removing this package + # if it exists + if $(${CHECK_CMD} patterns-openSUSE-minimal_base-conflicts &> /dev/null); then + sudo -H zypper remove -y patterns-openSUSE-minimal_base-conflicts + fi +elif [ -x '/usr/bin/apt-get' ]; then + OS_FAMILY="Debian" + INSTALLER_CMD="sudo -H -E apt-get -y install" + CHECK_CMD="dpkg -l" + PKG_MAP=( [gcc]=gcc + [git]=git + [libffi]=libffi-dev + [libopenssl]=libssl-dev + [net-tools]=net-tools + [python]=python-minimal + [python-devel]=libpython-dev + [venv]=python-virtualenv + [wget]=wget + ) + EXTRA_PKG_DEPS=() +elif [ -x '/usr/bin/dnf' ] || [ -x '/usr/bin/yum' ]; then + OS_FAMILY="RedHat" + PKG_MANAGER=$(which dnf || which yum) + INSTALLER_CMD="sudo -H -E ${PKG_MANAGER} -y install" + CHECK_CMD="rpm -q" + PKG_MAP=( + [gcc]=gcc + [git]=git + [libffi]=libffi-devel + [libopenssl]=openssl-devel + [net-tools]=net-tools + [python]=python + [python-devel]=python-devel + [venv]=python-virtualenv + [wget]=wget + ) + EXTRA_PKG_DEPS=() +else + echo "ERROR: Supported package manager not found. Supported: apt,yum,zypper" +fi + +if ! $(python --version &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[python]} +fi +if ! $(gcc -v &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[gcc]} +fi +if ! $(git --version &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[git]} +fi +if ! $(wget --version &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[wget]} +fi + +for pkg in ${CHECK_CMD_PKGS[@]}; do + if ! $(${CHECK_CMD} ${PKG_MAP[$pkg]} &>/dev/null); then + ${INSTALLER_CMD} ${PKG_MAP[$pkg]} + fi +done + +if [ -n "${EXTRA_PKG_DEPS-}" ]; then + for pkg in ${EXTRA_PKG_DEPS}; do + if ! $(${CHECK_CMD} ${pkg} &>/dev/null); then + ${INSTALLER_CMD} ${pkg} + fi + done +fi + +# If we're using a venv, we need to work around sudo not +# keeping the path even with -E. +PYTHON=$(which python) + +# To install python packages, we need pip. +# +# We can't use the apt packaged version of pip since +# older versions of pip are incompatible with +# requests, one of our indirect dependencies (bug 1459947). +# +# Note(cinerama): We use pip to install an updated pip plus our +# other python requirements. pip breakages can seriously impact us, +# so we've chosen to install/upgrade pip here rather than in +# requirements (which are synced automatically from the global ones) +# so we can quickly and easily adjust version parameters. +# See bug 1536627. +# +# Note(cinerama): If pip is linked to pip3, the rest of the install +# won't work. Remove the alternatives. This is due to ansible's +# python 2.x requirement. +if [[ $(readlink -f /etc/alternatives/pip) =~ "pip3" ]]; then + sudo -H update-alternatives --remove pip $(readlink -f /etc/alternatives/pip) +fi + +if ! which pip; then + wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py + sudo -H -E ${PYTHON} /tmp/get-pip.py +fi + +PIP=$(which pip) + +sudo -H -E ${PIP} install "pip>6.0" + +pip install ansible==$XCI_ANSIBLE_PIP_VERSION diff --git a/prototypes/xci/file/mini/configure-targethosts.yml b/prototypes/xci/file/mini/configure-targethosts.yml deleted file mode 100644 index 395f44a64..000000000 --- a/prototypes/xci/file/mini/configure-targethosts.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- hosts: all - remote_user: root - tasks: - - name: add public key to host - copy: - src: ../file/authorized_keys - dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - -- hosts: controller - remote_user: root - vars_files: - - ../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, when: ansible_distribution_release == "xenial", src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } - -- hosts: compute - remote_user: root - vars_files: - - ../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, when: ansible_distribution_release == "xenial", src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } - # TODO: this role is for configuring NFS on xenial and adjustment needed for other distros - - role: configure-nfs diff --git a/prototypes/xci/file/mini/flavor-vars.yml b/prototypes/xci/file/mini/flavor-vars.yml index 01fba7129..0d446ba20 100644 --- a/prototypes/xci/file/mini/flavor-vars.yml +++ b/prototypes/xci/file/mini/flavor-vars.yml @@ -1,19 +1,20 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'compute00': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', - 'VLAN_IP_SECOND': '173.29.241.1', + 'MGMT_IP': '172.29.236.12', 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, diff --git a/prototypes/xci/file/mini/openstack_user_config.yml b/prototypes/xci/file/mini/openstack_user_config.yml index 70429cea9..f9ccee24f 100644 --- a/prototypes/xci/file/mini/openstack_user_config.yml +++ b/prototypes/xci/file/mini/openstack_user_config.yml @@ -160,8 +160,11 @@ storage_hosts: container_vars: cinder_backends: limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "172.29.244.11" + nfs_volume: + volume_backend_name: NFS_VOLUME1 + volume_driver: cinder.volume.drivers.nfs.NfsDriver + nfs_mount_options: "rsize=65535,wsize=65535,timeo=1200,actimeo=120" + nfs_shares_config: /etc/cinder/nfs_shares + shares: + - ip: "172.29.244.12" + share: "/volumes" diff --git a/prototypes/xci/file/modules b/prototypes/xci/file/modules deleted file mode 100644 index 60a517f18..000000000 --- a/prototypes/xci/file/modules +++ /dev/null @@ -1,8 +0,0 @@ -# /etc/modules: kernel modules to load at boot time. -# -# This file contains the names of kernel modules that should be loaded -# at boot time, one per line. Lines beginning with "#" are ignored. -# Parameters can be specified after the module name. - -bonding -8021q diff --git a/prototypes/xci/file/noha/configure-targethosts.yml b/prototypes/xci/file/noha/configure-targethosts.yml deleted file mode 100644 index 6dc147f3b..000000000 --- a/prototypes/xci/file/noha/configure-targethosts.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- hosts: all - remote_user: root - tasks: - - name: add public key to host - copy: - src: ../file/authorized_keys - dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - -- hosts: controller - remote_user: root - vars_files: - - ../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, when: ansible_distribution_release == "xenial", src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } - -- hosts: compute - remote_user: root - vars_files: - - ../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, when: ansible_distribution_release == "xenial", src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } - -- hosts: compute01 - remote_user: root - # TODO: this role is for configuring NFS on xenial and adjustment needed for other distros - roles: - - role: configure-nfs diff --git a/prototypes/xci/file/noha/flavor-vars.yml b/prototypes/xci/file/noha/flavor-vars.yml index 7f52d343a..3c69a34bb 100644 --- a/prototypes/xci/file/noha/flavor-vars.yml +++ b/prototypes/xci/file/noha/flavor-vars.yml @@ -1,26 +1,26 @@ --- host_info: { 'opnfv': { - 'MGMT_IP': '172.29.236.10', 'VLAN_IP': '192.168.122.2', + 'MGMT_IP': '172.29.236.10', + 'VXLAN_IP': '172.29.240.10', 'STORAGE_IP': '172.29.244.10' }, 'controller00': { - 'MGMT_IP': '172.29.236.11', 'VLAN_IP': '192.168.122.3', + 'MGMT_IP': '172.29.236.11', + 'VXLAN_IP': '172.29.240.11', 'STORAGE_IP': '172.29.244.11' }, 'compute00': { - 'MGMT_IP': '172.29.236.12', 'VLAN_IP': '192.168.122.4', - 'VLAN_IP_SECOND': '173.29.241.1', + 'MGMT_IP': '172.29.236.12', 'VXLAN_IP': '172.29.240.12', 'STORAGE_IP': '172.29.244.12' }, 'compute01': { - 'MGMT_IP': '172.29.236.13', 'VLAN_IP': '192.168.122.5', - 'VLAN_IP_SECOND': '173.29.241.2', + 'MGMT_IP': '172.29.236.13', 'VXLAN_IP': '172.29.240.13', 'STORAGE_IP': '172.29.244.13' } diff --git a/prototypes/xci/file/noha/openstack_user_config.yml b/prototypes/xci/file/noha/openstack_user_config.yml index 05de6a9c1..fb12655e7 100644 --- a/prototypes/xci/file/noha/openstack_user_config.yml +++ b/prototypes/xci/file/noha/openstack_user_config.yml @@ -118,7 +118,7 @@ image_hosts: container_vars: limit_container_types: glance glance_nfs_client: - - server: "172.29.244.13" + - server: "172.29.244.12" remote_path: "/images" local_path: "/var/lib/glance/images" type: "nfs" @@ -162,8 +162,11 @@ storage_hosts: container_vars: cinder_backends: limit_container_types: cinder_volume - lvm: - volume_group: cinder-volumes - volume_driver: cinder.volume.drivers.lvm.LVMVolumeDriver - volume_backend_name: LVM_iSCSI - iscsi_ip_address: "172.29.244.11" + nfs_volume: + volume_backend_name: NFS_VOLUME1 + volume_driver: cinder.volume.drivers.nfs.NfsDriver + nfs_mount_options: "rsize=65535,wsize=65535,timeo=1200,actimeo=120" + nfs_shares_config: /etc/cinder/nfs_shares + shares: + - ip: "172.29.244.12" + share: "/volumes" diff --git a/prototypes/xci/playbooks/configure-localhost.yml b/prototypes/xci/playbooks/configure-localhost.yml index 2a559645e..34b974cd1 100644 --- a/prototypes/xci/playbooks/configure-localhost.yml +++ b/prototypes/xci/playbooks/configure-localhost.yml @@ -21,12 +21,6 @@ path: "{{LOG_PATH}}" state: directory recurse: no - # when the deployment is not aio, we use playbook, configure-targethosts.yml, to configure all the hosts - - name: copy multihost playbook - copy: - src: "{{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/configure-targethosts.yml" - dest: "{{OPNFV_RELENG_PATH}}/prototypes/xci/playbooks" - when: XCI_FLAVOR != "aio" # when the deployment is aio, we overwrite and use playbook, configure-opnfvhost.yml, since everything gets installed on opnfv host - name: copy aio playbook copy: diff --git a/prototypes/xci/playbooks/configure-opnfvhost.yml b/prototypes/xci/playbooks/configure-opnfvhost.yml index 8c794c422..64fcef0db 100644 --- a/prototypes/xci/playbooks/configure-opnfvhost.yml +++ b/prototypes/xci/playbooks/configure-opnfvhost.yml @@ -38,14 +38,6 @@ shell: "/bin/cp -rf {{XCI_FLAVOR_ANSIBLE_FILE_PATH}}/user_variables.yml {{OPENSTACK_OSA_ETC_PATH}}" - name: copy cinder.yml shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/cinder.yml {{OPENSTACK_OSA_ETC_PATH}}/env.d" - - name: bootstrap ansible on opnfv host - command: "/bin/bash ./scripts/bootstrap-ansible.sh" - args: - chdir: "{{OPENSTACK_OSA_PATH}}" - - name: generate password token - command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml" - args: - chdir: "{{OPENSTACK_OSA_PATH}}/scripts" # TODO: We need to get rid of this as soon as the issue is fixed upstream - name: change the haproxy state from disable to enable replace: @@ -54,10 +46,16 @@ replace: '\1haproxy_state: enabled' - name: copy OPNFV OpenStack playbook shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/setup-openstack.yml {{OPENSTACK_OSA_PATH}}/playbooks" - # Copy pinned role requirements if we are running as part of daily CI loop - name: copy OPNFV role requirements shell: "/bin/cp -rf {{OPNFV_RELENG_PATH}}/prototypes/xci/file/ansible-role-requirements.yml {{OPENSTACK_OSA_PATH}}" - when: XCI_LOOP == "daily" + - name: bootstrap ansible on opnfv host + command: "/bin/bash ./scripts/bootstrap-ansible.sh" + args: + chdir: "{{OPENSTACK_OSA_PATH}}" + - name: generate password token + command: "python pw-token-gen.py --file {{OPENSTACK_OSA_ETC_PATH}}/user_secrets.yml" + args: + chdir: "{{OPENSTACK_OSA_PATH}}/scripts" - hosts: localhost remote_user: root tasks: diff --git a/prototypes/xci/file/ha/configure-targethosts.yml b/prototypes/xci/playbooks/configure-targethosts.yml index 6dc147f3b..50da1f223 100644 --- a/prototypes/xci/file/ha/configure-targethosts.yml +++ b/prototypes/xci/playbooks/configure-targethosts.yml @@ -6,10 +6,6 @@ copy: src: ../file/authorized_keys dest: /root/.ssh/authorized_keys - - name: configure modules - copy: - src: ../file/modules - dest: /etc/modules - hosts: controller remote_user: root @@ -18,7 +14,9 @@ - ../var/flavor-vars.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/controller.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/controller.interface.j2", dest: "/etc/network/interfaces" } + # we need to force sync time with ntp or the nodes will be out of sync timewise + - role: synchronize-time - hosts: compute remote_user: root @@ -27,9 +25,11 @@ - ../var/flavor-vars.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/compute.interface.j2", dest: "/etc/network/interfaces" } + - { role: configure-network, src: "../template/compute.interface.j2", dest: "/etc/network/interfaces" } + # we need to force sync time with ntp or the nodes will be out of sync timewise + - role: synchronize-time -- hosts: compute01 +- hosts: compute00 remote_user: root # TODO: this role is for configuring NFS on xenial and adjustment needed for other distros roles: diff --git a/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml b/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml index 8bc84822c..aafadf712 100644 --- a/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml +++ b/prototypes/xci/playbooks/roles/configure-network/tasks/main.yml @@ -8,9 +8,27 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## # TODO: this role needs to be adjusted for different distros -- name: configure network for {{ ansible_os_family }} on interface {{ interface }} - template: - src: "{{ src }}" - dest: "{{ dest }}" -- name: restart ubuntu xenial network service - shell: "/sbin/ifconfig {{ interface }} 0 &&/sbin/ifdown -a && /sbin/ifup -a" +- block: + - name: configure modules + lineinfile: + dest: /etc/modules + state: present + create: yes + line: "8021q" + - name: add modules + modprobe: + name: 8021q + state: present + - name: ensure glean rules are removed + file: + path: "/etc/udev/rules.d/99-glean.rules" + state: absent + - name: ensure interfaces.d folder is empty + shell: "/bin/rm -rf /etc/network/interfaces.d/*" + - name: ensure interfaces file is updated + template: + src: "{{ src }}" + dest: "{{ dest }}" + - name: restart network service + shell: "/sbin/ifconfig {{ interface }} 0 && /sbin/ifdown -a && /sbin/ifup -a" + when: ansible_distribution_release == "xenial" diff --git a/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml b/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml index b188f4dbb..c52da0bf3 100644 --- a/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml +++ b/prototypes/xci/playbooks/roles/configure-nfs/tasks/main.yml @@ -9,11 +9,14 @@ ############################################################################## # TODO: this is for xenial and needs to be adjusted for different distros - block: - - name: make NFS dir + - name: make NFS directories file: - dest: /images - mode: 777 + dest: "{{ item }}" + mode: 0777 state: directory + with_items: + - "/images" + - "/volumes" - name: configure NFS service lineinfile: dest: /etc/services @@ -23,11 +26,15 @@ with_items: - "nfs 2049/tcp" - "nfs 2049/udp" - - name: configure NFS exports on ubuntu xenial - copy: - src: ../file/exports + - name: configure NFS exports + lineinfile: dest: /etc/exports - when: ansible_distribution_release == "xenial" + 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: diff --git a/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml b/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml new file mode 100644 index 000000000..5c39d897b --- /dev/null +++ b/prototypes/xci/playbooks/roles/synchronize-time/tasks/main.yml @@ -0,0 +1,18 @@ +--- +# 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 +############################################################################## +# TODO: this role needs to be adjusted for different distros +- block: + - name: restart chrony + service: + name: chrony + state: restarted + - name: synchronize time + shell: "chronyc -a 'burst 4/4' && chronyc -a makestep" + when: ansible_distribution_release == "xenial" diff --git a/prototypes/xci/template/compute.interface.j2 b/prototypes/xci/template/compute.interface.j2 index 0c5147c45..094544c3b 100644 --- a/prototypes/xci/template/compute.interface.j2 +++ b/prototypes/xci/template/compute.interface.j2 @@ -1,11 +1,7 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback - # Physical interface auto {{ interface }} iface {{ interface }} inet manual @@ -20,7 +16,7 @@ auto {{ interface }}.30 iface {{ interface }}.30 inet manual vlan-raw-device {{ interface }} -# Storage network VLAN interface (optional) +# Storage network VLAN interface auto {{ interface }}.20 iface {{ interface }}.20 inet manual vlan-raw-device {{ interface }} @@ -55,6 +51,7 @@ iface br-vlan inet static address {{host_info[inventory_hostname].VLAN_IP}} netmask 255.255.255.0 gateway 192.168.122.1 + dns-nameserver 8.8.8.8 8.8.4.4 offload-sg off # Create veth pair, don't bomb if already exists pre-up ip link add br-vlan-veth type veth peer name eth12 || true @@ -65,17 +62,7 @@ iface br-vlan inet static post-down ip link del br-vlan-veth || true bridge_ports br-vlan-veth -# Add an additional address to br-vlan -iface br-vlan inet static - # Flat network default gateway - # -- This needs to exist somewhere for network reachability - # -- from the router namespace for floating IP paths. - # -- Putting this here is primarily for tempest to work. - address {{host_info[inventory_hostname].VLAN_IP_SECOND}} - netmask 255.255.252.0 - dns-nameserver 8.8.8.8 8.8.4.4 - -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/prototypes/xci/template/controller.interface.j2 b/prototypes/xci/template/controller.interface.j2 index fbaa8b8dd..638e78e18 100644 --- a/prototypes/xci/template/controller.interface.j2 +++ b/prototypes/xci/template/controller.interface.j2 @@ -1,6 +1,3 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback @@ -35,18 +32,14 @@ iface br-mgmt inet static netmask 255.255.252.0 # OpenStack Networking VXLAN (tunnel/overlay) bridge -# -# Only the COMPUTE and NETWORK nodes must have an IP address -# on this bridge. When used by infrastructure nodes, the -# IP addresses are assigned to containers which use this -# bridge. -# auto br-vxlan -iface br-vxlan inet manual +iface br-vxlan inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ interface }}.30 + address {{host_info[inventory_hostname].VXLAN_IP}} + netmask 255.255.252.0 # OpenStack Networking VLAN bridge auto br-vlan @@ -60,7 +53,7 @@ iface br-vlan inet static gateway 192.168.122.1 dns-nameserver 8.8.8.8 8.8.4.4 -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/prototypes/xci/template/opnfv.interface.j2 b/prototypes/xci/template/opnfv.interface.j2 index fbaa8b8dd..e9f8649c6 100644 --- a/prototypes/xci/template/opnfv.interface.j2 +++ b/prototypes/xci/template/opnfv.interface.j2 @@ -1,6 +1,3 @@ -# This file describes the network interfaces available on your system -# and how to activate them. For more information, see interfaces(5). - # The loopback network interface auto lo iface lo inet loopback @@ -35,18 +32,14 @@ iface br-mgmt inet static netmask 255.255.252.0 # OpenStack Networking VXLAN (tunnel/overlay) bridge -# -# Only the COMPUTE and NETWORK nodes must have an IP address -# on this bridge. When used by infrastructure nodes, the -# IP addresses are assigned to containers which use this -# bridge. -# auto br-vxlan -iface br-vxlan inet manual +iface br-vxlan inet static bridge_stp off bridge_waitport 0 bridge_fd 0 bridge_ports {{ interface }}.30 + address {{ host_info[inventory_hostname].VXLAN_IP }} + netmask 255.255.252.0 # OpenStack Networking VLAN bridge auto br-vlan @@ -60,7 +53,7 @@ iface br-vlan inet static gateway 192.168.122.1 dns-nameserver 8.8.8.8 8.8.4.4 -# compute1 Storage bridge +# OpenStack Storage bridge auto br-storage iface br-storage inet static bridge_stp off diff --git a/prototypes/xci/xci-deploy.sh b/prototypes/xci/xci-deploy.sh index 2fd9be022..718ed73c2 100755 --- a/prototypes/xci/xci-deploy.sh +++ b/prototypes/xci/xci-deploy.sh @@ -50,7 +50,7 @@ echo "-------------------------------------------------------------------------" #------------------------------------------------------------------------------- # Install ansible on localhost #------------------------------------------------------------------------------- -pip install ansible==$XCI_ANSIBLE_PIP_VERSION +source file/install-ansible.sh # TODO: The xci playbooks can be put into a playbook which will be done later. |