Commit Graph

14250 Commits (3691c784d25c173f0967f536c52ee0c15922948d)

Author SHA1 Message Date
Fabio Alessandro Locati fb0779f657 Improve YAML examples - windows/win_regedit.py (#19400) 9 years ago
Fabio Alessandro Locati b6f2565d60 Improve YAML examples - windows/win_template.py (#19408) 9 years ago
Fabio Alessandro Locati beb6ed08cd Improve YAML examples - windows/win_owner.py (#19406) 9 years ago
Fabio Alessandro Locati 12205598c3 Improve YAML examples - windows/win_acl_inheritance.py (#19405) 9 years ago
Fabio Alessandro Locati 5a87f26658 Improve YAML examples - windows/win_get_url.py (#19404) 9 years ago
Fabio Alessandro Locati 5f8f1fa782 Improve YAML examples - windows/win_iis_webapppool.py (#19403) 9 years ago
Fabio Alessandro Locati 83d0f621da Improve YAML examples - windows/win_iis_webapplication.py (#19402) 9 years ago
Fabio Alessandro Locati f57418c2c1 Improve YAML examples - windows/win_user.py (#19401) 9 years ago
Fabio Alessandro Locati 9b3d9e1780 Improve YAML examples - windows/win_file_version.py (#19399) 9 years ago
Fabio Alessandro Locati 0aa16b36b7 Make the example in proper yaml format - windows/win_iis_virtualdirectory.py (#18829)
* Make the example in proper yaml format

* Add r
9 years ago
Fabio Alessandro Locati 75bcec0ef5 Fix conflict and typos (#18831) 9 years ago
Nathaniel Case 2405c0bbef Hopefully clear up some junos issues. (#17616) 9 years ago
Eric Beahan dce8f3899e Modify an initial value causing exception when vlan_range param is present (#19019) 9 years ago
Tim Rupp e0e1d3b561 Adds description parameter to pools (#19362)
This patch adds the description parameter as a supported param of
the bigip_pool module.

Tests for this change are available here

https://github.com/F5Networks/f5-ansible/blob/master/roles/bigip_pool/tasks/main.yaml#L732
9 years ago
Nathaniel Case 7900319fc3 Assorted python3 fixes for network code. (#18777) 9 years ago
ikelos c49eac5645 Fix the junos zeroize function (#19142)
Currently this function directs to the standard NetworkModule,
whose run_commands function takes no arguments (other than self).

This directs the call to the connection's cli method to run the command
directly on the device.
9 years ago
Ganesh Nalawade ee5d5c3e84 Fix #4103 Support json format in junos_command module (#19045) 9 years ago
Peter Sprygada ad99d52679 adds feature to allow connection to set action plugin (#18762)
Connection plugin can define default action plugin to use by providing
action_handler instance variable.  This will override the default
action plugin normal
9 years ago
Peter Sprygada 0cef38cf02 adds feature to all modules to be run locally (#18763)
* adds new error AnsibleModuleExit to handle module returns
* adds new action plugin network for attaching connection to network modules
* adds new shared module local to receive connection
* splits out function to update task_args with common updates

This commit provides a mechansim for running local modules that require
a connection object for interative commands tyically implemented for
network devices.  It provides a way to locally import modules (post fork)
and run them using exception handling to exit.
9 years ago
Fabio Alessandro Locati 066872cdc6 Improve examples (#18830) 9 years ago
Fabio Alessandro Locati 8dc3b60d0f Remove unneeded quotes - windows/win_uri.py (#18828) 9 years ago
Fabio Alessandro Locati cf5449c5d9 Remove unneeded quotes - windows/win_unzip.py (#18827) 9 years ago
Fabio Alessandro Locati 439f98005f Highly rewrite and fix the examples - windows/win_iis_webbinding.py (#18823) 9 years ago
Artur Molchanov a8d5358d7f systemd module: Allow to stop activating service (#19383)
* systemd module: Allow to stop activating service

Allow to stop service with ActiveState=activating.

* systemd: Fix incompatibility with Python 2.4
9 years ago
John R Barker 7dc86648c4 Docs typo (#19380) 9 years ago
Ryan S. Brown 197658aff4 Handle when the AMI launch permissions are unset.
Use an empty list to avoid a TypeError because `'NoneType' is not iterable``
9 years ago
Michael Gugino 250f862573 Fix bug #5328 apache module loading (#19355)
* Fix bug #5328 apache module loading

Currently, the apache2_module module parses apache configs
for correctness when enabling or disabling apache2 modules.

This behavior introduced a conflict condition when transitioning
between mpm modules, such as mpm_worker and mpm_event.

This change accounts for the specific error condition raised
by ``apachectl -M``:
``AH00534: apache2: Configuration error: No MPM loaded.``
When loading or unloading a module with a name that contains 'mpm_',
apache2_module will ignore the error raised by apachectl if stderr
contains 'AH00534'.

Fixes #5328

* Add AH00534 warning

* Added changes from PR #5629

* Modified ignore_configcheck behavior
9 years ago
Toshio Kuratomi 0b440a9289 Code smell test for iteritems and itervalues (#19292)
* Code smell test for iteritems and itervalues

* Change the keydict object in authorized_keys so it doesn't throw a false postive

keydict is a bad data structure anyway.  We don't use the iteritems and
itervalues methods so just disable them so that the code-smell tests do
not trigger on it.

* Change release templates so they work with py3
9 years ago
Brian Coca f550b4541f bad/missing fact plugin is a warning (#19350) 9 years ago
Steve Kuznetsov d5324c11a0 Factored polling std{out,err} reads into a function
The process to poll for data in the stdout and/or stderr pipes during a
low-level command execution was repetitive. Factoring this out into a
function DRYs out the code.

Signed-off-by: Steve Kuznetsov <skuznets@redhat.com>
9 years ago
Tim Rupp 362c86d323 Fixes map call usage
For the comparisions that need to be done, this map call needs
to convert to a list because the six import in ansible changes
the behavior of map to return an iterator instead of a list
9 years ago
Ondra Machacek f84f97d035 cloud: ovirt: Add support to upload/copy/move disks (#19337) 9 years ago
Brian Coca ed933421fe correct template lookup path
now all paths get 'templates/'
9 years ago
Ondra Machacek 5400a06ac4 cloud: ovirt: Various fixes for oVirt modules (#19141)
*  cloud: ovirt: fix various issues in ovirt modules

* cloud: ovirt: add support for nfs version

* cloud: ovirt: Fix facts documentation

* Add proper documentation fragmet
* Add proper argument_spec
* Fix return values

* cloud: ovirt: fix pep8
9 years ago
Robin Roth afca957396 Fix UnboundLocalError remote_head in git (#19057)
* Fix UnboundLocalError remote_head in git

Fixes #5505

The use of remote_head was a leftover of #4562.
remote_head is not necessary, since the repo is unchanged anyway and
after is set correctly.

Further changes:
* Set changed=True and msg once local_mods are detected and reset.
* Remove need_fetch that is always True (due to previous if) to improve
clarity
* Don't exit early for local_mods but run submodules update and
switch_version

* Add test for git with local modifications
9 years ago
Ondra Machacek fa96438f4c cloud: ovirt: Add support to list nested entities parameters (#19300) 9 years ago
Andrea Tartaglia 59227d8c31 Removed dict.iteritems() in several other files.
This is for py3 compatibility #18506
9 years ago
Dag Wieers 7c71c678fa Fix regression in search path behaviour
This PR fixes a few issues:

- Missing role parent directory for relative paths
- Fix integration tests (add missing stage)
- Redesign integration tests
- Incorrect order with tasks-lookups
- Duplicate paths are listed
- Repetitive tasks/tasks or files/files were possible

==== using copy with test.txt
Before:
```
   491 1481281038.29393: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
        /home/dag/home-made/ansible.testing/test.txt
```

After:
```
 32505 1481280963.22418: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
        /home/dag/home-made/ansible.testing/test.txt
```

==== Using copy with files/test.txt

Before:
```
 31523 1481280499.63052: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/files/files/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
```

After:
```
 31110 1481280299.38778: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt
        /home/dag/home-made/ansible.testing/files/test.txt
```

==== Using template with files/test.txt.j2
Before:
```
 30074 1481280064.15191: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/files/test.txt.j2
```

After:
```
 29201 1481279823.52752: search_path:
        /home/dag/home-made/ansible.testing/roles/test134/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/roles/test134/tasks/files/test.txt.j2
        /home/dag/home-made/ansible.testing/templates/files/test.txt.j2
        /home/dag/home-made/ansible.testing/files/test.txt.j2
```

This fixes #19048
9 years ago
René Moser 18b7852940 cloudstack: utils: fail friendlier if no zones available (#19332) 9 years ago
Toshio Kuratomi c6b42028c4 Fixes for uri under python3 and local (non-httptester) testing 9 years ago
Ken Evensen 6b62b9f48c Adding pamd module for Ansible (#19029) 9 years ago
Adrian Likins 08a5d506bb Fix errors on 'ansible-playbook --flush-cache' (#18754)
Add a unit test, and split out the flush cache logic to
it's own method.
Fixes #18708
9 years ago
Adrian Likins 6c4f554f5a Provide slightly better msg on fact cache error (#18759)
If the configured fact_cache plugin (fact_caching config)
fails, raise a fatal error instead of failing mysteriously
later.

Fixes #18751
9 years ago
Carlos E. Garcia 0b8011436d minor spelling changes 9 years ago
Michael Scherer 054a3fccf8 Cleanup import for sysctl module 9 years ago
Michael Scherer f9460f3c80 Use type='path' instead of 'str' for deploy_helper 9 years ago
Michael Scherer db8719cf8b Add support for NetBSD
While I only checked on NetBSD 7.0, it seems to use the same
rc system as FreeBSD so it should be working for now.
9 years ago
Michael Scherer 6ffd494efb Cleanup imports for user
Some class use shutil, who was not imported, and we want to
avoid '*' for future refactoring.
9 years ago
Lumír 'Frenzy' Balhar 84544ee8fd Fix AST nodes for Python 3 and enable dependent test_uri (#18597)
* Enable tests on python 3 for uri

* Added one more node type to SAFE_NODES into safe_eval module.

ast.USub represents unary operators. This is necessary for
parsing some unusual but still valid JSON files during testing
with Python 3.
9 years ago
Ondra Machacek 95ef9fd9f9 cloud: ovirt: Add ovirt_tags and ovirt_tags_facts modules (#19295) 9 years ago
Toshio Kuratomi 51491c9904 Remove itervalues (not available on py3) 9 years ago
Toshio Kuratomi a8af6c6baf Fix some SSL errors in mail.py causing SMTP Syntax Errors (Rebase of https://github.com/ansible/ansible-modules-extras/pull/708 ) (#19253)
* Rebase of https://github.com/ansible/ansible-modules-extras/pull/708

708 was full of extraneous merge commits interwoven with commits to
implement the feature. In the end the only way I could clean this up
in reasonable time was to just take a regular diff between the PR and
the base.  This lost the history of intermediate commits but I've
preserved attribution to @dayton967 via git's --author field.

Although I preserved the logic of the PR, there were a few additional
things that I cleaned up:

* Fixed import of email.mime.multipart
* Used the argspec to set port and timeout to integers instead of having
  ad hoc code inside of the module.
* Used argspec's choices for secure instead of ad hoc code inside of the
  module.
* Removed some unused variables
* Made secure_state a python boolean instead of using 0 and 1
* Used secure with string comparisons instead of turning it into an
  integer code.  This is much more readable.
* Fixed catching of SMTPExceptions (SMTPException wasn't imported
  directly so it needed to use the smtplib namespace.)
9 years ago
René Moser a28d898c29 cloudstack: cs_securitygroup_rule: fix impossible to set icmp_code and icmp_type to 0 (#19258) 9 years ago
Andrea Tartaglia ef391a11ec Removed dict.iteritems() in modules. (#18859)
This is for py3 compatibility, addressed in #18506
9 years ago
Vlad Glagolev 4b27d08643 dropped 'BOOLEANS' choices, converted env vars to str 9 years ago
Clark Boylan a65e34ce77 Fix synchronize retries (#18535)
* Fix synchronize retries

The synchronize module munges its task args on every invocation of
run(). This was problematic because the munged data was not fit for use
by a second pass of the synchronize module. Correct this by using a copy
of the task args on every invocation of run() so that the original args
are not affected.

Local testing using this playbook seems to confirm that things work as
expected:

  - hosts: all
  tasks:
    - delay: 2
      register: task_result
      retries: 1
      until: task_result.rc == 0
      synchronize:
        dest: /tmp/out
        mode: pull
        src: /tmp/nonexistent/

fixes #18281

* Update synchroncization fixture assertions

When we started operating on a copy of the task args the test assertions
were no longer asserting things about the munged state but of the
pristine state. Convert the copy of task args to a class member so that
it can be compared against later in testing and update the assertions to
check this munged copy.
* Shuffle objects around for cleaner testing

Attach the temporary args dict to the task rather than the action as
this makes updating the existing tests cleaner.
9 years ago
ikelos 9e5d4de49a Fix overwrite parameter in module_utils.junos (#18671)
The overwrite parameter is forcibly set to false, meaning a module
passing that parameter will have no effect.  The overwrite facility
is necessary to ensure that conflicting options can be written the
configuration (which, in replace mode, they cannot).

This change ensures that if overwrite is set, it will not be changed
to False in the logic.
9 years ago
Patrick Ogenstad 05e5474c52 Disable CLI errors when typing enable (#18531) 9 years ago
Juan Antonio Valiño García 40ddbe026d Fixes #18663. Bad handling of existing config in dellos9 module. (#18664)
* Fixes #18663. Bad handling of existing config in dellos9 module.

The dellos9 module doesn't build correctly the internal
structures used to represent the existing config of the managed
network device. This leads to apply changes every time the
playbook is run, even if the existing config is the same that the
one you are trying to push into the device.

Probably this problem exist also in the dellos6 and dellos10
modules, but I only fixed it in the dellos9 module.

The fix modifies two methods. The first one is `get_config`,
where the return clause didn't work correctly when the flow
doesn't enter in the `if` block. In that case the `contents`
variable is not an array an this should be handled.

The second fix is in the `get_sublevel_config` method. In this
case the indentation whitespaces of the parents should be rebuild
because further functions and methods required it to handle
correctly comparisons used to check if changes should be pushed
into device.

* Fixes #18663 for dellos10 module with the same patches as dellos9.
9 years ago
Matt Clay 43785aa246 Add --all option to ansible-doc. 9 years ago
Nehal J Wani ead0022255 Open temp file only once
mkstemp() returns a tuple containing an OS-level handle to an open file
(as would be returned by os.open()) and the absolute pathname of that
file, in that order.

This patch makes sure that the fd opened by tempfile.mkstemp() is
re-used and closed properly.
9 years ago
Fabio Alessandro Locati 470d1e3aea Remove unused quotes (#19207) 9 years ago
Fabio Alessandro Locati 4b9a65fd7c Improve quotes - notification/hall.py (#19166) 9 years ago
Fabio Alessandro Locati 64e4c2798c Improve quotes - notification/nexmo.py (#19168) 9 years ago
Fabio Alessandro Locati 5e9b763937 Remove useless quotes - notification/sns.py (#19169) 9 years ago
Fabio Alessandro Locati 3d15f622b0 Always run on localhost - notification/rocketchat.py (#19170) 9 years ago
Fabio Alessandro Locati cf5424e165 Remove useless quotes - monitoring/statusio_maintenance.py (#19173) 9 years ago
Kevin Burke 114e3cb7a4 Fix typos in git.py (#19186) 9 years ago
Evan Kaufman aaf13e07fe Handle byte/string conversion on read/write with text module_utils (#19188)
Fixes ansible/ansible-modules-core#5840, moved from ansible/ansible-modules-core#5847
9 years ago
Vlad Glagolev 45b2f4b479 Source Mage GNU/Linux package manager support (#19072)
* added alpha version of the 'sorcery' module

* fully conforming YAML

* use bundled check for executables

* - codex_list(): use commands instead of checksums to get sorcery version and verify codex equality - renamed: - manage_depends() -> match_depends() - tocast -> cast_queue, todispel -> dispel_queue, needs_recast -> depends_ok - SORCERY_LOG -> SORCERY_LOG_DIR, SORCERY_STATE -> SORCERY_STATE_DIR - removed: - SORCERY_VERSION_FILE - CODEX - added commentary to match_depends() and manage_spells() - fixed bug about dropped dependency line for previously existed dependency - fixed bug about not fixing depends for the 'latest' state - simplified several code constructions

* cleaned up some docs

* do not use separate message for Codex update, rely on the 'changed' status instead

* use built-in list conversion (_check_type_list()) for spells

* corrected spell name extraction from list in match_depends()

* avoid non-matching dependencies line duplication in depends file

* added more complex playbook example

* tiny stylistic fix for docs

* replaced ternary construction with a regular statement

* replaced yet another ternary construction with a regular statement

* enable Python 2.4 compatibility by splitting try-finally block

* enable Python 2.4 compatibility by replacing 'with' statement with try-except+try-finally blocks

* unify spells' assign

* replaced one regex with startswith()

* go Ansible 2.1

* added dummy RETURN template

* go Ansible 2.2

* better clarify permissions' requirements

* - updated copyright years - fixed rebuild command bug - re-used run_command_environ_update dict for env var management

* handle Python 3.5

* Revert "handle Python 3.5"

This reverts commit 33a5a0eb64c1193318298e111f063cdd5f93b73a.

* handle Python 3.5 (2nd try)

* go Ansible 2.3

* clarity++
9 years ago
Fabio Alessandro Locati 4bfb83c966 Native YAML - notification/mqtt.py (#19164) 9 years ago
Alexandre Garnier 0f7abad38f Fix python 2.4 compatibility
`start` keyword of `enumerate` is only available since python 2.6
9 years ago
Chris Houseknecht 65491cc839 For docker add --blocking-io only when missing (#19171) 9 years ago
Irina Muchnik 9f58e69d63 Fix secure temp file creation (#19096)
* For realz this time

* Fix tempfile.mkstemp (#2)

* back to square one, removing temp file from the mix

* Adding temp back

* Adding tuple  back

* Adding another tuple back

* Trying to get around weird Jenkins behavior of blowing up when both .hpi and jpi file found

* Incorporating PR feedback

* Delete .hpi file instead of backing it up, some basic clean up

* Moving file deletion to the right location

* Blank lines. They always get me.
9 years ago
Fabio Alessandro Locati 2adde7a6d1 Remove unused quotes - notification/pushbullet.py (#19149) 9 years ago
Fabio Alessandro Locati c3887138c5 Remove unused quotes (#19150) 9 years ago
Fabio Alessandro Locati 261fad8fee Remove unused quotes - notification/hipchat.py (#19151) 9 years ago
Fabio Alessandro Locati 617e82fe8c Remove unused quotes - notification/twilio.py (#19152) 9 years ago
Fabio Alessandro Locati e788f13956 Remove unused quotes - files/unarchive.py (#19155) 9 years ago
Fabio Alessandro Locati 90a698c367 Remove unused quotes - notification/rocketchat.py (#19156) 9 years ago
Fabio Alessandro Locati 372352f35d Remove unused quotes - web_infrastructure/deploy_helper.py (#19157) 9 years ago
Fabio Alessandro Locati e32b0da0b0 Improve examples - monitoring/logicmonitor_facts.py (#19158) 9 years ago
Fabio Alessandro Locati a8fa008bbe Remove unused quotes - source_control/github_hooks.py (#19159) 9 years ago
Fabio Alessandro Locati b42cda4dd2 Remove deprecated example (#19161) 9 years ago
Chris Houseknecht b02491ba70 Add --blocking-io option when docker connection (#19140) 9 years ago
Rene Moser b1ea79af51 cloudstack: cs_role: doc fixes. 9 years ago
René Moser a8fc8249b4 cloudstack: new module cs_role (#19134) 9 years ago
Matt Clay 2cb6a10a0e Fix module names in module docs. 9 years ago
Matt Clay cd47cb2a15 Remove remnants of obsolete fireball mode. 9 years ago
Matt Clay ac7edef2be Fix modules with documentation errors. 9 years ago
Fabio Alessandro Locati 9a075b5917 Avoid using an object if it does not exists (#19058) 9 years ago
Fabio Alessandro Locati 28a12e8b27 Use dbus only if it is present (#19060) 9 years ago
Fabio Alessandro Locati 3b509b1095 Avoid extending a class if it does not exists (#19059) 9 years ago
Kash 6b1586748f Fixes #4538 passing int params as required by boto (#18999) 9 years ago
Yury V. Zaytsev 395b59ea6c Update ec2_vpc_peer.py (#19069)
Document `peering_id` module parameter.
9 years ago
José Sabater Montes 66ced41485 Add new Amazon EBS volume types. Fixes issue 4041 of ansible-modules-core 9 years ago
Adam Chainz 0b8aada1bc Cloudformation - allow re-using an existing template (#19009)
* Allow re-using an existing template when updating a stack by not passing 'template' or 'template_url'. This is a big one for me as our deploy process creates a new stack and then modifies the old one; to avoid changing the resources inside the old one, we have had to avoid using the Ansible module and use the AWS CLI instead in order to pass `--use-previous-template`.
* Split create and update logic into separate functions
* Remove dead `update` variable
9 years ago
Maarten Bezemer 7b4eb078c6 Leave current secutiry groups as-is if not provided (#19043) 9 years ago
Tom Paine 1d80f5cf0f Update ec2_group.py (#19033)
PR move of https://github.com/ansible/ansible-modules-core/pull/3588

##### ISSUE TYPE
- Docs Pull Request

##### COMPONENT NAME
ec2_group.py

##### ANSIBLE VERSION

```
ansible 2.0.2.0
  config file = /Users/tpai/src/cm-secure/ansible.cfg
  configured module search path = Default w/o overrides
```
##### SUMMARY

Make it clear you can specify the created group in the rules list, allowing idempotent use for group<->group networking rules.

This is a really useful feature that isn't obvious enough in the docs.
9 years ago
Andy Freeland cb9b5ab146 Include volume encryption status in 'ec2_vol_facts' module (#19017) 9 years ago