소스 검색

Update ansible configuration

Emmanuel Bouthenot 7 년 전
부모
커밋
2227a96bea
1개의 변경된 파일110개의 추가작업 그리고 25개의 파일을 삭제
  1. 110 25
      ansible.cfg

+ 110 - 25
ansible.cfg

@@ -1,5 +1,5 @@
-# config file for ansible -- http://ansible.com/
-# ==============================================
+# config file for ansible -- https://ansible.com/
+# ===============================================
 
 # nearly all parameters can be overridden in ansible-playbook
 # or with command line flags. ansible will read ANSIBLE_CONFIG,
@@ -13,8 +13,9 @@
 
 #inventory      = /etc/ansible/hosts
 #library        = /usr/share/my_modules/
-#remote_tmp     = $HOME/.ansible/tmp
-#local_tmp      = $HOME/.ansible/tmp
+#module_utils   = /usr/share/my_module_utils/
+#remote_tmp     = ~/.ansible/tmp
+#local_tmp      = ~/.ansible/tmp
 #forks          = 5
 #poll_interval  = 15
 #sudo_user      = root
@@ -23,7 +24,7 @@
 #transport      = smart
 #remote_port    = 22
 #module_lang    = C
-#module_set_locale = True
+#module_set_locale = False
 
 # plays will gather facts by default, which contain information about
 # the remote system.
@@ -33,7 +34,8 @@
 # explicit - do not gather by default, must say gather_facts: True
 gathering = smart
 
-# by default retrieve all facts subsets
+# This only affects the gathering done by a play's gather_facts directive,
+# by default gathering retrieves all facts subsets
 # all - gather all subsets
 # network - gather min and network facts
 # hardware - gather hardware facts (longest facts to retrieve)
@@ -59,7 +61,7 @@ gathering = smart
 #host_key_checking = False
 
 # change the default callback
-stdout_callback = skippy
+stdout_callback = skippy2
 # enable additional callbacks
 #callback_whitelist = timer, mail
 
@@ -125,8 +127,8 @@ stdout_callback = skippy
 # replacing {file}, {host} and {uid} and strftime codes with proper values.
 #ansible_managed = Ansible managed: {file} modified on %Y-%m-%d %H:%M:%S by {uid} on {host}
 # {file}, {host}, {uid}, and the timestamp can all interfere with idempotence
-# This short version is better used in templates as it won't flag the file as changed every run.
-#ansible_managed = Ansible managed: {file} on {host}
+# in some situations so the default is a static string:
+#ansible_managed = Ansible managed
 
 # by default, ansible-playbook will display "Skipping [host]" if it determines a task
 # should not be run on a host.  Set this to "False" if you don't want to see these "Skipping"
@@ -179,8 +181,14 @@ display_skipped_hosts = False
 #vars_plugins       = /usr/share/ansible/plugins/vars
 #filter_plugins     = /usr/share/ansible/plugins/filter
 #test_plugins       = /usr/share/ansible/plugins/test
+#terminal_plugins   = /usr/share/ansible/plugins/terminal
 #strategy_plugins   = /usr/share/ansible/plugins/strategy
 
+
+# by default, ansible will use the 'linear' strategy but you may want to try
+# another one
+#strategy = free
+
 # by default callbacks are not loaded for /bin/ansible, enable this if you
 # want, for example, a notification or logging callback to also apply to
 # /bin/ansible runs
@@ -230,7 +238,7 @@ nocows = 1
 # when looping. Instead of calling the module once per with_ item, the
 # module is called once with all items at once. Currently this only works
 # under limited circumstances, and only with parameters named 'name'.
-#squash_actions = apk,apt,dnf,package,pacman,pkgng,yum,zypper
+#squash_actions = apk,apt,dnf,homebrew,pacman,pkgng,yum,zypper
 
 # prevents logging of task data, off by default
 #no_log = False
@@ -265,6 +273,28 @@ module_compression = 'ZIP_DEFLATED'
 # set to 0 for unlimited (RAM may suffer!).
 #max_diff_size = 1048576
 
+# This controls how ansible handles multiple --tags and --skip-tags arguments
+# on the CLI.  If this is True then multiple arguments are merged together.  If
+# it is False, then the last specified argument is used and the others are ignored.
+#merge_multiple_cli_flags = False
+
+# Controls showing custom stats at the end, off by default
+#show_custom_stats = True
+
+# Controls which files to ignore when using a directory as inventory with
+# possibly multiple sources (both static and dynamic)
+#inventory_ignore_extensions = ~, .orig, .bak, .ini, .cfg, .retry, .pyc, .pyo
+
+# This family of modules use an alternative execution path optimized for network appliances
+# only update this setting if you know how this works, otherwise it can break module execution
+#network_group_modules=['eos', 'nxos', 'ios', 'iosxr', 'junos', 'vyos']
+
+# When enabled, this option allows lookups (via variables like {{lookup('foo')}} or when used as
+# a loop with `with_foo`) to return data that is not marked "unsafe". This means the data may contain
+# jinja2 templating language which will be run through the templating engine.
+# ENABLING THIS COULD BE A SECURITY RISK
+#allow_unsafe_lookups = False
+
 [privilege_escalation]
 #become=True
 #become_method=sudo
