ansible  2.9.27
About: Ansible is an IT Configuration Management, Deployment \
About: Ansible (2.x) is an IT Configuration Management, Deployment & Orchestration tool.
ansible download page.
  Fossies Dox: ansible-2.9.27.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ansible.constants Namespace Reference

Classes

class  _DeprecatedSequenceConstant
 

Functions

def _warning (msg)
 
def _deprecated (msg, version='2.8')
 
def mk_boolean (value)
 
def get_config (parser, section, key, env_var, default_value, value_type=None, expand_relative_paths=False)
 
def set_constant (name, value, export=vars())
 

Variables

 __metaclass__ = type
 
 BECOME_METHODS
 
tuple BLACKLIST_EXTS = ('.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt', '.rst')
 
 BOOL_TRUE = BOOLEANS_TRUE
 
 DEFAULT_BECOME_PASS = None
 
 DEFAULT_PASSWORD_CHARS = to_text(ascii_letters + digits + ".,:-_", errors='strict')
 
 DEFAULT_REMOTE_PASS = None
 
 DEFAULT_SUBSET = None
 
tuple CONFIGURABLE_PLUGINS = ('become', 'cache', 'callback', 'cliconf', 'connection', 'httpapi', 'inventory', 'lookup', 'netconf', 'shell')
 
tuple DOCUMENTABLE_PLUGINS = CONFIGURABLE_PLUGINS + ('module', 'strategy', 'vars')
 
tuple IGNORE_FILES = ("COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES")
 
tuple INTERNAL_RESULT_KEYS = ('add_host', 'add_group')
 
tuple LOCALHOST = ('127.0.0.1', 'localhost', '::1')
 
 MODULE_REQUIRE_ARGS = tuple(add_internal_fqcns(('command', 'win_command', 'shell', 'win_shell', 'raw', 'script')))
 
 MODULE_NO_JSON = tuple(add_internal_fqcns(('command', 'win_command', 'shell', 'win_shell', 'raw')))
 
tuple RESTRICTED_RESULT_KEYS = ('ansible_rsync_path', 'ansible_playbook_python', 'ansible_facts')
 
 TREE_DIR = None
 
float VAULT_VERSION_MIN = 1.0
 
float VAULT_VERSION_MAX = 1.0
 
 INVALID_VARIABLE_NAMES = re.compile(r'^[\d\W]|[^\w]')
 
 COMMON_CONNECTION_VARS
 
 MAGIC_VARIABLE_MAPPING
 
 config = ConfigManager()
 
 value = setting.value
 
 t = Template(setting.value)
 
 _ACTION_DEBUG = add_internal_fqcns(('debug', ))
 
 _ACTION_IMPORT_PLAYBOOK = add_internal_fqcns(('import_playbook', ))
 
 _ACTION_IMPORT_ROLE = add_internal_fqcns(('import_role', ))
 
 _ACTION_IMPORT_TASKS = add_internal_fqcns(('import_tasks', ))
 
 _ACTION_INCLUDE = add_internal_fqcns(('include', ))
 
 _ACTION_INCLUDE_ROLE = add_internal_fqcns(('include_role', ))
 
 _ACTION_INCLUDE_TASKS = add_internal_fqcns(('include_tasks', ))
 
 _ACTION_INCLUDE_VARS = add_internal_fqcns(('include_vars', ))
 
 _ACTION_META = add_internal_fqcns(('meta', ))
 
 _ACTION_SET_FACT = add_internal_fqcns(('set_fact', ))
 
 _ACTION_SETUP = add_internal_fqcns(('setup', ))
 
 _ACTION_HAS_CMD = add_internal_fqcns(('command', 'shell', 'script'))
 
 _ACTION_ALLOWS_RAW_ARGS = _ACTION_HAS_CMD + add_internal_fqcns(('raw', ))
 
 _ACTION_ALL_INCLUDES = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS + _ACTION_INCLUDE_ROLE
 
 _ACTION_ALL_IMPORT_PLAYBOOKS = _ACTION_INCLUDE + _ACTION_IMPORT_PLAYBOOK
 
 _ACTION_ALL_INCLUDE_IMPORT_TASKS = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS + _ACTION_IMPORT_TASKS
 
 _ACTION_ALL_PROPER_INCLUDE_IMPORT_ROLES = _ACTION_INCLUDE_ROLE + _ACTION_IMPORT_ROLE
 
 _ACTION_ALL_PROPER_INCLUDE_IMPORT_TASKS = _ACTION_INCLUDE_TASKS + _ACTION_IMPORT_TASKS
 
 _ACTION_ALL_INCLUDE_ROLE_TASKS = _ACTION_INCLUDE_ROLE + _ACTION_INCLUDE_TASKS
 
 _ACTION_ALL_INCLUDE_TASKS = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS
 
 _ACTION_FACT_GATHERING = _ACTION_SETUP + add_internal_fqcns(('gather_facts', ))
 
 _ACTION_WITH_CLEAN_FACTS = _ACTION_SET_FACT + _ACTION_INCLUDE_VARS
 

