Merge "Add hosts integrated tests"
This commit is contained in:
commit
f749e83d65
@ -65,39 +65,63 @@
|
|||||||
that:
|
that:
|
||||||
- internal_lb_vip_address | ipaddr('private')
|
- internal_lb_vip_address | ipaddr('private')
|
||||||
|
|
||||||
- name: Ensure settings are not wrong with the usual suspects issues before trying to deploy infra
|
# Test openstack_hosts role
|
||||||
hosts: haproxy
|
- name: Playbook for role testing
|
||||||
gather_facts: yes
|
hosts: localhost
|
||||||
|
become: true
|
||||||
|
gather_facts: true
|
||||||
tasks:
|
tasks:
|
||||||
- name: Checking that the LB vips are well configured.
|
- name: Open modules file
|
||||||
assert:
|
slurp:
|
||||||
that:
|
src: "{{ (ansible_os_family | lower == 'debian') | ternary('/etc/modules', '/etc/modules-load.d/openstack-ansible.conf') }}"
|
||||||
- external_lb_vip_address != internal_lb_vip_address
|
register: modules_file
|
||||||
msg: |
|
|
||||||
External and Internal LB vip addresses are the same.
|
|
||||||
Run with -e vipcheck=False if you want to bypass this check.
|
|
||||||
when:
|
|
||||||
- vipcheck | default(True) | bool
|
|
||||||
- inventory_hostname == ansible_play_hosts[0]
|
|
||||||
|
|
||||||
- name: Checking that vip nics are well configured
|
- name: Open sysctl file
|
||||||
assert:
|
slurp:
|
||||||
that:
|
src: /etc/sysctl.conf
|
||||||
- item in ansible_interfaces
|
register: sysctl_file
|
||||||
msg: "Misconfigured keepalived IP, the carrying interface {{ item }} doesn't exist"
|
|
||||||
with_items:
|
|
||||||
- "{{ haproxy_keepalived_external_interface }}"
|
|
||||||
- "{{ haproxy_keepalived_internal_interface }}"
|
|
||||||
when:
|
|
||||||
- groups['haproxy'] | length > 1
|
|
||||||
|
|
||||||
- name: Checking that vip address is well formed
|
- name: Open hosts file
|
||||||
|
slurp:
|
||||||
|
src: /etc/hosts
|
||||||
|
register: hosts_file
|
||||||
|
|
||||||
|
- name: Open /etc/environment file
|
||||||
|
slurp:
|
||||||
|
src: /etc/environment
|
||||||
|
register: environment_file
|
||||||
|
|
||||||
|
- name: Read files
|
||||||
|
set_fact:
|
||||||
|
modules_content: "{{ modules_file.content | b64decode }}"
|
||||||
|
sysctl_content: "{{ sysctl_file.content | b64decode }}"
|
||||||
|
hosts_content: "{{ hosts_file.content | b64decode }}"
|
||||||
|
environment_content: "{{ environment_file.content | b64decode }}"
|
||||||
|
|
||||||
|
- name: Check for release file
|
||||||
|
stat:
|
||||||
|
path: /etc/openstack-release
|
||||||
|
register: release_file
|
||||||
|
|
||||||
|
- name: Check for systat file
|
||||||
|
stat:
|
||||||
|
path: "{{ (ansible_os_family | lower == 'debian') | ternary('/etc/default/sysstat', '/etc/sysconfig/sysstat') }}"
|
||||||
|
register: systat_file
|
||||||
|
|
||||||
|
- name: Check for ssh dir
|
||||||
|
stat:
|
||||||
|
path: "{{ ansible_env.HOME }}/.ssh"
|
||||||
|
register: ssh_dir
|
||||||
|
|
||||||
|
- name: Check role functions
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- item | ipaddr('address')
|
- "'dm_multipath' in modules_content"
|
||||||
msg: "Misconfigured keepalived: The vip {{ item }} is not an IP address, but a network"
|
- "'ebtables' in modules_content"
|
||||||
with_items:
|
- "'vm.swappiness' in sysctl_content"
|
||||||
- "{{ haproxy_keepalived_internal_vip_cidr }}"
|
- "'172.29.236.100 {{ ansible_fqdn }} {{ ansible_hostname }}' in hosts_content"
|
||||||
- "{{ haproxy_keepalived_external_vip_cidr }}"
|
- "'{{ hostvars[groups['galera_all'][0]]['container_address'] }} {{ hostvars[groups['galera_all'][0]]['ansible_hostname'] }}.openstack.local {{ hostvars[groups['galera_all'][0]]['ansible_hostname'] ~ ((hostvars[groups['galera_all'][0]]['ansible_hostname'] != groups['galera_all'][0]) | ternary(' ' ~ groups['galera_all'][0], '')) }}' in hosts_content"
|
||||||
when:
|
- "release_file.stat.exists"
|
||||||
- groups['haproxy'] | length > 1
|
- "systat_file.stat.exists"
|
||||||
|
- "'PATH=\"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' in environment_content"
|
||||||
|
- "ssh_dir.stat.isdir"
|
||||||
|
@ -178,6 +178,12 @@ else
|
|||||||
# Log some data about the instance and the rest of the system
|
# Log some data about the instance and the rest of the system
|
||||||
log_instance_info
|
log_instance_info
|
||||||
|
|
||||||
|
if [[ $SCENARIO =~ "hosts" ]]; then
|
||||||
|
# Verify our hosts setup and do not continue with openstack/infra part
|
||||||
|
openstack-ansible healthcheck-hosts.yml -e osa_gather_facts=False
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
|
|
||||||
# Reload environment file and apply variables for the session
|
# Reload environment file and apply variables for the session
|
||||||
set -a
|
set -a
|
||||||
. /etc/environment
|
. /etc/environment
|
||||||
@ -195,7 +201,7 @@ else
|
|||||||
# Log some data about the instance and the rest of the system
|
# Log some data about the instance and the rest of the system
|
||||||
log_instance_info
|
log_instance_info
|
||||||
|
|
||||||
if [[ $SCENARIO =~ "infra" ]]; then
|
if [[ $SCENARIO =~ "infra" && $ACTION != "upgrade" ]]; then
|
||||||
# Verify our infra setup and do not continue with openstack part
|
# Verify our infra setup and do not continue with openstack part
|
||||||
openstack-ansible healthcheck-infrastructure.yml -e osa_gather_facts=False
|
openstack-ansible healthcheck-infrastructure.yml -e osa_gather_facts=False
|
||||||
fi
|
fi
|
||||||
@ -242,6 +248,11 @@ if [[ "${ACTION}" == "upgrade" ]]; then
|
|||||||
# upgrade is irreversable.
|
# upgrade is irreversable.
|
||||||
echo 'YES' | bash "${OSA_CLONE_DIR}/scripts/run-upgrade.sh"
|
echo 'YES' | bash "${OSA_CLONE_DIR}/scripts/run-upgrade.sh"
|
||||||
|
|
||||||
|
if [[ $SCENARIO =~ "infra" ]]; then
|
||||||
|
# Verify our infra setup after upgrade
|
||||||
|
openstack-ansible ${OSA_CLONE_DIR}/playbooks/healthcheck-infrastructure.yml -e osa_gather_facts=False
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exit_success
|
exit_success
|
||||||
|
@ -296,11 +296,32 @@
|
|||||||
nodeset: ubuntu-focal
|
nodeset: ubuntu-focal
|
||||||
timeout: 10800
|
timeout: 10800
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-upgrade-infra_lxc-ubuntu-focal
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: ubuntu-focal
|
||||||
|
timeout: 10800
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-ansible-deploy-infra_lxc-ubuntu-focal
|
name: openstack-ansible-deploy-infra_lxc-ubuntu-focal
|
||||||
parent: openstack-ansible-deploy-aio
|
parent: openstack-ansible-deploy-aio
|
||||||
nodeset: ubuntu-focal
|
nodeset: ubuntu-focal
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_lxc-ubuntu-focal
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: ubuntu-focal
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_distro_lxc-ubuntu-focal
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: ubuntu-focal
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_metal-ubuntu-focal
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: ubuntu-focal
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-ansible-deploy-aio_distro_lxc-ubuntu-focal
|
name: openstack-ansible-deploy-aio_distro_lxc-ubuntu-focal
|
||||||
parent: openstack-ansible-deploy-aio-distro
|
parent: openstack-ansible-deploy-aio-distro
|
||||||
@ -407,6 +428,21 @@
|
|||||||
parent: openstack-ansible-deploy-aio
|
parent: openstack-ansible-deploy-aio
|
||||||
nodeset: centos-8
|
nodeset: centos-8
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_distro_lxc-centos-8
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: centos-8
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_lxc-centos-8
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: centos-8
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_metal-centos-8
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: centos-8
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-ansible-deploy-aio_distro_lxc-centos-8
|
name: openstack-ansible-deploy-aio_distro_lxc-centos-8
|
||||||
parent: openstack-ansible-deploy-aio-distro
|
parent: openstack-ansible-deploy-aio-distro
|
||||||
@ -428,6 +464,12 @@
|
|||||||
nodeset: centos-8
|
nodeset: centos-8
|
||||||
timeout: 10800
|
timeout: 10800
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-upgrade-infra_lxc-centos-8
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: centos-8
|
||||||
|
timeout: 10800
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-ansible-deploy-aio_metal-centos-8
|
name: openstack-ansible-deploy-aio_metal-centos-8
|
||||||
parent: openstack-ansible-deploy-aio
|
parent: openstack-ansible-deploy-aio
|
||||||
@ -477,6 +519,21 @@
|
|||||||
parent: openstack-ansible-deploy-aio
|
parent: openstack-ansible-deploy-aio
|
||||||
nodeset: debian-buster
|
nodeset: debian-buster
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_lxc-debian-buster
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: debian-buster
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_distro_lxc-debian-buster
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: debian-buster
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: openstack-ansible-deploy-hosts_metal-debian-buster
|
||||||
|
parent: openstack-ansible-deploy-aio
|
||||||
|
nodeset: debian-buster
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: openstack-ansible-deploy-aio_distro_lxc-debian-buster
|
name: openstack-ansible-deploy-aio_distro_lxc-debian-buster
|
||||||
parent: openstack-ansible-deploy-aio-distro
|
parent: openstack-ansible-deploy-aio-distro
|
||||||
|
@ -52,6 +52,17 @@
|
|||||||
- openstack-ansible-deploy-aio_lxc-ubuntu-focal
|
- openstack-ansible-deploy-aio_lxc-ubuntu-focal
|
||||||
- openstack-ansible-upgrade-aio_lxc-ubuntu-focal
|
- openstack-ansible-upgrade-aio_lxc-ubuntu-focal
|
||||||
|
|
||||||
|
- project-template:
|
||||||
|
name: openstack-ansible-upgrade-infra_lxc-jobs
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-upgrade-infra_lxc-centos-8:
|
||||||
|
voting: false
|
||||||
|
- openstack-ansible-upgrade-infra_lxc-ubuntu-focal
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-upgrade-infra_lxc-ubuntu-focal
|
||||||
|
|
||||||
- project-template:
|
- project-template:
|
||||||
name: openstack-ansible-upgrade-aio_metal-jobs
|
name: openstack-ansible-upgrade-aio_metal-jobs
|
||||||
check:
|
check:
|
||||||
@ -79,6 +90,51 @@
|
|||||||
jobs:
|
jobs:
|
||||||
- openstack-ansible-deploy-infra_lxc-ubuntu-focal
|
- openstack-ansible-deploy-infra_lxc-ubuntu-focal
|
||||||
|
|
||||||
|
- project-template:
|
||||||
|
name: openstack-ansible-deploy-hosts_lxc-jobs
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-ubuntu-focal
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-ubuntu-focal
|
||||||
|
periodic:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_lxc-ubuntu-focal
|
||||||
|
|
||||||
|
- project-template:
|
||||||
|
name: openstack-ansible-deploy-hosts_metal-jobs
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_metal-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_metal-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_metal-ubuntu-focal
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_metal-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_metal-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_metal-ubuntu-focal
|
||||||
|
periodic:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_metal-ubuntu-focal
|
||||||
|
|
||||||
|
- project-template:
|
||||||
|
name: openstack-ansible-deploy-hosts_distro_lxc-jobs
|
||||||
|
check:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-ubuntu-focal
|
||||||
|
gate:
|
||||||
|
jobs:
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-centos-8
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-debian-buster
|
||||||
|
- openstack-ansible-deploy-hosts_distro_lxc-ubuntu-focal
|
||||||
|
|
||||||
- project-template:
|
- project-template:
|
||||||
name: openstack-ansible-deploy-aio_distro_lxc-jobs
|
name: openstack-ansible-deploy-aio_distro_lxc-jobs
|
||||||
experimental:
|
experimental:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user