1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

41 commits

Author SHA1 Message Date
Tristan Le Guern
5135587c16
proxmox_kvm: fix undefined local variable status (#1847)
* proxmox_kvm: undefined local variable status

* proxmox_kvm: Add a changelog fragment

* Update changelogs/fragments/1847-proxmox-kvm-fix-status.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* proxmox_kvm: fix the RETURN document

* proxmox_kvm: fix name variable when state=current

The variable name is not always defined as the module can be called with
just a vmid.

Before:

> "msg": "VM None with vmid = 118 is stopped"

After:

> "msg": "VM test-instance with vmid = 118 is stopped"

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-17 21:25:05 +01:00
almdudler777
5aac81bdd1
proxmox_kvm: 500 error args parameter (#1783)
* don't add args if set to 'no_defaults'

* never add force even if false, will require archive parameter other which is not implemented

* remove trailing whitespace

* add changelog fragment

* Update changelogs/fragments/1783-proxmox-kvm-fix-args-500-error.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-15 22:40:51 +01:00
Jeffrey van Pelt
1cce279424
Added VMID to all returns (#1715)
* Added VMID to all returns

Also added in the docs promised return of MAC and devices when state ==
current.

Fixes: #1641

* Revert devices and mac as get_vminfo works differently then I expected

* Added status output to a few more calls

* Update RETURNS docs

* Remove vmid where it is not available

* Added changelog fragment

* Update changelogs/fragments/1715-proxmox_kvm-add-vmid-to-returns.yml

You're right, this message is way better then mine.. :-)

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-15 07:27:43 +00:00
Alexei Znamensky
0a5f79724c
Improved parameter handling on proxmox modules (#1765)
* Improved parameter handling on proxmox modules

* removed unused imports

* rollback change in plugins/modules/cloud/misc/proxmox_user_info.py

* added changelog fragment

* Update changelogs/fragments/1765-proxmox-params.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-12 13:01:52 +01:00
topperharly
562ff7efb7
only set param features when variable is not empty (#1763)
* only set param features when variable is not empty

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Topper Harly <topperharly@gmx.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-10 22:07:27 +01:00
Felix Fontein
29bd5a9486
Fix a bunch of potential security issues (secret leaking) (#1736)
* Fix a bunch of potential security issues (secret leaking).

* oneandone_server was already ok.

* Add more parameters for pagerduty_alert.

* Add more no_log=True.
2021-02-08 16:33:18 +01:00
Saqib Rokadia
dd0d460132
Fixing return code not showing the command that fails in terraform. (#1632)
* Fixing return code not showing the command that fails in terraform.

* Update changelogs/fragments/1632-using_check_rc_in_terraform.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-23 11:44:51 +01:00
christophemorio
9f4fd4c899
init_reconfigure fails on module cloud/misc/terraform.py (#1620)
* fix reconfigure option

If `init_reconfigure` is true, the init fails because it is run as:
`terraform init -input=false - r e c o n f i g u r e`

* changelog fragment

* typo

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-13 07:49:00 +01:00
James Harr
39bf187a25
Proxmox - add features flag (#1413)
* Add 'features' option to proxmox LXC

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/proxmox.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Apply suggestions from code review

Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update proxmox.py

Working fix

* Update changelogs/fragments/1413-proxmox-features.yml

Co-authored-by: Amin Vakil <info@aminvakil.com>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2020-12-27 14:07:10 +01:00
Jeffrey van Pelt
0d1417dcfa
New module: proxmox_snap (#1135)
* Fresh branch to try this again

* Fix typo

* Fix sanity error

* Redid some tests, not sure if this works...

* Re-fixed documentation

* Fixed linter

* Update layout

* Processed feedback

* Processed feedback

* Added check_mode

* Run test with check mode

* Fix layout

* Fix more layout

* Fixed last sanity errors (for now)

* Check mode is not a module arg..

* Fix sanity-error

* Reworked check_mode and adapted tests

* Added extra test to also run through remove logic, added message for check_mode to show output is different, grabbed magicmock from different library to fix py2 errors

* Remove unused function

* Processed feedback

* Processed feedback

* Processed feedback
2020-12-21 14:37:30 +01:00
Tristan Le Guern
d981f388fb
Proxmox doc fragments (#1404)
* proxmox{,_kvm,_template}: import auth doc fragment

* proxmox{,_kvm}: new common doc_fragment

Share the parameters `pool`, `vmid` and `node`.

* proxmox_template: sync node description

* changelog_framgent
2020-12-02 16:08:07 +01:00
morph027
1f7649fcd7
Add Cloud Init variables for Proxmox_KVM module (#797)
* Add Cloud Init variables for Proxmox_KVM module

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>

* Update plugins/modules/cloud/misc/proxmox_kvm.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* apply yaml syntax to all examples

* remove trailing whitespaces

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Amin Vakil <info@aminvakil.com>
2020-11-24 20:32:25 +01:00
Tristan Le Guern
51a08ea398
proxmox: create a common base (#1331)
* proxmox: create a common base

Add a doc_fragment to share the documentation regarding authentication
parameters (api_host, api_user, api_password, api_token_id,
api_token_secret as well as the lone validate_certs).

Add a module_utils to hold common code such as the argument spec (again
related to authentication paramters), a helper function to convert from
Proxmox boolean representation to python and the base class
ProxmoxAnsible.
For now it only handles the connection to Proxmox VE API but more can be
added in the future.

To check if everything is well in place add three new modules:
proxmox_{domain,group,user}_info.

And finaly tests these new modules.

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* Add tests/integration/targets/proxmox/aliases

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-24 17:30:39 +01:00
Alexei Znamensky
3d1f9ed657
Tidy up validate-modules ignores for some cloud/ modules (#1354)
* fixed validation-modules for plugins/modules/cloud/atomic/atomic_container.py

* fixed validation-modules for plugins/modules/cloud/oracle/oci_vcn.py

* fixed validation-modules for plugins/modules/cloud/heroku/heroku_collaborator.py

* fixed validation-modules for plugins/modules/cloud/docker/docker_stack.py

* fixed validation-modules for plugins/modules/cloud/pubnub/pubnub_blocks.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_ecs_instance.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_vpc_port.py

* fixed validation-modules for plugins/modules/cloud/huawei/hwc_vpc_subnet.py

* fixed validation-modules for plugins/modules/cloud/ovh/ovh_ip_failover.py

* fixed validation-modules for plugins/modules/cloud/ovh/ovh_ip_loadbalancing_backend.py

* fixed validation-modules for plugins/modules/cloud/softlayer/sl_vm.py

* fixed validation-modules for plugins/modules/cloud/misc/proxmox_kvm.py

* fixed validation-modules for plugins/modules/cloud/misc/proxmox_template.py

* fixed validation-modules for plugins/modules/cloud/misc/terraform.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_dns_reload.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_memstore_info.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_server_info.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone_domain.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone.py

* fixed validation-modules for plugins/modules/cloud/memset/memset_zone_record.py

* fixed validation-modules for plugins/modules/cloud/linode/linode.py

* fixed validation-modules for plugins/modules/cloud/linode/linode_v4.py

* fixed validation-modules for plugins/doc_fragments/dimensiondata.py

* fixed validation-modules for plugins/modules/cloud/dimensiondata/dimensiondata_network.py

* fixed validation-modules for plugins/modules/cloud/dimensiondata/dimensiondata_vlan.py

* fixed validation-modules for plugins/modules/cloud/xenserver/xenserver_guest_info.py

* fixed validation-modules for plugins/modules/cloud/xenserver/xenserver_guest_powerstate.py

* Tidy up validate-modules ignores for varied cloud modules

- loking at the count of ignore lines, worked from the lower numbers up

* rolled back line for docker_container, removed two extraneous for xenserver

* rolled back lins for linode in 2.9
2020-11-23 09:22:30 +01:00
Tristan Le Guern
5cc900cfdb
proxmox*: add support for API tokens (#1206)
Provides an alternative authentication method to the password.
The token validity is only tested during the first request after the
instantiation of `ProxmoxAPI`, thus the presence of a call to
`proxmox.version.get()` in `proxmox_template`.

Example:

    - name: Ensure test-vm is created
      proxmox_kvm:
        api_host: prx-test
        api_user: tleguern@pve
        api_token_id: api-pve-test
        api_token_secret: fad3db3d-b335-ee15-9fb0-ea1bf70128db
        node: prx-test-01
        name: test-vm
	...
2020-11-16 21:24:11 +01:00
thetuxkeeper
726aa5ecf7
proxmox_kvm: pool parameter not supported by qemu/<vmid>/config API endpoint (#1258)
* proxmox_kvm: pool parameter not supported by API on update

* added changelog fragment

* format fix and pull request link added

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-11-14 11:52:01 +01:00
Tobias Lindenberg
890ff574c3
proxmox_template download appliance templates (#1046)
* proxmox_template download appliance templates

* Update changelogs/fragments/proxmox_template-appliance-download.yml

added pull request link

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/proxmox_template.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/proxmox_template.py

Co-authored-by: Tristan Le Guern <tleguern@bouledef.eu>

* Update proxmox_template.py

grammar

* removed debug message

Co-authored-by: Tobias Lindenberg <me@bloomcake.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Tristan Le Guern <tleguern@bouledef.eu>
2020-11-04 23:16:07 +01:00
Damien Guihal
282c1d546c
Add support for "reconfigure" option for terraform init (#823)
* Add support for extra options for terraform init

* Add missing var declaration

* feat: add changelog fragment

* feat: switch from an init_extra_args global option to an init_reconfigure specific option

* Update changelogs/fragments/823-terraform_init_reconfigure.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-30 20:05:41 +01:00
Amin Vakil
d6f5029187
proxmox, proxmox_kvm: Deprecate hard-coded defaults (#850)
* Remove hard-coded defaults

* Remove hard-coded defaults in proxmox.py

* Add changelog

* Remove defaults in proxmox docs

* Remove more default values

* Remove defaults in doc proxmox_kvm

* Restore default=True to onboot

* Add unspecified back to format

* correct changelog format and grammar

Co-authored-by: Felix Fontein <felix@fontein.de>

* improve changelog

* Fix changelog formatting

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix changelog formatting

* Deprecate before behaviour change

* Change changelog

* Remove unnecessary ignored sanity tests, fix

* Fix

* Better mention it too often than too little :)

* Deprecate in version 4.0.0 instead of 2.0.0

* Fix changelog

* Fix

* Remove none values

* Improve documentation as suggessted by felixfontein

* fix changelog

Co-authored-by: Felix Fontein <felix@fontein.de>

* Remove default value in force in proxmox_kvm

* Add description to force in proxmox_kvm

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-30 13:15:25 +01:00
lukaszrzasik
e3e66a57ec
proxmox_kvm: allow setting format to null (None) (#1028)
* Allow setting format to null (None)

* Use string instead of None for consistency

* Add changelog

* Update changelogs/fragments/1028-proxmox-kvm-linked-clone.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/proxmox_kvm.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Substitute 'unspecified' format with None

Co-authored-by: Lukasz Rzasik <lukasz.rzasik@dreamlab.net>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-10 10:53:09 +02:00
Tristan Le Guern
02e80c610b
proxmox_kvm: code cleanup (#934)
* proxmox_kvm: remove redundant parameters

The functions start_vm() and stop_vm() receive four common parameters:
module, proxmox, vm and vmid.
The last too are redundant so keep only vm.

I also took the opportunity to remove extra API calls to proxmox.nodes()
by assigning its return value to a variable.

* proxmox_kvm: remove extra calls to status.current

The get_vm() function already returns an array of properties containing
the status so remove extra API calls to retrieve this information.

Example:

    [{''netin'': 177232, ''name'': ''test-instance'', ''maxcpu'': 1, ''node'': ''prx-01'', ''disk'': 0, ''template'': 0, ''uptime'': 267, ''cpu'': 0.0410680030805531, ''diskread'': 165294744, ''maxdisk'': 10737418240, ''vmid'': 42, ''status'': ''running'', ''id'': ''qemu/42'', ''maxmem'': 536870912, ''diskwrite'': 18528256, ''netout'': 2918, ''type'': ''qemu'', ''mem'': 160284950}]

* proxmox_kvm: kill VZ_TYPE global variable

It reduces readability without providing much values nowadays.

* proxmox_kvm: simplify vmid generation

Forgotten suggestion from Felix Fontein in PR#811.

* proxmox_kvm: add changelog fragment for PR#934
2020-09-23 16:39:46 +03:00
Tristan Le Guern
9a5fe4c9af
proxmox_kvm: new function wait_for_task() (#831)
Allows some factorization of redundant code in stop_vm(), start_vm(),
create_vm() and main().
This new function also waits one extra second after a successful task execution as the API can be a bit ahead of Proxmox.

Before:

    TASK [ansible-role-proxmox-instance : Ensure test-instance is created]
    changed: [localhost]

    TASK [ansible-role-proxmox-instance : Ensure test-instance is updated]
    fatal: [localhost]: FAILED! => changed=false
      msg: VM test-instance does not exist in cluster.

After:

    TASK [ansible-role-proxmox-instance : Ensure test-instance is created]
    changed: [localhost]

    TASK [ansible-role-proxmox-instance : Ensure test-instance is updated]
    changed: [localhost]

With suggestions from Felix Fontein <felix@fontein.de>.
2020-09-08 13:11:37 +02:00
Tristan Le Guern
e20eb64c6e
proxmox_kvm: allow force to be use with state=absent (#849)
In this case a running VM will be automaticaly shut down before being
removed.

With updates from Andrew Klychkov <aaklychkov@mail.ru>.
2020-09-07 22:07:40 +02:00
Tristan Le Guern
73f8338980
proxmox_kvm: fix idempotency issue with state=absent (#811)
When the `vmid` parameter is not supplied and the module can only rely on
name look-up an early failure can happen if the targeted VM doesn't exist.
In this case a task execution with the parameter `state` set to `absent`
will actually fail instead of being considered ok.

This patch introduces a deferred error-checking for non-existent VMs
by assigning the value -1 to the `vmid` parameter, allowing the actual
verification to be performed in the right code paths.
Is also help to differentiate between a non-existent `vmid` or non-existent
VM `name`.

Previously:

    TASK [ansible-role-proxmox-instance : Remove instance-test]
    changed: [localhost]
    ...
    TASK [ansible-role-proxmox-instance : Remove instance-test]
    fatal: [localhost]: FAILED! => changed=false
      msg: VM instance-test does not exist in cluster.

Now:

    TASK [ansible-role-proxmox-instance : Remove instance-test]
    ok: [localhost]
    ...
    TASK [ansible-role-proxmox-instance : Remove instance-test]
    ok: [localhost]

Update changelogs/fragments/811-proxmox-kvm-state-absent.yml

With suggestions from Felix Fontein <felix@fontein.de>.
2020-09-05 00:51:54 +02:00
Amin Vakil
d046dc34bf
Reduce ignored sanity tests in cloud/misc modules (#845)
* Reduce ignored sanity tests in cloud/misc modules

* Reduce ignored sanity tests in cloud/misc modules for proxmox_kvm

* Fix

* Remove in ignore-2.9.txt

* Fix

* Remove unneeded alias
2020-09-01 13:44:04 +02:00
AdamGoldsmith
7e6bde2ce1
Fix terraform changed status detection test (#561) (#563)
* Fix terraform changed status detection test (#561)

* Add changelog fragment

* Update changelogs/fragments/563-update-terraform-status-test.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-08-21 21:44:15 +02:00
Andrew Klychkov
c055340ecb
modules: fix examples to use FQCN for builtin modules (#648)
* modules: fix examples to use FQCN for builtin modules

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2020-07-14 18:28:08 +03:00
Andrew Klychkov
41cfdda6a3
modules: fix examples to use FQCN (#644)
* modules: fix examples to use FQCN

* fix

* fix

* fix
2020-07-13 21:50:31 +02:00
Felix Fontein
097aebadb0
Fix M(). (#591)
* Fix M().

* Break long line.

* Fix the remaining M(...).

* Break long line.
2020-06-29 14:59:15 +02:00
Amin Vakil
650ae65f24
collection: Change default='no's and 'yes's to default=False and default=True (#556)
* Change default={'no','yes'} to default={False,True}

* Add changelog

* Remove changelog
2020-06-22 15:56:35 +02:00
Felix Fontein
b54ddaa28c
Clean up deprecations (#504)
* Adjust deprecation versions.

* Remove redirects that are already made in ansible/ansible's ansible_builtin_runtime.yml

* Remove modules that were moved to the google.cloud collection according to ansible/ansible's ansible_builtin_runtime.yml.

* The _info module is in google.cloud.

* The gcp doc_fragment is a copy of the one in google.cloud and is only used by one lookup. Mark as deprecated/internal.

* Remove entries of modules that no longer exist.

* Update ignore.txt.

* Try to fix test.

* Remove debug output.
2020-06-16 13:15:19 +02:00
Felix Fontein
f9589d78a8
Add version_added for all new features (#214)
* Add version_added: 1.0.0 for all new features added before pre-ansible-base.

* Add version_added: 1.0.0 for all new features.

* Next release will be 0.2.0

* Fix error.

* Remove unnecessary warnings.
2020-06-13 15:01:19 +02:00
Mohammad Yosefpor
116978abca
terraform module: Added backend_config_file and multiple variables_file (#394)
* added backend_config_file, multiple variables_file

* typo

* sanity check

* Update plugins/modules/cloud/misc/terraform.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/terraform.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/cloud/misc/terraform.py

specify type

Co-authored-by: Felix Fontein <felix@fontein.de>

* change log, fixes

* polural form of option names

* typo

* another typo

* Update changelogs/fragments/394-terraform-add-config_file.yml

Added PR URL.

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-06-03 15:23:00 +03:00
Felix Fontein
a0a534508a
Un-remove wrongly removed ovirt modules and adjust deprecation to Ansible 2.14 (#353)
* Un-remove wrongly removed ovirt modules and adjust deprecation to Ansible 2.14 (regular 4 version deprecation cycle).

* Update sanity-2.10.txt

* Vendor dependencies from ovirt.ovirt as deprecated, and remove dependency on ovirt.ovirt.

* Use ovirt_facts doc_fragment, and don't add _ovirt_info doc_fragment.
2020-05-18 20:43:50 +01:00
LucasBoisserie
aadc6cd66d
Deprecated Helm module (#115)
Helm module is deprecated in favor of a new helm module from community.kubernetes.
2020-05-18 14:15:40 +05:30
Markus
cd5e3e2d85
add description and hookscript parameters to proxmox LXC container (#245)
* add description and hookscript parameters to proxmox LXC container

* fix pep8 E128

* Update plugins/modules/cloud/misc/proxmox.py

Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru>

* Update plugins/modules/cloud/misc/proxmox.py

Co-Authored-By: Andrew Klychkov <aaklychkov@mail.ru>

* add example for proxmox hookscript and description

* add changelogs fragment for PR #245

* set hookscript type

Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
2020-05-18 08:17:11 +03:00
Andrew Klychkov
328319b926
Fix Ansible documentation in part of example formatting. Part 1 (#332)
* Fix Ansible documentation in part of example formatting

* Fix
2020-05-15 13:13:45 +03:00
Andrew Klychkov
5d226f86b6
Remove ANSIBLE_METADATA (#339)
* Remove ANSIBLE_METADATA

* remove from other modules

* remove from plugins and scripts
2020-05-14 14:03:42 +01:00
Andrew Klychkov
d386506728
proxmox: fix examples formatting (#248)
* proxmox: fix examples formatting

* fix
2020-04-28 17:22:02 +03:00
Jesse Pretorius
0ffe9fa6c4
Remove libvirt/virt content (#14)
This content has been moved to:
https://github.com/ansible-collections/libvirt
2020-03-13 15:50:53 +00:00
Ansible Core Team
aebc1b03fd Initial commit 2020-03-09 09:11:07 +00:00