mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 14:50:02 -07:00
fixes to config/setting retrieval
- better variable precedence management - universal plugin option handling - also updated comments for future directions - leverage fragments for plugins - removed fact namespacing - added 'firendly name' field - updated missing descriptions - removed some unused yaml entries, updated others to reflect possible future - documented more plugins - allow reading docs using alias - short licenses - corrected args for 'all plugins' - fixed -a option for ansible-doc - updated vars plugins to allow docs - fixed 'gathering' - only set options IF connection - added path list and renamed pathspec mostly the diff is , vs : as separator - readded removed config entries that were deprecated but had no message ... and deprecated again - now deprecated entries give warning when set
This commit is contained in:
parent
f88750d665
commit
075ead8fb0
70 changed files with 1862 additions and 1292 deletions
|
@ -44,5 +44,17 @@ def get_plugin_class(obj):
|
|||
|
||||
class AnsiblePlugin(with_metaclass(ABCMeta, object)):
|
||||
|
||||
def get_option(self, option):
|
||||
return C.get_plugin_option(get_plugin_class(self), self.name, option)
|
||||
def __init__(self):
|
||||
self.options = {}
|
||||
|
||||
def get_option(self, option, hostvars=None):
|
||||
if option not in self.options:
|
||||
option_value = C.config.get_config_value(option, plugin_type=get_plugin_class(self), plugin_name=self.name, variables=hostvars)
|
||||
self.set_option(option, option_value)
|
||||
return self.options.get(option)
|
||||
|
||||
def set_option(self, option, value):
|
||||
self.options[option] = value
|
||||
|
||||
def set_options(self, options):
|
||||
self.options = options
|
||||
|
|
|
@ -392,7 +392,7 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
# we have a need for it, at which point we'll have to do something different.
|
||||
return remote_paths
|
||||
|
||||
if self._play_context.become and self._play_context.become_user not in ('root', remote_user):
|
||||
if self._play_context.become and self._play_context.become_user and self._play_context.become_user not in ('root', remote_user):
|
||||
# Unprivileged user that's different than the ssh user. Let's get
|
||||
# to work!
|
||||
|
||||
|
|
48
lib/ansible/plugins/cache/jsonfile.py
vendored
48
lib/ansible/plugins/cache/jsonfile.py
vendored
|
@ -1,19 +1,7 @@
|
|||
# (c) 2014, Brian Coca, Josh Drake, et al
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: jsonfile
|
||||
|
@ -21,8 +9,36 @@ DOCUMENTATION:
|
|||
description:
|
||||
- This cache uses JSON formatted, per host, files saved to the filesystem.
|
||||
version_added: "1.9"
|
||||
author: Brian Coca (@bcoca)
|
||||
author: Ansible Core
|
||||
options:
|
||||
_uri:
|
||||
required: True
|
||||
description:
|
||||
- Path in which the cache plugin will save the JSON files
|
||||
type: list
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
- key: fact_caching_connection
|
||||
section: defaults
|
||||
_prefix:
|
||||
description: User defined prefix to use when creating the JSON files
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||
ini:
|
||||
- key: fact_caching_prefix
|
||||
- section: defaults
|
||||
_timeout:
|
||||
default: 86400
|
||||
description: Expiration timeout for the cache plugin data
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||
ini:
|
||||
- key: fact_caching_timeout
|
||||
section: defaults
|
||||
type: integer
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
56
lib/ansible/plugins/cache/memcached.py
vendored
56
lib/ansible/plugins/cache/memcached.py
vendored
|
@ -1,19 +1,45 @@
|
|||
# (c) 2014, Brian Coca, Josh Drake, et al
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: memcached
|
||||
short_description: Use memcached DB for cache
|
||||
description:
|
||||
- This cache uses JSON formatted, per host records saved in memcached.
|
||||
version_added: "1.9"
|
||||
requirements:
|
||||
- memcache (python lib)
|
||||
options:
|
||||
_uri:
|
||||
description:
|
||||
- List of connection information for the memcached DBs
|
||||
default: ['127.0.0.1:11211']
|
||||
type: list
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
- key: fact_caching_connection
|
||||
section: defaults
|
||||
_prefix:
|
||||
description: User defined prefix to use when creating the DB entries
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||
ini:
|
||||
- key: fact_caching_prefix
|
||||
- section: defaults
|
||||
_timeout:
|
||||
default: 86400
|
||||
description: Expiration timeout for the cache plugin data
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||
ini:
|
||||
- key: fact_caching_timeout
|
||||
section: defaults
|
||||
type: integer
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
20
lib/ansible/plugins/cache/memory.py
vendored
20
lib/ansible/plugins/cache/memory.py
vendored
|
@ -1,25 +1,15 @@
|
|||
# (c) 2014, Brian Coca, Josh Drake, et al
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: memory
|
||||
short_description: RAM backed, non persistent
|
||||
description:
|
||||
- RAM backed cache that is not persistent.
|
||||
- This is the default used if no other plugin is specified.
|
||||
- There are no options to configure.
|
||||
version_added: historical
|
||||
author: core team (@ansible-core)
|
||||
'''
|
||||
|
|
46
lib/ansible/plugins/cache/pickle.py
vendored
46
lib/ansible/plugins/cache/pickle.py
vendored
|
@ -1,27 +1,41 @@
|
|||
# (c) 2017, Brian Coca
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: yaml
|
||||
cache: pickle
|
||||
short_description: Pickle formatted files.
|
||||
description:
|
||||
- This cache uses Python's pickle serialization format, in per host files, saved to the filesystem.
|
||||
version_added: "2.3"
|
||||
author: Brian Coca (@bcoca)
|
||||
options:
|
||||
_uri:
|
||||
required: True
|
||||
description:
|
||||
- Path in which the cache plugin will save the files
|
||||
type: list
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
- key: fact_caching_connection
|
||||
section: defaults
|
||||
_prefix:
|
||||
description: User defined prefix to use when creating the files
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||
ini:
|
||||
- key: fact_caching_prefix
|
||||
- section: defaults
|
||||
_timeout:
|
||||
default: 86400
|
||||
description: Expiration timeout for the cache plugin data
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||
ini:
|
||||
- key: fact_caching_timeout
|
||||
section: defaults
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
|
|
53
lib/ansible/plugins/cache/redis.py
vendored
53
lib/ansible/plugins/cache/redis.py
vendored
|
@ -1,19 +1,42 @@
|
|||
# (c) 2014, Brian Coca, Josh Drake, et al
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: redis
|
||||
short_description: Use Redis DB for cache
|
||||
description:
|
||||
- This cache uses JSON formatted, per host records saved in Redis.
|
||||
version_added: "1.9"
|
||||
requirements:
|
||||
- redis (python lib)
|
||||
options:
|
||||
_uri:
|
||||
description:
|
||||
- A colon separated string of connection information for Redis.
|
||||
required: True
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
- key: fact_caching_connection
|
||||
section: defaults
|
||||
_prefix:
|
||||
description: User defined prefix to use when creating the DB entries
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||
ini:
|
||||
- key: fact_caching_prefix
|
||||
- section: defaults
|
||||
_timeout:
|
||||
default: 86400
|
||||
description: Expiration timeout for the cache plugin data
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||
ini:
|
||||
- key: fact_caching_timeout
|
||||
section: defaults
|
||||
type: integer
|
||||
'''
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
45
lib/ansible/plugins/cache/yaml.py
vendored
45
lib/ansible/plugins/cache/yaml.py
vendored
|
@ -1,19 +1,7 @@
|
|||
# (c) 2017, Brian Coca
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
cache: yaml
|
||||
|
@ -22,6 +10,33 @@ DOCUMENTATION:
|
|||
- This cache uses YAML formatted, per host, files saved to the filesystem.
|
||||
version_added: "2.3"
|
||||
author: Brian Coca (@bcoca)
|
||||
options:
|
||||
_uri:
|
||||
required: True
|
||||
description:
|
||||
- Path in which the cache plugin will save the files
|
||||
type: list
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_CONNECTION
|
||||
ini:
|
||||
- key: fact_caching_connection
|
||||
section: defaults
|
||||
_prefix:
|
||||
description: User defined prefix to use when creating the files
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_PREFIX
|
||||
ini:
|
||||
- key: fact_caching_prefix
|
||||
- section: defaults
|
||||
_timeout:
|
||||
default: 86400
|
||||
description: Expiration timeout for the cache plugin data
|
||||
env:
|
||||
- name: ANSIBLE_CACHE_PLUGIN_TIMEOUT
|
||||
ini:
|
||||
- key: fact_caching_timeout
|
||||
section: defaults
|
||||
type: integer
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
# (c) 2015, Andrew Gaffney <andrew@agaffney.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: actionable
|
||||
type: stdout
|
||||
short_description: shows only items that need attention
|
||||
description:
|
||||
- Use this callback when you dont care about OK nor Skipped.
|
||||
- This callback suppreses any non Failed or Changed status.
|
||||
version_added: "2.1"
|
||||
requirements:
|
||||
- set as stdout callback in configuration
|
||||
'''
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,21 +1,20 @@
|
|||
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: context_demo
|
||||
type: aggregate
|
||||
short_description: demo callback that adds play/task context
|
||||
description:
|
||||
- Displays some play and task context along with normal output
|
||||
- This is mostly for demo purposes
|
||||
version_added: "2.1"
|
||||
requirements:
|
||||
- whitelist in configuration
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: debug
|
||||
type: stdout
|
||||
short_description: formated stdout/stderr display
|
||||
description:
|
||||
- Use this callback to sort though extensive debug output
|
||||
version_added: "2.4"
|
||||
requirements:
|
||||
- set as stdout in configuration
|
||||
'''
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,28 +1,40 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: default
|
||||
type: stdout
|
||||
short_description: default Ansible screen output
|
||||
version_added: historical
|
||||
description:
|
||||
- This is the default output callback for ansible-playbook.
|
||||
options:
|
||||
show_skipped_hosts:
|
||||
name: Show skipped hosts
|
||||
description: "Toggle to control displaying skipped task/host results in a task"
|
||||
env:
|
||||
- name: DISPLAY_SKIPPED_HOSTS
|
||||
ini:
|
||||
- key: display_skipped_hosts
|
||||
section: defaults
|
||||
type: boolean
|
||||
default: True
|
||||
show_custom_stats:
|
||||
name: Show custom stats
|
||||
default: False
|
||||
description: 'This adds the custom stats set via the set_stats plugin to the play recap'
|
||||
env:
|
||||
- name: ANSIBLE_SHOW_CUSTOM_STATS
|
||||
ini:
|
||||
- key: show_custom_stats
|
||||
section: defaults
|
||||
type: bool
|
||||
requirements:
|
||||
- set as stdout in configuration
|
||||
'''
|
||||
# Make coding more python3-ish
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
# (c) 2016, Dag Wieers <dag@wieers.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# Make coding more python3-ish
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: dense
|
||||
type: stdout
|
||||
short_description: minimal stdout output
|
||||
description:
|
||||
- When in verbose mode it will act the same as the default callback
|
||||
version_added: "2.3"
|
||||
requirements:
|
||||
- set as stdout in configuation
|
||||
'''
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,21 +1,42 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# (C) 2015, 2016 Daniel Lobato <elobatocs@gmail.com>
|
||||
# 2016 Guido Günther <agx@sigxcpu.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2015, 2016 Daniel Lobato <elobatocs@gmail.com>
|
||||
# (c) 2016 Guido Günther <agx@sigxcpu.org>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: foreman
|
||||
type: notification
|
||||
short_description: Sends events to Foreman
|
||||
description:
|
||||
- This callback will report facts and task events to Foreman https://theforeman.org/
|
||||
version_added: "2.2"
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- requests (python library)
|
||||
options:
|
||||
url:
|
||||
description: URL to the Foreman server
|
||||
env:
|
||||
- name: FOREMAN_URL
|
||||
required: True
|
||||
ssl_cert:
|
||||
description: X509 certificate to authenticate to Foreman if https is used
|
||||
env:
|
||||
- name: FOREMAN_SSL_CERT
|
||||
ssl_key:
|
||||
description: the corresponding private key
|
||||
env:
|
||||
- name: FOREMAN_SSL_KEY
|
||||
verify_certs:
|
||||
description:
|
||||
- Toggle to decidewhether to verify the Foreman certificate.
|
||||
- It can be set to '1' to verify SSL certificates using the installed CAs or to a path pointing to a CA bundle.
|
||||
- Set to '0' to disable certificate checking.
|
||||
env:
|
||||
- name: FOREMAN_SSL_VERIFY
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: full_skip
|
||||
type: stdout
|
||||
short_description: suppreses tasks if all hosts skipped
|
||||
description:
|
||||
- Use this plugin when you dont care about any output for tasks that were completly skipped
|
||||
version_added: "2.4"
|
||||
requirements:
|
||||
- set as stdout in configuation
|
||||
'''
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,21 +1,42 @@
|
|||
# (C) 2014, Matt Martz <matt@sivel.net>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: hipchat
|
||||
type: notification
|
||||
short_description: post task events to hipchat
|
||||
description:
|
||||
- The chatty part of ChatOps with a Hipchat server as a target
|
||||
- This callback plugin sends status updates to a HipChat channel during playbook execution.
|
||||
version_added: "1.6"
|
||||
requirements:
|
||||
- prettytable (python lib)
|
||||
options:
|
||||
token:
|
||||
description: HipChat API token
|
||||
required: True
|
||||
env:
|
||||
- name: HIPCHAT_TOKEN
|
||||
room:
|
||||
description: HipChat room to post in.
|
||||
default: ansible
|
||||
env:
|
||||
- name: HIPCHAT_ROOM
|
||||
from:
|
||||
description: Name to post as
|
||||
default: ansible
|
||||
env:
|
||||
- name: HIPCHAT_FROM
|
||||
notify:
|
||||
description: Add notify flag to important messages
|
||||
type: bool
|
||||
default: True
|
||||
env:
|
||||
- name: HIPCHAT_NOTIFY
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,18 +1,41 @@
|
|||
# Ansible CallBack module for Jabber (XMPP)
|
||||
# Copyright (C) 2016 maxn nikolaev.makc@gmail.com
|
||||
#
|
||||
# This module is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see http://www.gnu.org/licenses/
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: jabber
|
||||
type: notification
|
||||
short_description: post task events to a jabber server
|
||||
description:
|
||||
- The chatty part of ChatOps with a Hipchat server as a target
|
||||
- This callback plugin sends status updates to a HipChat channel during playbook execution.
|
||||
version_added: "2.2"
|
||||
requirements:
|
||||
- xmpp (python lib https://github.com/ArchipelProject/xmpppy)
|
||||
options:
|
||||
server:
|
||||
description: connection info to jabber server
|
||||
required: True
|
||||
env:
|
||||
- name: JABBER_SERV
|
||||
user:
|
||||
description: Jabber user to authenticate as
|
||||
required: True
|
||||
env:
|
||||
- name: JABBER_USER
|
||||
password:
|
||||
description: Password for the user to the jabber server
|
||||
required: True
|
||||
env:
|
||||
- name: JABBER_PASS
|
||||
to:
|
||||
description: chat identifier that will recieve the message
|
||||
required: True
|
||||
env:
|
||||
- name: JABBER_TO
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
@ -48,9 +71,9 @@ class CallbackModule(CallbackBase):
|
|||
self.j_pass = os.getenv('JABBER_PASS')
|
||||
self.j_to = os.getenv('JABBER_TO')
|
||||
|
||||
if (self.j_user or self.j_pass or self.serv) is None:
|
||||
if (self.j_user or self.j_pass or self.serv or self.j_to) is None:
|
||||
self.disabled = True
|
||||
self._display.warning('Jabber CallBack want JABBER_USER and JABBER_PASS env variables')
|
||||
self._display.warning('Jabber CallBack wants the JABBER_SERV, JABBER_USER, JABBER_PASS and JABBER_TO environment variables')
|
||||
|
||||
def send_msg(self, msg):
|
||||
"""Send message"""
|
||||
|
|
|
@ -1,29 +1,17 @@
|
|||
# (c) 2016, Matt Martz <matt@sivel.net>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: json
|
||||
short_description: Ansbile screen output asjson
|
||||
short_description: Ansbile screen output as JSON
|
||||
version_added: "2.2"
|
||||
description:
|
||||
- This callback converts all events into JSON output
|
||||
- This callback converts all events into JSON output to stdout
|
||||
type: stdout
|
||||
plugin_api_version: "2.0"
|
||||
requirements:
|
||||
- Set as stdout in config
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
|
|
|
@ -1,19 +1,44 @@
|
|||
# (c) 2016 Matt Clay <matt@mystile.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: junit
|
||||
type: aggregate
|
||||
short_description: write playbook output to a JUnit file.
|
||||
version_added: historical
|
||||
description:
|
||||
- This callback writes playbook output to a JUnit formatted XML file.
|
||||
- "Tasks show up in the report as follows:
|
||||
'ok': pass
|
||||
'failed' with 'EXPECTED FAILURE' in the task name: pass
|
||||
'failed' due to an exception: error
|
||||
'failed' for other reasons: failure
|
||||
'skipped': skipped"
|
||||
options:
|
||||
output_dir:
|
||||
name: JUnit output dir
|
||||
default: ~/.ansible.log
|
||||
description: Directory to write XML files to.
|
||||
env:
|
||||
- name: JUNIT_OUTPUT_DIR
|
||||
task_class:
|
||||
name: JUnit Task class
|
||||
default: False
|
||||
description: Configure the output to be one class per yaml file
|
||||
env:
|
||||
- name: JUNIT_TASK_CLASS
|
||||
fail_on_change:
|
||||
name: JUnit fail on change
|
||||
default: False
|
||||
description: Consider any tasks reporting "changed" as a junit test failure
|
||||
env:
|
||||
- name: JUNIT_FAIL_ON_CHANGE
|
||||
requirements:
|
||||
- whitelist in configuration
|
||||
- junit_xml (python lib)
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: log_plays
|
||||
type: notification
|
||||
short_description: write playbook output to log file
|
||||
version_added: historical
|
||||
description:
|
||||
- This callback writes playbook output to a file per host in the `/var/log/ansible/hosts` directory
|
||||
- "TODO: make this configurable"
|
||||
requirements:
|
||||
- Whitelist in configuration
|
||||
- A writeable /var/log/ansible/hosts directory by the user executing Ansbile on the controller
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,46 +1,84 @@
|
|||
""" (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com>
|
||||
# (c) 2015, Logentries.com, Jimmy Tang <jimmy.tang@logentries.com>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
This callback plugin will generate json objects to be sent to logentries
|
||||
for auditing/debugging purposes.
|
||||
|
||||
Todo:
|
||||
|
||||
* Better formatting of output before sending out to logentries data/api nodes.
|
||||
|
||||
To use:
|
||||
|
||||
Add this to your ansible.cfg file in the defaults block
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: logentries
|
||||
type: notification
|
||||
short_description: Sends events to Logentries
|
||||
description:
|
||||
- This callback plugin will generate JSON objects and send them to Logentries for auditing/debugging purposes.
|
||||
- If you want to use an ini configuration, the file must be placed in the same directory as this plugin and named logentries.ini
|
||||
version_added: "2.0"
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- certifi (python library)
|
||||
- flatdict (pytnon library)
|
||||
options:
|
||||
api:
|
||||
description: URI to the Logentries API
|
||||
env:
|
||||
- name: LOGENTRIES_API
|
||||
default: data.logentries.com
|
||||
ini:
|
||||
- section: defaults
|
||||
key: api
|
||||
port:
|
||||
description: Http port to use when connecting to the API
|
||||
env:
|
||||
- name: LOGENTRIES_PORT
|
||||
default: 80
|
||||
ini:
|
||||
- section: defaults
|
||||
key: port
|
||||
tls_port:
|
||||
description: Port to use when connecting to the API when TLS is enabled
|
||||
env:
|
||||
- name: LOGENTRIES_TLS_PORT
|
||||
default: 443
|
||||
ini:
|
||||
- section: defaults
|
||||
key: tls_port
|
||||
token:
|
||||
description: the authentication token
|
||||
env:
|
||||
- name: LOGENTRIES_ANSIBLE_TOKEN
|
||||
required: True
|
||||
ini:
|
||||
- section: defaults
|
||||
key: token
|
||||
use_tls:
|
||||
description:
|
||||
- Toggle to decidewhether to use TLS to encrypt the communications with the API server
|
||||
env:
|
||||
- name: LOGENTRIES_USE_TLS
|
||||
default: False
|
||||
type: boolean
|
||||
ini:
|
||||
- section: defaults
|
||||
key: use_tls
|
||||
flatten:
|
||||
description: flatten complex data structures into a single dictionary with complex keys
|
||||
type: boolean
|
||||
default: False
|
||||
env:
|
||||
- name: LOGENTRIES_FLATTEN
|
||||
ini:
|
||||
- section: defaults
|
||||
key: flatten
|
||||
EXAMPLES: >
|
||||
To enable, add this to your ansible.cfg file in the defaults block
|
||||
|
||||
[defaults]
|
||||
callback_plugins = ./callback_plugins
|
||||
callback_stdout = logentries
|
||||
callback_whitelist = logentries
|
||||
|
||||
Copy the callback plugin into the callback_plugins directory
|
||||
|
||||
Either set the environment variables
|
||||
|
||||
Either set the environment variables
|
||||
export LOGENTRIES_API=data.logentries.com
|
||||
export LOGENTRIES_PORT=10000
|
||||
export LOGENTRIES_ANSIBLE_TOKEN=dd21fc88-f00a-43ff-b977-e3a4233c53af
|
||||
|
||||
Or create a logentries.ini config file that sites next to the plugin with the following contents
|
||||
|
||||
Or create a logentries.ini config file that sites next to the plugin with the following contents
|
||||
[logentries]
|
||||
api = data.logentries.com
|
||||
port = 10000
|
||||
|
@ -48,10 +86,7 @@ Or create a logentries.ini config file that sites next to the plugin with the fo
|
|||
use_tls = no
|
||||
token = dd21fc88-f00a-43ff-b977-e3a4233c53af
|
||||
flatten = False
|
||||
|
||||
|
||||
"""
|
||||
|
||||
'''
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
@ -59,7 +94,6 @@ import os
|
|||
import socket
|
||||
import random
|
||||
import time
|
||||
import codecs
|
||||
import uuid
|
||||
|
||||
try:
|
||||
|
@ -77,6 +111,10 @@ except ImportError:
|
|||
from ansible.module_utils.six.moves import configparser
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
"""
|
||||
Todo:
|
||||
* Better formatting of output before sending out to logentries data/api nodes.
|
||||
"""
|
||||
|
||||
|
||||
class PlainTextSocketAppender(object):
|
||||
|
@ -92,8 +130,7 @@ class PlainTextSocketAppender(object):
|
|||
self.MIN_DELAY = 0.1
|
||||
self.MAX_DELAY = 10
|
||||
# Error message displayed when an incorrect Token has been detected
|
||||
self.INVALID_TOKEN = ("\n\nIt appears the LOGENTRIES_TOKEN "
|
||||
"parameter you entered is incorrect!\n\n")
|
||||
self.INVALID_TOKEN = ("\n\nIt appears the LOGENTRIES_TOKEN parameter you entered is incorrect!\n\n")
|
||||
# Unicode Line separator character \u2028
|
||||
self.LINE_SEP = u'\u2028'
|
||||
|
||||
|
@ -189,15 +226,17 @@ class CallbackModule(CallbackBase):
|
|||
if not HAS_SSL:
|
||||
self._display.warning("Unable to import ssl module. Will send over port 80.")
|
||||
|
||||
warn = ''
|
||||
if not HAS_CERTIFI:
|
||||
self.disabled = True
|
||||
self._display.warning('The `certifi` python module is not installed. '
|
||||
'Disabling the Logentries callback plugin.')
|
||||
warn += 'The `certifi` python module is not installed.'
|
||||
|
||||
if not HAS_FLATDICT:
|
||||
self.disabled = True
|
||||
self._display.warning('The `flatdict` python module is not installed. '
|
||||
'Disabling the Logentries callback plugin.')
|
||||
warn += 'The `flatdict` python module is not installed.'
|
||||
|
||||
if warn:
|
||||
self._display.warning('%s\nDisabling the Logentries callback plugin.' % warn)
|
||||
|
||||
config_path = os.path.abspath(os.path.dirname(__file__))
|
||||
config = configparser.ConfigParser()
|
||||
|
|
|
@ -1,19 +1,35 @@
|
|||
# (C) 2016, Ievgen Khmelenko <ujenmr@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (C) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: logstash
|
||||
type: notification
|
||||
short_description: Sends events to Logstash
|
||||
description:
|
||||
- This callback will report facts and task events to Foreman https://theforeman.org/
|
||||
version_added: "2.3"
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- logstash (python library)
|
||||
options:
|
||||
server:
|
||||
description: Address of the Logstash server
|
||||
env:
|
||||
- name: LOGSTASH_SERVER
|
||||
default: localhost
|
||||
port:
|
||||
description: Port on which logstash is listening
|
||||
env:
|
||||
- name: LOGSTASH_PORT
|
||||
default: 5000
|
||||
type:
|
||||
description: Message type
|
||||
env:
|
||||
- name: LOGSTASH_TYPE
|
||||
default: ansible
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,8 +1,28 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright: (c) 2012, Dag Wieers <dag@wieers.com>
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: mail
|
||||
type: notification
|
||||
short_description: Sends failure events via email
|
||||
description:
|
||||
- This callback will report failures via email
|
||||
version_added: "2.3"
|
||||
requirements:
|
||||
- whitelisting in configuration
|
||||
- logstash (python library)
|
||||
options:
|
||||
mta:
|
||||
description: Mail Transfer Agent, server that accepts SMTP
|
||||
env:
|
||||
- name: SMTPHOST
|
||||
default: localhost
|
||||
note:
|
||||
- "TODO: expand configuration options now that plugins can leverage Ansible's configuration"
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: minimal
|
||||
type: stdout
|
||||
short_description: minimal Ansible screen output
|
||||
version_added: historical
|
||||
description:
|
||||
- This is the default output callback used by the ansible command (ad-hoc)
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: oneline
|
||||
type: stdout
|
||||
short_description: oneline Ansible screen output
|
||||
version_added: historical
|
||||
description:
|
||||
- This is the output callback used by the -o/--one-line command line option.
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
# (c) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
|
||||
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: osx_say
|
||||
type: notification
|
||||
requirements:
|
||||
- whitelising in configuration
|
||||
- the '/usr/bin/say' command line program (standard on OS X)
|
||||
short_description: oneline Ansible screen output
|
||||
version_added: historical
|
||||
description:
|
||||
- This plugin will use the 'say' program to "speak" about play events.
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
callback: skippy
|
||||
callback_type: stdout
|
||||
requires: set as display
|
||||
short_description: Ansible screen output that ignores skipped status
|
||||
version_added: "2.0"
|
||||
description:
|
||||
- This callback does the same as the default except it does not output skipped host/task/item status
|
||||
'''
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
|
|
@ -70,6 +70,9 @@ class ConnectionBase(AnsiblePlugin):
|
|||
allow_executable = True
|
||||
|
||||
def __init__(self, play_context, new_stdin, *args, **kwargs):
|
||||
|
||||
super(ConnectionBase, self).__init__()
|
||||
|
||||
# All these hasattrs allow subclasses to override these parameters
|
||||
if not hasattr(self, '_play_context'):
|
||||
self._play_context = play_context
|
||||
|
|
|
@ -14,6 +14,18 @@
|
|||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: accelerate
|
||||
short_description: Temporary 0mq agent
|
||||
description:
|
||||
- This plugin uses one of the other ssh plugins to setup a temporary 0mq daemon on the target to execute subsequent tasks
|
||||
deprecated:
|
||||
why: paramiko and ssh + controlpersist perform the same or better without the problems of having an agent.
|
||||
version: 2.5
|
||||
alternative: paramiko and ssh with conrol persistence.
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,52 +1,41 @@
|
|||
# Based on the docker connection plugin
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
#
|
||||
# Connection plugin for building container images using buildah tool
|
||||
# https://github.com/projectatomic/buildah
|
||||
#
|
||||
# Written by: Tomas Tomecek (https://github.com/TomasTomecek)
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
connection: buildah
|
||||
short_description: interact with an existing buildah container
|
||||
short_description: Interact with an existing buildah container
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing container using buildah tool.
|
||||
author: Tomas Tomecek (ttomecek@redhat.com)
|
||||
version_added: 2.4
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- The ID of the container you want to access.
|
||||
default: inventory_hostname
|
||||
config:
|
||||
vars:
|
||||
- name: ansible_host
|
||||
remote_user:
|
||||
description:
|
||||
- User specified via name or ID which is used to execute commands inside the container.
|
||||
config:
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_user
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_USER
|
||||
vars:
|
||||
- name: ansible_user
|
||||
remote_addr:
|
||||
description:
|
||||
- The ID of the container you want to access.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
# keyword:
|
||||
# - name: hosts
|
||||
remote_user:
|
||||
description:
|
||||
- User specified via name or ID which is used to execute commands inside the container.
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_user
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_USER
|
||||
vars:
|
||||
- name: ansible_user
|
||||
# keyword:
|
||||
# - name: remote_user
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
|
|
@ -1,21 +1,37 @@
|
|||
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# (c) 2013, Maykel Moya <mmoya@speedyrails.com>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Maykel Moya <mmoya@speedyrails.com>
|
||||
connection: chroot
|
||||
short_description: Interact with local chroot
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing chroot on the Ansible controller.
|
||||
version_added: "1.1"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- The path of the chroot you want to access.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
executable:
|
||||
description:
|
||||
- User specified executable shell
|
||||
ini:
|
||||
- section: defaults
|
||||
key: executable
|
||||
env:
|
||||
- name: ANSIBLE_EXECUTABLE
|
||||
vars:
|
||||
- name: ansible_executable
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,26 +1,42 @@
|
|||
# Based on the chroot connection plugin by Maykel Moya
|
||||
#
|
||||
# Connection plugin for configuring docker containers
|
||||
# (c) 2014, Lorin Hochstein
|
||||
# (c) 2015, Leendert Brouwer
|
||||
# (c) 2015, Leendert Brouwer (https://github.com/objectified)
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# Maintainer: Leendert Brouwer (https://github.com/objectified)
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author:
|
||||
- Lorin Hochestein
|
||||
- Leendert Brouwer
|
||||
connection: docker
|
||||
short_description: Run tasks in docker containers
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing docker container.
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_user:
|
||||
description:
|
||||
- The user to execute as inside the container
|
||||
default: The set user as per docker's configuration
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_docker4_user
|
||||
docker_extra_args:
|
||||
description:
|
||||
- Extra arguments to pass to the docker command line
|
||||
default: ''
|
||||
remote_addr:
|
||||
description:
|
||||
- The path of the chroot you want to access.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_docker_host
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
|
||||
# (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# ---
|
||||
# The func transport permit to use ansible over func. For people who have already setup
|
||||
# func and that wish to play with ansible, this permit to move gradually to ansible
|
||||
# without having to redo completely the setup of the network.
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Michael Scherer (@msherer) <misc@zarb.org>
|
||||
connection: funcd
|
||||
short_description: Use funcd to connect to target
|
||||
description:
|
||||
- This transport permits you to use Ansible over Func.
|
||||
- For people who have already setup func and that wish to play with ansible,
|
||||
this permit to move gradually to ansible without having to redo completely the setup of the network.
|
||||
version_added: "1.1"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- The path of the chroot you want to access.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_func_host
|
||||
"""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
@ -61,8 +63,7 @@ class Connection(object):
|
|||
self.client = fc.Client(self.host)
|
||||
return self
|
||||
|
||||
def exec_command(self, cmd, become_user=None, sudoable=False,
|
||||
executable='/bin/sh', in_data=None):
|
||||
def exec_command(self, cmd, become_user=None, sudoable=False, executable='/bin/sh', in_data=None):
|
||||
''' run a command on the remote minion '''
|
||||
|
||||
if in_data:
|
||||
|
@ -96,8 +97,7 @@ class Connection(object):
|
|||
# take a file directly
|
||||
tmpdir = tempfile.mkdtemp(prefix="func_ansible")
|
||||
self.client.local.getfile.get(in_path, tmpdir)
|
||||
shutil.move(os.path.join(tmpdir, self.host, os.path.basename(in_path)),
|
||||
out_path)
|
||||
shutil.move(os.path.join(tmpdir, self.host, os.path.basename(in_path)), out_path)
|
||||
shutil.rmtree(tmpdir)
|
||||
|
||||
def close(self):
|
||||
|
|
|
@ -1,21 +1,33 @@
|
|||
# based on jail.py (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
# Based on jail.py
|
||||
# (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
# (c) 2016, Stephan Lohse <dev-github@ploek.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Stephan Lohse <dev-github@ploek.org>
|
||||
connection: iocage
|
||||
short_description: Run tasks in iocage jails
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing iocage jail
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Path to the jail
|
||||
default: The set user as per docker's configuration
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_iocage_host
|
||||
remote_user:
|
||||
description:
|
||||
- User to execute as inside the jail
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_iocage_user
|
||||
"""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,22 +1,34 @@
|
|||
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
|
||||
# (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Based on local.py by Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# and chroot.py by Maykel Moya <mmoya@speedyrails.com>
|
||||
# Copyright (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# Copyright (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: jail
|
||||
short_description: Run tasks in jails
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing jail
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Path to the jail
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_jail_host
|
||||
remote_user:
|
||||
description:
|
||||
- User to execute as inside the jail
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_jail_user
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -2,21 +2,27 @@
|
|||
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
|
||||
# (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Michael Scherer <misc@zarb.org>
|
||||
connection: libvirt_lxc
|
||||
short_description: Run tasks in lxc containers via libvirt
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing lxc container using libvirt
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Container identifier
|
||||
default: The set user as per docker's configuration
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_libvirt_lxc_host
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,19 +1,31 @@
|
|||
# (c) 2015, Joerg Thalheim <joerg@higgsboson.tk>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Joerg Thalheim <joerg@higgsboson.tk>
|
||||
connection: lxc
|
||||
short_description: Run tasks in lxc containers via lxc python library
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing lxc container using lxc python library
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Container identifier
|
||||
default: The set user as per docker's configuration
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_lxc_host
|
||||
executable:
|
||||
default: /bin/sh
|
||||
description:
|
||||
- Shell executable
|
||||
vars:
|
||||
- name: ansible_executable
|
||||
- name: ansible_lxc_executable
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,19 +1,31 @@
|
|||
# (c) 2016 Matt Clay <matt@mystile.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Matt Clay <matt@mystile.com>
|
||||
connection: lxd
|
||||
short_description: Run tasks in lxc containers via lxc CLI
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing lxc container using lxc CLI
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Container identifier
|
||||
default: The set user as per docker's configuration
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_lxd_host
|
||||
executable:
|
||||
description:
|
||||
- shell to use for execution inside container
|
||||
default: /bin/sh
|
||||
vars:
|
||||
- name: ansible_executable
|
||||
- name: ansible_lxd_executable
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -1,20 +1,71 @@
|
|||
#
|
||||
# (c) 2016 Red Hat Inc.
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Networking Team
|
||||
connection: netconf
|
||||
short_description: Use netconf to run command on network appliances
|
||||
description:
|
||||
- Use netconf to run command on network appliances
|
||||
version_added: "2.3"
|
||||
options:
|
||||
network_os:
|
||||
description:
|
||||
- Appliance specific OS
|
||||
default: 'default'
|
||||
vars:
|
||||
- name: ansible_netconf_network_os
|
||||
password:
|
||||
description:
|
||||
- Secret used to authenticate
|
||||
vars:
|
||||
- name: ansible_pass
|
||||
- name: ansible_netconf_pass
|
||||
private_key_file:
|
||||
description:
|
||||
- Key or certificate file used for authentication
|
||||
vars:
|
||||
- name: ansible_private_key_file
|
||||
- name: ansible_netconf_private_key_file
|
||||
ssh_config:
|
||||
type: boolean
|
||||
default: False
|
||||
description:
|
||||
- Flag to decide if we use SSH configuration options with netconf
|
||||
vars:
|
||||
- name: ansible_netconf_ssh_config
|
||||
env:
|
||||
- name: ANSIBLE_NETCONF_SSH_CONFIG
|
||||
user:
|
||||
description:
|
||||
- User to authenticate as
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_netconf_user
|
||||
port:
|
||||
type: int
|
||||
description:
|
||||
- port to connect to on the remote
|
||||
default: 830
|
||||
vars:
|
||||
- name: ansible_port
|
||||
- name: ansible_netconf_port
|
||||
timeout:
|
||||
type: int
|
||||
description:
|
||||
- Connection timeout in seconds
|
||||
default: 120
|
||||
host_key_checking:
|
||||
type: boolean
|
||||
description:
|
||||
- Flag to control wether we check for validity of the host key of the remote
|
||||
default: True
|
||||
# TODO:
|
||||
#look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS,
|
||||
#allow_agent=self.allow_agent,
|
||||
"""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,20 +1,42 @@
|
|||
#
|
||||
# (c) 2016 Red Hat Inc.
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Networking Team
|
||||
connection: network_cli
|
||||
short_description: Use network_cli to run command on network appliances
|
||||
description:
|
||||
- This plugin actually forces use of 'local' execution but using paramiko to establish a remote ssh shell on the appliance.
|
||||
- Also this plugin ignores the become_method but still uses the becoe_user and become_pass to
|
||||
do privilege escalation, method depending on network_os used.
|
||||
version_added: "2.3"
|
||||
options:
|
||||
network_os:
|
||||
description:
|
||||
- Appliance specific OS
|
||||
default: 'default'
|
||||
vars:
|
||||
- name: ansible_netconf_network_os
|
||||
password:
|
||||
description:
|
||||
- Secret used to authenticate
|
||||
vars:
|
||||
- name: ansible_pass
|
||||
- name: ansible_netconf_pass
|
||||
private_key_file:
|
||||
description:
|
||||
- Key or certificate file used for authentication
|
||||
vars:
|
||||
- name: ansible_private_key_file
|
||||
timeout:
|
||||
type: int
|
||||
description:
|
||||
- Connection timeout in seconds
|
||||
default: 120
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,29 +1,55 @@
|
|||
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: paramiko
|
||||
short_description: Run tasks via python ssh (paramiko)
|
||||
description:
|
||||
- Use the python ssh implementation (Paramiko) to connect to targets
|
||||
- The paramiko transport is provided because many distributions, in particular EL6 and before do not support ControlPersist
|
||||
in their SSH implementations.
|
||||
- This is needed on the Ansible control machine to be reasonably efficient with connections.
|
||||
Thus paramiko is faster for most users on these platforms.
|
||||
Users with ControlPersist capability can consider using -c ssh or configuring the transport in the configuration file.
|
||||
version_added: "0.1"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Address of the remote target
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_ssh_host
|
||||
- name: ansible_paramiko_host
|
||||
remote_user:
|
||||
description:
|
||||
- User to login/authenticate as
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_ssh_user
|
||||
- name: ansible_paramiko_user
|
||||
# TODO:
|
||||
#getattr(self._play_context, 'ssh_extra_args', '') or '',
|
||||
#getattr(self._play_context, 'ssh_common_args', '') or '',
|
||||
#getattr(self._play_context, 'ssh_args', '') or '',
|
||||
#C.HOST_KEY_CHECKING
|
||||
#C.PARAMIKO_HOST_KEY_AUTO_ADD
|
||||
#C.USE_PERSISTENT_CONNECTIONS:
|
||||
# ssh.connect(
|
||||
# look_for_keys=C.PARAMIKO_LOOK_FOR_KEYS,
|
||||
# key_filename,
|
||||
# password=self._play_context.password,
|
||||
# timeout=self._play_context.timeout,
|
||||
# port=port,
|
||||
#proxy_command = proxy_command or C.PARAMIKO_PROXY_COMMAND
|
||||
#C.PARAMIKO_PTY
|
||||
#C.PARAMIKO_RECORD_HOST_KEYS
|
||||
"""
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
# ---
|
||||
# The paramiko transport is provided because many distributions, in particular EL6 and before
|
||||
# do not support ControlPersist in their SSH implementations. This is needed on the Ansible
|
||||
# control machine to be reasonably efficient with connections. Thus paramiko is faster
|
||||
# for most users on these platforms. Users with ControlPersist capability can consider
|
||||
# using -c ssh or configuring the transport in ansible.cfg.
|
||||
|
||||
import warnings
|
||||
import os
|
||||
import socket
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
# (c) 2017 Red Hat Inc.
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: persistent
|
||||
short_description: Use a persistent unix socket for connection
|
||||
description:
|
||||
- This is a helper plugin to allow making other connections persistent.
|
||||
version_added: "2.3"
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -2,26 +2,29 @@
|
|||
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
|
||||
# Based on func.py
|
||||
# (c) 2014, Michael Scherer <misc@zarb.org>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# ---
|
||||
# The saltstack transport permit to use ansible over saltstack. For
|
||||
# people who have already setup saltstack and that wish to play with
|
||||
# ansible, this permit to use both of them.
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Michael Scherer <misc@zarb.org>
|
||||
connection: saltstack
|
||||
short_description: Allow ansible to piggyback on salt minions
|
||||
description:
|
||||
- This allows you to use existing Saltstack infrastructure to connect to targets.
|
||||
version_added: "2.2"
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
import re
|
||||
import os
|
||||
import pty
|
||||
import subprocess
|
||||
|
||||
from ansible.module_utils._text import to_bytes, to_text
|
||||
from ansible.module_utils.six.moves import cPickle
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# Copyright (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
|
||||
# Copyright 2017 Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
connection: ssh
|
||||
|
@ -26,114 +13,111 @@ DOCUMENTATION:
|
|||
author: ansible (@core)
|
||||
version_added: historical
|
||||
options:
|
||||
host:
|
||||
description: Hostname/ip to connect to.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_ssh_host
|
||||
host_key_checking:
|
||||
constants:
|
||||
- name: HOST_KEY_CHECKING
|
||||
description: Determines if ssh should check host keys
|
||||
type: boolean
|
||||
ini:
|
||||
- section: defaults
|
||||
key: 'host_key_checking'
|
||||
env:
|
||||
- name: ANSIBLE_HOST_KEY_CHECKING
|
||||
password:
|
||||
description: Authentication password for the C(remote_user). Can be supplied as CLI option.
|
||||
vars:
|
||||
- name: ansible_password
|
||||
- name: ansible_ssh_pass
|
||||
ssh_args:
|
||||
description: Arguments to pass to all ssh cli tools
|
||||
default: '-C -o ControlMaster=auto -o ControlPersist=60s'
|
||||
ini:
|
||||
- section: 'ssh_connection'
|
||||
key: 'ssh_args'
|
||||
env:
|
||||
- name: ANSIBLE_SSH_ARGS
|
||||
ssh_common_args:
|
||||
description: Common extra args for all ssh CLI tools
|
||||
vars:
|
||||
- name: ansible_ssh_common_args
|
||||
ssh_executable:
|
||||
default: ssh
|
||||
description:
|
||||
- This defines the location of the ssh binary. It defaults to `ssh` which will use the first ssh binary available in $PATH.
|
||||
- This option is usually not required, it might be useful when access to system ssh is restricted,
|
||||
or when using ssh wrappers to connect to remote hosts.
|
||||
env: [{name: ANSIBLE_SSH_EXECUTABLE}]
|
||||
ini:
|
||||
- {key: ssh_executable, section: ssh_connection}
|
||||
yaml: {key: ssh_connection.ssh_executable}
|
||||
const:
|
||||
- name: ANSIBLE_SSH_EXECUTABLE
|
||||
version_added: "2.2"
|
||||
scp_extra_args:
|
||||
description: Extra exclusive to the 'scp' CLI
|
||||
vars:
|
||||
- name: ansible_scp_extra_args
|
||||
sftp_extra_args:
|
||||
description: Extra exclusive to the 'sftp' CLI
|
||||
vars:
|
||||
- name: ansible_sftp_extra_args
|
||||
ssh_extra_args:
|
||||
description: Extra exclusive to the 'ssh' CLI
|
||||
vars:
|
||||
- name: ansible_ssh_extra_args
|
||||
ssh_retries:
|
||||
# constant: ANSIBLE_SSH_RETRIES
|
||||
description: Number of attempts to connect.
|
||||
default: 3
|
||||
env:
|
||||
- name: ANSIBLE_SSH_RETRIES
|
||||
ini:
|
||||
- section: connection
|
||||
key: retries
|
||||
- section: ssh_connection
|
||||
key: retries
|
||||
port:
|
||||
description: Remote port to connect to.
|
||||
type: int
|
||||
default: 22
|
||||
ini:
|
||||
host:
|
||||
description: Hostname/ip to connect to.
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_ssh_host
|
||||
host_key_checking:
|
||||
#constant: HOST_KEY_CHECKING
|
||||
description: Determines if ssh should check host keys
|
||||
type: boolean
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_port
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_PORT
|
||||
vars:
|
||||
- name: ansible_port
|
||||
- name: ansible_ssh_port
|
||||
remote_user:
|
||||
description:
|
||||
- User name with which to login to the remote server, normally set by the remote_user keyword.
|
||||
- If no user is supplied, Ansible will let the ssh client binary choose the user as it normally
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_user
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_USER
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_ssh_user
|
||||
pipelining:
|
||||
default: ANSIBLE_PIPELINING
|
||||
description:
|
||||
- Pipelining reduces the number of SSH operations required to execute a module on the remote server,
|
||||
by executing many Ansible modules without actual file transfer.
|
||||
- This 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 the sudoers file for the target hosts,
|
||||
which is why this feature is disabled by default.
|
||||
env: [{name: ANSIBLE_SSH_PIPELINING}]
|
||||
ini:
|
||||
- {key: pipelining, section: ssh_connection}
|
||||
type: boolean
|
||||
vars: [{name: ansible_ssh_pipelining}]
|
||||
|
||||
key: 'host_key_checking'
|
||||
env:
|
||||
- name: ANSIBLE_HOST_KEY_CHECKING
|
||||
password:
|
||||
description: Authentication password for the C(remote_user). Can be supplied as CLI option.
|
||||
vars:
|
||||
- name: ansible_password
|
||||
- name: ansible_ssh_pass
|
||||
ssh_args:
|
||||
description: Arguments to pass to all ssh cli tools
|
||||
default: '-C -o ControlMaster=auto -o ControlPersist=60s'
|
||||
ini:
|
||||
- section: 'ssh_connection'
|
||||
key: 'ssh_args'
|
||||
env:
|
||||
- name: ANSIBLE_SSH_ARGS
|
||||
ssh_common_args:
|
||||
description: Common extra args for all ssh CLI tools
|
||||
vars:
|
||||
- name: ansible_ssh_common_args
|
||||
ssh_executable:
|
||||
default: ssh
|
||||
description:
|
||||
- This defines the location of the ssh binary. It defaults to `ssh` which will use the first ssh binary available in $PATH.
|
||||
- This option is usually not required, it might be useful when access to system ssh is restricted,
|
||||
or when using ssh wrappers to connect to remote hosts.
|
||||
env: [{name: ANSIBLE_SSH_EXECUTABLE}]
|
||||
ini:
|
||||
- {key: ssh_executable, section: ssh_connection}
|
||||
yaml: {key: ssh_connection.ssh_executable}
|
||||
#const: ANSIBLE_SSH_EXECUTABLE
|
||||
version_added: "2.2"
|
||||
scp_extra_args:
|
||||
description: Extra exclusive to the 'scp' CLI
|
||||
vars:
|
||||
- name: ansible_scp_extra_args
|
||||
sftp_extra_args:
|
||||
description: Extra exclusive to the 'sftp' CLI
|
||||
vars:
|
||||
- name: ansible_sftp_extra_args
|
||||
ssh_extra_args:
|
||||
description: Extra exclusive to the 'ssh' CLI
|
||||
vars:
|
||||
- name: ansible_ssh_extra_args
|
||||
ssh_retries:
|
||||
# constant: ANSIBLE_SSH_RETRIES
|
||||
description: Number of attempts to connect.
|
||||
default: 3
|
||||
env:
|
||||
- name: ANSIBLE_SSH_RETRIES
|
||||
ini:
|
||||
- section: connection
|
||||
key: retries
|
||||
- section: ssh_connection
|
||||
key: retries
|
||||
port:
|
||||
description: Remote port to connect to.
|
||||
type: int
|
||||
default: 22
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_port
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_PORT
|
||||
vars:
|
||||
- name: ansible_port
|
||||
- name: ansible_ssh_port
|
||||
remote_user:
|
||||
description:
|
||||
- User name with which to login to the remote server, normally set by the remote_user keyword.
|
||||
- If no user is supplied, Ansible will let the ssh client binary choose the user as it normally
|
||||
ini:
|
||||
- section: defaults
|
||||
key: remote_user
|
||||
env:
|
||||
- name: ANSIBLE_REMOTE_USER
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_ssh_user
|
||||
pipelining:
|
||||
default: ANSIBLE_PIPELINING
|
||||
description:
|
||||
- Pipelining reduces the number of SSH operations required to execute a module on the remote server,
|
||||
by executing many Ansible modules without actual file transfer.
|
||||
- This 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 the sudoers file for the target hosts,
|
||||
which is why this feature is disabled by default.
|
||||
env: [{name: ANSIBLE_SSH_PIPELINING}]
|
||||
ini:
|
||||
- {key: pipelining, section: ssh_connection}
|
||||
type: boolean
|
||||
vars: [{name: ansible_ssh_pipelining}]
|
||||
# TODO:
|
||||
# ANSIBLE_SSH_RETRIES
|
||||
|
||||
|
@ -152,7 +136,6 @@ import fcntl
|
|||
import hashlib
|
||||
import os
|
||||
import pty
|
||||
import socket
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
|
@ -850,7 +833,6 @@ class Connection(ConnectionBase):
|
|||
else:
|
||||
methods = ['sftp']
|
||||
|
||||
success = False
|
||||
for method in methods:
|
||||
returncode = stdout = stderr = None
|
||||
if method == 'sftp':
|
||||
|
|
|
@ -1,19 +1,30 @@
|
|||
# (c) 2014, Chris Church <chris@ninemoreminutes.com>
|
||||
#
|
||||
# This file is part of Ansible.
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: winrm
|
||||
short_description: Run tasks over Microsoft's WinRM
|
||||
description:
|
||||
- Run commands or put/fetch on a target via WinRM
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Address of the windows machine
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_winrm_host
|
||||
remote_user:
|
||||
description:
|
||||
- The user to log in as to the Windows machine
|
||||
vars:
|
||||
- name: ansible_user
|
||||
- name: ansible_winrm_user
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
|
|
@ -3,21 +3,27 @@
|
|||
# and jail.py (c) 2013, Michael Scherer <misc@zarb.org>
|
||||
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
|
||||
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
"""
|
||||
DOCUMENTATION:
|
||||
author: Ansible Core Team
|
||||
connection: zone
|
||||
short_description: Run tasks in a zone instance
|
||||
description:
|
||||
- Run commands or put/fetch files to an existing zone
|
||||
version_added: "2.0"
|
||||
options:
|
||||
remote_addr:
|
||||
description:
|
||||
- Zone identifire
|
||||
default: inventory_hostname
|
||||
vars:
|
||||
- name: ansible_host
|
||||
- name: ansible_zone_host
|
||||
"""
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
|
|
@ -1,20 +1,6 @@
|
|||
# Copyright 2017 RedHat, inc
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#############################################
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
inventory: advanced_host_list
|
||||
|
|
|
@ -1,20 +1,6 @@
|
|||
# Copyright 2017 RedHat, inc
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#############################################
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
name: constructed
|
||||
|
@ -27,25 +13,8 @@ DOCUMENTATION:
|
|||
- The JInja2 exprpessions are calculated and assigned to the variables
|
||||
- Only variables already available from previous inventories can be used for templating.
|
||||
- Failed expressions will be ignored (assumes vars were missing).
|
||||
strict:
|
||||
description:
|
||||
- If true make invalid entries a fatal error, otherwise skip and continue
|
||||
- Since it is possible to use facts in the expressions they might not always be available
|
||||
and we ignore those errors by default.
|
||||
type: boolean
|
||||
default: False
|
||||
compose:
|
||||
description: create vars from jinja2 expressions
|
||||
type: dictionary
|
||||
default: {}
|
||||
groups:
|
||||
description: add hosts to group based on Jinja2 conditionals
|
||||
type: dictionary
|
||||
default: {}
|
||||
keyed_groups:
|
||||
description: add hosts to group based on the values of a variable
|
||||
type: list
|
||||
default: []
|
||||
extends_documentation_fragment:
|
||||
- constructed
|
||||
EXAMPLES: | # inventory.config file in YAML format
|
||||
plugin: comstructed
|
||||
compose:
|
||||
|
|
|
@ -1,19 +1,6 @@
|
|||
# Copyright 2017 RedHat, inc
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
r'''
|
||||
DOCUMENTATION:
|
||||
inventory: host_list
|
||||
|
|
|
@ -1,19 +1,5 @@
|
|||
# Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
|
|
19
lib/ansible/plugins/inventory/openstack.py
Executable file → Normal file
19
lib/ansible/plugins/inventory/openstack.py
Executable file → Normal file
|
@ -2,22 +2,9 @@
|
|||
# Copyright (c) 2013, Jesse Keating <jesse.keating@rackspace.com>
|
||||
# Copyright (c) 2015, Hewlett-Packard Development Company, L.P.
|
||||
# Copyright (c) 2016, Rackspace Australia
|
||||
# Copyright (c) 2017, Red Hat, Inc.
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
name: openstack
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# Copyright (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
inventory: script
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
# This file is part of Ansible,
|
||||
# (c) 2012-2017, Michael DeHaan <michael.dehaan@gmail.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#############################################
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
name: virtualbox
|
||||
|
|
|
@ -1,20 +1,6 @@
|
|||
# Copyright 2017 RedHat, inc
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
#############################################
|
||||
# Copyright (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
'''
|
||||
DOCUMENTATION:
|
||||
inventory: yaml
|
||||
|
|
|
@ -1,23 +1,9 @@
|
|||
# (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
|
||||
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
|
||||
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
|
||||
#
|
||||
# This file is part of Ansible
|
||||
#
|
||||
# Ansible is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# Ansible is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
# (c) 2017 Ansible Project
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
# Make coding more python3-ish
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
|
@ -62,6 +48,8 @@ class PluginLoader:
|
|||
self.base_class = required_base_class
|
||||
self.package = package
|
||||
self.subdir = subdir
|
||||
|
||||
# FIXME: remove alias dict in favor of alias by symlink?
|
||||
self.aliases = aliases
|
||||
|
||||
if config and not isinstance(config, list):
|
||||
|
@ -239,7 +227,7 @@ class PluginLoader:
|
|||
self._extra_dirs.append(directory)
|
||||
self._paths = None
|
||||
|
||||
def find_plugin(self, name, mod_type='', ignore_deprecated=False):
|
||||
def find_plugin(self, name, mod_type='', ignore_deprecated=False, check_aliases=False):
|
||||
''' Find a plugin named name '''
|
||||
|
||||
if mod_type:
|
||||
|
@ -252,6 +240,9 @@ class PluginLoader:
|
|||
# they can have any suffix
|
||||
suffix = ''
|
||||
|
||||
if check_aliases:
|
||||
name = self.aliases.get(name, name)
|
||||
|
||||
# The particular cache to look for modules within. This matches the
|
||||
# requested mod_type
|
||||
pull_cache = self._plugin_path_cache[suffix]
|
||||
|
|
|
@ -25,13 +25,17 @@ import random
|
|||
|
||||
from ansible.module_utils.six import text_type
|
||||
from ansible.module_utils.six.moves import shlex_quote
|
||||
from ansible.plugins import AnsiblePlugin
|
||||
|
||||
_USER_HOME_PATH_RE = re.compile(r'^~[_.A-Za-z0-9][-_.A-Za-z0-9]*$')
|
||||
|
||||
|
||||
class ShellBase(object):
|
||||
class ShellBase(AnsiblePlugin):
|
||||
|
||||
def __init__(self):
|
||||
|
||||
super(ShellBase, self).__init__()
|
||||
|
||||
self.env = dict()
|
||||
if C.DEFAULT_MODULE_SET_LOCALE:
|
||||
module_locale = C.DEFAULT_MODULE_LANG or os.getenv('LANG', 'en_US.UTF-8')
|
||||
|
|
|
@ -24,7 +24,7 @@ DOCUMENTATION:
|
|||
the next series of hosts until the batch is done, before going on to the next task.
|
||||
version_added: "2.0"
|
||||
notes:
|
||||
- This was the default Ansible behaviour before 'strategy plugins' were introduces in 2.0.
|
||||
- This was the default Ansible behaviour before 'strategy plugins' were introduced in 2.0.
|
||||
author: Ansible Core Team
|
||||
'''
|
||||
# Make coding more python3-ish
|
||||
|
|
|
@ -27,6 +27,18 @@ DOCUMENTATION:
|
|||
- Only applies to inventory sources that are existing paths.
|
||||
notes:
|
||||
- It takes the place of the previously hardcoded group_vars/host_vars loading.
|
||||
options:
|
||||
_valid_extensions:
|
||||
default: [".yml", ".yaml", ".json"]
|
||||
description:
|
||||
- "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.'
|
||||
env:
|
||||
- name: ANSIBLE_YAML_FILENAME_EXT
|
||||
ini:
|
||||
- section: yaml_valid_extensions
|
||||
key: defaults
|
||||
type: list
|
||||
'''
|
||||
|
||||
from __future__ import (absolute_import, division, print_function)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue