-
Notifications
You must be signed in to change notification settings - Fork 0
/
ansible.cfg
46 lines (36 loc) · 1.5 KB
/
ansible.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[defaults]
# Define the path to your inventory file
inventory = ./inventory/hosts.ini
# Setting the roles path to make sure Ansible can find your roles
roles_path = ./roles
# Use persistent connections for faster execution
forks = 10 # Adjust to a reasonable number depending on your infrastructure
timeout = 30
# Enforce usage of YAML output for better readability.
# Feel free to use json if you prefer, although YAML is usually more readable
stdout_callback = yaml
# Logging ensures you can review what happened after a playbook run.
log_path = /var/log/ansible/ansible.log
# Determining whether Ansible should ask for privilege escalation password
ask_sudo_pass = false
remote_user = sdp
become = true
become_method = sudo
# Control verbosity: Use -vvvv for maximum, adjust per need
# Adjust this verbosity based on whether you're debugging or running in production.
# For production, the default can be left as 0 (basic output).
verbosity = 1
# Ensuring safe boolean syntax (recommended)
jinja2_native = True
[ssh_connection]
# Use ControlPersist to keep SSH connections open for faster repeated connections within a session.
control_path = %(directory)s/%%h-%%r
pipelining = True
control_persist = 60s # How long to keep connections open
ssh_args = -o ControlMaster=auto -o ControlPersist=60s # Improve SSH performance
# Make sure the timeout is adjusted to accommodate network lag or heavy tasks
retries = 3
timeout = 30
[diff]
# Show changed lines when files are modified (useful for templating tasks)
always = True