Commit Graph

93221 Commits

Author SHA1 Message Date
Cédric Bosdonnat
3d3ed786cd
virt module: actually deprecate virt.nic option
virt.nic is considered as the old version of virt:nic in the code, but
there is no warning of this. The documentation is also still mentioning
virt.nic. Updating it all to move to virt:nic
2018-04-23 15:21:19 +02:00
Cédric Bosdonnat
6858c9931a
virt module: move virt.images to virt:images
To continue the virt module options harmonization, deprecate virt.images
in favor of virt:images and add documentation on this option.
2018-04-23 15:21:17 +02:00
Cédric Bosdonnat
20048c6fca
virt module: convert virt.tunnel into virt:tunnel
To continue the virt module options harmonization, deprecate virt.tunnel
in favor of virt:tunnel and add documentation on this option.
2018-04-23 15:21:16 +02:00
Cédric Bosdonnat
dbed81e1eb
Read values from config.DEFAULTS in config.get
config.option reads values from DEFAULTS, while config.get doesn't.
Adding DEFAULTS as the last fallback in config.get in case nothing
else matched.
2018-04-23 15:21:15 +02:00
Cédric Bosdonnat
4673b767ca
virt module: change libvirt:storagepool to virt:storagepool
In order to simplify the virt module configuration, continue moving
all configuration options to a virt tree.
2018-04-23 15:21:13 +02:00
Cédric Bosdonnat
569ab11820
virt module: remove unused _image_type() function 2018-04-23 15:21:12 +02:00
Cédric Bosdonnat
087fb19455
virt module: more connection optimizations 2018-04-23 15:21:10 +02:00
Cédric Bosdonnat
fbbc012b57
virt module: stop leaking libvirt connections
All libvirt connections in the virt module are left opened. For healthy
libvirt daemons, we need to close them when no longer needed.
2018-04-23 15:21:09 +02:00
Cédric Bosdonnat
a5d32c42c6
virt module: use _get_domain() where possible
list_domain() should not be used internally to get domains as it usually
involves duplicate opened connections. Remove some more useless libvirt
connections by using _get_domain() instead.
2018-04-23 15:21:07 +02:00
Cédric Bosdonnat
5cac785514
virt module: spare connections in list_domain
list_domain opens two libvirt connections: one for active VMs and one
for inactive ones. Move all the logic in _get_domain() by adding two
possible kwargs ('active' and 'inactive'). With this only one connection
is required by this call and _get_domain should now be the function to
use internally to get domains.
2018-04-23 15:21:06 +02:00
Cédric Bosdonnat
627b2e2594
virt module: extract get_nics, get_disks and get_graphics
Extract the code of get_nics, get_disks and get_graphics into private
functions providing the same feature with a libvirt domain as parameter.

