Commit graph

15397 commits

Author SHA1 Message Date
Tim Rupp
a8910e78ca Using the wrong variable (#22386) 2017-03-08 08:43:36 +00:00
Tim Rupp
3c69cf6d7d Moved exception handler in a little bit (#22376)
It wasn't being caught in the previous indentation
2017-03-07 21:05:01 +00:00
Adrian Likins
edcbef27ec Retain vault password as bytes in 2.2 (#22378)
* Retain vault password as bytes in 2.2

Prior to 2.2.1, the vault password was read in as byes and then remained
bytes all the way through the code.  A bug existed where bytes and text
were mixed, leading to a traceback with non-ascii passwords.  In devel,
this was fixed by changing the read in password to text type to match
with our overall strategy of converting at the borders.  This was
backported to stable-2.2 for the 2.2.1 release.

On reflection, this should not have been backported as it causes
passwords which were originally non-utf-8 to become utf-8.  People will
then have their working 2.2.x vault files become in-accessible.

this commit pipes bytes all the way through the system for vault
password.  That way if a password is read in as a non-utf-8 character
sequence, it will continue to work in 2.2.2+.  This change is only for
the 2.2 branch, not for 2.3 and beyond.

Why not everywhere?  The reason is that non-utf-8 passwords will cause
problems when vault files are shared between systems or users.  If the
password is read from the prompt and one user/machine has a latin1
encoded locale while a second one has utf-8, the non-ascii password
typed in won't match between machines.  Deal with this by making sure
that when we encrypt the data, we always use valid utf-8.

Fixes #20398

(cherry picked from commit 5dcce0666a)
2017-03-07 15:30:09 -05:00
Alex Lo
8e910cce8a ec2_group: description is only required when group state is present (#19791)
* description is only required when group state is present

also note that AWS requires a non-empty description when creating a security group

* clarify description requirement
2017-03-07 20:55:17 +01:00
René Moser
e0d38fb137 composer: fix escape working_dir (#22363)
* composer: fix escaping of path working_dir

* composer: fix pep8
2017-03-07 20:51:04 +01:00
Brian Coca
c71b15a696 Bad extra early (#22322)
* catch bad extra vars data earlier

* incoporated @alkins feedback
2017-03-07 13:44:36 -05:00
Toshio Kuratomi
1ea3313c90 Document synchronize limitations around become and connections (#22373)
* Document synchronize limitations around become and connections
2017-03-07 10:22:24 -08:00
Brian Coca
c4cff44e77 fix 'ungrouped' issue with some inventory formats 2017-03-07 12:49:24 -05:00
Brian Coca
20bf02f6b9 rename return var to avoid conflicts
fixes #22323
2017-03-07 12:08:31 -05:00
Ricardo Carrillo Cruz
fd6429fbd1 Idempotency fix for iosxr_config (#22365)
Multiple fixes to address idempotency issues, along with refactor of
module_utils iosxr to look like ios, for code consistency.

Fixes #22315
2017-03-07 15:57:19 +00:00
Kamil Cholewiński
ec9582fd83 Fix invocations of module.fail_json with no msg=
Bonus: add missing % in cs_nic.py
2017-03-07 10:17:14 -05:00
Michael Scherer
91860b2423 Verify that the role specification is using a comma before warning
One way to trigger this is having this snippet in meta/main.yml:

dependencies:
  - role: foo
    when: "use_foo == True"

It shouldn't show a warning but since we assume that 'foo' is the old
style format, it always show one. So we should verify the
style before calling role_spec_parse.
2017-03-07 09:35:42 -05:00
Chris Alfonso
25827c85d2 Fixing issue #22193 - authorize argument is not deprecated for 2.3 for ios and eos (#22326) 2017-03-07 13:03:44 +01:00
Loïc Blot
792efbe3b6 virt.py: autostart VM attribute (#22208)
* virt.py: autostart VM attribute
autostart is now an idempotent VM attribute instead of a non idempotent forced autostart attribute set to True

* Make shippable happy

* Missing version added

* Fix some points

* Autostart default is now None

* Ident fix
2017-03-07 11:07:19 +00:00
Andrea Giardini
863c1ff38b Ec2_tag support for check mode (#21779) 2017-03-07 10:44:32 +00:00
John R Barker
8531547ec2 Correct module:, it should match filename (#22296)
* Validate module: matches filename

* remove testcase

* Revert module validation, move to different PR
2017-03-07 09:49:03 +00:00
Tim Rupp
c2180888f7 I think for now I'll just not use dunder setter (#22336) 2017-03-07 09:36:13 +00:00
Ricardo Carrillo Cruz
5357a67607 Remove 'update' param from documentation examples (#22350)
The 'update' param is no longer supported, thus removing from docs.
2017-03-07 10:32:36 +01:00
Ryan Brown
f0491b4261 [cloud] Fix ZeroDivisionError in ec2_elb_facts module (#22332) 2017-03-06 17:26:02 -05:00
Tim Rupp
6ff9bd0a33 Fixes baseclass for new f5 modules (#22333) 2017-03-06 22:04:49 +00:00
Lujeni
d942196666 Use a dedicated directory for the mongodb modules (#22187)
* Use a dedicated directory for the mongodb modules
* Missing the RETURN documentation in mongodb_user
2017-03-06 13:14:14 -08:00
JimFicarra
2206b5e900 Fix Issue #20553 #15737 - merge with reg functionality #19443 (#20555) 2017-03-06 12:56:17 -08:00
Robin Miller
9c20182bdf [cloud] Avoid failures in RDS modyue due to throttling while waiting (#22271)
1. Check less aggressively for resources that take a long time to return
(some resources can take an hour or more).
2. Handle throttling when checking for resources, and back off quickly
when it occurs.
2017-03-06 15:19:59 -05:00
Ricardo Carrillo Cruz
43aef4e868 Do not pass filters to os_group get_group call (#22321)
As default is set to None, the get_group call doesn't find groups
on domain 'None'.
Only pass filters in case we pass domain_id value.
2017-03-06 19:15:00 +01:00
Dan Vaida
433829769e [cloud] Fix data types in ec2_elb_lb causing resource to be spuriously updated (#21906)
fixes broken idempotence caused by the idle_timeout and cross_az_load_balancing params. (#21906)
2017-03-06 12:27:30 -05:00
Brian Coca
516d61f1ae simplified if 2017-03-06 12:13:05 -05:00
Marius Gedminas
15c7288ab9 Show diff when file: state=link changes the symlink target (#22243)
* Show diff when file: state=link changes the symlink target

* Integration test for symlink target change

* Also check soft link idempotency
2017-03-06 11:29:20 -05:00
Michał Masłowski
228131d1cd lambda: Fix adding environment variables to functions previously not having any (#22313) 2017-03-06 11:10:40 -05:00
Valentyn Boginskey
2d10ad4a3e [cloud] allow ec2_lc to take user data from binary files w/ user_data_path (#20138)
* Add user_data_path parameter to ec2_lc module

* Improve user_data_path parameter documentation

- Specify mutual exclusivity
- Specify `version_added`
- Change module parameter type to `path`

* Use correct comparison for user_data result

* Include traceback on error and use with block

* Only hide user data if provided in file
2017-03-06 11:09:25 -05:00
John R Barker
aa3fbb0d54 Restore extends_documentation_fragment: nxos (#22312)
* Restore extends_documentation_fragment: nxos

* Restore extends_documentation_fragment: nxos
2017-03-06 13:53:33 +00:00
Angus Williams
9be30f2eca Fixes idempotency issue when upgrading chocolatey packages (#21476) 2017-03-06 12:55:42 +00:00
Dhivyap
89cf8d83e4 dellos* modules- Documentation Update (#22306) 2017-03-06 12:53:35 +00:00
gaudenz
2772f9d9b0 cloudscale: Document SSH host key retrieval (#22299)
Document how the cloudscale_server module can be used to retrieve the
SSH host keys of the server.
2017-03-05 22:48:45 +01:00
René Moser
c1730c21ce cloudstack: cs_sshkeypair: fix fingerprint not used as identifier (#22276)
* cloudstack: cs_sshkeypair: fix fingerprint not used as identifier

* remove from legacy

* fix for 2 keys, one with name and one with fingerprint
2017-03-05 22:47:19 +01:00
John R Barker
3afb67e9b2 Fix Docs build issues (#22295)
* restore network docs fragments

* Fix RST errors

* code-block formatting
2017-03-05 11:41:29 +00:00
John R Barker
0775d39a87 Add extends_documentation_fragment back (#22293) 2017-03-05 08:37:01 +00:00
John R Barker
284b3e42d1 timezone: Inline emphasis start-string without end-string (#22292)
Fixes
`docs/docsite/rst/timezone_module.rst:20: WARNING: Inline emphasis start-string without end-string.`
2017-03-05 08:29:27 +00:00
tchernomax
f65661ab66 documentation: add important information about attributes parameter (#18732)
If the attributes aren't set in the right order the module always detect
an attributes change.
2017-03-04 21:27:38 -08:00
Adrian Likins
694c57de2e add python version info to --version (#22089)
* add python info to ansible --version
* Add unit tests for cli.CLI.version
2017-03-03 16:41:54 -05:00
Matt Davis
d12c93ef2b fix azure_rm version checks (#22270)
* Use packaging.version.Version instead of LooseVersion for better support of prerelease tags (eg, 0.30.0 > 0.30.0rc6)
* Add explicit check/error for msrestazure package
2017-03-03 13:28:08 -08:00
Clemens Weiß
7018aa3316 Update expired keys (#21539)
If a key has expired it will not be added by this module, so check for "expired" in the list of keys.
Example output with expired key:

pub   1024D/5072E1F5 2003-02-03 [expired: 2017-02-16]
uid                  MySQL Release Engineering <mysql-build@oss.oracle.com>
2017-03-03 20:53:21 +01:00
Will Thames
274016101f ec2_vpc_subnet: cope with empty tags (#21813)
ensure_tags fails if `tags` is None rather than an empty
dict. Ensure that not passing `tags` parameter is equivalent
to passing an empty dict.

Fixes #21778
2017-03-03 13:47:29 -05:00
Will Thames
699f0e861c [cloud] Add supports_check_mode to ec2_ami_find (#22180)
ec2_ami_find is a facts module, and makes no
changes, so trivially supports check mode
2017-03-03 13:34:38 -05:00
Jean-Philippe Evrard
19b49a9224 [cloud][lxc] Prevent hostname to be set (#22246)
If the host .bashrc holds a var named HOSTNAME, the container
where the lxc_container module will attach to will inherit from
this var, potentially breaking some applications (like rabbitmqctl)
due to an incorrect $HOSTNAME reported in the container.
2017-03-03 13:33:41 -05:00
Brian Coca
f53921093f respond with correct vaulting suggestion
fixes #22247
2017-03-03 11:38:44 -05:00
Viktor Fogelberg
b9ed3454e4 Change comment to reflect the actual code 2017-03-03 10:32:47 -05:00
Andrea Giardini
04e990281e Add flag to Docker pull_image to know when the image is already latest (#21508)
* Add flag to Docker pull_image to know when the image is already latest

Whenever the flag pull is set to 'yes' the resource is always defined
as 'changed'. That is not true in case the image is already at the
latest version.

Related to ansible/ansible#19549

* Docker pull_image does not change status if the image is latest
2017-03-03 10:16:16 -05:00
Artem Zinenko
7decd10c76 Fixes #22136 (#22137) 2017-03-03 09:50:42 -05:00
Peter Sprygada
6c8025ce5c adds eos_system integration tests (#22214)
* adds integration test cases
* updates eos_system with minor bug fixes
2017-03-02 21:20:17 -06:00
James Cammarata
a2599cab79 Fix variable precedence of INI/script vars to be in-line with docs.
This commit also adds a new test script (ansible-var-precedence-check.py in code-smell/)
to provide us with another line of defense against precedence bugs going forward.

The precedence docs state that the INI vars have a lower precedence than group/host
vars files for inventory and playbooks, however that has not been the case since 2.0
was released. This change fixes that in one way, though not exactly as the docs say.
The rules are:

1) INI/script < inventory dir < playbook dir
2) "all" group vars < other group_vars < host_vars

So the new order will be (from the test script mentioned above):

8. pb_host_vars_file - var in playbook/host_vars/host
9. ini_host_vars_file - var in inventory/host_vars/host
10. ini_host - host var inside the ini
11. pb_group_vars_file_child - var in playbook/group_vars/child
12. ini_group_vars_file_child - var in inventory/group_vars/child
13. pb_group_vars_file_parent - var in playbook/group_vars/parent
14. ini_group_vars_file_parent - var in inventory/group_vars/parent
15. pb_group_vars_file_all - var in playbook/group_vars/all
16. ini_group_vars_file_all - var in inventory/group_vars/all
17. ini_child - child group var inside the ini
18. ini_parent - parent group var inside the ini
19. ini_all - all group var inside the ini

Fixes #21845
2017-03-02 17:07:00 -06:00