diff --git a/image/tools-ansible/ansible/ansible.cfg b/image/tools-ansible/ansible/ansible.cfg index 988eb16..eb20d26 100644 --- a/image/tools-ansible/ansible/ansible.cfg +++ b/image/tools-ansible/ansible/ansible.cfg @@ -1,125 +1,173 @@ [defaults] # (boolean) By default Ansible will issue a warning when received from a task action (module or action plugin) # These warnings can be silenced by adjusting this setting to False. +# (布尔)默认情况下,收到来自任务动作(模块或动作插件)的告警时,Ansible 会给出警告。 +# 将此项设为 False 可以屏蔽这些告警。 ;action_warnings=True # (list) Accept list of cowsay templates that are 'safe' to use, set to empty list if you want to enable all installed templates. +# (列表)可安全使用的 cowsay 模板,若想启用所有已安装模板,请设为空列表。 ;cowsay_enabled_stencils=bud-frogs, bunny, cheese, daemon, default, dragon, elephant-in-snake, elephant, eyes, hellokitty, kitty, luke-koala, meow, milk, moofasa, moose, ren, sheep, small, stegosaurus, stimpy, supermilker, three-eyes, turkey, turtle, tux, udder, vader-koala, vader, www # (string) Specify a custom cowsay path or swap in your cowsay implementation of choice +# (字符串)指定自定义的 cowsay 路径,或换用你喜欢的 cowsay 实现。 ;cowpath= # (string) This allows you to chose a specific cowsay stencil for the banners or use 'random' to cycle through them. +# (字符串)为横幅选择特定的 cowsay 模板,或设为 'random' 轮流使用。 ;cow_selection=default # (boolean) This option forces color mode even when running without a TTY or the "nocolor" setting is True. +# (布尔)即使没有 TTY 运行,或 nocolor 设置为 True,也强制启用彩色输出。 ;force_color=False # (path) The default root path for Ansible config files on the controller. +# (路径)控制端上 Ansible 配置文件的默认根目录。 ;home=~/.ansible # (boolean) This setting allows suppressing colorizing output, which is used to give a better indication of failure and status information. +# (布尔)关闭彩色输出;彩色原本用于更清晰地标示失败与状态信息。 ;nocolor=False # (boolean) If you have cowsay installed but want to avoid the 'cows' (why????), use this. +# (布尔)如果装了 cowsay 却不想看到那些 '牛'(为什么会这样???),用这个开关。 ;nocows=False # (boolean) Sets the default value for the any_errors_fatal keyword, if True, Task failures will be considered fatal errors. +# (布尔)设置 any_errors_fatal 关键字的默认值;若为 True,任务失败将被视为致命错误。 ;any_errors_fatal=False # (path) The password file to use for the become plugin. --become-password-file. # If executable, it will be run and the resulting stdout will be used as the password. +# (路径)become 插件使用的密码文件。--become-password-file。 +# 如果是可执行文件,它会被运行,并用其标准输出作为密码。 ;become_password_file= # (pathspec) Colon separated paths in which Ansible will search for Become Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Become 插件。 ;become_plugins={{ ANSIBLE_HOME ~ "/plugins/become:/usr/share/ansible/plugins/become" }} # (string) Chooses which cache plugin to use, the default 'memory' is ephemeral. +# (字符串)选择使用哪个缓存插件;默认的 'memory' 是临时的。 ;fact_caching=memory # (string) Defines connection or path information for the cache plugin +# (字符串)定义缓存插件的连接或路径信息。 ;fact_caching_connection= # (string) Prefix to use for cache plugin files/tables +# (字符串)缓存插件文件/表使用的前缀。 ;fact_caching_prefix=ansible_facts # (integer) Expiration timeout for the cache plugin data +# (整数)缓存插件数据的过期超时时间。 ;fact_caching_timeout=86400 # (list) List of enabled callbacks, not all callbacks need enabling, but many of those shipped with Ansible do as we don't want them activated by default. +# (列表)启用的回调插件列表;并非所有回调都需要启用,但 Ansible 自带的许多回调并不默认激活。 ;callbacks_enabled= # (string) When a collection is loaded that does not support the running Ansible version (with the collection metadata key `requires_ansible`). +# (字符串)当加载的集合不支持当前运行的 Ansible 版本(集合元数据中的 `requires_ansible` 键)时的处理方式。 ;collections_on_ansible_version_mismatch=warning # (pathspec) Colon separated paths in which Ansible will search for collections content. Collections must be in nested *subdirectories*, not directly in these directories. For example, if ``COLLECTIONS_PATHS`` includes ``'{{ ANSIBLE_HOME ~ "/collections" }}'``, and you want to add ``my.collection`` to that directory, it must be saved as ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找集合内容。集合必须放在嵌套子目录中,不能直接放在这些目录下。例如,若 ``COLLECTIONS_PATHS`` 包含 ``'{{ ANSIBLE_HOME ~ "/collections" }}'``,要把 ``my.collection`` 加进去,它必须放在 ``'{{ ANSIBLE_HOME} ~ "/collections/ansible_collections/my/collection" }}'``。 ;collections_path={{ ANSIBLE_HOME ~ "/collections:/usr/share/ansible/collections" }} # (boolean) A boolean to enable or disable scanning the sys.path for installed collections +# (布尔)是否允许扫描 sys.path 以查找已安装的集合。 ;collections_scan_sys_path=True # (path) The password file to use for the connection plugin. --connection-password-file. +# (路径)连接插件使用的密码文件。--connection-password-file。 ;connection_password_file= # (pathspec) Colon separated paths in which Ansible will search for Action Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找动作插件。 ;action_plugins={{ ANSIBLE_HOME ~ "/plugins/action:/usr/share/ansible/plugins/action" }} # (boolean) When enabled, this option allows lookup plugins (whether used in variables as ``{{lookup('foo')}}`` or as a loop as with_foo) to return data that is not marked 'unsafe'. # By default, such data is marked as unsafe to prevent the templating engine from evaluating any jinja2 templating language, as this could represent a security risk. This option is provided to allow for backward compatibility, however users should first consider adding allow_unsafe=True to any lookups which may be expected to contain data which may be run through the templating engine late +# (布尔)启用后,查询插件(无论以 ``{{lookup('foo')}}`` 形式在变量中使用,还是以 with_foo 形式作为循环)返回的数据不会被标记为 'unsafe'。 +# 默认情况下,此类数据会被标记为 unsafe,以防模板引擎对它求值 jinja2 模板语言,否则可能存在安全风险。此选项用于保持向后兼容;不过用户应优先考虑给可能期望晚些再经过模板引擎处理的查询加上 allow_unsafe=True。 ;allow_unsafe_lookups=False # (boolean) This controls whether an Ansible playbook should prompt for a login password. If using SSH keys for authentication, you probably do not need to change this setting. +# (布尔)控制 ansible-playbook 是否提示输入登录密码。若使用 SSH 密钥认证,通常无需修改此项。 ;ask_pass=False # (boolean) This controls whether an Ansible playbook should prompt for a vault password. +# (布尔)控制 ansible-playbook 是否提示输入 vault 密码。 ;ask_vault_pass=False # (pathspec) Colon separated paths in which Ansible will search for Cache Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找缓存插件。 ;cache_plugins={{ ANSIBLE_HOME ~ "/plugins/cache:/usr/share/ansible/plugins/cache" }} # (pathspec) Colon separated paths in which Ansible will search for Callback Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找回调插件。 ;callback_plugins={{ ANSIBLE_HOME ~ "/plugins/callback:/usr/share/ansible/plugins/callback" }} # (pathspec) Colon separated paths in which Ansible will search for Cliconf Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Cliconf 插件。 ;cliconf_plugins={{ ANSIBLE_HOME ~ "/plugins/cliconf:/usr/share/ansible/plugins/cliconf" }} # (pathspec) Colon separated paths in which Ansible will search for Connection Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找连接插件。 ;connection_plugins={{ ANSIBLE_HOME ~ "/plugins/connection:/usr/share/ansible/plugins/connection" }} # (boolean) Toggles debug output in Ansible. This is *very* verbose and can hinder multiprocessing. Debug output can also include secret information despite no_log settings being enabled, which means debug mode should not be used in production. +# (布尔)开启 Ansible 的调试输出。它*非常*冗长,还会拖慢多进程;即便开启了 no_log,调试输出也可能泄露敏感信息,因此生产环境不应使用调试模式。 ;debug=False # (string) This indicates the command to use to spawn a shell under for Ansible's execution needs on a target. Users may need to change this in rare instances when shell usage is constrained, but in most cases it may be left as is. +# (字符串)指定 Ansible 在目标端执行所需时用来生成 shell 的命令。用户可能需要在此覆盖,例如某些使用受限 shell 的少见场景,但大多数情况下保持默认即可。 ;executable=/bin/sh # (string) This option allows you to globally configure a custom path for 'local_facts' for the implied :ref:`ansible_collections.ansible.builtin.setup_module` task when using fact gathering. # If not set, it will fallback to the default from the ``ansible.builtin.setup`` module: ``/etc/ansible/facts.d``. # This does **not** affect user defined tasks that use the ``ansible.builtin.setup`` module. # The real action being created by the implicit task is currently ``ansible.legacy.gather_facts`` module, which then calls the configured fact modules, by default this will be ``ansible.builtin.setup`` for POSIX systems but other platforms might have different defaults. +# (字符串)该选项用于为隐式收集主机事实时调用的 :ref:`ansible_collections.ansible.builtin.setup_module` 任务全局配置自定义 'local_facts' 路径。 +# 若未设置,将回退到 ``ansible.builtin.setup`` 模块的默认值:``/etc/ansible/facts.d``。 +# 这**不会**影响用户自定义的、使用 ``ansible.builtin.setup`` 模块的任务。 +# 隐式任务实际由 ``ansible.legacy.gather_facts`` 模块创建,它随后调用已配置的 fact 模块;对 POSIX 系统来说默认是 ``ansible.builtin.setup``,其他平台可能有不同默认值。 ;fact_path= # (pathspec) Colon separated paths in which Ansible will search for Jinja2 Filter Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Jinja2 过滤器插件。 ;filter_plugins={{ ANSIBLE_HOME ~ "/plugins/filter:/usr/share/ansible/plugins/filter" }} # (boolean) This option controls if notified handlers run on a host even if a failure occurs on that host. # When false, the handlers will not run if a failure has occurred on a host. # This can also be set per play or on the command line. See Handlers and Failure for more details. +# (布尔)该选项控制当某台主机发生失败后,已触发的 handler 是否仍在该主机上运行。 +# 为 false 时,若发生失败,handler 将不会运行。 +# 也可以通过 play 或命令行按需设置,详见 Handlers and Failure 相关文档。 ;force_handlers=False # (integer) Maximum number of forks Ansible will use to execute tasks on target hosts. +# (整数)Ansible 在目标主机上执行任务时使用的最大 fork 并行数。 ;forks=5 # (string) This setting controls the default policy of fact gathering (facts discovered about remote systems). # This option can be useful for those wishing to save fact gathering time. Both 'smart' and 'explicit' will use the cache plugin. +# (字符串)该设置控制默认的事实收集策略(收集到的远程系统事实)。 +# 希望节省事实收集时间的用户可以用这个选项。'smart' 和 'explicit' 都会使用缓存插件。 ;gathering=implicit # (list) Set the `gather_subset` option for the :ref:`ansible_collections.ansible.builtin.setup_module` task in the implicit fact gathering. See the module documentation for specifics. # It does **not** apply to user defined ``ansible.builtin.setup`` tasks. +# (列表)为隐式事实收集中的 :ref:`ansible_collections.ansible.builtin.setup_module` 任务设置 `gather_subset` 选项,具体选项见模块文档。 +# 它**不**适用于用户自定义的 ``ansible.builtin.setup`` 任务。 ;gather_subset= # (integer) Set the timeout in seconds for the implicit fact gathering, see the module documentation for specifics. # It does **not** apply to user defined :ref:`ansible_collections.ansible.builtin.setup_module` tasks. +# (整数)设置隐式事实收集的超时时间(秒),具体见模块文档。 +# 它**不**适用于用户自定义的 :ref:`ansible_collections.ansible.builtin.setup_module` 任务。 ;gather_timeout= # (string) This setting controls how duplicate definitions of dictionary variables (aka hash, map, associative array) are handled in Ansible. @@ -131,345 +179,489 @@ # Changing the setting to ``merge`` applies across variable sources, but many sources will internally still overwrite the variables. For example ``include_vars`` will dedupe variables internally before updating Ansible, with 'last defined' overwriting previous definitions in same file. # The Ansible project recommends you **avoid ``merge`` for new projects.** # It is the intention of the Ansible developers to eventually deprecate and remove this setting, but it is being kept as some users do heavily rely on it. New projects should **avoid 'merge'**. +# (字符串)该设置控制 Ansible 如何处理字典类变量(即哈希、映射、关联数组)的重复定义。 +# 它不影响取值为标量(整数、字符串)或数组的变量。 +# **警告**,不建议修改此设置,因为它很脆弱,会让你的内容(play、role、集合)变得不可移植,导致持续不断的混淆和误用。除非你确信有绝对必要,否则不要改这一项。 +# 我们建议避免复用变量名,改用 ``combine`` 过滤器以及 ``vars``、``varnames`` 查询来构造各个变量的合并版本。以我们的经验,真正需要这样做的情形很少,它往往说明数据结构引入了过多复杂度。 +# 有些用法还可以考虑自定义 vars_plugins 在输入阶段进行合并,甚至替换负责解析 ``host_vars/`` 和 ``group_vars/`` 目录的默认 ``host_group_vars``。该设置的大多数使用者只关心清单作用域,但这个设置本身会影响所有来源,让调试更加困难。 +# 所有官方示例仓库中的 playbook 和 role 都假定此设置取默认值。 +# 改为 ``merge`` 后会跨变量来源生效,但许多来源内部仍会覆盖变量。例如 ``include_vars`` 在更新 Ansible 之前会在内部对变量去重,按“最后定义”覆盖同文件中先前的定义。 +# Ansible 项目建议**新项目避免使用 ``merge``。** +# Ansible 开发者的意图是最终弃用并移除该设置,但之所以保留,是因为确实有些用户严重依赖它。新项目应**避免使用 'merge'**。 ;hash_behaviour=replace # (pathlist) Comma separated list of Ansible inventory sources +# (路径列表)逗号分隔的 Ansible 清单来源列表。 ;inventory=/etc/ansible/hosts # (pathspec) Colon separated paths in which Ansible will search for HttpApi Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 HttpApi 插件。 ;httpapi_plugins={{ ANSIBLE_HOME ~ "/plugins/httpapi:/usr/share/ansible/plugins/httpapi" }} # (float) This sets the interval (in seconds) of Ansible internal processes polling each other. Lower values improve performance with large playbooks at the expense of extra CPU load. Higher values are more suitable for Ansible usage in automation scenarios, when UI responsiveness is not required but CPU usage might be a concern. # The default corresponds to the value hardcoded in Ansible <= 2.1 +# (浮点数)设置 Ansible 内部进程互相轮询的间隔(秒)。较低的值可提升大型 playbook 的性能,代价是额外的 CPU 开销;较高的值更适合 UI 不太需要实时响应、而 CPU 占用成问题的自动化场景。 +# 默认值与 Ansible <= 2.1 中写死的值一致。 ;internal_poll_interval=0.001 # (pathspec) Colon separated paths in which Ansible will search for Inventory Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找清单插件。 ;inventory_plugins={{ ANSIBLE_HOME ~ "/plugins/inventory:/usr/share/ansible/plugins/inventory" }} # (string) This is a developer-specific feature that allows enabling additional Jinja2 extensions. # See the Jinja2 documentation for details. If you do not know what these do, you probably don't need to change this setting :) +# (字符串)这是面向开发者的功能,允许启用额外的 Jinja2 扩展。 +# 详见 Jinja2 文档;如果不清楚它们的作用,你多半不需要修改此项 :) ;jinja2_extensions=[] # (boolean) This option preserves variable types during template operations. +# (布尔)该选项在模板操作过程中保留变量类型。 ;jinja2_native=False # (boolean) Enables/disables the cleaning up of the temporary files Ansible used to execute the tasks on the remote. # If this option is enabled it will disable ``ANSIBLE_PIPELINING``. +# (布尔)启用/禁用清理 Ansible 用于在远程执行任务的临时文件。 +# 启用此选项会禁用 ``ANSIBLE_PIPELINING``。 ;keep_remote_files=False # (boolean) Controls whether callback plugins are loaded when running /usr/bin/ansible. This may be used to log activity from the command line, send notifications, and so on. Callback plugins are always loaded for ``ansible-playbook``. +# (布尔)控制运行 /usr/bin/ansible 时是否加载回调插件。可用于记录命令行活动、发送通知等。``ansible-playbook`` 总会加载回调插件。 ;bin_ansible_callbacks=False # (tmppath) Temporary directory for Ansible to use on the controller. +# (tmppath)Ansible 在控制端使用的临时目录。 ;local_tmp={{ ANSIBLE_HOME ~ "/tmp" }} # (list) List of logger names to filter out of the log file +# (列表)要从日志文件中过滤掉的日志器名称列表。 ;log_filter= # (path) File to which Ansible will log on the controller. When empty logging is disabled. +# (路径)在控制端写入 Ansible 日志的文件。为空时禁用日志记录。 ;log_path= # (pathspec) Colon separated paths in which Ansible will search for Lookup Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找查询插件。 ;lookup_plugins={{ ANSIBLE_HOME ~ "/plugins/lookup:/usr/share/ansible/plugins/lookup" }} # (string) Sets the macro for the 'ansible_managed' variable available for :ref:`ansible_collections.ansible.builtin.template_module` and :ref:`ansible_collections.ansible.windows.win_template_module`. This is only relevant for those two modules. +# (字符串)设置 :ref:`ansible_collections.ansible.builtin.template_module` 和 :ref:`ansible_collections.ansible.windows.win_template_module` 可用的 'ansible_managed' 变量宏。仅对这两个模块有意义。 ;ansible_managed=Ansible managed # (string) This sets the default arguments to pass to the ``ansible`` adhoc binary if no ``-a`` is specified. +# (字符串)未指定 ``-a`` 时传给 ``ansible`` adhoc 二进制的默认参数。 ;module_args= # (string) Compression scheme to use when transferring Python modules to the target. +# (字符串)向目标传输 Python 模块时使用的压缩方案。 ;module_compression=ZIP_DEFLATED # (string) Module to use with the ``ansible`` AdHoc command, if none is specified via ``-m``. +# 未通过 ``-m`` 指定时,``ansible`` AdHoc 命令使用的模块。 ;module_name=command # (pathspec) Colon separated paths in which Ansible will search for Modules. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找模块。 ;library={{ ANSIBLE_HOME ~ "/plugins/modules:/usr/share/ansible/plugins/modules" }} # (pathspec) Colon separated paths in which Ansible will search for Module utils files, which are shared by modules. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找模块工具(module_utils)文件,这些文件由多个模块共享。 ;module_utils={{ ANSIBLE_HOME ~ "/plugins/module_utils:/usr/share/ansible/plugins/module_utils" }} # (pathspec) Colon separated paths in which Ansible will search for Netconf Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Netconf 插件。 ;netconf_plugins={{ ANSIBLE_HOME ~ "/plugins/netconf:/usr/share/ansible/plugins/netconf" }} # (boolean) Toggle Ansible's display and logging of task details, mainly used to avoid security disclosures. +# (布尔)切换 Ansible 对任务详情的显示与日志记录,主要用于避免泄露安全信息。 ;no_log=False # (boolean) Toggle Ansible logging to syslog on the target when it executes tasks. On Windows hosts this will disable a newer style PowerShell modules from writing to the event log. +# (布尔)切换目标端执行任务时 Ansible 是否写入目标端 syslog。在 Windows 主机上,这会禁用较新风格的 PowerShell 模块写入事件日志。 ;no_target_syslog=False # (raw) What templating should return as a 'null' value. When not set it will let Jinja2 decide. +# (raw)模板渲染时用作 'null' 值的内容。未设置时交由 Jinja2 决定。 ;null_representation= # (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how often to check back on the status of those tasks when an explicit poll interval is not supplied. The default is a reasonably moderate 15 seconds which is a tradeoff between checking in frequently and providing a quick turnaround when something may have completed. +# (整数)对于 Ansible 中的异步任务(见“异步操作与轮询”),当未显式指定轮询间隔时,这是检查这些任务状态的回访频率。默认 15 秒是个合理的折中:既能较频繁地检查,又能在任务可能已完成时快速响应。 ;poll_interval=15 # (path) Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, you can set the default value here to avoid re-specifying --private-key with every invocation. +# (路径)对于使用证书或密钥文件(而非 agent 或密码)认证的连接,可在此设置默认值,免得每次调用都重新指定 --private-key。 ;private_key_file= # (boolean) By default, imported roles publish their variables to the play and other roles, this setting can avoid that. # This was introduced as a way to reset role variables to default values if a role is used more than once in a playbook. # Included roles only make their variables public at execution, unlike imported roles which happen at playbook compile time. +# (布尔)默认情况下,import 的 role 会把变量发布到 play 及其他 role;开启此项可避免这种做法。 +# 引入它是为了在 playbook 中多次使用同一 role 时,把 role 变量重置为默认值。 +# 与 import 的 role(在 playbook 编译期发布)不同,include 的 role 只在执行时使变量公开。 ;private_role_vars=False # (integer) Port to use in remote connections, when blank it will use the connection plugin default. +# (整数)远程连接使用的端口;留空则使用连接插件的默认值。 ;remote_port= # (string) Sets the login user for the target machines # When blank it uses the connection plugin's default, normally the user currently executing Ansible. +# (字符串)设置目标机器的登录用户。 +# 留空时使用连接插件的默认值,通常是当前执行 Ansible 的用户。 ;remote_user= # (pathspec) Colon separated paths in which Ansible will search for Roles. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 role。 ;roles_path={{ ANSIBLE_HOME ~ "/roles:/usr/share/ansible/roles:/etc/ansible/roles" }} # (string) Set the main callback used to display Ansible output. You can only have one at a time. # You can have many other callbacks, but just one can be in charge of stdout. # See :ref:`callback_plugins` for a list of available options. +# (字符串)设置用于显示 Ansible 输出的主回调。同一时间只能有一个。 +# 你可以同时拥有许多其他回调,但只能有一个负责标准输出。 +# 可用选项列表见 :ref:`callback_plugins`。 ;stdout_callback=default # (string) Set the default strategy used for plays. +# (字符串)设置 play 使用的默认策略。 ;strategy=linear # (pathspec) Colon separated paths in which Ansible will search for Strategy Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找策略插件。 ;strategy_plugins={{ ANSIBLE_HOME ~ "/plugins/strategy:/usr/share/ansible/plugins/strategy" }} # (boolean) Toggle the use of "su" for tasks. +# (布尔)切换任务是否使用 "su"。 ;su=False # (string) Syslog facility to use when Ansible logs to the remote target +# (字符串)Ansible 记录到远程目标时使用的 syslog facility。 ;syslog_facility=LOG_USER # (pathspec) Colon separated paths in which Ansible will search for Terminal Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找终端插件。 ;terminal_plugins={{ ANSIBLE_HOME ~ "/plugins/terminal:/usr/share/ansible/plugins/terminal" }} # (pathspec) Colon separated paths in which Ansible will search for Jinja2 Test Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Jinja2 测试插件。 ;test_plugins={{ ANSIBLE_HOME ~ "/plugins/test:/usr/share/ansible/plugins/test" }} # (integer) This is the default timeout for connection plugins to use. +# (整数)连接插件使用的默认超时时间。 ;timeout=10 # (string) Can be any connection plugin available to your ansible installation. # There is also a (DEPRECATED) special 'smart' option, that will toggle between 'ssh' and 'paramiko' depending on controller OS and ssh versions. +# (字符串)可以是 Ansible 安装中可用的任意连接插件。 +# 另有一个(已弃用的)特殊选项 'smart',会根据控制端操作系统和 ssh 版本在 'ssh' 与 'paramiko' 之间切换。 ;transport=ssh # (boolean) When True, this causes ansible templating to fail steps that reference variable names that are likely typoed. # Otherwise, any '{{ template_expression }}' that contains undefined variables will be rendered in a template or ansible action line exactly as written. +# (布尔)为 True 时,若步骤引用的变量名看起来像是拼写错误,模板化会直接失败。 +# 否则,任何包含未定义变量的 '{{ template_expression }}' 都会原样渲染到模板或 Ansible 动作行中。 ;error_on_undefined_vars=True # (pathspec) Colon separated paths in which Ansible will search for Vars Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找 Vars 插件。 ;vars_plugins={{ ANSIBLE_HOME ~ "/plugins/vars:/usr/share/ansible/plugins/vars" }} # (string) The vault_id to use for encrypting by default. If multiple vault_ids are provided, this specifies which to use for encryption. The --encrypt-vault-id cli option overrides the configured value. +# (字符串)默认用于加密的 vault_id。若提供了多个 vault_id,此项指定加密时使用哪一个。命令行选项 --encrypt-vault-id 会覆盖此配置值。 ;vault_encrypt_identity= # (string) The label to use for the default vault id label in cases where a vault id label is not provided +# (字符串)未提供 vault id 标签时,用作默认 vault id 标签的标签。 ;vault_identity=default # (list) A list of vault-ids to use by default. Equivalent to multiple --vault-id args. Vault-ids are tried in order. +# (列表)默认使用的 vault-id 列表,等价于多个 --vault-id 参数。会按顺序尝试这些 vault-id。 ;vault_identity_list= # (string) If true, decrypting vaults with a vault id will only try the password from the matching vault-id +# (字符串)若为 true,使用 vault id 解密时只会尝试与该 vault-id 匹配的密码。 ;vault_id_match=False # (path) The vault password file to use. Equivalent to --vault-password-file or --vault-id # If executable, it will be run and the resulting stdout will be used as the password. +# (路径)使用的 vault 密码文件,等价于 --vault-password-file 或 --vault-id。 +# 如果是可执行文件,它会被运行,并用其标准输出作为密码。 ;vault_password_file= # (integer) Sets the default verbosity, equivalent to the number of ``-v`` passed in the command line. +# (整数)设置默认详细程度,等价于命令行中传入的 ``-v`` 个数。 ;verbosity=0 # (boolean) Toggle to control the showing of deprecation warnings +# (布尔)切换是否显示弃用警告。 ;deprecation_warnings=True # (boolean) Toggle to control showing warnings related to running devel +# (布尔)切换是否显示与运行 devel 版本相关的警告。 ;devel_warning=True # (boolean) Normally ``ansible-playbook`` will print a header for each task that is run. These headers will contain the name: field from the task if you specified one. If you didn't then ``ansible-playbook`` uses the task's action to help you tell which task is presently running. Sometimes you run many of the same action and so you want more information about the task to differentiate it from others of the same action. If you set this variable to True in the config then ``ansible-playbook`` will also include the task's arguments in the header. # This setting defaults to False because there is a chance that you have sensitive values in your parameters and you do not want those to be printed. # If you set this to True you should be sure that you have secured your environment's stdout (no one can shoulder surf your screen and you aren't saving stdout to an insecure file) or made sure that all of your playbooks explicitly added the ``no_log: True`` parameter to tasks which have sensitive values See How do I keep secret data in my playbook? for more information. +# (布尔)通常情况下,``ansible-playbook`` 会为运行的每个任务打印一个标题,标题包含你指定的 name: 字段;若未指定,则用任务的动作来帮助区分当前运行的是哪个任务。有时你会运行许多相同动作的任务,因此想获得更多信息来区分它们。若在配置中把此项设为 True,``ansible-playbook`` 还会在标题中包含任务的参数。 +# 此设置默认为 False,因为你的参数中可能含有敏感值,而你不想把它们打印出来。 +# 若设为 True,请确保已保护好环境的 stdout(没人能偷看你的屏幕,你也没有把 stdout 保存到不安全的文件),或确保所有参数含敏感值的 playbook 都显式加上了 ``no_log: True`` 参数。关于如何保密 playbook 中的敏感数据,见 How do I keep secret data in my playbook?。 ;display_args_to_stdout=False # (boolean) Toggle to control displaying skipped task/host entries in a task in the default callback +# (布尔)切换是否在任务的默认回调中显示被跳过的任务/主机条目。 ;display_skipped_hosts=True # (string) Root docsite URL used to generate docs URLs in warning/error text; must be an absolute URL with valid scheme and trailing slash. +# (字符串)用于在警告/错误文本中生成文档链接的站点根 URL,必须是带合法协议且以斜杠结尾的绝对 URL。 ;docsite_root_url=https://docs.ansible.com/ansible-core/ # (pathspec) Colon separated paths in which Ansible will search for Documentation Fragments Plugins. +# (路径列表)以冒号分隔的目录,Ansible 在这些目录中查找文档片段插件。 ;doc_fragment_plugins={{ ANSIBLE_HOME ~ "/plugins/doc_fragments:/usr/share/ansible/plugins/doc_fragments" }} # (string) By default Ansible will issue a warning when a duplicate dict key is encountered in YAML. # These warnings can be silenced by adjusting this setting to False. +# (字符串)默认情况下,YAML 中出现重复字典键时 Ansible 会给出警告。 +# 可通过把此项设为 False 屏蔽这些警告。 ;duplicate_dict_key=warn # (boolean) Whether or not to enable the task debugger, this previously was done as a strategy plugin. # Now all strategy plugins can inherit this behavior. The debugger defaults to activating when # a task is failed on unreachable. Use the debugger keyword for more flexibility. +# (布尔)是否启用任务调试器,它以前是作为策略插件实现的。 +# 现在所有策略插件都可以继承此行为。调试器默认在不可达(unreachable)时任务失败的情况下激活。 +# 使用 debugger 关键字可以获得更灵活的控制。 ;enable_task_debugger=False # (boolean) Toggle to allow missing handlers to become a warning instead of an error when notifying. +# (布尔)切换是否允许缺失的 handler 变为警告而不是错误(在 notify 时)。 ;error_on_missing_handler=True # (list) Which modules to run during a play's fact gathering stage, using the default of 'smart' will try to figure it out based on connection type. # If adding your own modules but you still want to use the default Ansible facts, you will want to include 'setup' or corresponding network module to the list (if you add 'smart', Ansible will also figure it out). # This does not affect explicit calls to the 'setup' module, but does always affect the 'gather_facts' action (implicit or explicit). +# (列表)play 收集事实阶段要运行的模块。默认的 'smart' 会根据连接类型尝试自行判断。 +# 若添加你自己的模块但仍想使用默认的 Ansible 事实,需要把 'setup' 或相应的网络模块加入列表(若加入 'smart',Ansible 也会自行判断)。 +# 这不会影响对 'setup' 模块的显式调用,但总会影响 'gather_facts' 动作(隐式或显式)。 ;facts_modules=smart # (boolean) Set this to "False" if you want to avoid host key checking by the underlying tools Ansible uses to connect to the host +# (布尔)若想通过 Ansible 底层连接主机时使用的工具跳过主机密钥校验,请设为 "False"。 ;host_key_checking=True # (boolean) Facts are available inside the `ansible_facts` variable, this setting also pushes them as their own vars in the main namespace. # Unlike inside the `ansible_facts` dictionary, these will have an `ansible_` prefix. +# (布尔)事实可在 `ansible_facts` 变量中获取;此设置还会把它们作为独立变量推入主命名空间。 +# 与 `ansible_facts` 字典内部不同,这些变量会带有 `ansible_` 前缀。 ;inject_facts_as_vars=True # (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backwards-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present. -;interpreter_python=auto +# (字符串)用于在远程目标上执行模块的 Python 解释器路径,或自动发现模式。支持的发现模式:``auto``(默认)、``auto_silent``、``auto_legacy``、``auto_legacy_silent``。所有发现模式都会用一张查找表来使用系统自带的 Python(在已知自带 Python 的发行版上),若没有平台特定的默认值,则回退到一个固定顺序的常见 Python 解释器位置列表。回退行为会发出警告,提示应显式设置解释器(因为之后安装的解释器可能改变实际使用的那个)。将此项设为 ``auto_silent`` 或 ``auto_legacy_silent`` 可以禁用这条警告。``auto_legacy`` 提供完全相同的回退行为,但为兼容总是默认使用 ``/usr/bin/python`` 的旧版 Ansible,只要该解释器存在就会使用它。 +#interpreter_python=/usr/local/python3/bin/python3 # (boolean) If 'false', invalid attributes for a task will result in warnings instead of errors +# (布尔)若为 'false',任务上的非法属性只会产生警告而不是错误。 ;invalid_task_attribute_failed=True # (boolean) Toggle to control showing warnings related to running a Jinja version older than required for jinja2_native +# (布尔)切换是否显示与运行的 Jinja 版本低于 jinja2_native 所需版本相关的警告。 ;jinja2_native_warning=True # (boolean) By default Ansible will issue a warning when there are no hosts in the inventory. # These warnings can be silenced by adjusting this setting to False. +# (布尔)默认情况下,清单中没有任何主机时 Ansible 会给出警告。 +# 可通过把此项设为 False 屏蔽这些警告。 ;localhost_warning=True # (int) Maximum size of files to be considered for diff display +# (整数)参与差异(diff)显示的文件最大大小。 ;max_diff_size=104448 # (list) List of extensions to ignore when looking for modules to load # This is for rejecting script and binary module fallback extensions +# (列表)查找待加载模块时要忽略的扩展名列表。 +# 用于拒绝脚本和二进制模块的回退扩展名。 ;module_ignore_exts={{(REJECT_EXTS + ('.yaml', '.yml', '.ini'))}} # (bool) Enables whether module responses are evaluated for containing non UTF-8 data # Disabling this may result in unexpected behavior # Only ansible-core should evaluate this configuration +# (布尔)启用后,模块响应会被检查是否包含非 UTF-8 数据。 +# 禁用可能导致意外行为。 +# 只有 ansible-core 应评估此配置。 ;module_strict_utf8_response=True # (list) TODO: write it +# (列表)TODO:待补充。 ;network_group_modules=eos, nxos, ios, iosxr, junos, enos, ce, vyos, sros, dellos9, dellos10, dellos6, asa, aruba, aireos, bigip, ironware, onyx, netconf, exos, voss, slxos # (boolean) Previously Ansible would only clear some of the plugin loading caches when loading new roles, this led to some behaviours in which a plugin loaded in previous plays would be unexpectedly 'sticky'. This setting allows to return to that behaviour. +# (布尔)以前 Ansible 只在加载新 role 时清除部分插件加载缓存,这导致某些行为:之前 play 中加载的插件意外地变得“粘滞”。此设置允许恢复那种行为。 ;old_plugin_cache_clear=False # (path) A number of non-playbook CLIs have a ``--playbook-dir`` argument; this sets the default value for it. +# (路径)若干非 playbook 的 CLI 都有 ``--playbook-dir`` 参数,此项设置其默认值。 ;playbook_dir= # (string) This sets which playbook dirs will be used as a root to process vars plugins, which includes finding host_vars/group_vars +# (字符串)设置以哪些 playbook 目录为根来处理 vars 插件(包括查找 host_vars/group_vars)。 ;playbook_vars_root=top # (path) A path to configuration for filtering which plugins installed on the system are allowed to be used. # See :ref:`plugin_filtering_config` for details of the filter file's format. # The default is /etc/ansible/plugin_filters.yml +# (路径)用于筛选系统中安装了哪些插件可被使用的配置文件路径。 +# 该筛选文件格式的详情见 :ref:`plugin_filtering_config`。 +# 默认为 /etc/ansible/plugin_filters.yml。 ;plugin_filters_cfg= # (string) Attempts to set RLIMIT_NOFILE soft limit to the specified value when executing Python modules (can speed up subprocess usage on Python 2.x. See https://bugs.python.org/issue11284). The value will be limited by the existing hard limit. Default value of 0 does not attempt to adjust existing system-defined limits. +# (字符串)尝试把 RLIMIT_NOFILE 软限制设为指定值(用于执行 Python 模块时,可加速 Python 2.x 上的子进程使用,见 https://bugs.python.org/issue11284)。该值受现有硬限制约束。默认值 0 表示不尝试调整系统定义的现有限制。 ;python_module_rlimit_nofile=0 # (bool) This controls whether a failed Ansible playbook should create a .retry file. +# (布尔)控制失败的 playbook 是否创建 .retry 文件。 ;retry_files_enabled=False # (path) This sets the path in which Ansible will save .retry files when a playbook fails and retry files are enabled. # This file will be overwritten after each run with the list of failed hosts from all plays. +# (路径)设置 playbook 失败且启用 retry 文件时,Ansible 保存 .retry 文件的路径。 +# 每次运行后,该文件会被覆盖为所有 play 中失败主机的列表。 ;retry_files_save_path= # (str) This setting can be used to optimize vars_plugin usage depending on user's inventory size and play selection. +# (字符串)该设置可用于根据用户的清单规模和 play 选择来优化 vars_plugin 的使用。 ;run_vars_plugins=demand # (bool) This adds the custom stats set via the set_stats plugin to the default output +# (布尔)把通过 set_stats 插件设置的统计信息加入默认输出。 ;show_custom_stats=False # (string) Action to take when a module parameter value is converted to a string (this does not affect variables). For string parameters, values such as '1.00', "['a', 'b',]", and 'yes', 'y', etc. will be converted by the YAML parser unless fully quoted. # Valid options are 'error', 'warn', and 'ignore'. # Since 2.8, this option defaults to 'warn' but will change to 'error' in 2.12. +# (字符串)模块参数值被转换为字符串时的处理方式(不影响变量)。对字符串参数而言,'1.00'、"['a', 'b',]" 以及 'yes'、'y' 等值会被 YAML 解析器转换,除非完整加引号。 +# 可选值:'error'、'warn'、'ignore'。 +# 自 2.8 起此选项默认为 'warn',但将在 2.12 中改为 'error'。 ;string_conversion_action=warn # (boolean) Allows disabling of warnings related to potential issues on the system running ansible itself (not on the managed hosts) # These may include warnings about 3rd party packages or other conditions that should be resolved if possible. +# (布尔)允许禁用与运行 Ansible 的机器本身(而非受管主机)潜在问题相关的警告。 +# 这些可能包括关于第三方包或其他若可解决就应解决的状况的警告。 ;system_warnings=True # (boolean) This option defines whether the task debugger will be invoked on a failed task when ignore_errors=True is specified. # True specifies that the debugger will honor ignore_errors, False will not honor ignore_errors. +# (布尔)此选项定义一个任务在指定 ignore_errors=True 时失败后,是否调用任务调试器。 +# True 表示调试器会遵循 ignore_errors;False 表示不会遵循。 ;task_debugger_ignore_errors=True # (integer) Set the maximum time (in seconds) that a task can run for. # If set to 0 (the default) there is no timeout. +# (整数)设置任务可运行的最长时间(秒)。 +# 若设为 0(默认),则没有超时。 ;task_timeout=0 # (string) Make ansible transform invalid characters in group names supplied by inventory sources. +# (字符串)让 Ansible 转换清单来源提供的组名中的非法字符。 ;force_valid_group_names=never # (boolean) Toggles the use of persistence for connections. +# (布尔)切换是否使用连接持久化。 ;use_persistent_connections=False # (bool) A toggle to disable validating a collection's 'metadata' entry for a module_defaults action group. Metadata containing unexpected fields or value types will produce a warning when this is True. +# (布尔)用于禁用对模块默认值动作组的集合 'metadata' 条目进行校验的开关。此值为 True 时,包含意外字段或值类型错误的元数据会在校验时产生警告。 ;validate_action_group_metadata=True # (list) Accept list for variable plugins that require it. +# (列表)需要该选项的变量插件所接受的列表。 ;vars_plugins_enabled=host_group_vars # (list) Allows to change the group variable precedence merge order. +# (列表)允许修改组变量的优先级合并顺序。 ;precedence=all_inventory, groups_inventory, all_plugins_inventory, all_plugins_play, groups_plugins_inventory, groups_plugins_play # (string) The salt to use for the vault encryption. If it is not provided, a random salt will be used. +# (字符串)vault 加密使用的 salt。若未提供,将使用随机 salt。 ;vault_encrypt_salt= # (bool) Force 'verbose' option to use stderr instead of stdout +# (布尔)强制 'verbose' 选项使用 stderr 而不是 stdout。 ;verbose_to_stderr=False # (integer) For asynchronous tasks in Ansible (covered in Asynchronous Actions and Polling), this is how long, in seconds, to wait for the task spawned by Ansible to connect back to the named pipe used on Windows systems. The default is 5 seconds. This can be too low on slower systems, or systems under heavy load. # This is not the total time an async command can run for, but is a separate timeout to wait for an async command to start. The task will only start to be timed against its async_timeout once it has connected to the pipe, so the overall maximum duration the task can take will be extended by the amount specified here. +# (整数)对于 Ansible 中的异步任务(见“异步操作与轮询”),这是等待 Ansible 启动的任务在 Windows 系统上与命名管道建立连接的时间(秒)。默认 5 秒在较慢或负载较重的系统上可能太短。 +# 这不是异步命令可运行的总时长,而是等待异步命令启动的独立超时。任务只有在连接到管道后才会开始按其 async_timeout 计时,因此任务可用的最长总时长会在此基础上增加此处指定的时长。 ;win_async_startup_timeout=5 # (list) Check all of these extensions when looking for 'variable' files which should be YAML or JSON or vaulted versions of these. # This affects vars_files, include_vars, inventory and vars plugins among others. +# (列表)查找“变量”文件(应为 YAML、JSON 或它们的 vault 加密版本)时要检查的扩展名。 +# 这会影响 vars_files、include_vars、清单以及 vars 插件等。 ;yaml_valid_extensions=.yml, .yaml, .json [privilege_escalation] # (boolean) Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method +# (布尔)显示与 become 方法无关的提示,而不显示包含所提供 become 方法命令行的提示。 ;agnostic_become_prompt=True # (boolean) This setting controls if become is skipped when remote user and become user are the same. I.E root sudo to root. # If executable, it will be run and the resulting stdout will be used as the password. +# (布尔)此设置控制当远程用户与 become 用户相同时是否跳过 become,例如 root sudo 到 root。 +# 如果是可执行文件,它会被运行,并用其标准输出作为密码。 ;become_allow_same_user=False # (boolean) Toggles the use of privilege escalation, allowing you to 'become' another user after login. +# (布尔)切换是否使用特权提升,允许在登录后 'become' 为另一个用户。 ;become=False # (boolean) Toggle to prompt for privilege escalation password. +# (布尔)切换是否提示输入特权提升密码。 ;become_ask_pass=False # (string) executable to use for privilege escalation, otherwise Ansible will depend on PATH +# (字符串)用于特权提升的可执行文件,否则 Ansible 将依赖 PATH。 ;become_exe= # (string) Flags to pass to the privilege escalation executable. +# (字符串)传给特权提升可执行文件的标志。 ;become_flags= # (string) Privilege escalation method to use when `become` is enabled. +# (字符串)启用 become 时使用的特权提升方法。 ;become_method=sudo # (string) The user your login/remote user 'becomes' when using privilege escalation, most systems will use 'root' when no user is specified. +# (字符串)使用特权提升时,你的登录/远程用户会 'become' 为哪个用户;未指定用户时,大多数系统会使用 'root'。 ;become_user=root [persistent_connection] # (path) Specify where to look for the ansible-connection script. This location will be checked before searching $PATH. # If null, ansible will start with the same directory as the ansible script. +# (路径)指定在哪里查找 ansible-connection 脚本。会先检查此位置,再搜索 $PATH。 +# 若为 null,ansible 会从 ansible 脚本所在目录开始查找。 ;ansible_connection_path= # (int) This controls the amount of time to wait for response from remote device before timing out persistent connection. +# (整数)控制等待远程设备响应持久连接的时长,超时即中断。 ;command_timeout=30 # (integer) This controls the retry timeout for persistent connection to connect to the local domain socket. +# (整数)控制持久连接重试连接本地 domain socket 的超时时间。 ;connect_retry_timeout=15 # (integer) This controls how long the persistent connection will remain idle before it is destroyed. +# (整数)控制持久连接在销毁前可保持空闲的时长。 ;connect_timeout=30 # (path) Path to socket to be used by the connection persistence system. +# (路径)连接持久化系统使用的 socket 路径。 ;control_path_dir={{ ANSIBLE_HOME ~ "/pc" }} @@ -479,67 +671,91 @@ # It can result in a very significant performance improvement when enabled. # However this conflicts with privilege escalation (become). For example, when using 'sudo:' operations you must first disable 'requiretty' in /etc/sudoers on all managed hosts, which is why it is disabled by default. # This setting will be disabled if ``ANSIBLE_KEEP_REMOTE_FILES`` is enabled. +# (布尔)这是全局选项,各连接插件可以通过更具体的选项覆盖它,或者根本不支持 pipelining。 +# 若连接插件支持,pipelining 可减少在远程服务器上执行模块所需的网络操作次数,方式是无需实际传输文件即可执行多个 Ansible 模块。 +# 启用后可能带来非常显著的性能提升。 +# 但它与特权提升(become)冲突。例如使用 'sudo:' 操作时,必须先在所有受管主机上禁用 /etc/sudoers 中的 'requiretty',这就是默认禁用它的原因。 +# 若启用了 ``ANSIBLE_KEEP_REMOTE_FILES``,此设置会被禁用。 ;pipelining=False [colors] # (string) Defines the color to use on 'Changed' task status +# (字符串)定义 'Changed'(已变更)任务状态的颜色。 ;changed=yellow # (string) Defines the default color to use for ansible-console +# (字符串)定义 ansible-console 默认使用的颜色。 ;console_prompt=white # (string) Defines the color to use when emitting debug messages +# (字符串)定义输出调试信息时使用的颜色。 ;debug=dark gray # (string) Defines the color to use when emitting deprecation messages +# (字符串)定义输出弃用信息时使用的颜色。 ;deprecate=purple # (string) Defines the color to use when showing added lines in diffs +# (字符串)定义显示差异(diff)中新增行时使用的颜色。 ;diff_add=green # (string) Defines the color to use when showing diffs +# (字符串)定义显示差异(diff)时使用的颜色。 ;diff_lines=cyan # (string) Defines the color to use when showing removed lines in diffs +# (字符串)定义显示差异(diff)中被删除行时使用的颜色。 ;diff_remove=red # (string) Defines the color to use when emitting error messages +# (字符串)定义输出错误信息时使用的颜色。 ;error=red # (string) Defines the color to use for highlighting +# (字符串)定义用于高亮的颜色。 ;highlight=white # (string) Defines the color to use when showing 'OK' task status +# (字符串)定义显示 'OK' 任务状态时使用的颜色。 ;ok=green # (string) Defines the color to use when showing 'Skipped' task status +# (字符串)定义显示 'Skipped'(已跳过)任务状态时使用的颜色。 ;skip=cyan # (string) Defines the color to use on 'Unreachable' status +# (字符串)定义 'Unreachable'(不可达)状态使用的颜色。 ;unreachable=bright red # (string) Defines the color to use when emitting verbose messages. i.e those that show with '-v's. +# (字符串)定义输出详细消息时使用的颜色,即带 -v 等参数时显示的那些。 ;verbose=blue # (string) Defines the color to use when emitting warning messages +# (字符串)定义输出警告消息时使用的颜色。 ;warn=bright purple [selinux] # (boolean) This setting causes libvirt to connect to lxc containers by passing --noseclabel to virsh. This is necessary when running on systems which do not have SELinux. +# (布尔)此设置让 libvirt 通过给 virsh 传 --noseclabel 来连接 lxc 容器。在未启用 SELinux 的系统上运行时需要这样做。 ;libvirt_lxc_noseclabel=False # (list) Some filesystems do not support safe operations and/or return inconsistent errors, this setting makes Ansible 'tolerate' those in the list w/o causing fatal errors. # Data corruption may occur and writes are not always verified when a filesystem is in the list. +# (列表)有些文件系统不支持安全操作,或会返回前后不一致的错误;此设置让 Ansible 对列表中的文件系统 '容忍' 这些情况,而不产生致命错误。 +# 文件系统在列表中时可能发生数据损坏,且写入并不总能得到验证。 ;special_context_filesystems=fuse, nfs, vboxsf, ramfs, 9p, vfat [diff] # (bool) Configuration toggle to tell modules to show differences when in 'changed' status, equivalent to ``--diff``. +# (布尔)配置开关,告诉模块在处于 'changed' 状态时显示差异,等价于 ``--diff``。 ;always=False # (integer) How many lines of context to show when displaying the differences between files. +# (整数)显示两个文件之间的差异时显示多少行上下文。 ;context=3 @@ -547,47 +763,67 @@ # (path) The directory that stores cached responses from a Galaxy server. # This is only used by the ``ansible-galaxy collection install`` and ``download`` commands. # Cache files inside this dir will be ignored if they are world writable. +# (路径)存储 Galaxy 服务器缓存响应的目录。 +# 仅被 ``ansible-galaxy collection install`` 和 ``download`` 命令使用。 +# 若此目录中的缓存文件对所有人可写,它们将被忽略。 ;cache_dir={{ ANSIBLE_HOME ~ "/galaxy_cache" }} # (bool) whether ``ansible-galaxy collection install`` should warn about ``--collections-path`` missing from configured :ref:`collections_paths` +# (布尔)``ansible-galaxy collection install`` 是否应在 ``--collections-path`` 未出现在已配置的 :ref:`collections_paths` 中时发出警告。 ;collections_path_warning=True # (path) Collection skeleton directory to use as a template for the ``init`` action in ``ansible-galaxy collection``, same as ``--collection-skeleton``. +# (路径)集合骨架目录,用作 ``ansible-galaxy collection`` 中 ``init`` 动作的模板,等同于 ``--collection-skeleton``。 ;collection_skeleton= # (list) patterns of files to ignore inside a Galaxy collection skeleton directory +# (列表)要在 Galaxy 集合骨架目录中忽略的文件模式。 ;collection_skeleton_ignore=^.git$, ^.*/.git_keep$ # (bool) Disable GPG signature verification during collection installation. +# (布尔)在集合安装期间禁用 GPG 签名校验。 ;disable_gpg_verify=False # (bool) Some steps in ``ansible-galaxy`` display a progress wheel which can cause issues on certain displays or when outputting the stdout to a file. # This config option controls whether the display wheel is shown or not. # The default is to show the display wheel if stdout has a tty. +# (布尔)``ansible-galaxy`` 中某些步骤会显示进度转轮,这在某些显示环境或在把 stdout 输出到文件时会造成问题。 +# 此配置选项控制是否显示转轮。 +# 默认情况下,stdout 连接了 tty 时才显示转轮。 ;display_progress= # (path) Configure the keyring used for GPG signature verification during collection installation and verification. +# (路径)配置在集合安装与校验期间用于 GPG 签名校验的 keyring。 ;gpg_keyring= # (boolean) If set to yes, ansible-galaxy will not validate TLS certificates. This can be useful for testing against a server with a self-signed certificate. +# (布尔)若设为 yes,ansible-galaxy 将不校验证书;这在测试使用自签名证书的服务器时有用。 ;ignore_certs= # (list) A list of GPG status codes to ignore during GPG signature verification. See L(https://github.com/gpg/gnupg/blob/master/doc/DETAILS#general-status-codes) for status code descriptions. # If fewer signatures successfully verify the collection than `GALAXY_REQUIRED_VALID_SIGNATURE_COUNT`, signature verification will fail even if all error codes are ignored. +# (列表)GPG 签名校验期间要忽略的 GPG 状态码列表。状态码说明见 L(https://github.com/gpg/gnupg/blob/master/doc/DETAILS#general-status-codes)。 +# 若成功校验的签名数量少于 `GALAXY_REQUIRED_VALID_SIGNATURE_COUNT`,即便所有错误码都被忽略,签名校验也会失败。 ;ignore_signature_status_codes= # (str) The number of signatures that must be successful during GPG signature verification while installing or verifying collections. # This should be a positive integer or all to indicate all signatures must successfully validate the collection. # Prepend + to the value to fail if no valid signatures are found for the collection. +# (字符串)在安装或校验集合期间,GPG 签名校验必须成功的签名数量。 +# 应为正整数,或 all 表示所有签名都必须成功。 +# 在值前加 + 表示:若集合未找到有效签名则失败。 ;required_valid_signature_count=1 # (path) Role skeleton directory to use as a template for the ``init`` action in ``ansible-galaxy``/``ansible-galaxy role``, same as ``--role-skeleton``. +# (路径)role 骨架目录,用作 ``ansible-galaxy``/``ansible-galaxy role`` 中 ``init`` 动作的模板,等同于 ``--role-skeleton``。 ;role_skeleton= # (list) patterns of files to ignore inside a Galaxy role or collection skeleton directory +# (列表)要在 Galaxy role 或集合骨架目录中忽略的文件模式。 ;role_skeleton_ignore=^.git$, ^.*/.git_keep$ # (string) URL to prepend when roles don't specify the full URI, assume they are referencing this server as the source. +# (字符串)role 未指定完整 URI 时在前面拼接的 URL,假定它们引用这个服务器作为来源。 ;server=https://galaxy.ansible.com # (list) A list of Galaxy servers to use when installing a collection. @@ -595,20 +831,29 @@ # See :ref:`galaxy_server_config` for more details on how to define a Galaxy server. # The order of servers in this list is used to as the order in which a collection is resolved. # Setting this config option will ignore the :ref:`galaxy_server` config option. +# (列表)安装集合时使用的 Galaxy 服务器列表。 +# 其值与配置 ini 段 ``[galaxy_server.{{item}}]`` 对应,该段定义服务器详情。 +# 详见 :ref:`galaxy_server_config` 中关于如何定义 Galaxy 服务器的说明。 +# 此列表中服务器的顺序即解析集合时使用的顺序。 +# 设置此配置选项会忽略 :ref:`galaxy_server` 配置选项。 ;server_list= # (int) The default timeout for Galaxy API calls. Galaxy servers that don't configure a specific timeout will fall back to this value. +# (整数)Galaxy API 调用的默认超时时间。未配置特定超时的 Galaxy 服务器将回退到此值。 ;server_timeout=60 # (path) Local path to galaxy access token file +# (路径)Galaxy 访问令牌文件的本地路径。 ;token_path={{ ANSIBLE_HOME ~ "/galaxy_token" }} [inventory] # (string) This setting changes the behaviour of mismatched host patterns, it allows you to force a fatal error, a warning or just ignore it +# (字符串)此设置改变主机模式不匹配时的行为,可强制为致命错误、警告,或直接忽略。 ;host_pattern_mismatch=warning # (boolean) If 'true', it is a fatal error when any given inventory source cannot be successfully parsed by any available inventory plugin; otherwise, this situation only attracts a warning. +# (布尔)若为 'true',当任一给定的清单来源无法被任何可用清单插件成功解析时,即为致命错误;否则该情形只会产生警告。 ;any_unparsed_is_failed=False @@ -616,75 +861,109 @@ # This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`. # The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory configuration. # This message will be removed in 2.16. +# (布尔)切换是否开启清单缓存。 +# 此设置已移至各个清单插件,作为插件选项 :ref:`inventory_plugins`。 +# 现有配置设置仍可接受,清单插件会从清单配置中添加额外选项。 +# 此消息将在 2.16 中移除。 ;cache=False # (string) The plugin for caching inventory. # This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`. # The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration. # This message will be removed in 2.16. +# (字符串)用于缓存清单的插件。 +# 此设置已移至各个清单插件,作为插件选项 :ref:`inventory_plugins`。 +# 现有配置设置仍可接受,清单插件会从清单配置和事实缓存配置中添加额外选项。 +# 此消息将在 2.16 中移除。 ;cache_plugin= # (string) The inventory cache connection. # This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`. # The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration. # This message will be removed in 2.16. +# (字符串)清单缓存的连接。 +# 此设置已移至各个清单插件,作为插件选项 :ref:`inventory_plugins`。 +# 现有配置设置仍可接受,清单插件会从清单配置和事实缓存配置中添加额外选项。 +# 此消息将在 2.16 中移除。 ;cache_connection= # (string) The table prefix for the cache plugin. # This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`. # The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration. # This message will be removed in 2.16. +# (字符串)缓存插件的表前缀。 +# 此设置已移至各个清单插件,作为插件选项 :ref:`inventory_plugins`。 +# 现有配置设置仍可接受,清单插件会从清单配置和事实缓存配置中添加额外选项。 +# 此消息将在 2.16 中移除。 ;cache_prefix=ansible_inventory_ # (string) Expiration timeout for the inventory cache plugin data. # This setting has been moved to the individual inventory plugins as a plugin option :ref:`inventory_plugins`. # The existing configuration settings are still accepted with the inventory plugin adding additional options from inventory and fact cache configuration. # This message will be removed in 2.16. +# (字符串)清单缓存插件数据的过期超时时间。 +# 此设置已移至各个清单插件,作为插件选项 :ref:`inventory_plugins`。 +# 现有配置设置仍可接受,清单插件会从清单配置和事实缓存配置中添加额外选项。 +# 此消息将在 2.16 中移除。 ;cache_timeout=3600 # (list) List of enabled inventory plugins, it also determines the order in which they are used. +# (列表)启用的清单插件列表,同时也决定了它们的使用顺序。 ;enable_plugins=host_list, script, auto, yaml, ini, toml # (bool) Controls if ansible-inventory will accurately reflect Ansible's view into inventory or its optimized for exporting. +# (布尔)控制 ansible-inventory 是准确反映 Ansible 对清单的视图,还是针对导出进行优化。 ;export=False # (list) List of extensions to ignore when using a directory as an inventory source +# (列表)把目录作为清单来源时,要忽略的扩展名列表。 ;ignore_extensions={{(REJECT_EXTS + ('.orig', '.ini', '.cfg', '.retry'))}} # (list) List of patterns to ignore when using a directory as an inventory source +# (列表)把目录作为清单来源时,要忽略的模式列表。 ;ignore_patterns= # (bool) If 'true' it is a fatal error if every single potential inventory source fails to parse, otherwise this situation will only attract a warning. +# (布尔)若为 'true',当每一个潜在的清单来源都无法解析时即为致命错误;否则该情形只会产生警告。 ;unparsed_is_failed=False # (boolean) By default Ansible will issue a warning when no inventory was loaded and notes that it will use an implicit localhost-only inventory. # These warnings can be silenced by adjusting this setting to False. +# (布尔)默认情况下,没有加载任何清单且注意到将使用隐式的仅 localhost 清单时,Ansible 会发出警告。 +# 可通过把此项设为 False 屏蔽这些警告。 ;inventory_unparsed_warning=True [netconf_connection] # (string) This variable is used to enable bastion/jump host with netconf connection. If set to True the bastion/jump host ssh settings should be present in ~/.ssh/config file, alternatively it can be set to custom ssh configuration file path to read the bastion/jump host settings. +# (字符串)此变量用于为 netconf 连接启用堡垒机/跳板机。若设为 True,堡垒机/跳板机的 ssh 设置应存在于 ~/.ssh/config 文件中;也可设为自定义 ssh 配置文件路径来读取堡垒机/跳板机设置。 ;ssh_config= [paramiko_connection] # (boolean) TODO: write it +# (布尔)TODO:待补充。 ;host_key_auto_add=False # (boolean) TODO: write it +# (布尔)TODO:待补充。 ;look_for_keys=True [jinja2] # (list) This list of filters avoids 'type conversion' when templating variables # Useful when you want to avoid conversion into lists or dictionaries for JSON strings, for example. +# (列表)此过滤器列表可避免模板化时的“类型转换”。 +# 例如,当你不想把 JSON 字符串转换成列表或字典时很有用。 ;dont_type_filters=string, to_json, to_nice_json, to_yaml, to_nice_yaml, ppretty, json [tags] # (list) default list of tags to run in your plays, Skip Tags has precedence. +# (列表)在你的 play 中默认要运行的标签列表;skip 标签优先级更高。 ;run= # (list) default list of tags to skip in your plays, has precedence over Run Tags +# (列表)在你的 play 中默认要跳过的标签列表,优先于 run 标签。 ;skip= diff --git a/image/tools-ansible/ansible/hosts b/image/tools-ansible/ansible/hosts index 5b1f30f..255acac 100644 --- a/image/tools-ansible/ansible/hosts +++ b/image/tools-ansible/ansible/hosts @@ -1,53 +1,54 @@ -# This is the default ansible 'hosts' file. +# Ansible 主机清单:使用用户名 + 密码连接 Linux / Windows / macOS # -# It should live in /etc/ansible/hosts +# 本文件默认安装在 /etc/ansible/hosts,也可用 `ansible -i hosts ...` 指定 +# 示例中的 IP、用户名、密码均为占位值,请替换为实际值 # -# - Comments begin with the '#' character -# - Blank lines are ignored -# - Groups of hosts are delimited by [header] elements -# - You can enter hostnames or ip addresses -# - A hostname/ip can be a member of multiple groups +# 每台主机的账号密码都不同,因此变量全部写在主机行内(ini 清单的 key=value 形式), +# 不使用 [组名:vars],避免同组主机被迫共用一套凭据; +# 需要按组统一处理的非凭据变量(如 ansible_connection)也逐台写在行内,见下方各组注释 -# Ex 1: Ungrouped hosts, specify before any group headers: +# --------------------------------------------------------------------------- +# Linux:SSH 用户名 + 密码 +# - 用密码登录 SSH 需要控制端装 sshpass(原生 ssh 连接插件不支持交互式输入密码) +# alinux3 / RHEL 系:yum install -y sshpass +# Debian / Ubuntu:apt-get install -y sshpass +# macOS(Homebrew):brew install hudochenkov/sshpass/sshpass +# - StrictHostKeyChecking=no 用于跳过首次连接的主机指纹确认 +# - 普通用户需要提权时再加 ansible_become=true ansible_become_password=... +# --------------------------------------------------------------------------- +[linux] +linux-01 ansible_host=192.0.2.11 ansible_connection=ssh ansible_user=root ansible_password=YourLinuxPassword1 ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' +linux-02 ansible_host=192.0.2.12 ansible_connection=ssh ansible_user=admin ansible_password=YourLinuxPassword2 ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -## green.example.com -## blue.example.com -## 192.168.100.1 -## 192.168.100.10 +# --------------------------------------------------------------------------- +# Windows:WinRM 用户名 + 密码 +# 1. 目标机已执行 ConfigureRemotingForAnsible.ps1,或手动开启 WinRM 并放行 5985/5986 +# 2. 本地账号 / 域账号都可用 NTLM;域账号写 DOMAIN\用户名 或 用户名@domain.com +# (反斜杠在 ini 清单里不是转义字符,可直接写) +# 3. 改用 Basic 认证(仅限可信内网)时:ansible_winrm_transport=basic +# ansible_port=5985 ansible_winrm_scheme=http +# 4. 控制端需要 pywinrm:pip install pywinrm requests-ntlm +# (本镜像未预装,非 Windows 需求可以不装;镜像内走的是 runtime-python315 的 pip 国内源) +# --------------------------------------------------------------------------- +[windows] +win-01 ansible_host=192.0.2.21 ansible_connection=winrm ansible_user=Administrator ansible_password=YourWindowsPassword1 ansible_winrm_transport=ntlm ansible_port=5986 ansible_winrm_scheme=https ansible_winrm_server_cert_validation=ignore +win-02 ansible_host=192.0.2.22 ansible_connection=winrm ansible_user=CORP\deploy ansible_password=YourWindowsPassword2 ansible_winrm_transport=ntlm ansible_port=5986 ansible_winrm_scheme=https ansible_winrm_server_cert_validation=ignore -# Ex 2: A collection of hosts belonging to the 'webservers' group: +# --------------------------------------------------------------------------- +# macOS:SSH 用户名 + 密码 +# 1. 目标 Mac 打开「系统设置 → 通用 → 共享 → 远程登录」,或 sudo systemsetup -setremotelogin on +# 2. macOS 默认只有 python3(没有 /usr/bin/python),必须显式指定解释器, +# 否则 Ansible 自动发现会报 "No python interpreters found" +# 3. 密码登录需要 sshd 允许(默认允许);控制端同样需要 sshpass +# --------------------------------------------------------------------------- +[macos] +mac-01 ansible_host=192.0.2.31 ansible_connection=ssh ansible_user=admin ansible_password=YourMacPassword1 ansible_python_interpreter=/usr/bin/python3 ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' +mac-02 ansible_host=192.0.2.32 ansible_connection=ssh ansible_user=deploy ansible_password=YourMacPassword2 ansible_python_interpreter=/usr/bin/python3 ansible_ssh_common_args='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' -## [webservers] -## alpha.example.org -## beta.example.org -## 192.168.1.100 -## 192.168.1.110 - -# If you have multiple hosts following a pattern, you can specify -# them like this: - -## www[001:006].example.com - -# You can also use ranges for multiple hosts: - -## db-[99:101]-node.example.com - -# Ex 3: A collection of database servers in the 'dbservers' group: - -## [dbservers] -## -## db01.intranet.mydomain.net -## db02.intranet.mydomain.net -## 10.25.1.56 -## 10.25.1.57 - - -# Ex4: Multiple hosts arranged into groups such as 'Debian' and 'openSUSE': - -## [Debian] -## alpha.example.org -## beta.example.org - -## [openSUSE] -## green.example.com -## blue.example.com +# --------------------------------------------------------------------------- +# 关于凭据安全 +# - 密码明文写在清单里有泄露风险,production 建议用 ansible-vault 加密宿主变量文件后 +# 用 vars_files 引入,或统一改用密钥登录(ansible_ssh_private_key_file) +# - 也可以不写 ansible_password,运行时用 --ask-pass 交互输入(一次输入作用于该次运行的所有主机, +# 因此只适合本次运行内密码一致的情况) +# ---------------------------------------------------------------------------