Files
system-config/playbooks/roles/install-ansible/templates/ansible.cfg.j2
Clark Boylan ef35694661 Update Ansible config to set ssh ServerAliveInterval
We hit Ansible rc -13 again in gate testing for a system-config change.
This is the error code that Ansible returns for a task when it tries to
connect via ssh as the ControlMaster is shutting down due to the
ControlPerist timeout being reached. We already set ControlPersist to
180 seconds in an effort to make this an uncommon issue. Set
ServerAliveInterval to 60 seconds to match zuul's configuration for
Ansible as that seems to work well for Zuul jobs.

Change-Id: I66f28fcf7f539b76bfbb6da99c9836a6a92431e5
2025-07-09 14:00:28 -07:00

46 lines
1.5 KiB
Django/Jinja

[defaults]
inventory=/home/zuul/src/opendev.org/opendev/system-config/inventory/base/hosts.yaml,/home/zuul/src/opendev.org/opendev/system-config/inventory/service/groups.yaml,/etc/ansible/hosts/emergency.yaml
library=/usr/share/ansible
log_path=/var/log/ansible/ansible.log
inventory_plugins=/etc/ansible/inventory_plugins
roles_path=/etc/ansible/roles
retry_files_enabled=False
retry_files_save_path=
gathering=smart
fact_caching=jsonfile
fact_caching_connection=/var/cache/ansible/facts
# Squash warning about ansible auto-transforming group names with -'s in them
force_valid_group_names=ignore
callback_enabled=profile_tasks, timer
{% if install_ansible_ara_enable %}
callback_plugins=/etc/ansible/callback_plugins:{{ install_ansible_ara_callback_plugins.stdout }}
{% else %}
callback_plugins=/etc/ansible/callback_plugins
{% endif %}
stdout_callback=debug
[inventory]
enable_plugins=yaml,yamlgroup,advanced_host_list,ini
cache=True
cache_plugin=jsonfile
cache_connection=/var/cache/ansible/inventory
any_unparsed_is_failed=True
[ssh_connection]
retries=3
pipelining = True
# Override the default ControlPersist value of 60s due to
# https://github.com/ansible/ansible/issues/81777 and the hunch that
# fewer task pairs have larger deltas between them.
ssh_args = -o ControlMaster=auto -o ControlPersist=180s -o ServerAliveInterval=60
[callback_profile_tasks]
task_output_limit = 50
{% if install_ansible_ara_enable %}
[ara]
{% for k, v in install_ansible_ara_config.items() %}
{{ k }}={{ v }}
{% endfor %}
{% endif %}