Function Documentation

◆ _deprecated()

def ansible.constants._deprecated (   msg,
  version = '2.8' 
)
private
 display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write 

Definition at line 33 of file constants.py.

References ansible.constants._deprecated().

Referenced by ansible.constants._DeprecatedSequenceConstant.__getitem__(), ansible.constants._DeprecatedSequenceConstant.__len__(), ansible.constants._deprecated(), ansible.constants.get_config(), and ansible.constants.mk_boolean().

◆ _warning()

def ansible.constants._warning (   msg)
private
 display is not guaranteed here, nor it being the full class, but try anyways, fallback to sys.stderr.write 

Definition at line 23 of file constants.py.

References ansible.constants._warning(), and nsot.warning().

Referenced by ansible.constants._warning().

◆ get_config()

def ansible.constants.get_config (   parser,
  section,
  key,
  env_var,
  default_value,
  value_type = None,
  expand_relative_paths = False 
)

◆ mk_boolean()

def ansible.constants.mk_boolean (   value)

◆ set_constant()

def ansible.constants.set_constant (   name,
  value,
  export = vars() 
)
 sets constants and returns resolved options dict 

Definition at line 69 of file constants.py.

References ansible.constants.set_constant().

Referenced by ansible.constants.set_constant().

Variable Documentation

◆ __metaclass__

ansible.constants.__metaclass__ = type
private

Definition at line 6 of file constants.py.

◆ _ACTION_ALL_IMPORT_PLAYBOOKS

ansible.constants._ACTION_ALL_IMPORT_PLAYBOOKS = _ACTION_INCLUDE + _ACTION_IMPORT_PLAYBOOK
private

Definition at line 217 of file constants.py.

◆ _ACTION_ALL_INCLUDE_IMPORT_TASKS

ansible.constants._ACTION_ALL_INCLUDE_IMPORT_TASKS = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS + _ACTION_IMPORT_TASKS
private

Definition at line 218 of file constants.py.

◆ _ACTION_ALL_INCLUDE_ROLE_TASKS

ansible.constants._ACTION_ALL_INCLUDE_ROLE_TASKS = _ACTION_INCLUDE_ROLE + _ACTION_INCLUDE_TASKS
private

Definition at line 221 of file constants.py.

◆ _ACTION_ALL_INCLUDE_TASKS

ansible.constants._ACTION_ALL_INCLUDE_TASKS = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS
private

Definition at line 222 of file constants.py.

◆ _ACTION_ALL_INCLUDES

ansible.constants._ACTION_ALL_INCLUDES = _ACTION_INCLUDE + _ACTION_INCLUDE_TASKS + _ACTION_INCLUDE_ROLE
private

Definition at line 216 of file constants.py.

◆ _ACTION_ALL_PROPER_INCLUDE_IMPORT_ROLES

ansible.constants._ACTION_ALL_PROPER_INCLUDE_IMPORT_ROLES = _ACTION_INCLUDE_ROLE + _ACTION_IMPORT_ROLE
private

Definition at line 219 of file constants.py.

◆ _ACTION_ALL_PROPER_INCLUDE_IMPORT_TASKS