The rationale behind this change is to allow reducing the number of
libvirt connections opened during some calls.
2018-04-23 15:21:05 +02:00
Cédric Bosdonnat
2dfdc4eb4b
virt module: support authenticated connections
ESXi connections are using libvirt.openAuth with all the authentication
setup delegated in the libvirt config files. Make the whole thing more
generic to be generally usable to users for all kind of hypervisors (issue #47156).
2018-04-23 15:21:03 +02:00
Cédric Bosdonnat
9712724a9c
virt module: use 'virt:connection:uri' in all cases
Connecting to an ESX server requires libvirt:connection property, while
connecting to another libvirt driver requires virt.connect property.
In order to harmonize them, deprecate them all in favor of
virt:connectioni:uri (issue #47156).

The rationale behind not keeping any of them is to harmonize the
libvirt:* and virt* configuration properties in this module and move
them all into a virt tree.
2018-04-23 15:21:02 +02:00
Cédric Bosdonnat
1043f72c20
virt module: don't force default connection URI
libvirt open() function handles None connection URI. In such a case it
tries all the hypervisors and connects to the first possible one.
Forcing 'qemu:///system' URI in the virt module was wrong since it
forced using the QEMU system session even on minions that don't have it.
With None as default, the user has nothing to do to connect to
hypervisors like Xen.

While at it, remove the use of __opts__ to access the 'virt.connect'
property, use config.get instead.
2018-04-23 15:21:01 +02:00
Cédric Bosdonnat
8a43398036
libvirt engine events auto discover hypervisor by default
libvirt.open() has the good idea to automatically connect to the first
available local hypervisor it finds if the uri parameter is None. Don't
force a default value to benefit from that feature. Thus a configuration
like the following will listen to all events on the local hypervisor:

    engines:
        - libvirt_events
2018-04-23 15:20:59 +02:00
Cédric Bosdonnat
6e0d150c58
virt module: pylint cleanup 2018-04-23 15:20:58 +02:00
Nicole Thomas
6a7833db38
Merge pull request #47170 from diepes/develop
Create new Softlayer VMs with security_groups attached if configured.
2018-04-20 10:39:29 -04:00
Pieter
04c5f2b9d5
Merge branch 'develop' into develop 2018-04-20 13:35:06 +12:00
Nicole Thomas
2d935be03c
Merge pull request #46922 from terminalmage/issue7424
Add function to return TLS cert expiration date
2018-04-19 17:29:37 -04:00
Nicole Thomas
4aee26f939
Merge pull request #47158 from rallytime/fix-mysql-test
Change check_db_exists default to True
2018-04-19 15:35:22 -04:00
Nicole Thomas
3d812f64b2
Merge pull request #47040 from terminalmage/new-decorators
Add ability to run a shell command to depends decorator
2018-04-19 15:30:25 -04:00
Nicole Thomas
b7cfe31476
Merge pull request #47161 from terminalmage/salt-jenkins-930
Fix failing pillar unit test
2018-04-19 15:29:39 -04:00
Erik Johnson
d7bfd1391f
Add unit test for tls.get_expiration_date 2018-04-19 12:03:51 -05:00
Erik Johnson
c56c890095
Log the exception when the read/cert object creation fails 2018-04-19 12:01:10 -05:00
Erik Johnson
4ada39d8a1
Add function to return TLS cert expiration date
Refs: #7424
2018-04-19 11:22:57 -05:00
Nicole Thomas
a72affcbc8
Merge pull request #47148 from LukeCarrier/add-docker-slsbuild-extrafilerefs
Add extra_filerefs to sls_build
2018-04-19 11:28:02 -04:00
Pieter E Smit
8fba0007ae
Create new Softlayer VMs with security_groups attached if configured. 2018-04-19 09:22:33 +12:00
Erik Johnson
3df82869d0
Mock __gather_avail in test_includes_override_sls 2018-04-18 13:15:00 -05:00
Erik Johnson
af83a5755d
mocked file_roots and pillar_roots should be dicts 2018-04-18 13:00:33 -05:00
Erik Johnson
ba4ac60787
Remove trailing whitespace 2018-04-18 12:59:57 -05:00
rallytime
31f9ef0e74
Change check_db_exists default to True
This option was added in PR #46895 where the default in the `run_file` function
was set to `True`, but in the `run` function it was set to `False`. This is an
error and the default should be `True`.

With the default set to False, it causes a test failure and would also be a change
in behavior from previous releases. In addition, the docs also say that default
is True. Therefore, this looks to be a typo. This PR sets the default to `True`.

Fixes the following test failure:

- unit.states.test_mysql_query.MysqlQueryTestCase.test_run
2018-04-18 11:51:40 -04:00
Nicole Thomas
1c1e4a4226
Merge pull request #47138 from dijit/patch-1
plaintext not supported in Windows Server 2016.
2018-04-18 11:35:17 -04:00
Nicole Thomas
7b0ced82fb
Merge pull request #47115 from cvedel/allow-ssh-host-in-vm-profile
salt-cloud/vmware if specified use ssh_host to deploy
2018-04-18 10:13:13 -04:00
Luke Carrier
e592c87eb0 Add extra_filerefs to sls_build 2018-04-18 10:38:45 +01:00
Christophe Vedel
c6a62966e6 only change ssh_host if necessary 2018-04-18 09:51:53 +02:00
Jan Harasym
df26cdc1d6
plaintext not supported in Windows Server 2016.
ntlm authentication is backwards compatible to Windows Server 2008 at least, but plaintext is not supported in Server 2016.
2018-04-18 00:12:02 +02:00
Erik Johnson
09dcb8ffce
Merge pull request #47084 from bloomberg/26396-docpatch
GH-26396, add a clarification on pillar merge strategy
2018-04-17 16:33:22 -05:00
Nicole Thomas
68aeb62a95
Merge pull request #47071 from beornf/vault-write-data
Support return value when setting vault secret
2018-04-17 16:52:22 -04:00
Nicole Thomas
5fba2cbf78
Merge pull request #47072 from beornf/vault-wrapped-token
Add wrapped token auth method for vault module
2018-04-17 16:51:13 -04:00
Nicole Thomas
ab8b12379b
Merge pull request #47078 from sjorge/zfsgrainnopool
Ignore return code in zfs grains
2018-04-17 16:50:21 -04:00
Nicole Thomas
cdde25be86
Merge pull request #47091 from ixs/xen_pv_args
Add Xen function to get and set PV_ARGS
2018-04-17 16:49:18 -04:00
Nicole Thomas
99debdd1cb
Merge pull request #47111 from terminalmage/default-renderer
Update default renderer to jinja|yaml, improve renderer docs
2018-04-17 16:47:33 -04:00
Nicole Thomas
ac0656967c
Merge pull request #47123 from rallytime/merge-develop
[develop] Merge forward from 2018.3 to develop
2018-04-17 16:46:37 -04:00
Nicole Thomas
56900be173
Merge pull request #47121 from pcjeff/develop
fix pip import error in pip 10.0.0
2018-04-17 15:06:07 -04:00
rallytime
c85fa430f0
Update old utils paths with new utils paths 2018-04-17 11:54:43 -04:00
rallytime
abe2309c91
Merge branch '2018.3' into 'develop'
Conflicts:
  - salt/netapi/rest_tornado/saltnado.py
2018-04-17 11:50:01 -04:00
Erik Johnson
1786589e1e
Update test to reflect docstring changes 2018-04-17 09:21:05 -05:00
Nicole Thomas
9e3fb7c7f2
Merge pull request #47082 from awerner/add-saltclass-recursive-pillars
saltclass: added pillars to __pillar__ when encountered
2018-04-17 10:15:49 -04:00
Nicole Thomas
0403abcf76
Merge branch 'develop' into zfsgrainnopool 2018-04-17 10:15:00 -04:00
Jeff.JF Lin
e81cf80519 add ImportError 2018-04-17 22:09:04 +08:00