Skip to content

Commit

Permalink
Speed up gate: avoid gathering facts more than necessary
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean-Philippe Evrard authored and Jesse Pretorius (odyssey4me) committed Jun 15, 2016
1 parent d83c889 commit e5622ad
Show file tree
Hide file tree
Showing 27 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions playbooks/galera-install.yml
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions playbooks/haproxy-install.yml
Expand Up @@ -15,6 +15,7 @@

- name: haproxy container config
hosts: haproxy_all
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 0
user: root
tasks:
Expand Down Expand Up @@ -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')}}"
Expand All @@ -58,6 +60,7 @@

- name: Install haproxy
hosts: haproxy
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:
Expand Down
1 change: 1 addition & 0 deletions playbooks/lxc-containers-create.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions playbooks/lxc-containers-destroy.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions playbooks/lxc-hosts-setup.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/memcached-install.yml
Expand Up @@ -15,6 +15,7 @@

- name: Install memcached
hosts: memcached
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:
Expand Down
1 change: 1 addition & 0 deletions playbooks/openstack-hosts-setup.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-aodh-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-ceilometer-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-cinder-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-glance-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-heat-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-horizon-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-ironic-install.yml
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-keystone-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-neutron-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-nova-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-swift-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-swift-setup.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-swift-sync.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/os-tempest-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/rabbitmq-install.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/repo-server.yml
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions playbooks/rsyslog-install.yml
Expand Up @@ -15,6 +15,7 @@

- name: Install rsyslog
hosts: rsyslog
gather_facts: "{{ gather_facts | default(True) }}"
max_fail_percentage: 20
user: root
pre_tasks:
Expand Down
1 change: 1 addition & 0 deletions playbooks/security-hardening.yml
Expand Up @@ -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",
Expand Down
8 changes: 7 additions & 1 deletion scripts/run-playbooks.sh
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/scripts-library.sh
Expand Up @@ -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 '}

Expand Down

0 comments on commit e5622ad

Please sign in to comment.