Browse Source

Tune ansible configuration for better performance

This change will update our ansible configuration to ensure we're getting the best
possible performance when running ansible playbooks via mistral.

- sets the ansible option internal_poll_interval so that we lower overall cpu
  consumption.
- sets the ssh option PreferredAuthentications so that we're only offering
  pubkeys when connecting to remote hosts which, in most cases, will save us
  from attempting a PTR lookup.

Change-Id: I421183abd0982f9f57f8719d72fd2cbf2e3d4d04
Signed-off-by: Kevin Carter <kecarter@redhat.com>
(cherry picked from commit 8ab0901ad7)
changes/11/705411/1
Kevin Carter Jesse Pretorius (odyssey4me) 4 weeks ago
parent
commit
98a54fabf6
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      tripleo_common/actions/ansible.py

+ 5
- 1
tripleo_common/actions/ansible.py View File

@@ -111,6 +111,9 @@ def write_default_ansible_cfg(work_dir,
config.set('defaults', 'fact_caching_connection',
'/var/lib/mistral/ansible_fact_cache')

# Set the pull interval to lower CPU overhead
config.set('defaults', 'internal_poll_interval', '0.05')

# Set the interpreter discovery to auto mode.
config.set('defaults', 'interpreter_python', 'auto')

@@ -124,7 +127,8 @@ def write_default_ansible_cfg(work_dir,
'-o ControlMaster=auto '
'-o ControlPersist=30m '
'-o ServerAliveInterval=5 '
'-o ServerAliveCountMax=5')
'-o ServerAliveCountMax=5 '
'-o PreferredAuthentications=publickey')
config.set('ssh_connection', 'control_path_dir',
os.path.join(work_dir, 'ansible-ssh'))
config.set('ssh_connection', 'retries', '8')


Loading…
Cancel
Save