ansible.constants._ACTION_ALL_PROPER_INCLUDE_IMPORT_TASKS = _ACTION_INCLUDE_TASKS + _ACTION_IMPORT_TASKS
private

Definition at line 220 of file constants.py.

◆ _ACTION_ALLOWS_RAW_ARGS

ansible.constants._ACTION_ALLOWS_RAW_ARGS = _ACTION_HAS_CMD + add_internal_fqcns(('raw', ))
private

Definition at line 215 of file constants.py.

◆ _ACTION_DEBUG

ansible.constants._ACTION_DEBUG = add_internal_fqcns(('debug', ))
private

Definition at line 203 of file constants.py.

◆ _ACTION_FACT_GATHERING

ansible.constants._ACTION_FACT_GATHERING = _ACTION_SETUP + add_internal_fqcns(('gather_facts', ))
private

Definition at line 223 of file constants.py.

◆ _ACTION_HAS_CMD

ansible.constants._ACTION_HAS_CMD = add_internal_fqcns(('command', 'shell', 'script'))
private

Definition at line 214 of file constants.py.

◆ _ACTION_IMPORT_PLAYBOOK

ansible.constants._ACTION_IMPORT_PLAYBOOK = add_internal_fqcns(('import_playbook', ))
private

Definition at line 204 of file constants.py.

◆ _ACTION_IMPORT_ROLE

ansible.constants._ACTION_IMPORT_ROLE = add_internal_fqcns(('import_role', ))
private

Definition at line 205 of file constants.py.

◆ _ACTION_IMPORT_TASKS

ansible.constants._ACTION_IMPORT_TASKS = add_internal_fqcns(('import_tasks', ))
private

Definition at line 206 of file constants.py.

◆ _ACTION_INCLUDE

ansible.constants._ACTION_INCLUDE = add_internal_fqcns(('include', ))
private

Definition at line 207 of file constants.py.

◆ _ACTION_INCLUDE_ROLE

ansible.constants._ACTION_INCLUDE_ROLE = add_internal_fqcns(('include_role', ))
private

Definition at line 208 of file constants.py.

◆ _ACTION_INCLUDE_TASKS

ansible.constants._ACTION_INCLUDE_TASKS = add_internal_fqcns(('include_tasks', ))
private

Definition at line 209 of file constants.py.

◆ _ACTION_INCLUDE_VARS

ansible.constants._ACTION_INCLUDE_VARS = add_internal_fqcns(('include_vars', ))
private

Definition at line 210 of file constants.py.

◆ _ACTION_META

ansible.constants._ACTION_META = add_internal_fqcns(('meta', ))
private

Definition at line 211 of file constants.py.

◆ _ACTION_SET_FACT

ansible.constants._ACTION_SET_FACT = add_internal_fqcns(('set_fact', ))
private

Definition at line 212 of file constants.py.

◆ _ACTION_SETUP

ansible.constants._ACTION_SETUP = add_internal_fqcns(('setup', ))
private

Definition at line 213 of file constants.py.

◆ _ACTION_WITH_CLEAN_FACTS

ansible.constants._ACTION_WITH_CLEAN_FACTS = _ACTION_SET_FACT + _ACTION_INCLUDE_VARS
private

Definition at line 224 of file constants.py.

◆ BECOME_METHODS

ansible.constants.BECOME_METHODS
Initial value:
1= _DeprecatedSequenceConstant(
2 ['sudo', 'su', 'pbrun', 'pfexec', 'doas', 'dzdo', 'ksu', 'runas', 'pmrun', 'enable', 'machinectl'],
3 ('ansible.constants.BECOME_METHODS is deprecated, please use '
4 'ansible.plugins.loader.become_loader. This list is statically '
5 'defined and may not include all become methods'),
6 '2.10'
7)

Definition at line 90 of file constants.py.

◆ BLACKLIST_EXTS

tuple ansible.constants.BLACKLIST_EXTS = ('.pyc', '.pyo', '.swp', '.bak', '~', '.rpm', '.md', '.txt', '.rst')

Definition at line 99 of file constants.py.

◆ BOOL_TRUE

ansible.constants.BOOL_TRUE = BOOLEANS_TRUE

