This commit allows users to access a vCenter or a ESXi through a
HTTP CONNECT based proxy.
To do so, the users have to set the `proxy_host` and `proxy_port`
variables.
The can also use the `VMWARE_PROXY_HOST` and `VMWARE_PROXY_PORT`
environment variables.
This feature depends on pyvmomi > v6.7.1.2018.12.
Fixes: #42221
Co-Author: Abhijeet Kasurde <akasurde@redhat.com>
Co-Author: Gonéri Le Bouder <goneri@redhat.com>
Refactor vmware_cluster into several modules (vmware_cluster, vmware_cluster_drs, vmware_cluster_ha and vmware_cluster_vsan) as discussed in #58023.
vmware_cluster lacks a lot of configuration options for DRS, HA and vSAN. Implementing them
all in vmware_cluster would make the module hard to maintain. Therefore, splitting it into several
modules and implementing the missing configuration options in them seems a good idea to me.
This is step one, refactoring vmware_cluster into several modules. Step two, implementing more
configuration options for DRS, HA and vSAN, will follow.
If the 'local' parameter of the 'user' Ansible module is enabled, and
the user has been found in the local user database, don't emit
a warning, because this is an expected outcome.
Add changelog and integration tests
Co-authored-by: drybed <drybjed@gmail.com>
* meraki_snmp module supports network SNMP settings
- Network SNMP settings were added to the API
- Parameters are different so it's a new data structure
- Full suite of integration tests
- Commit includes some cleanup as well
* Add reset task for SNMPv3
* Fix py3 decoding issues in cyberarkpassword.py
* Use to_native instead of forced utf-8 decoding
* Use to_bytes to avoid trouble with Popen
* Create 59500-cyberarkpassword-fix-py3-decoding.yaml
##### SUMMARY
It should be known that this does not install homebrew. It only uses homebrew that is already installed. It's a core requirement.
##### ISSUE TYPE
- Docs Pull Request
+label: docsite_pr
* Update pbrun.py
Require ternary operator for if get_option('user') returns NoneType object.
* Update pbrun.py
Added default value to become_user in documentation.
* Update pbrun.py
Changed default for become_user to be '' instead of root.
If a VM has an attached CDROM, `backing` attribute of the CDROM will
be defined.
As a result, we cannot just loop `vm_obj.config.hardware.device` and check
for the existance of the attribute to decide if the entry is a
harddrive.
Instead, we check the type of the device, and only keep the
`vim.vm.device.VirtualDisk` disk.
This issue is actually breaking our test-suite with regular environment
because we keep a Fedora ISO attached to the VM.
* Fixed the redhat_subscription module:
- Option 'pool_ids' works in Python3 now
- It tries to attach only pools IDs that are available
- Optimization of code: do not call list --available, when
no pool is requested
- Simplified configure() method
- Small changes to generate same commands on Python2 and Python3.
Order of arguments/options and pool IDs have to be same to
be able to run unit test using Python2 and Python3.
- Added fragments file for redhat_subscribtion module
Remove confusing phrase about pesize as a "multiple of 128KiB".
Allowed values are anything accepted by vgcreate -s,
powers of 2, minimum 1K for lvm2.
As pesize less than 1M is accepted since Ansible 2.6,
close#29295
* Added new module avi_user.py and tests for that
* Updated documentation as per module argspec
* Updated as per review comments on IP address
* Updated documentation for types
* Fixed sanity check failure for __future__ import
* Updated documentation as per review comments.
* change variable name from isinstance to is_instance (prevent overriding builtin function)
* Added support for:
- Filtering existing Elastic IPs based on a tag name or it's value (when reuse_existing_ip_allowed is true)
- Allocating new Elastic IPs from a given IPv4 pool (BYOIP support)
* yamllint corrections
* added examples for:
- tag_name,
- tag_value
- public_ipv4_pool
* remove aliases
* Added changelog fragment
* added integration tests for ec2_eip module
* removed space to trigger rebuild
* Implements etc_hosts for docker_image module
Allows custom hosts on docker_image module.
The of this option made impossible to use docker_image module to build
images that required a custom hostname in /etc/hosts. For running
containers this option was already present.
While the python-docker API uses extra_hosts term, our existing module
already uses etc_hosts argument, so it sounds better to have some
consistency between docker_container and docker_image.
Fixes: #59233
* Update test/integration/targets/docker_image/files/EtcHostsDockerfile
Co-Authored-By: Felix Fontein <felix@fontein.de>
* Update lib/ansible/modules/cloud/docker/docker_image.py
Co-Authored-By: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/docker_image_etc_hosts.yml
Co-Authored-By: Felix Fontein <felix@fontein.de>
* Initial commit for meraki_mx_l7_firewall module
* Add argument checking
* Sanity fixes
* Fix crash and improve integration tests
* Improved integration tests and coverage
* Reformat response data
- Module does not match argument structure of API
- PR reformats the response to match Ansible arg spec
- Improved integration tests
* Fix reformatting for diffs
* Create rename_* functions
- is_update_required() ignores the key id
- Meraki expects one of the keys to be id
- Function temporarily renames key to appId to get around this
* Tweak documentation and tests
- Tests now do an include so each task doesn't need delegate_to
* Fix which files I'm editing
* Initial commit for meraki_nat module
- Query fully works
- Present is still very much in development
* Add initial code for present functionality, not complete
* Add request documentation
* Add examples and return documentation.
* Added payload to requests
- Module seems to need new idempotency check
* Allow 1:1 and 1:many NAT to work
- New idempotency check method is probably required to work
* Make all three options work
- Module isn't idempotent
* Diff support
- Added integration tests
- Diff support isn't quite done
* Fix diff output
* Enable idempotency assertion in tests
* Add test assertions for code coverage
* Update documentation and tests
- Split tests to separate file to avoid delegate_to
* Fix blank line
* Initial commit for module
- Module can query or modify network services on Meraki gear
- Check mode supported
- Integration tests included
* Small change to examples
* Move mutual exclusive to build in approach
* Sanity err
* Split integration tests into two files to avoid delegate_to
* Add the integration tests, woops
The default for a httpapi connection is to do basic auth, however
when setting the url_username and url_password without
force_basic_auth, the call to ansible.module_utils.open_url would
not always properly handle the basic auth headers based on the
combinations of **kwargs passed. This ensures that is always the
case when no session token exists and as the goal is to use basic
auth in the event of not having a session token, this should be
a safe operation.
Signed-off-by: Adam Miller <admiller@redhat.com>
Before this fix, the module was not able to look up a `VM Network` located at
`/DC0/network/VM Network`. As a consequence, the test module was failing
with a real environment (Non-govcsim).
* Adding Avi ansible lookup module
(cherry picked from commit 77b8951f68cbc889e6595b2a359ca27b84a43c0d)
* Added description for examples
* Added debug logs and unit tests
* Fix __builtin__ import and restting super
* Fix pep8 errors
* Updated as per review comments on IP address
Previously if `sysctl_set=no` (which is the default) this module only
checked for changes in the sysctl.conf file to decide whether it should
reload it or not. This means that if the values in the conf file are the
same as they are set with the module, but the current values on the
system are different, that this module wouldn't apply the changes on the
system and thus the value set with the module wouldn't be applied on the
OS. This isn't obvious and it doesn't make sense that the module works
like that by default, especially because there is a separate option
`reload`. Now sysctl will also check if the current value differs on the
system and if it does, it will reload the file again.
* Add junos_lag_interfaces resource module
* Add new resource module junos_lag_interfaces.
* Targets model https://github.com/ansible-network/resource_module_models/pull/29
* Deprecate junos_linkagg module
* Fix CI issues
* Fix junos integration test cases
* Fail if base lag interface is not configured
* Generate galaxy.yml based on single source of truth
* Fix up tests and align file names
* Minor Makefile tweak
* Remove link in galaxy.yml file and make it a template file
* Moved collections docs to dev_guide
* change Makefile clean path
* Added readme to example meta file
* review fixes
* Use newer style for doc generation script
* Fix mistake in dev_guide index
* removed uneeded file, fixed links and added preview banner
* Moved banner for sanity test
* add parameter list argument
* add tests
* fix test and add doc
* correct test file
* fix typo
* fix tests
* fix typo in file name
* correct file name reverting the previous commit
* correct property name
* add checkmode message
* changes as per review comments
* variable casing and other review comment changes
* define $test_parameters_check_mode_msg variable
* InventoryManager start of perf improvements
* 0 not 1
* More startswith to [0] improvements
* Remove unused var
* The hash doesn't need to be a string, start as a list, make it into a tuple
* set actually appears faster than frozenset, and these don't need to be frozen
* Cache hosts lists, to avoid extra get_hosts calls, pass to get_vars too
* negligible perf improvement, it could help with memory later
* Try the fast way, fallback to the safe way
* Revert to previous logic, linting fix
* Extend pre-caching to free
* Address test failures
* Hosts are strings
* Fix unit test
* host is a string
* update test assumption
* drop SharedPluginLoaderObj, pre-create a set, instead of 2 comparisons in the list comprehension
* Dedupe code
* Change to _hosts and _hosts_all in get_vars
* Add backwards compat for strategies that don't do set host caches
* Add deprecation message to SharedPluginLoaderObj
* Remove unused SharedPluginLoaderObj import
* Update docs/comments
* Remove debugging
* Indicate what patterh_hash is
* That won't work
* Re-fix tests
* Update _set_hosts_cache to accept the play directly, use without refresh in get_hosts_remaining and get_failed_hosts for backwards compat
* Rename variable to avoid confusion
* On add_host only manipulate _hosts_cache_all
* Add warning docs around _hosts and _hosts_all args
Commit b7724fdf85
appears to have caused a regression, where `ip4`, `gw4`, `ip6`, `gw6`
were converted to `ipv4.address`, `ipv4.gateway` etc.
This causes bootproto (or `ipv4.method`) to remain `dhcp`, as noted in https://github.com/ansible/ansible/issues/36615
This commit only reverts the key-value pairs to the original names,
which is in line with both expectation (manual ip addr == no dhcp) and
the language used in the playbook, which is, for example, "ip4" not
"ipv4.address"
Co-authored-by: Stuart Pollock <spollock@pivotal.io>
Co-authored-by: Tyler Ramer <tramer@pivotal.io>
vmware_guest accepts 0MB as valid value for memory reservation in
virtual machine hardware configuration. This fixes the regression
introduced via 193f69064f.
Fixes: #59190
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Windows - Add common util for web requests
* Use different method of retrieving options from module arg spec
* Added proper version_added for module options
* Fix linting errors
* Fix proxy issues and updated cred docs
* Fix FTP usage with proxy settings
* Removed uneeded function added in bad rebase
* Fix up client certificate auth
* fix new sanity checks
* Edit http agent code and update porting guide
* Print warning when both an option and its alias is specified.
* Improve output.
* Put warnings into self._warnings directly, resp. use self.warn() when handling subspecs.
* Add changelog.
* Add unit test.
* Added support to create/delete mulitiple databases in MySQL
Fixes: #58370
* Added additional tests cases and fixed documentation changes
* Code refactoring and added tests for better test coverage
- Removed db_exists usage from most of the code. Used existence_list
and non_existence_list instead
- Added additional tests to cover all scenarios w.r.t creation and deletion
on multiple databases
- Added tests for dump operations
* Minor fix
* Minor fix - create check mode test
* Added dump tests for better dump tests coverage
* Removed minor database connection details
* fixed error
* Added test case for import operations
* Code refactoring and review fixes
- Added dump all test case
* Fixed review comments
* Minor review comment fixes
* Altered db_create return value
* Removed db_list and altered "does exist" to just "exist"
* Kept db and db_list in module.exit_json
* Refactored tests
- Added removal of dump2 file
* Moved import tests to state_dump_import file
* Removed import tests from multi_db_create_delete
* Updated porting guide, added RETURN block
* Minor identation fix
* Added validation to check if databases are dumped
* Create a user home directory if it has parents that do not exist
The useradd command line tool does not create parent directories. Check if the specified home path has parents that do not exist. If so, create them prior to running useradd, then set the proper permission on the created directory.
Add tests
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Use dict for default user group in tests
Signed-off-by: Sam Doran <sdoran@redhat.com>
* Fix tests
Signed-off-by: Sam Doran <sdoran@redhat.com>
In ovirt-engine 4.3 and onwards a 'commit on success' parameter is
available. It is used to commit a network configuration automatically
upon successful application of the configuration without needing a
separate save request.
Therefore since ansible 2.8 if the 'save' parameter is specified as
'true' the commit on success parameter will be set to true and used
instead of making an additional save request.
* Based upon partial work of wilmardo
* Now, user can specify managed object id of virtual machine to find
an existing virtual machine
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
It's not critical information and there's been a number of issues over
the years with trying to retrieve it. If an exception is thrown just
return null.
Fixes: #47813
* minor checkpoint module fix
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
* state default value set
Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
- Support more import statements:
from ansible_collections.ansible.builtin.plugins.module_utils import basic
from ansible_collections.ansible.builtin.plugins.module_utils.basic import AnsibleModule
- Add unit tests for more import statements.
- Raise ImportError instead of returning None if load_module fails.
We have some common code used by several docs scripts. Migrate that
into the build-only shared code repository.
* Move lib/ansible/utils/_build_helpers.py to the directory for common
build code
* Migrate docs/bin/dump_config.py to a build-ansible subcommand
* Migrate dump_keywords to the build-ansible framework
* Make the script more maintainable by using functions and good
variable names
* Port to Python3 idioms
* Fix bug so that private attributes will be undocumented
* Move generate_man to a build-ansible subcommand
* Port plugin_formatter to a build-ansible subcommand
* Rework command_plugins so that docs scripts can target Python-3.4+ and
releng-only subcommands can use more recent versions of Python.
The architecture is now that command_plugins/* need to be importable
on Python-3.4. The init_parsers() method needs to run on Python-3.4.
But the main() method can utilize features of more recent Python as
long as it fits within those parameters.
* Update docs build requirements
Port the plugin_formatter to build-ansible framework
* The chroot connection plugin crashes because its constructor calls
self.get_option(...) before the plugin loader has established its
self._load_name. Therefore, we should defer the self.get_option(...)
call so that it happens in connect().
Fixes#59063
* User now can be specify datastore cluster for deploying OVF
* Added find_resource_pool_by_cluster API
Fixes: #57849
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* The description has been replaced with proxy_password and proxy_username.
* Rename 59068-fix doc for yum_repository.py to 59068-fix_doc_for_yum_repository.yml
The Display class has no `info` attribute/method. The use of the method
was raising an Exception in task_queue_manager and displayed an
unappropriate deprecation warning.
* Add SNOW OAuth Support and Multi-record Query
* Add OAuth documentation to snow_record_find
* Fix lint and verification issue for PR 58410
* Fix E309 and E324 errors in PR 58410
* Fix E307, need advice on E309
* Fix E309 for PR 58410
* Re-add instance, username and password documentation
* Fix data type mismatch in documentation
* Remove doc_fragment overlap
* Refactor service now module space
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
* Changes as per review comments and renamed file to vmware_content_library_info
* Removing password field from publish info dictionary
* Removed current password field from publish info
* Modified vmware_content_library_info module with review comments.
* Review comments. Moved test .yml files under tasks folder
* Moved test files under module name folder. Handled library_get call under try catch to throw proper error message
* Fixed precheck failure bare except. Catching Exception