Commit Graph

30469 Commits (b7662f7e5bdb55093f22f672d2c71ab9813ad96d)
 

Author SHA1 Message Date
Esteban Echeverry b7662f7e5b Import from urllib and not url (#25102)
* Import from urllib and not url

In Python 3, the correct way to import
urlparse is through urllib.parse.

* Use six module to import urlparse

Import urlparse from ansible.module_utils.six.
This way, the import statement is compatible both
with Python 3 and Python 2.

* Fix urlparse import using six module

The correct import is:
from six.moves.urllib.parse import urlparse

* Import six from ansible.compat

* Import from six.moves. Don't make six global.

Prevent code smell by not making six available
in the global namespace and instead importing from
one of its subpackages.
8 years ago
Sloane Hertel e67cdd448e [cloud] EC2 dynamic inventory default filename is documented as ec2.ini - fixes #24396 (#24515)
* the default filename is ec2.ini

(to override that use the env var EC2_INI_PATH)

* allow fallback to ec2.ini
8 years ago
Brian Coca d03b16e88b start of 'profiling utils' 8 years ago
piotrsmolinski c3ffc49914 reset_connection fixes: #23621 (#25211)
* moved the logging statement

moved the logging statement before the actual action

* added status code check

In the existing implementation when the ssh command fails the command
result is silently discarded. It hides the fact that the disconnection
did not go as expected. Effectively the intended action was not
successful, but the play continues.

* Revert "added status code check"

This reverts commit fe2eb2ae4a.

* added command status code check

In the existing implementation the command is checked for the success.
As a result failed execution is silently discarded. The change tests for
return code and fails if it did not work.
8 years ago
Dag Wieers c13b1a718a plugins/terminal/: PEP8 compliancy (#25207)
- Make PEP8 compliant
8 years ago
Brian Coca caf5868ec9 removed debugging prints 8 years ago
Brian Coca 798d05ea41 corrected object with columns 8 years ago
Chris Alfonso b937bad52e Narrowing the match for python 3 cmp check (#25220)
Allowing the yaml examples in python documentation.
8 years ago
Brian Coca 5667603a27 fixed format 8 years ago
Brian Coca 05caa3654c fix to alwasy use param in case subpec is used 8 years ago
Philippe Dellaert 3ae69302a2 Fixes ansible/ansible#25096 (#25098) 8 years ago
Senthil Kumar Ganesan e0db5d23cc Update facts module to support the new OS10 10.3 release (#25090)
* Update facts module to support the new OS10 10.3 release

* Address PEP8 issues reported by ansibot
8 years ago
Sloane Hertel 75bdcce072 s3 integration tests (#22920)
* s3 integration tests

* Make s3 integration tests work in standard integration setup and with fish as current shell
see also https://github.com/ansible/proposals/issues/62 if you don't like this much

* test_s3 integration test - substitute command instead of shell where simple

* test_s3 integration test - random contents + complete elimination of use of shell module by moving to tempfile

* move s3 to integration test targets

* Add a couple more test for . in bucket names

Tidy syntax

remove reference to legacy credentials.yml

remove posix/cli/cloud/aws

* remove from legacy testing

* remove dependencies that aren't used
8 years ago
Brian Coca 62a434141e ensure display is terminal sensistive
fixes #18248 by using display width intead of hardcoded length
8 years ago
Yap Sok Ann 24cfb10ce9 gce_net: change default to match with b7e78656 for idempotency (#23555)
After b7e78656, if `src_range`, `src_tags` or `target_tags` is left as
null, the firewall rule would always be recreated.
8 years ago
Yury V. Zaytsev c559567f16 [cloud] s3_bucket: fix connections for buckets with dots in names (#24720)
Refer to 689f135 for similar fix in s3 module. This change makes `OrdinaryCallingFormat` default for handling S3 connections. 

Signed-off-by: Yury V. Zaytsev <yury.zaytsev@moneymeets.com>
8 years ago
Will Thames bc24ae88a8 Allow iam_role to work with friendly policy names (#22630)
Basically obtain all the policies and create a mapping
from friendly name to ARN

Tidy up module argument specification to remove unneeded
settings.
8 years ago
Rob 2f0ce790d1 [cloud] New module to support ALB/ELBv2 elb_target_group (#19492)
* New module = elb_target_group

* Update elb_target_group.py

Adds support for adding and removing targets from a target group

* Better error handling

* Bump version_added

* Minor fixes

* Scope ec2 imports, add better doco, fix up examples, allow for both upper and lower case in protocol

* Yaml fixes

* ci fix

* Added targets parameter to doc and added new modify_targets flag to prevent runs from modifying targets

* Update to metadata_version

* Update to metadata support

* Remove defaults for some params. Add tags parameter

* Use paginator to get target groups

* Add tag support

* Add tg attributes to module

* Quote multilines

* Remove unnecessary defaults. Fix multiline

* Fix line ending
8 years ago
Tyler Lubeck d6bfc11e6d Fix formatting for rst code block (#25185) 8 years ago
Rob 76e56bf48e [cloud] New module = elb_application_lb (#19491)
* New module = elb_application_lb

* Update elb_application_lb.py

Adds support for rules, adds wait option for ALB creation, adds support for using target group names instead of ARNs when referencing target groups in rules. All additional features should be idempotent.

* Better exception error messages. Bump version_added. Pep8 fixes

* Add missing full stop to description

* Review changes and fixes

* Fix pep issues

* Fix up examples

* Fix pep8

* half way through sorting elb attributes

* Add access logs enabled param

* Finish implementing elb attributes

* Use paginator to get elbs

* Dont snake_case the tags

* Add listeners to return output and fixed up examples

* review changes

* fix line lengths

* pep8 fixes
8 years ago
Sloane Hertel b04cf04f59 Prior to 2.4 only one source is permitted for ec2_group rules/rules_egress. 2.4 and after a list of sources is accepted. (#25165) 8 years ago
Will Thames 5c1a914002 Fix ec2_asg exception handling (#25121)
`e.message` is a string, and `camel_dict_to_snake_dict` fails when
given a string. The intended code is to run `camel_dict_to_snake_dict`
on `e.response`, the result of which includes a `message` key.

Make exception handling lines more consistent and wrap for slightly
shorter lines.
8 years ago
Dag Wieers d958440bcb win_firewall_rule: Implement idempotency, check-mode and diff support (#23162)
* win_firewall_rule: Small idempotency fix

This PR includes the following changes:
- an idempotency fix when `profile: any`
- better difference output to debug idempotency issues
- documentation fixes (remove `required: false`)
- Parameter handling fixes
- RDP example that matches default RDP rule
- Renamed parameter 'enable' to 'enabled' (kept alias)
- Renamed parameter 'profile' to 'profiles' (kept alias)

* Rewrite module completely

The logic is still intact, but various changes with a single goal:

- Make the module idempotent
- Implement check-mode
- Implement diff-mode
- Adapted integration tests

This fixes #18807 and #23455.

* Change casing to lowercase

* Improve the logic wrt. diff
8 years ago
Dag Wieers 0e160d5c7e Ensure exit_json returns failed = False
This is required for modules that may return a non-zero `rc` value for a
successful run, similar to #24865 for Windows fixing **win_chocolatey**.

We also disable the dependency on `rc` value only, even if `failed` was
set.

Adapted unit and integration tests to the new scheme.
Updated raw, shell, script, expect to take `rc` into account.
8 years ago
Evgeni Golov 1f78715848 apt: include arch in check for installed packages on multi-arch systems (#24846)
* apt: include arch in check for installed packages on multi-arch systems

Thanks: Stefan Löwen <stefan.loewen@gmail.com>

Fixes: #24673

* add an integration test for apt's multi-arch handling
8 years ago
Dag Wieers 758cfeb73e contrib: PEP8 compliancy (#24680)
- Make PEP8 compliant
8 years ago
Benjamin Curtis 16c2207d21 Fix return code (#23592)
The Honeybadger API returns 201 for success, not 200.
8 years ago
Will Thames 23324bdda0 Ensure `when` warning is checked before expanding (#25092)
The `when` condition templating warning should only happen
if the condition itself contains templating, not if variables
in the condition are themselves composed through templating

Before

```
vars:
  x: hello
  y: "{{ x }}"

tasks:
- debug: msg=hello
  when: y
```

would fire a warning because `y` would get expanded to `{{ x }}`.
This checks whether a warning is required prior to expansion.
8 years ago
Ricardo Carrillo Cruz 69efb61008 Add provider param to prepare_iosxr_tests role tasks (#25163)
This will avoid passing -u -k to ansible-playbook
8 years ago
Nathaniel Case 53837c2ab0 Assorted nxos_bgp_* fixes (#25080)
* Simplify apply_key_map

* Fix nxapi

* Clean up get_value

* Fix missing non-values

* Add test for existing bgp_af case

* Fix small issues with bgp_neighbor_af
8 years ago
Pierre-Louis Bonicoli a4131197e0 PostgreSQL tests: enforce UTF8
By default, client encoding is determined either from the LANG_*/LC_*
environment variables or using encoding of the database.

Containers used in the CI don't define a default locale, then encoding
of default databases was SQL_ASCII.
8 years ago
Pierre-Louis Bonicoli fb1e7aaa81 Creates cluster the same way Debian package does
This task is only executed when the playbook has already been executed
once, for example using 'ansible-test integration' with '--retry-error'
switch when the first run fails.

This modification allows to recreate default databases (postgres,
template0 and template1) using the same encoding that the one used by
the Debian package.

Default encoding is 'SQL_ASCII' when default locale is not set in
/etc/default/locale.
8 years ago
Pierre-Louis Bonicoli ce856c2123 postgresql_user: add tests with hashed password 8 years ago
Pierre-Louis Bonicoli 69edd9e0bb Avoid useless queries: use standard module hashlib
When an unchanged MD5-hashed password was used and passlib was
unavailable, an useless 'ALTER USER' query was executed.

Once this useless query avoided, the last 'SELECT' query becomes
useless too.
8 years ago
Pierre-Louis Bonicoli f59f042bb0 postgresql_user: fix doc
See: https://www.postgresql.org/docs/current/static/sql-createrole.html
8 years ago
Dag Wieers 09ba70f7c4 stat: PEP8, imports, cosmetics (#24653)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
8 years ago
Abhijeet Kasurde 3a82246d82 Misc typo fix in fleet inventory (#25174)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
8 years ago
Dag Wieers 8d962209f4 mod_utils/cloudengine: PEP8 compliancy (#24659)
- Make PEP8 compliant
8 years ago
Dag Wieers b3b11fbce2 get_url: PEP8, imports, cosmetics (#24676)
- Make PEP8 compliant
- Ensure imports are specific
- Few cosmetic changes (sort lists, casing, punctuation)
8 years ago
Dag Wieers 630185cb20 ansible/executor: PEP8 compliancy (#24695)
- Make PEP8 compliant
8 years ago
Dag Wieers 51b595992b ansible/utils/: PEP8 compliancy (#24686)
- Make PEP8 compliant
8 years ago
Ganesh Nalawade d5ad3093d6 Add config_format note in junos_facts docs (#25125)
Fixes #24610

Add note to mention config_format value
dependency.
8 years ago
Dag Wieers 47738eb1dd docs: PEP8 compliance (#24681)
- Make PEP8 compliant
8 years ago
Ganesh Nalawade 44121352fe Update requirements in junos module docs (#25154)
Fixes #24975

Update requirements section in junos
module docs
8 years ago
Dag Wieers 4efec414e7 test/: PEP8 compliancy (#24803)
* test/: PEP8 compliancy

- Make PEP8 compliant

* Python3 chokes on casting int to bytes (#24952)

But if we tell the formatter that the var is a number, it works
8 years ago
Trishna Guha 31c59ad5f9 nxos_portchannel fix and unit test (#25019)
Signed-off-by: Trishna Guha <trishnaguha17@gmail.com>
8 years ago
John R Barker 24fb567c40 MAX_FILE_SIZE_FOR_DIFF (#25170) 8 years ago
Brian Coca 5d572055b3 fixed script plugin
fixes #25130
8 years ago
Brian Coca bc403934ef properlly report plugin name 8 years ago
Ricardo Carrillo Cruz fd5db52fd9 Add provider to prepare_ios_tests role tasks (#25162)
This avoids passing -u <user> -k, as it will just consume
the credentials from group_vars
8 years ago