Definition at line 100 of file constants.py.

◆ COMMON_CONNECTION_VARS

ansible.constants.COMMON_CONNECTION_VARS
Initial value:
1= frozenset(('ansible_connection', 'ansible_host', 'ansible_user', 'ansible_shell_executable',
2 'ansible_port', 'ansible_pipelining', 'ansible_password', 'ansible_timeout',
3 'ansible_shell_type', 'ansible_module_compression', 'ansible_private_key_file'))

Definition at line 129 of file constants.py.

◆ config

ansible.constants.config = ConfigManager()

Definition at line 175 of file constants.py.

◆ CONFIGURABLE_PLUGINS

tuple ansible.constants.CONFIGURABLE_PLUGINS = ('become', 'cache', 'callback', 'cliconf', 'connection', 'httpapi', 'inventory', 'lookup', 'netconf', 'shell')

Definition at line 106 of file constants.py.

◆ DEFAULT_BECOME_PASS

ansible.constants.DEFAULT_BECOME_PASS = None

Definition at line 101 of file constants.py.

◆ DEFAULT_PASSWORD_CHARS

ansible.constants.DEFAULT_PASSWORD_CHARS = to_text(ascii_letters + digits + ".,:-_", errors='strict')

Definition at line 102 of file constants.py.

◆ DEFAULT_REMOTE_PASS

ansible.constants.DEFAULT_REMOTE_PASS = None

Definition at line 103 of file constants.py.

◆ DEFAULT_SUBSET

ansible.constants.DEFAULT_SUBSET = None

Definition at line 104 of file constants.py.

◆ DOCUMENTABLE_PLUGINS

tuple ansible.constants.DOCUMENTABLE_PLUGINS = CONFIGURABLE_PLUGINS + ('module', 'strategy', 'vars')

Definition at line 108 of file constants.py.

◆ IGNORE_FILES

tuple ansible.constants.IGNORE_FILES = ("COPYING", "CONTRIBUTING", "LICENSE", "README", "VERSION", "GUIDELINES")

Definition at line 109 of file constants.py.

◆ INTERNAL_RESULT_KEYS

tuple ansible.constants.INTERNAL_RESULT_KEYS = ('add_host', 'add_group')

Definition at line 110 of file constants.py.

◆ INVALID_VARIABLE_NAMES

ansible.constants.INVALID_VARIABLE_NAMES = re.compile(r'^[\d\W]|[^\w]')

Definition at line 120 of file constants.py.

◆ LOCALHOST

tuple ansible.constants.LOCALHOST = ('127.0.0.1', 'localhost', '::1')

Definition at line 111 of file constants.py.

◆ MAGIC_VARIABLE_MAPPING

ansible.constants.MAGIC_VARIABLE_MAPPING

Definition at line 133 of file constants.py.

◆ MODULE_NO_JSON

ansible.constants.MODULE_NO_JSON = tuple(add_internal_fqcns(('command', 'win_command', 'shell', 'win_shell', 'raw')))

Definition at line 113 of file constants.py.

◆ MODULE_REQUIRE_ARGS

ansible.constants.MODULE_REQUIRE_ARGS = tuple(add_internal_fqcns(('command', 'win_command', 'shell', 'win_shell', 'raw', 'script')))

Definition at line 112 of file constants.py.

◆ RESTRICTED_RESULT_KEYS

tuple ansible.constants.RESTRICTED_RESULT_KEYS = ('ansible_rsync_path', 'ansible_playbook_python', 'ansible_facts')

Definition at line 114 of file constants.py.

◆ t

ansible.constants.t = Template(setting.value)

Definition at line 185 of file constants.py.

Referenced by Ansible.Become.BecomeUtil.CreateProcessAsUser().

◆ TREE_DIR

ansible.constants.TREE_DIR = None

Definition at line 115 of file constants.py.

◆ value

◆ VAULT_VERSION_MAX

float ansible.constants.VAULT_VERSION_MAX = 1.0

Definition at line 117 of file constants.py.

◆ VAULT_VERSION_MIN

float ansible.constants.VAULT_VERSION_MIN = 1.0

Definition at line 116 of file constants.py.