Commit graph

15145 commits

Author SHA1 Message Date
Peter Sprygada
8716a5bc67 maps ios provider ssh_keyfile to play_context (#21597)
This allows the key file to be specified in the playbook for the ios
module provider argument
2017-02-17 18:56:00 +00:00
Thomas Szymanski
60bb677154 Add safety checks to nspawn connection plugin
This patch adds some checks on the path that is accessed as a container,
making sure it looks like one. It implements the connection method and
add adaptations to the modern way of writing connections for Ansible.
It also rewords docs and vars to use the nspawn terminology instead of
chroot.
2017-02-17 12:39:48 -05:00
Thomas Szymanski
b8125ac1a6 Remove the --nspawn-extra-args cli option
Providing extra arguments to pass to systemd-nspawn is still possible
through the `nspawn_connection` of the `ansible.cfg` file.
2017-02-17 12:39:48 -05:00
Lars Kellogg-Stedman
3597ca082b add systemd-nspawn connection driver
This commit adds a connection driver built on top of systemd-nspawn.
This is similar to the existing `chroot` driver, except that nspawn
offers a variety of additional services. For example, it takes care of
automatically mounting `/proc` and `/sys` inside the chroot environment,
which will make a variety of tools work correctly that would otherwise
fail.

You can take advantage of other system-nspawn features to perform more
complicated tasks.  For example, on my x86_64 system I have a Raspberry
Pi disk image mounted on `/rpi`.  I can't use `chroot` with this because
the binaries contained in the image are for the wrong architecture.
However, I can use the systemd-nspawn `--bind` option to automatically
insert the appropriate qemu-arm binary into the container using an
inventory file like this:

    pi ansible_host=/rpi ansible_nspawn_extra_args='--bind /usr/bin/qemu-arm --bind /lib64'

See http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html
for more information about systemd-nspawn itself.
2017-02-17 12:39:48 -05:00
John R Barker
482f882798 Correct example 2017-02-17 17:31:05 +00:00
Toshio Kuratomi
3feb3d6c16 Restore validate_certs being a bool type 2017-02-17 09:17:05 -08:00
Brian Coca
0ddcde2fb2 updated docs to match 2017-02-17 12:04:24 -05:00
Monty Taylor
5d21256d9f Default verify to None for OpenStack modules
This will require a new release of os-client-config.
2017-02-17 11:59:13 -05:00
James Cammarata
1bf8c99974 Update any_errors_fatal field attributes in block/task to match play 2017-02-17 10:25:27 -06:00
Wayne Witzel III
743d48af5c Add Tower Project module (#21479) 2017-02-17 16:19:33 +00:00
Wayne Witzel III
17f0dc3f4d Add Tower Group module (#21480) 2017-02-17 16:19:06 +00:00
Wayne Witzel III
17a2e5ead2 Add Tower Host module (#21482) 2017-02-17 16:18:40 +00:00
Wayne Witzel III
ff3023e82b Add Tower Inventory module (#21483) 2017-02-17 16:18:11 +00:00
Wayne Witzel III
2b6c13f883 Add Tower Label module (#21485) 2017-02-17 16:17:41 +00:00
Ryan Brown
d64d38a1f4 [cloud][docker] Insensitive search for docker port publishing (#21579) 2017-02-17 10:41:26 -05:00
Adrian Likins
7b6c992c46 Vault encrypt string cli (#21024)
* Add a vault 'encrypt_string' command.

The command will encrypt the string on the command
line and print out the yaml block that can be included
in a playbook.

To be prompted for a string to encrypt:
   
   ansible-vault encrypt_string --prompt

To specify a string on the command line:

   ansible-vault encrypt_string "some string to encrypt"

To read a string from stdin to encrypt:

   echo  "the plaintext to encrypt" | ansible-vault encrypt_string

If a --name or --stdin-name is provided, the output will include that name in yaml key value format: 

   $ ansible-vault encrypt_string "42" --name "the_answer"
    the_answer: !vault-encrypted |
          $ANSIBLE_VAULT;1.1;AES256
          <vault cipher text here>

plaintext provided via prompt, cli, and/or stdin can be mixed:

      $ ansible-vault encrypt_string "42" --name "the_answer" --prompt
      Vault password: 
      Variable name (enter for no name): some_variable
      String to encrypt: microfiber
      # The encrypted version of variable ("some_variable", the string #1 from the interactive prompt).
     some_variable: !vault-encrypted |
              $ANSIBLE_VAULT;1.1;AES256
              < vault cipher text here>
      # The encrypted version of variable ("the_answer", the string #2 from the command line args).
      the_answer: !vault-encrypted |
             $ANSIBLE_VAULT;1.1;AES256
             < vault cipher text here>

Encryption successful
* add stdin and prompting to vault 'encrypt_string'
* add a --name to encrypt_string to optional specify a var name
* prompt for a var name to use with --prompt
* add a --stdin-name for the var name for value read from stdin
2017-02-17 10:12:14 -05:00
Zhuo Peng
fe02dbecc0 [cloud] Fix a minor doc error in docker_container module (#21033) 2017-02-17 10:01:15 -05:00
Peter Sprygada
a6cecef6bc clean up of terminal plugins (#21549)
* removes unneeded supports_multiplexing var
* refactors terminal_prompts_re to terminal_stdout_re
* refactors terminal_errors_re to terminal_stderr_re
* updates network_cli unit test cases
2017-02-17 10:00:23 -05:00
Ricardo Carrillo Cruz
c5452eef6f Removes default kwarg in iosxr_argument_spec for timeout (#21569) 2017-02-17 15:59:24 +01:00
Peter Sprygada
4cbbed0b37 fixes issue with prompt detection in network_cli (#21574)
The network_cli plugin would return immediately if an error was
detected.  This patch will force the connection plugin to still try to
detect the current prompt even if an error is found.
2017-02-17 14:13:26 +00:00
Evgeni Golov
d3d1aa2dca synchronize: quote private_key (#21570)
otherwise rsync will fail when trying to access a key with spaces:

fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh 'ssh -i /home/user/Some Folder/.vagrant/machines/default/libvirt/private_key -S none -o StrictHostKeyChecking=no -o Port=22' --out-format='<<CHANGED>>%i %n%L' \"/etc/issue\" \"vagrant@192.168.121.10:/tmp/issue2\"", "failed": true, "msg": "Warning: Identity file /home/user/Some not accessible: No such file or directory.\nssh: Could not resolve hostname folder/.vagrant/machines/default/libvirt/private_key: No address associated with hostname\r\nrsync: connection unexpectedly closed (0 bytes received so far) [sender]\nrsync error: unexplained error (code 255) at io.c(226) [sender=3.1.2]\n", "rc": 255}
2017-02-17 14:18:41 +01:00
Peter Sprygada
b0abbb5f8b removes the default kwarg in ios_argument_spec for timeout (#21552)
Uses the configured timeout setting instead of the arg_spec

fixes #21520
2017-02-17 13:12:12 +01:00
Ondra Machacek
a5d34f2ac2 cloud: ovirt: add override_iptables to examples (#21474) 2017-02-17 09:03:24 +00:00
Matt Davis
8527013fbe Complete rewrite of Windows exec wrapper (#21510)
* supports pipelining for faster execution
* supports become (runas), creates interactive subsession under WinRM batch logon
* supports usage of arbitrary module_utils files
* modular exec wrapper payload supports easier extension
* integrates async wrapper behavior for pipelined/become'd async
* module_utils are loaded as true Powershell modules, no more runtime modifications to module code
2017-02-17 00:09:56 -08:00
James Cammarata
7bf56ceee3 Relocate creation of Templar in process_pending_results
Moving it to after the blocks where per-item results are calculated,
as it's not used there and causes quite a performance hit being there.

Fixes #21340
2017-02-17 00:26:09 -06:00
Peter Sprygada
c9f6a2b740 fixes issue with cli shell left open (#21548)
The nxos action plugin will now close the shell connection once the
module has completely run
2017-02-16 22:11:32 -05:00
Peter Sprygada
20c5a1adc1 verifies cli context for iosxr (#21550)
Checks cli context and exits config mode if needed
2017-02-16 22:11:21 -05:00
Peter Sprygada
9d4a3599b8 bug fixes and updates for eos connections (#21534)
* refactors supports_sessions to a property
* exposes supports_sessions as a toplevel function
* adds open_shell() to network_cli
* implements open_shell() in eos action plugin
2017-02-16 20:26:48 -05:00
Peter Sprygada
a01288859d check ios cli context and exits config mode if there (#21544) 2017-02-16 20:26:29 -05:00
Toshio Kuratomi
eeaec56ed5 Use isinstance instead of type() comparisons. isinstance is more robust 2017-02-16 16:34:43 -08:00
Tom Melendez
0d3d8cbcd9 [GCE] Doc fixes for gce_net (#21524)
* Updated examples and added return block.

Doc fix only.  No logic or executable code modified in this commit.
2017-02-16 16:39:00 -05:00
Sumit Kumar
1ba47cdf2e Add NetApp SolidFire volume module (#20732)
* Add NetApp SolidFire volume module

* Make requested changes

* Make requested changes

* Set supports_check_mode to True

* Make requested changes

* Change new_account_id to account_id, 512emulation

* Make requested changes

* Add alias for enable512e

* Move byte_map to utils and add exit message

* Update description for ‘attributes’
2017-02-16 15:21:14 -05:00
Ted Timmons
5d9df86b42 Postgres ssl mode prefer (#21498)
* refactor postgres,
* adds a basic unit test module
* first step towards a common utils module
* set postgresql_db doc argument defaults to what the code actually uses

* unit tests that actually test a missing/found psycopg2, no dependency needed

* add doc fragments, use common args, ansible2ify the imports

* update dict

* add AnsibleModule import

* mv AnsibleModule import to correct file

* restore some database utils we need

* rm some more duplicated pg doc fragments

* change ssl_mode from disable to prefer, add update docs

* use LibraryError pattern for import verification

per comments on #21435. basically LibraryError and touching up its usage in pg_db and the tests.
2017-02-16 11:29:43 -08:00
Ted Timmons
a000594436 fix failing fail_json call in postgresql_schema (#21495)
fix failing fail_json call in postgresql_schema

- Bugfix Pull Request

modules/database/postgresql/postgresql_schema

```
2.3.0
```

Here's an example of the error that was coming out. Massaged some linebreaks and backslashes to make it more readable:

    "module_stderr": "Traceback (most recent call last):
      File "/tmp/ansible_3X05GE/ansible_module_postgresql_schema.py", line 274, in <module>
        main()
      File "/tmp/ansible_3X05GE/ansible_module_postgresql_schema.py", line 265, in main
        module.fail_json(msg="Database query failed: %s" %(text, str(e)))
      NameError: global name 'text' is not defined
    ",

Now it triggers with the correct exception and shows the traceback. This duplication of str(e) and traceback seems to be the best design pattern.

Sample of the new output:

    An exception occurred during task execution. The full traceback is:
    Traceback (most recent call last):
      File "/tmp/ansible_gp4v1Q/ansible_module_postgresql_schema.py", line 254, in main
        changed = schema_create(cursor, schema, owner)
    ...
        return super(DictCursor, self).execute(query, vars)
    ProgrammingError: permission denied for database schemadb

    fatal: [localhost]: FAILED! => {
        "changed": false,
        "failed": true,
    ...
        },
        "msg": "Database query failed: permission denied for database schemadb\n"
2017-02-16 11:26:40 -08:00
Peter Sprygada
02d2b753db refactors junos modules to support persistent socket connections (#21365)
* updates junos_netconf module
* updates junos_command module
* updates junos_config module
* updates _junos_template module
* adds junos_rpc module
* adds junos_user module
2017-02-16 10:53:03 -05:00
Brian Coca
47870c3385 refine password field filtering (#21230)
* refine password field filtering

* dont skip

* removed bad leftover vestige of previous condition
2017-02-16 10:52:27 -05:00
Brian Coca
cc0bb54d2c the return of reset_connection
allows user to force persistent connection to close, needed for when
you want to benefit from changes applied to the current play but persistent connections
prevent them from being realized.
2017-02-16 10:49:57 -05:00
Tomas Tomecek
30026cfb84 [cloud] module docker_image: print output on failure (#20757)
Fixes https://github.com/ansible/ansible-modules-core/issues/5161

Signed-off-by: Tomas Tomecek <ttomecek@redhat.com>
2017-02-16 09:47:18 -05:00
Will Thames
f42ffe6de3 [cloud] Ensure that s3_bucket module always enables/disables versioning if it is specified (#21320)
If versioning is not enabled, then `get_bucket_versioning`
can return an empty dict.

If that happens, the code to enable versioning should still
run!

The logic for suspending versioning was also incorrect, so
have updated that too.

Fixes #20491
2017-02-16 09:45:05 -05:00
Sloane Hertel
a077aeb693 [cloud][aws] Refactor s3 module, and add 'ignore_nonexistent_bucket' option (#20501)
Introduces `ignore_nonexistent_bucket` option that does not require ListBuckets permission, so less permissioned IAM roles can still be used with this module. 

Fixes #20501
2017-02-16 09:39:11 -05:00
Peter Sprygada
34e6cc788f check cli context to be sure out of config mode in ios (#21493)
This change will now check the cli context after a module runs and if
the cli is still in config mode it will exit config mode.  Also fixes a
minor issue with converting list of commands to a dict

fixes #21481
2017-02-16 12:54:33 +00:00
Dag Wieers
edf2b00614 win_regmerge: Clean up parameter handling (#21388)
Changes include:
- Use Get-AnsibleParam with -type support
- Replace $result PSObject with normal hash
2017-02-16 12:41:59 +00:00
Dave Kasberg
dbb452100a New module: cnos_vlan and various utility files (#21107)
* First set of CNOS network modules

Two modules: cnos_vlan and cnos_command.  First 2 of 17 CNOS modules

* Revert "First set of CNOS network modules"

This reverts commit 63da68b2a857e622b449f514050eed25fbcf0a35.

* cnos_vlan module

First of 17 CNOS modules

* Modify playbook for cnos_vlan module testing

* fix issue found by shippable in cnos.py

* cnos_backup module

* Fix Python3.5 compilation error

* remove cnos_backup module from this PR

* add aliases file so that testing of the cnos_vlan module will be skipped.

* Use empty aliases file

* utility scripts under module_utils changed to BSD license.

* clean up PEP8 issues, add cnos_vlan tests

* remove blank lines from yml files

* remove more blank lines

* remove even more blank lines

* Revert "remove even more blank lines"

This reverts commit bb3998661ce387260340bca39d5f146f5ec54f44.

* re-submit last commit

* fix blank lines in this file under parsing

* fix yamllint errors in doc section of cnos_vlan

* Fix errors reported by Sanity check using validate-modules

* change test playbook to include tasks for all modules

* fix additional pep8 errors

* more fixes, plus fix for python3

* fix for empty options section, removed unnecessary documentation

* fix up documentation section

* Correct options capitalization

* fix example section, add options

* Fix example section of the documentation
2017-02-16 08:11:39 +00:00
Peter Sprygada
d77a6bda97 remove unneeded module eapi 2017-02-15 20:47:43 -05:00
Peter Sprygada
d3b57a2f9c more cleanup from net_command module that is abandoned for 2.3 (#21497) 2017-02-15 20:38:57 -05:00
James
87646595e3 Remove the end of the task_data.path which causes #21461 2017-02-15 17:35:16 -08:00
johnnysheppard-isode
54de41309f win_lineinfile backrefs bug fix and updated examples. (#20926)
* Bug Fix for win_lineinfile and updated examples.

- changed $backrefs to a bool so it works with true/false/yes/no. This also fixes idempotency.
- Updated Docs with an example of using backrefs.

* Made suggested updates and converted two more parameters to "bool"

* Updated the Exception message

- Now contains the Windows Exception message as well as a custom message to help point in the right direction of a failed write.

* Updated Exception Handling

- Added Exception checks for Creating and removing the temporary files.
- Changed the ErrorAction on the copy tmpfile and remove tmp file to "Stop" to
  cause the exception handler to catch all errors so we can fail gracefully
  every time.
2017-02-15 20:09:30 -05:00
Jasper Lievisse Adriaanse
52960ff7d0 Fix service_mgr fact for Solaris; svcs is used to list services.
Instead use 'smf' to reflect the name of framework, as is done elsewhere
(e.g. 'systemd' instead of 'systemctl').
2017-02-15 20:07:16 -05:00
Sloane Hertel
f775996209 add 'version_added' field for environment_variables option in lambda.py (#21500)
* Add 'version_added' field for environment_variables option (version_added: "2.3")
2017-02-15 18:52:48 -05:00
Abdoul Bah
c22fbdc831 resolve #21056 - Add support for full cloning a Qemu VM. Fix some issues. Update doc (#21225)
* resolve #21056 - Add support for full cloning. Fix some issues. Update doc

* Fix condition and update doc. Fixes #28585

* Using built-in helper for argspec, revert ansible metadata, add more control and remove type in documentation

* PEP8 style compliance
2017-02-15 22:51:46 +00:00
Tim Rupp
7869b543fa Changes attribute to be public (#21490)
eom
2017-02-15 22:48:31 +00:00
Benjamin JOLIVOT
9baf95bcc4 Add status_code & failed:false when status==200 (#21457)
* Add status_code & failed:false when status==200

* remove failed=false, it's broking tests
2017-02-15 14:30:06 -08:00
James Cammarata
eec88b63c2 Fix bug introduced in 0df3767 regarding undefined entries in HostVars
Fixes #21084
2017-02-15 16:22:31 -06:00
Matt Martz
78a000502e YAML fixes for examples in additional modules 2017-02-15 13:01:43 -08:00
Matt Martz
7c00346714 Validate EXAMPLES as YAML 2017-02-15 13:01:43 -08:00
Michael Scherer
6fae1d2bbf Make password lookup treat /dev/null as a special case
I have from time to time a need of random password without
wanting to write them down (one example is mailman list creation,
that requires a password to be given to be sent to the list owner).

But using /dev/null do not return null, but the empty string, which
doesn't generate a password at all and so do not achieve my use case.
2017-02-15 12:15:09 -08:00
Will Thames
103ede26df Ensure ssh hostkey checks respect server port (#20840)
* Add tests for `get_fqdn_and_port` method.

Currently tests verify original behavior - returning default `ssh-keyscan` port
Add test around `add_host_key` to verify underlying command arguments
Add some new expectations for `get_fqdn_and_port`
Test that non-standard port is passed to `ssh-keyscan` command

* Ensure ssh hostkey checks respect server port

ssh-keyscan will default to getting the host key for port 22.
If the ssh service is running on a different port, ssh-keyscan
will need to know this.

Tidy up minor flake8 issues

* Update known_hosts tests for port being None

Ensure that git urls don't try and set port when a path
is specified

Update known_hosts tests to meet flake8

* Fix stdin swap context for test_known_hosts

Move test_known_hosts from under basic, as it is its own library.
Remove module_utils.known_hosts from pep8 legacy files list
2017-02-15 11:47:57 -08:00
Matt Clay
09f4242ce4 Fix junit callback handling of surrogate escapes. 2017-02-15 10:51:55 -08:00
Toshio Kuratomi
99fd2328af Fix hash filter for non-ascii strings and Python3
hashlib hashes operate on byte strings.  When given a text string on
Python3, hashlib backtraces.  When given a text string on Python2,
hashlib will backtrace if the string contains non-ascii characters.
Encode the text string to utf-8 prior to hashing to avoid this problem.

Fixes #21452
2017-02-15 10:50:10 -08:00
Wilfrido Vidana
e89259dbd0 Fixes #19835: enable role attribute change when not changing password (#19834)
Fixes #19835
2017-02-15 13:47:15 -05:00
Adrian Likins
106439e470 Handle sysctl.conf files that use ';' for comments (#20576)
'#' and ';' are both valid comment chars for sysctl.conf files
according to the 'man sysctl.conf':

  "Lines which begin with a # or ; are considered comments and ignored."

Fixes #20569
2017-02-15 13:37:09 -05:00
Daniel O'Brien
320c791cfb Adding more functionality for Linode cloud module 2017-02-15 10:26:40 -08:00
Peter Sprygada
48b02336ab code clean of old code from network modules updates (#21469)
* removes unused code
* removes module_utils/local.py
* removes plugins/action/network.py
* removes action_handler from connection plugins
* removes code to use action_handler in task_executor
* updates action plugins to subclass from normal
2017-02-15 12:46:30 -05:00
Peter Sprygada
2d14cdc5ac fixes broken run_commands() method (#21478) 2017-02-15 12:12:59 -05:00
Wayne Witzel III
f98d41c121 Ansible Tower user and credential module (#21020)
* rename tower config module parameters to avoid conflicts

* add Ansible Tower user module

* add Ansible Tower credential module

* remove errant hash from interpreter line

* friendlier error messages

* Update tower_verify_ssl defaults and module examples

* Update tower_verify_ssl default documentation

* Tower expects satellite6 not foreman
2017-02-15 16:59:03 +00:00
Tim Rupp
2a9778e320 Change the f5 modules to use f5_utils file (#21466)
The f5 module utils were using a file name that appeared to
conflict with the f5 python SDK's namespace. This patch just changes
the name of the included class to be f5_utils to avoid the issue
of namespace collisions
2017-02-15 16:51:13 +00:00
Peter Sprygada
21d993a4b8 refactors nxos module to use persistent connections (#21470)
This completes the refactor of the nxos modules to use the persistent
connection.  It also updates all of the nxos modules to use the
new connection module and preserves use of nxapi as well.
2017-02-15 11:43:09 -05:00
Peter Sprygada
eb1453a366 updates iosxr modules to support socket (#21231)
* updates all iosxr modules to support persistent socket
* adds iosxr action plugin to connect to device
* adds exec_command() to iosxr shared module
* fixes iosxr_config and iosxr_template local action
* update all unit test cases
* adds base test module for iosxr module testing
2017-02-15 10:47:02 -05:00
Will Thames
635e3fe9ee [cloud] ec2_vpc_peer should remove peering connections (#20113)
Don't try to create tags on a vpc that you've just removed.

Avoids

```
 "msg": "An error occurred (InvalidParameterValue) when calling the CreateTags operation: You must specify one or more tags to create"
```

Although not quite sure why the `create_tags` was being called
as `module.params.get('tags')` *should* have returned `None`.
2017-02-15 10:21:47 -05:00
Dag Wieers
39a8638ec0 Advanced example using shell with other executable (#21462)
The shell module is quite versatile in its use.
2017-02-15 14:52:31 +00:00
Ondra Machacek
34da024e06 cloud: ovirt: add requirments to ovirt_auth module (#21460) 2017-02-15 13:59:27 +00:00
Peter Sprygada
381a045089 updates network local actions to check for connection=local (#21437)
* updates vyos local action
* updates ios local action
2017-02-15 11:27:54 +00:00
John R Barker
86e2feffc1 archive docs formatting (#21454) 2017-02-15 11:24:05 +00:00
Alexander Turner
dc5d92eac2 Added Ordnance Module (#21447)
* Added Ordnance network module.

* Tidied up code base as per PR20436

* Whitespace blocking PEP8 test

* Removed acciental addition to VERSION

* Removed acciental addition to VERSION

* Documentation YAML issues

* removed force arg (depreciated)

* rectified broken import

* Ordnance module init

* added ordnance helper
2017-02-15 10:30:45 +00:00
Peter Sprygada
47141b8426 fixes minor issue with strict diff of network config (#21436)
strips leading and trailing spaces for line comparision to prevent
fails positiives
2017-02-14 20:12:49 -05:00
Peter Sprygada
8e4f0ec162 checks connection type is local and fails if not in eos (#21429) 2017-02-14 18:42:15 -05:00
Tim Rupp
6fc989a902 Adds a factory function for getting REST api tools (#21423)
I plan on converting most all f5 modules to use the rest api, so
this is part of that conversion. it adds a factory method to get
the various rest management root apis provided in the f5 sdk
2017-02-14 22:31:11 +00:00
Gabriele
db786fc211 Fixing nxos_portchannel bug caused by wrong regex (#20850) 2017-02-14 16:08:43 -05:00
Sumit Kumar
f3fe1eef03 Add NetApp ONTAP aggregate module (#20712)
* Add NetApp ONTAP Aggregate module

* Update fail_json message

* Make changes to adhere to community guidelines
2017-02-14 16:01:35 -05:00
Sumit Kumar
2c81e05baa Add NetApp ONTAP user module (#20723)
* Add NetApp ONTAP user module

* Make changes to adhere to community guidelines

* Fix PEP8 issue
2017-02-14 16:01:16 -05:00
Sumit Kumar
97b238b6c6 Add NetApp ONTAP license module (#20715)
* Add NetApp ONTAP license module

* Make changes to adhere to community guidelines
2017-02-14 16:01:07 -05:00
Sumit Kumar
774277ceb7 Add NetApp ONTAP SVM module (#20670)
* Add NetApp ONTAP SVM module

* Update fail_json message

* Make changes to adhere to community guidelines
2017-02-14 16:00:14 -05:00
Sumit Kumar
236db1cf66 Add NetApp ONTAP LUN module (#20716)
* Add NetApp ONTAP LUN module

* Make changes to adhere to community guidelines
2017-02-14 15:57:14 -05:00
Sumit Kumar
3de8419261 Add NetApp ONTAP qtree module (#20719)
* Add NetApp ONTAP tree module

* Make changes to adhere to community guidelines
2017-02-14 15:55:54 -05:00
Sumit Kumar
c50e286ab8 Add NetApp ONTAP user-role module (#20722)
* Add NetApp ONTAP user-role module

* Make changes to adhere to community guidelines
2017-02-14 15:55:24 -05:00
Michael Price
56dd5a702d Refactor E-Series AMG module to use module_utils (#20871)
* Refactor E-Series AMG module to use module_utils

Refactor the NetApp E-Series module to utlize the common module_utils
and doc_fragments.

* Resolve a PEP8 issue with a missing newline

* Resolve compatibility issue with json import
2017-02-14 15:53:18 -05:00
Dylan Silva
53c73ae836 Modified openswitch module metadata from core to community (#21355) 2017-02-14 15:51:51 -05:00
Sumit Kumar
026e2f3d50 Add NetApp ONTAP volume module (#20668)
* Add NetApp ONTAP volume module
* Update fail_json message
* Make changes to adhere to community guidelines.
* Make requested changes
2017-02-14 15:46:09 -05:00
Tim Rupp
22926088a0 Removes expanduser in favor of type 'path'
Removes the usage of expanduser because it is automatically handed
by specifying a type of 'path'. Related to #12263
2017-02-14 15:43:53 -05:00
s-hertel
c5446d95cc [cloud] New module: AWS elasticache_parameter_group for modifying Elasticache cluster settings (#21023)
Added a new module for ElastiCache. Allows users to create/modify/delete/reset cache parameter groups.
2017-02-14 15:32:42 -05:00
Brian Coca
258316ca72 user older functions as getres* are >=2.7 2017-02-14 15:05:25 -05:00
Peter Sprygada
b0c01bbb82 updates network_common lib (#21306)
* removes connection functions refactored into connection
* updates ComplexDict and ComplexList objects to use with AnsibleModule
* updates modules to add new argument to ComplexList & ComplexDict
2017-02-14 14:38:30 -05:00
Brian Coca
009ac075b7 expanded user facts to effective/real/saved 2017-02-14 14:37:31 -05:00
caio2k
2505d56401 removed deprecated HEADER_* from examples (#21395)
Even though the documentation says that HEADER_* parameter is deprecated, the examples still show its usage.
2017-02-14 14:31:12 -05:00
Tim Rupp
5f01cd4402 [cloud][serverless] Removes manual expanduser call in favor of type path (#21418)
Removes the usage of expanduser because it is handled automatically
by type 'path'. Related to #12263
2017-02-14 14:29:43 -05:00
Peter Sprygada
e1a2c6e1d3 roll up of fixes for eos modules (#21406)
* fixes issue with load_provider() not checking for an existing key
* adds updates to eos_config results key
* lots of minor syntax fixes in eos shared module
* adds eos_argument_spec to eos_eapi

fixes #21402
2017-02-14 18:47:29 +00:00
Adrián López
e1761d7724 yum: improve disk usage when update_cache used (#21098)
* Marks metadata files as outdated

Eliminates time records of the metadata and mirrorlists download
for each repository. This forces yum to revalidate the cache for
each repository the next time it is used.

* Command arguments in two separate strings to be compatible if run_command implementation changes. Doc explains a little better what is that parameter doing
2017-02-14 18:53:14 +01:00
Gabriele
5fbe64a324 Fixing nxos modules when interface is loopback (#20645)
* Fixing modules when interface is loopback

* Remove capitalize
2017-02-14 12:10:46 -05:00
Jiri Tyr
9008e8017b Fixing mounting of multiple sources to the same dest (#21413) 2017-02-14 09:09:48 -08:00
Scott Buchanan
8c6606aeee fix non-zero exit code on missing role file (#19002) 2017-02-14 17:57:06 +01:00
Jiri Tyr
d94b2d802e Fixing broken bind mount on CentOS 7 (#20703)
* Fixing broken bind mount on CentOS 7
* Fixing remount
2017-02-14 08:17:21 -08:00
Patrick Deelman
65cd21e9a8 passwordstore (pass) lookup module (#21314)
* passwordstore (pass) lookup module

* removed shebang
changed licensing
2017-02-14 11:12:39 -05:00
Sergey
8cb57f0b1d [cloud] New module: PubNub BLOCKS management module (#20200)
* Added PubNub BLOCKS management module.

* . increased block start/stop wait to 30 seconds

* . fixed multi-line documentation

* . fixed YAML formatting in documentation section

* . removed multi-line commits
. fixed YAML format in description section

* . updated test script to upload event handler sources if non-local connection used for tests
. changed module configuration parameter from 'block' to 'name' (represent target block name)
. updated module docs regarding 'chanes' configuration parameter. Only block 'name' can be changed using this parameter ('description' can be changed directly in module call configuration)
. changed module configuration parameter from 'pwd' tp 'password'
. migrated 'urlencode' import from try..catch to six module imported from Ansible module utils
. removed custom method which is used to verify whether value is empty

* ^ fixed value for key-path function usage with names of application/keyset/block and handlers.
. reduced unnecessary requests (better pre-procesing of previous results)
. event handler name change won't trigger block restart

* ^ fixed too long documentation lines

* . moved PubNub BLOCKS client code into separate package under PyPi
. updated module code to utilize new package
. changed block start stop state to: started and started

* . small changes in documentation format
2017-02-14 10:53:31 -05:00
s-hertel
0123ec786d [cloud] New module: AWS elasticache_snapshot (#21135)
* Adding an elasticache snapshot module.

Allows user to create, copy, or delete a snapshot.

* Removing unnecessary function

* Make indentation uniform.

* Making requested changes.

Fixing PEP8

Adding a more graceful fail for delete() if the snapshot's state valid (such as when it is in the process of being created).

* PEP8

* Fixing some formatting

move imports

fix parameter alignment

* move imports to the top of the file below documentation
2017-02-14 10:41:07 -05:00
Ondra Machacek
fd899c0339 [cloud][ovirt] Fix waiting to down state of stateless VM (#21246)
This patch enhances waiting operation of stateless VM to be down.
Because stateless VM creates a snapshot and removes it after the
VM is shutdown, we must wait until the VM is really prepared to
start again.
2017-02-14 10:40:21 -05:00
John R Barker
80c3087977 Revert "Added Ordnance network module." (#21408) 2017-02-14 15:33:19 +00:00
Stepan Stipl
86ed4b116c [cloud] add ec2_vpc_route_table purge_routes and purge_subnets options (#19334)
* Added purge_routes option to ec2_vpc_route_table module

* Added purge_subnets option to ec2_vpc_route_table module
2017-02-14 10:08:51 -05:00
Peter Sprygada
d43eac93bc ios local action creates circular reference (#21404)
When loading the params in the local action, the provider key was
inadvertently being loaded as well.  This created the circular
reference.  The load_provider() method will now check for the provider
key and skip it when encountered.

fixes #21399
2017-02-14 09:56:52 -05:00
Alexander Turner
f1a6d14d8e Added Ordnance network module. (#20436)
* Added Ordnance network module.

* Tidied up code base as per PR20436

* Whitespace blocking PEP8 test

* Removed acciental addition to VERSION

* Removed acciental addition to VERSION

* Documentation YAML issues

* removed force arg (depreciated)
2017-02-14 12:50:59 +00:00
Loïc Blot
acda9e9c85 nsupdate: rename rc(_str) to dns_rc(_str) (#21341)
This prevent module to fail when removing a removed record which returned RC 8 (NXRRSET)
2017-02-14 11:45:44 +00:00
Benjamin JOLIVOT
e3328e847b Ansible Mattermost Module (#21247)
* Ansible Mattermost Module v0.9

* __future__ not in top of file

* python3 ready

* trailing whitespace problem

* Bad metadata

* check mode + explicit imports + standardization

* bad false check

* move imports after documentation

* Add notes in doc explaining checkmode

* Remove default=false in doc + remove default values in doc

* rewrite default values in documentation

* trailing whitesapces

* Update description
2017-02-14 10:52:20 +00:00
Tim Rupp
09edc00008 Adds f5-sdk import check to all F5 modules (#21354)
Including this check in module utils so that it can be done
automatically in all F5 modules. This includes the ones that
do not yet use the f5-sdk because those modules too will move
to the SDK in the future
2017-02-14 08:42:07 +00:00
Pilou
f2c22109fb Don't mix deprecations messages with warnings messages (#21337)
* Remove unused attribute '_passthrough'

* Don't mix deprecations with warnings

* Return values: add 'deprecations' key used internally

* 'deprecations' and 'warnings' return values: add tests
2017-02-13 23:49:39 -05:00
René Moser
f2729f11c3 ios_config: fix "save" arg results in timeout (#21344)
* ios_config: fix "save" arg results in timeout

The command "copy running-config startup-config" prompts for a
destination filename, which was not handled.

~~~
testswitch#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
0 bytes copied in 0.679 secs (0 bytes/sec)

[15:16]
ios: write memory
~~~

* test_ios_config: adjust test_ios_config_save
2017-02-13 21:12:54 -05:00
Peter Sprygada
14b942f3fb updates eos modules to use socket (#21197)
* updates eos modules to use persistent connection socket
* removes split eos shared module and combines into one
* adds singular eos doc frag (eos_local to be removed after module updates)
* updates unit test cases
2017-02-13 20:22:10 -05:00
Peter Sprygada
9937e604f5 fixes ios_facts that was returning no values (#21357)
* adds conversion to command dict into ios shared lib
* fixes hardware commands in ios_facts
* adds network_os value to play_context in ios action plugin

fixes #21190
2017-02-13 20:20:44 -05:00
Tim Rupp
bf836850a4 Replaces expanduser with type path
Replaces the usage of expanduser with the type 'path' for the
dest and object options as that functionality is available
in that type automatically.

patch related to #12263
2017-02-13 17:32:41 -05:00
Tim Rupp
f8cbfad5e6 Removes usage of expanduser due to type 'path'
Removes the usage of the expanduser function because it is
being performed automatically by the type 'path' of the
path option.
2017-02-13 17:24:24 -05:00
James Cammarata
8cc98b07c5 Fixing PEP8 errors in utils/vars.py 2017-02-13 16:13:40 -06:00
James Cammarata
a4b2b0a734 Small fix for 350a32bd to make it Py3 compliant 2017-02-13 15:54:25 -06:00
Tim Rupp
b49d39c5db Removes usage of expanduser because of type path
The usage of type 'path' for the path option makes the use
of expanduser redundant. This patch removes the expanduser
call because the path type is already used for the path
option
2017-02-13 15:02:05 -05:00
Brian Coca
2cb658925b fixed for chrrot as ignore error still has rc=0 2017-02-13 14:47:39 -05:00
James Cammarata
350a32bd95 Tweaking the new unique id generate to be uuid compliant 2017-02-13 13:34:53 -06:00
Ondra Machacek
c8c4a73e14 Fix compatibility of affinity groups in oVirt 4.0 and 4.1 (#21308)
* cloud: ovirt: exit if incompatible API/SDK version

* cloud: ovirt: fix affinity groups compatibility for oVirt 4.1
2017-02-13 12:43:35 -05:00
Robin Roth
82eaa9735c Add try/except around xml parsing in zypper
Zypper sometimes produces invalid XML. Catch that in a nicer way.

Potential future improvement: Work around broken XML by removing some
sections.
2017-02-13 12:28:22 -05:00
Tim Rupp
4900201c5b Remove expanduser and use type path
This patch removes the use of expanduser and replaces it with
type 'path'. This patch is related to #12263
2017-02-13 12:15:50 -05:00
Tim Rupp
c4d3bf3207 Adds path type and remove expanduser
Related to #12263, this patch removes the usage of expanduser
in favor of the path 'type' for the module options of src and
dest
2017-02-13 12:05:40 -05:00
Tim Rupp
1fb53e6aaf Remove expanduser usage because of path type
With the addition of the 'path' type, the usage of expanduser
is redundant. This patch  removes that extra usage.
2017-02-13 12:05:08 -05:00
Tim Rupp
0fcc6edf2b Replace expanduser with type path
This patch removes the use of expanduser and replaces it with
type 'path' for the option. This is related to #12263.
2017-02-13 11:15:13 -05:00
Peter Sprygada
8adb108aa9 updates vyos modules to use socket connection (#21228)
* updates all vyos modules to use socket connection
* adds vyos local action handler
* adds exec_command() to vyos
* updates vyos_config local action
* update unit test cases
* add base class for testing vyos modules
2017-02-13 10:41:22 -05:00
Brian Coca
85194234ba fixed bad copy/paste, deprecations should deprecate 2017-02-13 10:37:54 -05:00
Peter Sprygada
7f1c43e597 updates ios modules to support persistent socket (#21258)
* updates all ios modules to support persistent socket
* adds ios action plugin to connect to device
* adds exec_command() to ios shared module
* fixes ios_config and ios_template local action
* update all unit test cases
* adds base test module for ios module testing
2017-02-13 15:22:14 +00:00
jjlorenzo
3befc894e1 set no_log for url_password 2017-02-13 09:38:51 -05:00
Brian Coca
441ccd3a58 fixed typo 2017-02-13 09:37:13 -05:00
Brian Coca
18b062760c update shared services
added new daemonization function
documented existing functions
2017-02-13 09:37:13 -05:00
Willem van Ketwich
93a689958e [cloud] add summary feature and refactor AWS cloudfront_facts module (#20791)
* initial commit of cloudfront_facts.py

* modification as per review from @georgepsarakis

* fixed shippable build error

* fixed shippable build error

* removed wildcard imports and replaced with specific imports from ansible.module_utils.ec2 as advised by @georgepsarakis

* renamed all instances of cloud_front_origin_access_identity to origin_access_identity as advised by @georgepsarakis

* show facts based on alias and distribution id for easy referencing as advised by @ryansb. have done for both distribution and distribution_config

* fixed incorrect logic for default list_distributions, fixed list_distributions_by_web_acl - wasn't passing web_acl_id, fixed list_invalidations keyword args missing DistributionId

* fixed last fact added clobbering all previous facts for an alias or an id

* removed list_ prefix from list keys

* removed unnecessary boto fields. made list_distributions and list_streaming_distributions dictionaries with id/alias as key. fixed list_invalidations.

* initial commit of cloudfront_facts summary

* checks for empty list returned from boto, standardised list naming

* neatened up parameters

* added summary documentation

* refactoring of functions for modularity

* refactoring, neatening code, fix for if cname not present, added try-catch blocks

* more refactoring, cleaning

* more cleaning, allowed streaming distributions to be found by domain name alias

* removed unnecessary line

* fixed tabs

* fixed indentation

* removed trailing whitespace

* removed more whitespace

* more refactoring, modified where invalidations dict is set

* added ETag to summary

* refactored summary list

* moved list out of for loop

* trailing white space

* reverted line lengthening as advised by @willthames

* modified exceptions to multi line as advised by @willthames

* reverted variable spacing to be more pythonic'

* reverted spacing in YAML as advised by @ryansb

* reverted line spacing for parameters for correct blame attribution as advised by @ryansb

* removed white space

* more white space

* reverted line spacings for parameters as advised by @ryansb

* removed spaces between parameters as advised by @ryansb
2017-02-13 09:20:04 -05:00
Dag Wieers
f824b2ce8d Avoid having module documentation links to itself (#21329)
* Avoid having module documentation links to itself

A lot of modules use M(own_module) in their documentation causing a link
in the documentation to itself.

* Make note more clear now
2017-02-13 14:02:34 +00:00
Loïc Blot
fb32c19fea New module: nsupdate (#21099)
Add nsupdate module to manage DNS records on a DNS server

This uses dnspython library

It's greatly inspired by https://github.com/mskarbek/ansible-nsupdate with some rework, better feedbacks and documentation addition

Signed-off-by: nerzhul <loic.blot@unix-experience.fr>
2017-02-13 11:13:23 +00:00
Peter Sprygada
92aa92ebd2 updates netconf to use persistent socket (#21307) 2017-02-12 09:05:23 -05:00
Peter Sprygada
b8f138cabb adds connection module to module_utils (#21310)
* connection module connecting to persistent sockets
2017-02-12 07:52:50 -05:00
aperigault
1cdde216ec vmware_guest: Extend facts with vmware tools informations (#20860) 2017-02-11 22:50:59 -05:00
aperigault
98d841b324 vmware_guest: Fix undefine variable in rename feature (#20855)
* vmware_guest: Fix undefine variable in rename feature

* vmare_guest: We can't wait_for_task because MarkAsTemplate return None
2017-02-11 22:46:58 -05:00
Ted
65e32243b8 Make access_token type str, remove alias, and make validate_certs def… (#20811)
* Make access_token type str, remove alias, and make validate_certs default value true

* Remove extra white space and add end of file newline

* Remove comma

* Try removing that whitespace again
2017-02-11 15:41:24 +00:00
John R Barker
4ad91fc96b notes (not note) (#21287) 2017-02-11 15:38:06 +00:00
Ivan Bojer
5b9807dbac new module for private cert generation (#20889)
* new module for private cert generation

* - changes based on the reviewer's comments

* - changes based on the reviewer's comments

* extra documentation per request
2017-02-11 15:34:12 +00:00
Sumit Kumar
05c74cee47 Add NetApp SolidFire account manager module (#20728)
* Add NetApp SolidFire account manager module

* Minor fixes

* Set supports_check_mode to True

* Add Ansible Metadata

* Fix 'state' example argument

* Remove logger
2017-02-11 08:02:48 +00:00
Brian Coca
916a10c8ec delegate_to is a string 2017-02-10 20:07:49 -05:00
Brian Coca
fa93bf7096 allow more than .service, onus on user 2017-02-10 18:12:02 -05:00
Brian Coca
2f0070639f attempt to fix systemd in chroot env
fixes #21026
2017-02-10 18:12:02 -05:00
Tim Bielawa
1b1d58eb7e Fix incorrect wording in the 'find' module 'paths' parameter 2017-02-10 16:30:31 -05:00