@@ -282,23 +312,42 @@ module_compression = 'ZIP_DEFLATED'
 # line to disable this behaviour.
 #pty=False
 
+# paramiko will default to looking for SSH keys initially when trying to
+# authenticate to remote devices.  This is a problem for some network devices
+# that close the connection after a key failure.  Uncomment this line to
+# disable the Paramiko look for keys function
+#look_for_keys = False
+
+# When using persistent connections with Paramiko, the connection runs in a
+# background process.  If the host doesn't already have a valid SSH key, by
+# default Ansible will prompt to add the host key.  This will cause connections
+# running in background processes to fail.  Uncomment this line to have
+# Paramiko automatically add host keys.
+#host_key_auto_add = True
+
 [ssh_connection]
 
 # ssh arguments to use
 # Leaving off ControlPersist will result in poor performance, so use
-#ssh_args = -o ControlMaster=auto -o ControlPersist=60s
-ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
-
-# The path to use for the ControlPath sockets. This defaults to
-# "%(directory)s/ansible-ssh-%%h-%%p-%%r", however on some systems with
-# very long hostnames or very long path names (caused by long user names or
-# deeply nested home directories) this can exceed the character limit on
-# file socket names (108 characters for most platforms). In that case, you
-# may wish to shorten the string below.
+# paramiko on older platforms rather than removing it, -C controls compression use
+#ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s
+ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
+
+# The base directory for the ControlPath sockets. 
+# This is the "%(directory)s" in the control_path option
+# 
+# Example: 
+# control_path_dir = /tmp/.ansible/cp
+#control_path_dir = ~/.ansible/cp
+
+# The path to use for the ControlPath sockets. This defaults to a hashed string of the hostname, 
+# port and username (empty string in the config). The hash mitigates a common problem users 
+# found with long hostames and the conventional %(directory)s/ansible-ssh-%%h-%%p-%%r format. 
+# In those cases, a "too long for Unix domain socket" ssh error would occur.
 #
 # Example:
 # control_path = %(directory)s/%%h-%%r
-#control_path = %(directory)s/ansible-ssh-%%h-%%p-%%r
+#control_path =
 
 # Enabling pipelining reduces the number of SSH operations required to
 # execute a module on the remote server. This can result in a significant
@@ -310,17 +359,45 @@ ssh_args = -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes
 #
 pipelining = True
 
-# Control the mechanism for transfering files
+# Control the mechanism for transferring files (old)
 #   * smart = try sftp and then try scp [default]
-# if True, make ansible use scp if the connection type is ssh
-# (default is sftp)
-#scp_if_ssh = True
+#   * True = use scp only
+#   * False = use sftp only
+#scp_if_ssh = smart
+
+# Control the mechanism for transferring files (new)
+# If set, this will override the scp_if_ssh option
+#   * sftp  = use sftp to transfer files
+#   * scp   = use scp to transfer files
+#   * piped = use 'dd' over SSH to transfer files
+#   * smart = try sftp, scp, and piped, in that order [default]
+#transfer_method = smart
 
 # if False, sftp will not use batch mode to transfer files. This may cause some
 # types of file transfer failures impossible to catch however, and should
 # only be disabled if your sftp version has problems with batch mode
 #sftp_batch_mode = False
 
+[persistent_connection]
+
+# Configures the persistent connection timeout value in seconds.  This value is
+# how long the persistent connection will remain idle before it is destroyed.  
+# If the connection doesn't receive a request before the timeout value 
+# expires, the connection is shutdown.  The default value is 30 seconds.
+connect_timeout = 30
+
+# Configures the persistent connection retries.  This value configures the
+# number of attempts the ansible-connection will make when trying to connect
+# to the local domain socket.  The default value is 30.
+connect_retries = 30
+
+# Configures the amount of time in seconds to wait between connection attempts 
+# to the local unix domain socket.  This value works in conjunction with the
+# connect_retries value to define how long to try to connect to the local
+# domain socket when setting up a persistent connection.  The default value is
+# 1 second.
+connect_interval = 1
+
 [accelerate]
 #accelerate_port = 5099
 #accelerate_timeout = 30
@@ -340,7 +417,7 @@ pipelining = True
 # file systems that require special treatment when dealing with security context
 # the default behaviour that copies the existing context or uses the user default
 # needs to be changed to use the file system dependent context.
-#special_context_filesystems=nfs,vboxsf,fuse,ramfs
+#special_context_filesystems=nfs,vboxsf,fuse,ramfs,9p
 
 # Set this to yes to allow libvirt_lxc connections to work without SELinux.
 #libvirt_lxc_noseclabel = yes
@@ -359,3 +436,11 @@ changed = bright yellow
 diff_add = bright green
 diff_remove = bright red
 #diff_lines = cyan
+
+
+[diff]
+# Always print diff when running ( same as always running with -D/--diff )
+always = yes
+
+# Set how many context lines to show in diff
+# context = 3