zoukankan      html  css  js  c++  java
  • ansible Inventory定义

    ------------恢复内容开始------------

    HOSTS定义

    List of Behavioral Inventory Parameters
    As alluded to above, setting the following variables controls how ansible interacts with remote hosts.

    Host connection:
    
    ansible_connection
    Connection type to the host. This can be the name of any of ansible’s connection plugins. SSH protocol types are smart, ssh or paramiko. The default is smart. Non-SSH based types are described in the next section.
    Note
    
    Ansible 2.0 has deprecated the “ssh” from ansible_ssh_user, ansible_ssh_host, and ansible_ssh_port to become ansible_user, ansible_host, and ansible_port. If you are using a version of Ansible prior to 2.0, you should continue using the older style variables (ansible_ssh_*). These shorter variables are ignored, without warning, in older versions of Ansible.
    
    General for all connections:
    
    ansible_host
    The name of the host to connect to, if different from the alias you wish to give to it.
    ansible_port
    The ssh port number, if not 22.
    ansible_user
    The default ssh user name to use.
    Specific to the SSH connection:
    
    ansible_ssh_pass
    The ssh password to use (never store this variable in plain text; always use a vault. See Variables and Vaults).
    ansible_ssh_private_key_file
    Private key file used by ssh. Useful if using multiple keys and you don’t want to use SSH agent.
    ansible_ssh_common_args
    This setting is always appended to the default command line for sftp, scp, and ssh. Useful to configure a ProxyCommand for a certain host (or group).
    ansible_sftp_extra_args
    This setting is always appended to the default sftp command line.
    ansible_scp_extra_args
    This setting is always appended to the default scp command line.
    ansible_ssh_extra_args
    This setting is always appended to the default ssh command line.
    ansible_ssh_pipelining
    Determines whether or not to use SSH pipelining. This can override the pipelining setting in ansible.cfg.
    ansible_ssh_executable (added in version 2.2)
    This setting overrides the default behavior to use the system ssh. This can override the ssh_executable setting in ansible.cfg.
    Privilege escalation (see Ansible Privilege Escalation for further details):
    
    ansible_become
    Equivalent to ansible_sudo or ansible_su, allows to force privilege escalation.
    ansible_become_method
    Allows to set privilege escalation method.
    ansible_become_user
    Equivalent to ansible_sudo_user or ansible_su_user, allows to set the user you become through privilege escalation.
    ansible_become_pass
    Equivalent to ansible_sudo_pass or ansible_su_pass, allows you to set the privilege escalation password (never store this variable in plain text; always use a vault. See Variables and Vaults).
    ansible_become_exe
    Equivalent to ansible_sudo_exe or ansible_su_exe, allows you to set the executable for the escalation method selected.
    ansible_become_flags
    Equivalent to ansible_sudo_flags or ansible_su_flags, allows you to set the flags passed to the selected escalation method. This can be also set globally in ansible.cfg in the sudo_flags option.
    Remote host environment parameters:
    
    ansible_shell_type
    The shell type of the target system. You should not use this setting unless you have set the ansible_shell_executable to a non-Bourne (sh) compatible shell. By default commands are formatted using sh-style syntax. Setting this to csh or fish will cause commands executed on target systems to follow those shell’s syntax instead.
    ansible_python_interpreter
    The target host python path. This is useful for systems with more than one Python or not located at /usr/bin/python such as *BSD, or where /usr/bin/python is not a 2.X series Python. We do not use the /usr/bin/env mechanism as that requires the remote user’s path to be set right and also assumes the python executable is named python, where the executable might be named something like python2.6.
    ansible_*_interpreter
    Works for anything such as ruby or perl and works just like ansible_python_interpreter. This replaces shebang of modules which will run on that host.
    New in version 2.1.
    
    ansible_shell_executable
    This sets the shell the ansible controller will use on the target machine, overrides executable in ansible.cfg which defaults to /bin/sh. You should really only change it if is not possible to use /bin/sh (i.e. /bin/sh is not installed on the target machine or cannot be run from sudo).
    

    转载于:https://docs.ansible.com/ansible/2.4/intro_inventory.html
    ------------恢复内容结束------------

  • 相关阅读:
    saltstack源码详解一
    linux的yum报错
    django restframework
    列表生成式
    面向对象的封装
    linux对于zombie的处理
    Flask学习目录
    #1_两数之和
    LeetCode入门
    Struts2(一)——基本使用
  • 原文地址:https://www.cnblogs.com/ligao/p/12201149.html
Copyright © 2011-2022 走看看