Commit graph

30086 commits

Author SHA1 Message Date
Andreas Calminder 3b764c6dcb Add diff and check_mode support to os_server (#62206)
* don't mix " and '

* rename functions that perform changes

* add diff, reorganize _present/_absent functions

* update tests to match function reorg

* add result to _exit_hostvars and removal of possibly sensitive information

* shallow copy dict for proper diff, add check_mode

* set check_mode to False for unit tests

* move _parse_meta back to it's original place

* use get_openstack_vars for diff when not in check_mode

* add changelog fragment
2020-01-16 10:39:54 +01:00
jainnikhil30 ea6bc98398 Foreman: support for want_collectionhosts and want_ansible_ssh_host
* Add support for want_collectionhosts and want_ansible_ssh_host in foreman plugin
2020-01-16 14:55:45 +05:30
Lassi Kortela 450d9c4a04 hostname - Add Void Linux distribution (#66499)
Add support for Void Linux in hostname module.
2020-01-16 14:30:22 +05:30
haiyuan_zhang bc37ea96d5 Vmss scale in policy (#66512)
* azure_rm_virtualmachinescaleset: add scale_in_policy and terminate_event_notification

* azure_rm_virtualmachinescalesetinstance: add vmss instance protection policy support
2020-01-16 09:24:39 +08:00
Jordan Borean e459eac565
Use UTF-8 without a BOM for win coverage (#66510) 2020-01-16 09:52:05 +10:00
Evgeni Golov ee3dcb4d35 use query instead of q in "if files exist" example (#66409)
##### SUMMARY
It's not obvious that `q` is the same as `query` (which is referred to in the name of the task) and using long-names is generally preferred in examples.

##### ISSUE TYPE
- Docs Pull Request

+label: docsite_pr
2020-01-15 14:19:16 -05:00
Patrick Easters d5c5cb5a17 podman_image: Use provided credentials when pulling image (#66372)
* Use credentials when pulling from a remote registry
2020-01-15 12:47:12 -05:00
Sloane Hertel 1cb634a3ab Add a metadata property for CollectionRequirement (#66370)
* Add a metadata property for CollectionRequirement so the _metadata attribute doesn't need to be accessed directly

* changelog
2020-01-15 12:40:26 -05:00
Paul Belanger af3603f9ee Revert "Allow httpapi for resource modules (#62843)" (#66483)
While this does properly pass our testing for ansible/ansible devel
branch, it is currently breaking our collection testing for 2.10.

Specifically, this would mean ansible.netcommon would need to directly
import arista.eos or cisco.nxos collections, causing a circular dependency.

This reverts commit e266e5f8b6.
2020-01-15 12:25:38 -05:00
Gonéri Le Bouder 3103fd62dd vmware_vmotion/test: ensure we can run tests
Some adjustments to be able to run the test-suite properly:

- Starts with the ESXi out of the cluster to be able to deploy the
  VM on a proper host consistently
- Ensure the resource pool exists
- The resource pool is called `DC0_C0_RP1`, not `Resources`
- Avoid an exception if we try to move a non existing VM.

Put the test in the zuul/vmware/vcenter_2esxi group.
2020-01-15 11:50:04 -05:00
Abhijeet Kasurde afb71c14bd
VMware: Use existing DVPG network in vmware_guest_network (#65994)
* Handle all cases of networks

Fixes: #65968

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-15 21:56:19 +05:30
Peng Xiao 69f9c3c8eb add one note to help ansible user to understand the requirements to (#65969)
execute iosxr_command module

Signed-off-by: Peng Xiao <xiaoquwl@gmail.com>
2020-01-15 12:35:07 +05:30
Abhijeet Kasurde 257ac9d175
Fortios: Correct underscore_to_hyphen API (#66119)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-15 10:35:57 +05:30
Ric de France 62991a8bdd terraform: Remove line that is suppressing output being shown (#66322)
* remove the line that is suppressing the output being shown when running
terraform from ansible
* Address #56934 and #57044
* added changelog for bug fix for missing terraform output

Co-authored-by: Adam <adam.lemanski@gmail.com>
2020-01-15 09:42:58 +05:30
Nathaniel Case e266e5f8b6
Allow httpapi for resource modules (#62843)
* Redo tests to be transport agnostic

cli -> eos config

Redirect connection for httpapi
2020-01-14 14:26:10 -05:00
Adharsh Srivats R 6044325dec Bug fix for #53271 (return commands for cli_config) (#61808)
* cli_config return commands bug fix

* Spacing error

* Added notes section

* Spacing error

* Spacing error

* Spacing error

* Spacing error
2020-01-14 11:32:28 -05:00
ad1rie1 9272e3d547 Fix Bug (#64553) 2020-01-14 11:08:38 -05:00
Sloane Hertel 1b3ca349eb
RoleRequirement - Include stderr in the error message (#66006)
* RoleRequirement - Include stderr in the error message if there's a non-0 return code

* Don't try to concatenate str and bytes

Co-Authored-By: Sam Doran <sdoran@redhat.com>
2020-01-14 09:46:23 -05:00
JP Mens b06e78c16c make: use -f instead of --file to aid in portability (#65880)
`make` on FreeBSD (and others) has support for an option `-f` to specify a `Makefile`, whereas GNU make uses `--file` or `-f`. In the interest of portability use `-f` which covers both.
2020-01-14 06:01:13 -05:00
Jordan Borean 6f04f87a13
Deprecate Windows 2008, and 2008 R2 (#66257)
* Deprecate Windows 2008, and 2008 R2

* Remove shippable nodes

* Update windows_faq.rst

Be less specific about 2008/R2 timeframes

* Update setup.ps1

tweak warning text

Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
2020-01-14 11:22:39 +10:00
Piotr Stawarski 9a1329153e ec2_vol module filtering bug (#65960)
* Update ec2_vol.py

When `name` is specified, it ignores `zone` filter. That is you could not have same tag:Name in different zones.

* Add changelog fragment
2020-01-14 11:09:06 +10:00
Nathaniel Case 3a2257c45c
net_facts modules: Don't warn about defaults changing if they're not being used (#66270) 2020-01-13 11:36:01 -05:00
ndclt d64b49e8a0 Delete linter ignore lines for keycloak modules (#66406)
* linter: auth_client_id is not required, default value

Delete the lines linked to this mistake in ignore.txt.

* doc: state is not required
2020-01-13 10:41:07 +00:00
sky-joker 3de2575063 Add proxy type passive example to example block of zabbix_proxy (#66400) 2020-01-13 04:40:12 -05:00
Martin Krizek b7dfcfa0b4
Check vars against Mapping in DEBUG (#66355)
When ANSIBLE_DEBUG=1, vars are VarsWithSources now which is a Mapping.
Check vars against Mapping instead of dict.
2020-01-13 10:04:32 +01:00
Felix Fontein b070fd1630
Fix typo. (#66403) 2020-01-13 07:27:07 +01:00
Ganesh Nalawade 654b9e2754
Add collection support with local for supported network platforms (#66302)
* Add collection support with local for supported network platforms

*  The legacy behavior of network action plugins using persistent
   the framework is to override the connection=local with the actual connection type (network_cli/netconf/httpapi) based
   on the value of transport option in provider.
*  After the actual connection plugin is identified try to load it from
   `ansible.netcommon` collection, if it fails load it from ansible
   core. This is done to work with Ansible 2.10 and also maintain backward compatibility for
   Ansible 2.9 version to ensure it works with network collections.
*  To support this need to pass collection_list value to connection
   plugins. As in case of connection=local it loads `persistent`
   connection within action plugin which in turn invokes `network_cli`
   or `netconf` connection. Similarly `network_cli` connection plugin invokes
   `terminal` and `cliconf plugins and `netconf` connection plugin invokes `netconf`
   `plugins` based on value on `ansible_network_os`.
*  Add deprecation warning for connection=local support and
   provider support for applicable platforms

* Fix CI failures
2020-01-13 09:49:55 +05:30
Abhijeet Kasurde 5c04f25245 ec2_lc: Update example to use snapshot id (#66064)
Fixes: #52085

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-13 13:13:13 +10:00
Felix Fontein a79ca57d22
Fix aws_ssm connection plugin. (#66393) 2020-01-12 23:59:25 +01:00
Felix Fontein c380b18dcf
openssl_* modules: allow direct input for some files (#66384)
* Allow to not read content from file.

* Allow to feed content directly into _info modules.

* Allow to feed non-primary content into openssl_certificate, openssl_csr and openssl_publickey.

* Rename changelog.
2020-01-12 19:12:33 +01:00
Dusan Matejka 3456700420 adjusted doc and argument spec in zabbix modules to match sanity requirements (#66176) 2020-01-11 15:25:15 +01:00
Andrew Klychkov 515c4a7e2c Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3 (#66331)
* Bugfix of 65367: postgresql_query doesn't support non-ASCII characters in SQL files with Python3

* add changelog

* fix

* change changelog fragment, add example
2020-01-11 15:19:55 +01:00
psharkey f8fb391548 new connection plugin aws_ssm (#49652)
* new connection plugin aws_ssm

Return code may be at the end of the last command output line.

Marking regex.

Ensure command status code is on it's owm line - last 3 lines are not part of command stdout.

* Adding timeout parameter - aws_ssm_timeout

Default 10 second timeout (https://docs.ansible.com/ansible/2.4/intro_configuration.html#timeout) is marginal.
This avoids changing this default and allowing the SSM timeout to be controlled via inventory.
This change wraps commands so commands which may never return do timeout.

* Added integration tests

Added AWS SSM Executor, target and config functions

Fixed more code for integration tests

Improved execution

Added S3 bucket name

Fixed pylint

Reverted lib changes

Reverted few more changes

Improved support for integration test execution

added ansible role for aws_ssm_integration_test setup and teardown and modifiled runme.sh

Reset to 17fa565 commit

inventory file location changed

change inventory file location

deleted meta and handlers folder as it is not required

deleted main.yml inside vars, removed extra space from tasks/main.yml, Added appropriate tags for ec2 and delete test folder as it is not required

deleted main.yml inside vars, removed extra space from tasks/main.yml, Added appropriate tags for ec2 and delete test folder as it is not required

modified task/main.yml

added region variable and fixed pattern for using variable

modified policy for IAM role

moved to first line of scrip set -eux

Updated Session Manager plugin installation

edited custme policy

Included tags for Session Manager plugin installation

Added README.md

Upddated README and added support for ssm-plugin for Amazon-Linux

Added Windows Integration test support

Improved user data for Linux

Added random value generation for the role and policy,delete vars_to_delete.yml

upadte README in vars

fixed typo

update policy

Updated IAM policy file

update playbook

Updated playbook to include ssm-agent userdata

modified jing2 template

modified jing2 template

modified jing2 template and fixed role deletion

fixed role name issue while deleting and task name

Updated playbook to include wait_connection for ec2

Corrected Synatx changes and updated ssm-plugin debian file

Changed region variable to us-east-1

Removed vars file and updated  to /tmp dir

fixed typo

Improved setup

Fixed boto3 dependency

Fixed missing tag

Added boto as dependency as well

Improved execution workflow

Trying other way of defining tags

Fixed undefined var

Changed AMI ID to Amazon Linux

Improved Tags

Ok, created different directory for WIndows test execution

Fixed IAM Role Name for Windows

Fixed inventory not found

Improved integration test execution

Fixed Windows Inventory path

Fixed wrong Windows AMI ID

Fixes issue for windows test execution

* Don't attempt to terminate sessions without a session id.

* Added Unit test cases file for AWS SSM Connection plugin

updated test file with close

updated unit test file with start_session

updated test files

* Eliminate AWS CLI dependency for terminal session.

* Removing unused code, cleanup logic.

Reduce mark length - 52^26 should be plenty
Be explicit about subprocess.Popen options
Simplify if/else for mark end
_stdin_readline is not used now

* updated test file

Added exec command and fixed close session unit tests

updated test files

Improved ansible ssm test command

updated file for lint checks

updated for pylint checks

New Unit_testcases for pre-signed URL file

removing additonal spaces and white spaces

remaning error changes

fixed changes

fixed spaces issues

python 2.7 version and whitespaces

python 2.7 version and whitespaces

python 2.7 skip if

space issue with 16:1

Unit test cases for windows and linux

Unit test cases for windows and linux with issues fixed issues

Unit test cases for windows and linux with issues fixed issues1

* Added support for S3 Pre-signed URLs

* Updated documentation and comments

* Documentation and curl dependency removal for controller machine

Fixing lint errors and removing requirements.

* Adding support for Windows remote EC2 instances.

* Added Encoding fixes

* Updating author section and adding obvious requirement for the SSM agent.

* Refactor stdout post processing
Attempt to get real return code on error (test using ansible -m raw -a 'cmd /c exit 99'.
Fixes problem at terminal width (ansible windows -i ./hosts.yml -m setup).

* Refactor back to a single module.

* Fixed fetch file for windows

* ssm usage examples for linux and windows

* Update aws_ssm.py

Service state corrected.

* Strip line continuation when at terminal width - otherwise replace.
Strip ANSI control sequences only for Windows.

Test playbook:

---
- name: test
  hosts: windows
  gather_facts: False
  vars:
    small: 'abc'
  tasks:
  - name:
    set_fact:
      large: "{{ lookup('password', '/dev/null length=2000 chars=ascii_letters,digits,hexdigits,punctuation') }}"
  - name: small fixed
    raw: echo '{{ small }}'
    register: small_result
    changed_when: False
  - name: check
    assert:
      that:
        - "(item | length) == (small | length)"
        - "item == small"
      msg: "'{{ item | length }} must equal '{{ small | length }}' and '{{ item }}' must match '{{ small }}'"
    with_items:
      - "{{ small_result.stdout_lines[0] }}"
  - name: large random
    raw: echo '{{ large }}'
    register: large_result
    changed_when: False
  - name: check
    assert:
      that:
        - "(item | length) == (large | length)"
        - "item == large"
      msg: "'{{ item | length }} must equal '{{ large | length }}' and '{{ item }}' must match '{{ large }}'"
    with_items:
      - "{{ large_result.stdout_lines[0] }}"
  - name: gather facts
    setup:

* Correct module parameter names.

* Updated Windows Executable variable.

Updated Windows Executable variable to "ansible_shell_type".

Fixing Examples with raw declaration

Updated the plugin timeout variable.

* Fix to work with dynamic inventory plug-in

* IntegrationTest template updates

* Removing unsupported flag for integration tests.
Fixing unit test.

* Adding shippable group.

* SSM Usage examples with dynamic inventory plugin

* Fixing yamllint errors.

* Fixed Integration tests

* Fixed Integration tests

* Updates for python3.

Removing python3 restriction.

* Remove python3 restriction.
Change block from retry to always

* Fixed Integration tests with Python 3

* Fixed shellcheck

* Fix for Windows which could pick up end mark prematurely
Move debug to _wrap_command and use a single return point

Single-quotes not needed around linux marks
Fix typo in comment

End mark to new command.

* Unit test cases now works on Python2 and Python3

* Skip tests on Python 2.6

* Fix for wait_for_connection module for windows.

* Updated changes as per review comments

* Fixing broken pipe error seen with session-manager-plugin version 1.1.17.0.
Eliminating sleep as this looks to be fixed in session-manager-plugin version 1.1.17.0.

* Adding back delays for Windows with session-manager-plugin 1.1.17.0.

* Updating Windows AMI ID for integration Test

* Upgrading windows ssm agent to the latest

* Adding boilerplate code.

* Windows ami and integration test updates

* Revert "Windows ami and integration test updates"

This reverts commit cd6ca3579b7cda584bd9c065f9c0835bddb23627.

* Updating windows ami for Integration tests

* Integration test suite updates and fixes.

* Updates and fixes

* Eliminate duplicate processing for exit code on failed command.

* Add powershell wrap.

* Refactor windows post_process.

* AMI Lookup, aliases, OSC filter, test suite updates

Co-authored-by: Gaurav Ashtikar <gau1991@gmail.com>
Co-authored-by: Deepak Choudhary <40276333+deepsvc@users.noreply.github.com>
Co-authored-by: Hanumanth <46720371+hanumantharaomvl@users.noreply.github.com>
Co-authored-by: KUMAR MAYANK <mayank@flux7.com>
2020-01-11 15:22:01 +10:00
Nathaniel Case 0a3a81bd12
Persistent connections: These timeouts seem unused (#66267)
* These timeouts seem unused

* Add changelog
2020-01-10 23:09:21 -05:00
Bill Dodd 5f966ef664 Update deprecation version and porting guide for resource_id option (#66060)
* update deprecation version and porting guide for resource_id option

* add changelog fragment
2020-01-10 16:37:53 -06:00
Ganesh Nalawade 0d85ab1fe3 Add collection support for network platform agnostic modules (#66342)
*  Refactor net_base action plugin to invoke platform
   action plugin with implementation module name updated
   in the new task copy.
2020-01-10 12:42:53 -05:00
Chris Van Heuveln 3ebc96e5c7 nxos_l3_interfaces: fix states, add new minor attributes (#64853)
* (WIP) nxos_l3_interfaces: fix states, add new minor attributes

* sa cleanup

* more regression fixes

* test_8 for add'l code coverage

* Fix regressions to handle mgmt w/o IP

* add 'no system default switchport' to regression setups

* add err msg to terminal_stderr_re so that cli_config will catch L2 failures

* regression test change: /int4/int3/

* Add default rsvd_intf_len for Zuul CI

* Fix replaced-with-no-ipaddr and ip redirect issues
2020-01-10 16:33:22 +05:30
Sumit Jaiswal 687f57d6ca
updating metadata (#66289) 2020-01-10 12:29:28 +05:30
Jordan Borean c92b538cc5
WebRequest - remove generically named aliases from util (#66325)
* WebRequest - remove generically named aliases from util

* Fix location of deprecated aliases key
2020-01-10 13:01:26 +10:00
Paul Belanger 7a7f70612a
Revert "Fix net_put module text file issue (#66065)" (#66328)
This PR didn't properly run testing for network jobs. As a result it has
broken jobs for ios and junos.

This reverts commit fa66813696.
2020-01-09 21:51:59 -05:00
Jordan Borean 7ed00a1560
Fix up deprecated_aliases spot for PS (#66326) 2020-01-10 11:44:15 +10:00
Jordan Borean 595ab62ab8
Ansible.Basic - Added deprecated_aliases (#66323) 2020-01-10 09:13:13 +10:00
kaorihinata 3ca4580cb4 Allow no_log=False to silence the no_log warnings for module parameters (#64733)
As AnsibleModule._log_invocation is currently implemented, any parameter
with a name that matches PASSWORD_MATCH triggers the no_log warning as a
precaution against parameters that may contain sensitive data, but have not
been marked as sensitive by the module author.

This patch would allow module authors to explicitly mark the aforementioned
parameters as not sensitive thereby bypassing an erroneous warning message,
while still catching parameters which have not been marked at all by the
author.

Adds tests for various no_log states including True, False, and None (as
extracted by AnsibleModule._log_invocation) when applied to an argument with
a name that matches PASSWORD_MATCH.

Fixes: #49465 #64656
2020-01-09 16:47:57 -05:00
Jordan Borean 93bfa4b07a
win_user_right - docs to show how to remove all (#66315) 2020-01-10 06:33:00 +10:00
Karthikeyan Singaravelan 891c759832 Fix AttributeError due to cgi.escape removal in Python 3.8. (#66040)
* Fix cgi.escape AttributeError due to cgi.escape removal in Python 3.8.

* Fix linter errors.
2020-01-09 15:28:02 -05:00
Jordan Borean d3427bb860
Make sure warnings are printed during fact gathering (#66258) 2020-01-10 06:16:20 +10:00
GomathiselviS a3d67edfca
Fix to nxos_vrf purge breaks with empty aggregate (#66004)
* resolving conflicts

* fixed issue with purge and state var. fixed space issue with vrf name

* lint issues
2020-01-09 14:43:59 -05:00
Jordan Borean aba8f12495 ansible-galaxy ignore empty server_list (#65986)
* ansible-galaxy ignore empty server_list
2020-01-09 14:24:36 -05:00
Ganesh Nalawade fa66813696
Fix net_put module text file issue (#66065)
*  Modify the parent class for net_put and net_get
   module to refer from `ActionModule` class in
   network.py action plugin which contains the
   common code for network plugins.
*  Replace `_handle_template` with `_handle_src_option`
   function name which is defined in common class.
2020-01-09 18:42:00 +05:30
Abhijeet Kasurde 42b0c967d0
FreeIPA: Fix documentation (#66194)
* Add datatype whereever it is missing
* Fix documentation

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-01-09 15:32:26 +05:30