mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 06:40:03 -07:00
Merge branch 'retf_py' of git://github.com/berendt/ansible into devel
Conflicts: lib/ansible/inventory/vars_plugins/group_vars.py plugins/callbacks/mail.py
This commit is contained in:
commit
8c4161d4a1
21 changed files with 48 additions and 48 deletions
|
@ -70,10 +70,10 @@ class CallbackModule(object):
|
|||
sender = '"Ansible: %s" <root>' % host
|
||||
if isinstance(res, basestring):
|
||||
subject = 'Unreachable: %s' % res.strip('\r\n').split('\n')[-1]
|
||||
body = 'An error occured for host ' + host + ' with the following message:\n\n' + res
|
||||
body = 'An error occurred for host ' + host + ' with the following message:\n\n' + res
|
||||
else:
|
||||
subject = 'Unreachable: %s' % res['msg'].strip('\r\n').split('\n')[0]
|
||||
body = 'An error occured for host ' + host + ' with the following message:\n\n' + \
|
||||
body = 'An error occurred for host ' + host + ' with the following message:\n\n' + \
|
||||
res['msg'] + '\n\nA complete dump of the error:\n\n' + str(res)
|
||||
mail(sender=sender, subject=subject, body=body)
|
||||
|
||||
|
@ -81,9 +81,9 @@ class CallbackModule(object):
|
|||
sender = '"Ansible: %s" <root>' % host
|
||||
if isinstance(res, basestring):
|
||||
subject = 'Async failure: %s' % res.strip('\r\n').split('\n')[-1]
|
||||
body = 'An error occured for host ' + host + ' with the following message:\n\n' + res
|
||||
body = 'An error occurred for host ' + host + ' with the following message:\n\n' + res
|
||||
else:
|
||||
subject = 'Async failure: %s' % res['msg'].strip('\r\n').split('\n')[0]
|
||||
body = 'An error occured for host ' + host + ' with the following message:\n\n' + \
|
||||
body = 'An error occurred for host ' + host + ' with the following message:\n\n' + \
|
||||
res['msg'] + '\n\nA complete dump of the error:\n\n' + str(res)
|
||||
mail(sender=sender, subject=subject, body=body)
|
||||
|
|
|
@ -157,7 +157,7 @@ class DigitalOceanInventory(object):
|
|||
# DigitalOceanInventory data
|
||||
self.data = {} # All DigitalOcean data
|
||||
self.inventory = {} # Ansible Inventory
|
||||
self.index = {} # Varous indices of Droplet metadata
|
||||
self.index = {} # Various indices of Droplet metadata
|
||||
|
||||
# Define defaults
|
||||
self.cache_path = '.'
|
||||
|
@ -368,7 +368,7 @@ or environment variables (DO_CLIENT_ID and DO_API_KEY)'''
|
|||
|
||||
|
||||
def load_droplet_variables_for_host(self):
|
||||
'''Generate a JSON reponse to a --host call'''
|
||||
'''Generate a JSON response to a --host call'''
|
||||
host = self.to_safe(str(self.args.host))
|
||||
|
||||
if not host in self.index['host_to_droplet']:
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
# inventory information.
|
||||
#
|
||||
# This plugin does not support targeting of specific hosts using the --host
|
||||
# flag. Instead, it it queries the Docker API for each container, running
|
||||
# flag. Instead, it queries the Docker API for each container, running
|
||||
# or not, and returns this data all once.
|
||||
#
|
||||
# The plugin returns the following custom attributes on Docker containers:
|
||||
|
@ -196,7 +196,7 @@ def setup():
|
|||
write_stderr(e)
|
||||
sys.exit(1)
|
||||
|
||||
# Enviroment Variables
|
||||
# Environment Variables
|
||||
env_base_url = os.environ.get('DOCKER_HOST')
|
||||
env_version = os.environ.get('DOCKER_VERSION')
|
||||
env_timeout = os.environ.get('DOCKER_TIMEOUT')
|
||||
|
|
|
@ -34,4 +34,4 @@ if len(sys.argv) == 2 and sys.argv[1] == '--list':
|
|||
elif len(sys.argv) == 3 and sys.argv[1] == '--host':
|
||||
print json.dumps({'ansible_connection': 'jail'})
|
||||
else:
|
||||
print "Need a argument, either --list or --host <host>"
|
||||
print "Need an argument, either --list or --host <host>"
|
||||
|
|
|
@ -34,4 +34,4 @@ if len(sys.argv) == 2 and sys.argv[1] == '--list':
|
|||
elif len(sys.argv) == 3 and sys.argv[1] == '--host':
|
||||
print json.dumps({'ansible_connection': 'lxc'})
|
||||
else:
|
||||
print "Need a argument, either --list or --host <host>"
|
||||
print "Need an argument, either --list or --host <host>"
|
||||
|
|
|
@ -23,7 +23,7 @@ inventory: openshift
|
|||
short_description: Openshift gears external inventory script
|
||||
description:
|
||||
- Generates inventory of Openshift gears using the REST interface
|
||||
- this permit to reuse playbook to setup a Openshift gear
|
||||
- this permit to reuse playbook to setup an Openshift gear
|
||||
version_added: None
|
||||
author: Michael Scherer
|
||||
'''
|
||||
|
@ -113,4 +113,4 @@ if len(sys.argv) == 2 and sys.argv[1] == '--list':
|
|||
elif len(sys.argv) == 3 and sys.argv[1] == '--host':
|
||||
print json.dumps({})
|
||||
else:
|
||||
print "Need a argument, either --list or --host <host>"
|
||||
print "Need an argument, either --list or --host <host>"
|
||||
|
|
|
@ -8,11 +8,11 @@ shamelessly copied from existing inventory scripts.
|
|||
|
||||
This script and it's ini can be used more than once,
|
||||
|
||||
i.e vmware.py/vmware_colo.ini vmware_idf.py/vmware_idf.ini
|
||||
i.e. vmware.py/vmware_colo.ini vmware_idf.py/vmware_idf.ini
|
||||
(script can be link)
|
||||
|
||||
so if you don't have clustered vcenter but multiple esx machines or
|
||||
just diff clusters you can have a inventory per each and automatically
|
||||
just diff clusters you can have an inventory per each and automatically
|
||||
group hosts based on file name or specify a group in the ini.
|
||||
|
||||
You can also use <SCRIPT_NAME>_HOST|USER|PASSWORD environment variables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue