Speed up gate: avoid gathering facts more than necessary

This commit adds a gather_facts variable in the playbooks, which
is defaulted to True. If run_playbooks.sh is used, this commit adds
"-e gather_facts=False" to the openstack-ansible cli for the playbook
run. Everything should work fine for deployers (because there is no
change for them), and for the gate (because fact caching is enabled)

It should speed up the gate by avoiding the long "setup" task cost for each host.
Instead it does the setup to the appropriate hosts, at the appropriate time.

Change-Id: I348a4b7dfe70d56a64899246daf65ea834a75d2a
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
This commit is contained in:
Jean-Philippe Evrard 2016-06-10 13:47:01 +01:00 committed by Jesse Pretorius (odyssey4me)
parent d83c889631
commit e5622adc43
27 changed files with 36 additions and 2 deletions

View File

@ -16,6 +16,7 @@
- name: Galera container config
hosts: galera_all
max_fail_percentage: 0
gather_facts: "{{ gather_facts | default(True) }}"
user: root
tasks:
- name: Use the lxc-openstack aa profile
@ -59,6 +60,7 @@
- name: Install galera server
hosts: galera_all
gather_facts: "{{ gather_facts | default(True) }}"
serial: 1
max_fail_percentage: 20
user: root

View File

@ -15,6 +15,7 @@
- name: haproxy container config
hosts: haproxy_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 0
user: root
tasks:
@ -49,6 +50,7 @@
- haproxy-lxc-container-setup
- hosts: haproxy
gather_facts: "{{ gather_facts | default(True) }}"
user: root
vars_files:
- "{{ haproxy_keepalived_vars_file | default('vars/configs/keepalived_haproxy.yml')}}"
@ -58,6 +60,7 @@
- name: Install haproxy
hosts: haproxy
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Create container(s)
hosts: "{{ container_group|default('all_containers') }}"
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
gather_facts: false
user: root

View File

@ -15,6 +15,7 @@
- name: Destroy lxc containers
hosts: "{{ container_group|default('all_containers') }}"
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
gather_facts: false
user: root

View File

@ -15,6 +15,7 @@
- name: Basic lxc host setup
hosts: "{{ lxc_host_group|default('hosts') }}"
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
roles:

View File

@ -15,6 +15,7 @@
- name: Install memcached
hosts: memcached
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Basic host setup
hosts: "{{ openstack_host_group|default('hosts') }}"
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
roles:

View File

@ -15,6 +15,7 @@
- name: Install the aodh components
hosts: aodh_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install the ceilometer components
hosts: ceilometer_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install cinder server
hosts: cinder_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install glance server
hosts: glance_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install heat server
hosts: heat_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install horizon server
hosts: horizon_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Ironic
hosts: ironic_all
gather_facts: "{{ gather_facts | default(True) }}"
user: root
pre_tasks:
- name: Use the lxc-openstack aa profile

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Keystone
hosts: keystone_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Neutron
hosts: neutron_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Nova
hosts: nova_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Swift
hosts: swift_all:swift_remote_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -17,6 +17,7 @@
- name: Installation and setup of Swift
hosts: swift_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -17,6 +17,7 @@
# The services need to be installed first though.
- name: Synchronisation of swift ring and ssh keys
hosts: swift_all:swift_remote_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
roles:

View File

@ -15,6 +15,7 @@
- name: Installation and setup of Tempest
hosts: utility_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
roles:

View File

@ -15,6 +15,7 @@
- name: Create and configure rabbitmq container
hosts: rabbitmq_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 0
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Setup repo servers
hosts: repo_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -15,6 +15,7 @@
- name: Install rsyslog
hosts: rsyslog
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:

View File

@ -19,6 +19,7 @@
- name: Apply security hardening configurations
hosts: "{{ host_group|default('hosts') }}"
gather_facts: "{{ gather_facts | default(True) }}"
user: root
roles:
- { role: "openstack-ansible-security",

View File

@ -39,6 +39,12 @@ info_block "Checking for required libraries." 2> /dev/null || source $(dirname $
# Initiate the deployment
pushd "playbooks"
ansible -m setup localhost
if [ "${DEPLOY_HOST}" == "no" ]; then
ansible -m setup all
fi
if [ "${DEPLOY_HOST}" == "yes" ]; then
# Install all host bits
install_bits openstack-hosts-setup.yml
@ -70,7 +76,7 @@ pushd "playbooks"
# Create the containers.
install_bits lxc-containers-create.yml
ansible -m setup all
# Log some data about the instance and the rest of the system
log_instance_info

View File

@ -19,7 +19,7 @@
LINE='----------------------------------------------------------------------'
MAX_RETRIES=${MAX_RETRIES:-5}
REPORT_DATA=${REPORT_DATA:-""}
ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-""}
ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-" -e 'gather_facts=False' "}
STARTTIME="${STARTTIME:-$(date +%s)}"
PIP_INSTALL_OPTIONS=${PIP_INSTALL_OPTIONS:-'pip==8.1.2 setuptools==22.0.0 wheel==0.29.0 '}