Commit graph

33242 commits

Author SHA1 Message Date
James Cammarata 9b6b924e9c Use events instead of sleep for result reading 2017-10-02 12:25:00 -05:00
James Cammarata f860ea10c4 Updating locking in plugins after rebasing 2017-10-02 12:25:00 -05:00
James Cammarata dbd3a0828a Use threading instead of concurrent.futures for py2 and py3 2017-10-02 12:25:00 -05:00
James Cammarata 5e63647517 Use persistent threads with job/results queues
Instead of creating a one-time use thread for every host/task
2017-10-02 12:25:00 -05:00
James Cammarata f95160723d Start of work to use threading instead of forking
Rather than using multiprocessing (Process and Queue objects) to do worker
tasks in Ansible:

* Using concurrent.futures
* Using ThreadProcessExecutor
* Making PluginLoader thread-safe
* Gutting a lot of code dealing with message passing
2017-10-02 12:25:00 -05:00
Dave Grochowski a7229df469 [cloud] Fix handling of encrypt option in aws_s3 module (#30822) 2017-10-02 13:18:47 -04:00
Abhijeet Kasurde 02b5c7a8a3 New module - vmware_guest_powerstate
Fix adds a new module 'vmware_guest_powerstate' to manage
power states of virtual machine.

Fixes: #30371

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-10-02 18:57:44 +02:00
Abhijeet Kasurde 6a7676d738 Add testsuite for vmware_maintenancemode
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-10-02 18:55:06 +02:00
James Tanner eca4897a08 Include the top level folder for esxi in the break condition 2017-10-02 12:31:51 -04:00
James Tanner 8c368b25cd Implement second change from #30826 2017-10-02 12:31:51 -04:00
James Tanner 1c1c89927d Get the moid in a more failsafe manner 2017-10-02 12:31:51 -04:00
Andrew Lihonosov 4c0889e8fc docker_service build command respects the "pull: no" parameter
Fixes #30296.
2017-10-02 11:11:48 -04:00
Artem Bolshakov fb4d065654 Fix running docker container with not readable logging driver. Fixes #27278 2017-10-02 11:00:16 -04:00
Brian Coca 44d2f21e02 corrected yaml extensions ini setting 2017-10-02 10:02:47 -04:00
Prasad Katti 3b1376ad09 [cloud] add boto3 requirement to cloudformation module docs (#31135) 2017-10-02 09:25:12 -04:00
Julien Palard 5802ec04bf yaml inventory: Better error reporting on typo. fixes (#31118) 2017-10-02 09:22:21 -04:00
jctanner 6b6a145027 Add an option to spawn vcsim in esx mode (#31155) 2017-10-02 13:44:13 +01:00
Dylan Silva 614a2b403e fixed url issue for rpm location (#31164)
Thanks @thaumos!
2017-10-02 02:20:03 -07:00
n0trax ba99e44b42 Catch AttributeError if regex is not found. (#30990) 2017-10-01 07:19:34 -04:00
maorlipchuk 0f39536c5c Avoid calling maintenace or detach on destroy storage domain. (#28962)
As part of the absent state of ovirt_storage_domains module,
the pre_remove method tries to move the stoage domain to
maintenance and detach it.

In case a destroy of a storage domain is being called there is no need
for those operations since the destroy might be merely a DB operation.
2017-10-01 05:13:19 -04:00
Michihito Shigemura d0d1c7d249 Fix typo in dev_guide/developing_plugins (#31142) 2017-10-01 02:00:38 -07:00
Michihito Shigemura 221c01ff49 Fix typo in dev_guide/developing_modules_general (#31122) 2017-10-01 01:39:02 -07:00
Michihito Shigemura b7b8c669a3 Fix typo in dev_guide/developing_modules_documenting (#31120) 2017-09-30 17:19:09 -07:00
Prasad Katti 4b62e555df Added quotes to start and end samples 2017-09-30 19:57:02 +02:00
Dag Wieers 3749ba6ee1 Small changes. 2017-09-30 19:57:02 +02:00
Prasad Katti b7fbc57227 Document return values for command module 2017-09-30 19:57:02 +02:00
Abhijeet Kasurde afa3206205 Make vm_username and vm_password required params
vm_username and vm_password are required parameters in
vmware_vm_shell. Fix adds changes to documentation as well.

Fixes: #28266

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2017-09-30 14:50:44 +02:00
Phillip Thurston c1e7332c82 Updated changelog to show that 2.4 is no longer RC. 2017-09-30 14:45:33 +02:00
Brian Coca ac9278ff0f remove action plugin only fields from 'file' calls (#31047)
* remove action plugin only fields from 'file' calls

fixes #30556

* Add a test for #30556
2017-09-29 17:13:32 -07:00
Damian Zaremba 92f777e815 module_utils.urls - Encode the proxy connect as binary (#30811)
* module_utils.urls - Encode the proxy connect as binary

Under Python3 the sendall method expects binary not a string.

Prior to this change the below exception was being thrown;
Traceback (most recent call last):
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 1044, in fetch_url
    client_key=client_key, cookies=cookies)
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 951, in open_url
    r = urllib_request.urlopen(*urlopen_args)
  File "/opt/blue-python/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/opt/blue-python/3.6/lib/python3.6/urllib/request.py", line 524, in open
    req = meth(req)
  File "/tmp/ansible_umxox7_x/ansible_modlib.zip/ansible/module_utils/urls.py", line 729, in http_request
    s.sendall((self.CONNECT_COMMAND % (self.hostname, self.port)).decode())
AttributeError: 'str' object has no attribute 'decode'

Encoding the value is inline with the lines below (Proxy-Authorization etc) which are being sent as binary.
2017-09-29 14:32:29 -07:00
Brian Coca 43cbcbcc75 removed typo from dig docs 2017-09-29 11:23:58 -04:00
Jiri Tyr d35ef1fc21 [cloud][contrib] Set missing default values for EC2 inventory (#28375)
* Set missing default values for EC2 inventory

* Make it run even with no ec2.ini file

* Fixing INI file reading

* Refactor how defaults are handeled

Define defaults in a dictionary and use .get rather than if statements with has_option

* Removing double keys and fixing logic for instance_filter

* Removing one more doubled key
2017-09-29 10:48:48 -04:00
Kedar K 916e6be888 - Fix to return error message back to the module. (#31035) 2017-09-29 17:06:30 +05:30
Dag Wieers bedfd0a5a4 atomic: PEP8 compliancy and doc fixes (#30918)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-29 13:17:29 +02:00
yaacov 3ffc62b43b change be to exist in the docs 2017-09-29 12:54:48 +02:00
yaacov 19f4120c89 make the list of tags more meaningful 2017-09-29 12:54:48 +02:00
yaacov 4db133e725 add a state list option 2017-09-29 12:54:48 +02:00
yaacov 8b9c4de3b0 inline trivial calc url method 2017-09-29 12:54:48 +02:00
yaacov b70845bb40 use the is_changed? paradigm, following example from other modules 2017-09-29 12:54:48 +02:00
yaacov bf780c709d move manageiq_entities to module utils 2017-09-29 12:54:48 +02:00
yaacov 26a70f41ce Add new module manageiq_tags 2017-09-29 12:54:48 +02:00
jhawkesworth 04afacc2ee win_chocolately document improvedments, mention win_hotfix and use of become (#31085) 2017-09-29 05:47:38 -04:00
Rene Moser d7fa3ab487 cloudstack: cs_template: remove dependency to CloudStackException
* fixes docs
* fixes pep8
2017-09-29 11:11:22 +02:00
Dag Wieers fde4244d04 kubernetes: PEP8 compliancy and doc fixes (#30914)
This PR includes:
- PEP8 compliancy fixes
- Documentation fixes
2017-09-29 01:51:23 -04:00
jonjozwiak 74f950936a Fix ec2_win_password to allow blank key_passphrase (#28791) 2017-09-28 21:21:59 -04:00
Brian Coca 057eec94ee fixed winrm to use proper task vars (#31072)
it avoids hitting hostvars templating issue and ignoring exception
fixes #30911

also normal var precedence should work for ansible_winrm vars
2017-09-29 11:12:56 +10:00
jctanner 32cf69c00a Use the group-d1 moId instead of i8ln based names to identify the root folder. (#31077)
Addresses #29043
2017-09-28 20:36:54 -04:00
Toshio Kuratomi 5f22b4f8ad Reduce chance of mistakes with unsafe_shell check during refactor
Code like this:

if cond1 and cond2:
    pass
elif cond1:
    pass

Has a hidden dependency on the order that the conditions are checked.
This makes them fragile and subject to breakage during refactors.
Rewrite the code like this:

if cond1:
    if cond2:
        pass
    else:
        pass

The nested structure makes the ordering explicit and less likely for
someone to break the code when they refactor.
2017-09-28 16:48:22 -07:00
Alberto Murillo 3e7b240696 os_keystone_endpoint.py (#29031)
* Add os_keystone_service_endpoint

This patch adds a new Ansible module which allows a user to create
an endpoint to a service with Keystone.

Fixes #23909

* os_keystone_endpoint: Fix style and messages

Fix comments, pep8, version, metadata, license header
and imports according to the Contributing Modules Checklist

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Fix return values

- Change type of 'endpoint' return value from dictionary to complex
  in order to get validate_module checks passed.

- Remove 'id' from the return data since it is included inside the
  'endpoint' value wich is already being returned.

- Rename 'service' field to 'service_id' which is the correct name
  for the service id field returned in json.

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Update shade version

Update minimum shade version to 1.11.0

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Make region optional

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Validate service exists before using service.id

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Fix documentation for service to accept name or id

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Pass the full service object to create_endpoint()

We already have the service object retrieved in code, by passing service.id to
create_endpoint, the shade librarie queries the api again to get the full service
object.

By Passing the already rerieved service object to create_endpoint() we save one
request to the API.

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>

* os_keystone_endpoint: Make type explicit in module arguments.

Althoug type is default to str when not specified in module arguments
this commit explicitly defines type='str' for better readability.

Signed-off-by: Alberto Murillo <albertomurillosilva@gmail.com>
2017-09-28 23:05:44 +02:00
Will Thames 371c6dba8b Fix aws_s3 connection exception handling (#30955)
`ProfileNotFound` does not have a `response` attribute, and
`NoCredentialsError` does not occur at connection creation time.
2017-09-28 16:20:10 -04:00