Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
* upstream/develop: (28 commits)
  Corrected pylint string issue.
  Add a note to LocalClient docs about IOLoops (saltstack#35501)
  Spelling fix in nxos proxy docs (saltstack#35527)
  Be explicit about SaltInvocationError import (saltstack#35528)
  Add versionadded tag for show_low_sls function in salt-ssh state wrapper (saltstack#35537)
  Gate the statistics module (saltstack#35539)
  Whitespace fix
  Might be a good idea to be able to download the software we make (saltstack#35513)
  setup.py will not print each individual file
  Completely remove Python and verify
  Errors will stop the scripts
  Copy and delete silently, do not list each file
  Lazy init for cache lazyloader to prevent serialization on fork.
  Fix import
  Add Carbon to versionadded for git.diff
  remove unused imports
  remove TMP and add integration.TMP
  Add supported templates list to all template doc references in file state
  Fix spacing
  Added new features and improvements to the ProfitBricks provider including:
  ...
  • Loading branch information
jojohans committed Aug 18, 2016
2 parents ea32339 + dfe0e3d commit 9a82e0c
Show file tree
Hide file tree
Showing 23 changed files with 677 additions and 189 deletions.
2 changes: 1 addition & 1 deletion doc/topics/cloud/index.rst
Expand Up @@ -116,7 +116,7 @@ Cloud Provider Specifics
Getting Started With OpenNebula <opennebula>
Getting Started With OpenStack <openstack>
Getting Started With Parallels <parallels>
Getting Started With Profitbricks <profitbricks>
Getting Started With ProfitBricks <profitbricks>
Getting Started With Proxmox <proxmox>
Getting Started With Rackspace <rackspace>
Getting Started With Saltify <saltify>
Expand Down
82 changes: 73 additions & 9 deletions doc/topics/cloud/profitbricks.rst
Expand Up @@ -6,12 +6,12 @@ ProfitBricks provides an enterprise-grade Infrastructure as a Service (IaaS)
solution that can be managed through a browser-based "Data Center Designer"
(DCD) tool or via an easy to use API. A unique feature of the ProfitBricks
platform is that it allows you to define your own settings for cores, memory,
and disk size without being tied to a particular instance size.
and disk size without being tied to a particular server size.

Dependencies
============

* profitbricks >= 2.3.0
* profitbricks >= 2.3.4

Configuration
=============
Expand All @@ -23,6 +23,8 @@ Configuration
.. code-block:: yaml
my-profitbricks-config:
driver: profitbricks
# Set the location of the salt-master
#
minion:
Expand All @@ -39,8 +41,6 @@ Configuration
ssh_public_key: /path/to/id_rsa.pub
ssh_private_key: /path/to/id_rsa
driver: profitbricks
.. note::
.. versionchanged:: 2015.8.0
Expand Down Expand Up @@ -78,12 +78,10 @@ Here is an example of a profile:

.. code-block:: yaml
profitbricks_production:
profitbricks_staging
provider: my-profitbricks-config
size: Micro Instance
image: 2f98b678-6e7e-11e5-b680-52540066fee9
disk_size: 10
disk_type: SSD
cores: 2
ram: 4096
public_lan: 1
Expand All @@ -92,6 +90,35 @@ Here is an example of a profile:
ssh_private_key: /path/to/id_rsa
ssh_interface: private_lan
profitbricks_production:
provider: my-profitbricks-config
image: Ubuntu-15.10-server-2016-05-01
disk_type: SSD
disk_size: 40
cores: 8
cpu_family: INTEL_XEON
ram: 32768
public_lan: 1
private_lan: 2
public_firewall_rules:
Allow SSH:
protocol: TCP
source_ip: 1.2.3.4
port_range_start: 22
port_range_end: 22
Allow Ping:
protocol: ICMP
icmp_type: 8
ssh_public_key: /path/to/id_rsa.pub
ssh_private_key: /path/to/id_rsa
ssh_interface: private_lan
volumes:
db_data:
disk_size: 500
db_log:
disk_size: 50
disk_type: SSD
The following list explains some of the important properties.

size
Expand Down Expand Up @@ -126,14 +153,42 @@ ram
forth.

public_lan
This option will connect the instance to the specified public LAN. If no
This option will connect the server to the specified public LAN. If no
LAN exists, then a new public LAN will be created. The value accepts a LAN
ID (integer).

public_firewall_rules
This option allows for a list of firewall rules assigned to the public
network interface.

Firewall Rule Name:
protocol: <protocol> (TCP, UDP, ICMP)
source_mac: <source-mac>
source_ip: <source-ip>
target_ip: <target-ip>
port_range_start: <port-range-start>
port_range_end: <port-range-end>
icmp_type: <icmp-type>
icmp_code: <icmp-code>

private_lan
This option will connect the instance to the specified private LAN. If no
This option will connect the server to the specified private LAN. If no
LAN exists, then a new private LAN will be created. The value accepts a LAN
ID (integer).

private_firewall_rules
This option allows for a list of firewall rules assigned to the private
network interface.

Firewall Rule Name:
protocol: <protocol> (TCP, UDP, ICMP)
source_mac: <source-mac>
source_ip: <source-ip>
target_ip: <target-ip>
port_range_start: <port-range-start>
port_range_end: <port-range-end>
icmp_type: <icmp-type>
icmp_code: <icmp-code>

ssh_private_key
Full path to the SSH private key file.
Expand All @@ -146,6 +201,15 @@ ssh_interface
as bootstrapping the node) instead of the public LAN IP. The value accepts
'private_lan'.

cpu_family
This option allow the CPU family to be set to AMD_OPTERON or INTEL_XEON.
The default is AMD_OPTERON.

volumes:
This option allows a list of additional volumes by name that will be
created and attached to the server. Each volume requires 'disk_size'
and, optionally, 'disk_type'. The default is HDD.

deploy
Set to False if Salt should not be installed on the node.

Expand Down
9 changes: 9 additions & 0 deletions pkg/windows/uninstall-and-wipe-Python.cmd
@@ -0,0 +1,9 @@
@echo off

:: uninstall Python 2.7 64bit
MsiExec.exe /X {16E52445-1392-469F-9ADB-FC03AF00CD62} /QN

:: wipe the Python directory
:: DOS hack first create dir because Windows cannot test not existing without error message
md c:\Python27 1>nul 2>nul
rd /s /q c:\Python27 || echo Failure: c:\Python27 still exists, please find out why and repeat.
25 changes: 7 additions & 18 deletions salt/cache/__init__.py
Expand Up @@ -6,8 +6,8 @@
'''
from __future__ import absolute_import
import os
import salt.loader
import time
from salt.loader import LazyLoader
from salt.payload import Serial


Expand Down Expand Up @@ -48,24 +48,13 @@ def __init__(self, opts):
self.opts = opts
self.driver = opts['cache']
self.serial = Serial(opts)
self.modules = self._modules()
self._modules = None

def _modules(self, functions=None, whitelist=None):
'''
Lazy load the cache modules
'''
codedir = os.path.dirname(os.path.realpath(__file__))
return LazyLoader(
[codedir],
self.opts,
tag='cache',
pack={
'__opts__': self.opts,
'__cache__': functions,
'__context__': {'serial': self.serial},
},
whitelist=whitelist,
)
@property
def modules(self):
if self._modules is None:
self._modules = salt.loader.cache(self.opts, self.serial)
return self._modules

def cache(self, bank, key, fun, loop_fun=None, **kwargs):
'''
Expand Down
9 changes: 9 additions & 0 deletions salt/client/__init__.py
Expand Up @@ -114,6 +114,15 @@ class LocalClient(object):
running as. (Unless :conf_master:`external_auth` is configured and
authentication credentials are included in the execution).
..note::
The LocalClient uses a Tornado IOLoop, this can create issues when
using the LocalClient inside an existing IOLoop. If creating the
LocalClient in partnership with another IOLoop either create the
IOLoop before creating the LocalClient, or when creating the IOLoop
use ioloop.current() which will return the ioloop created by
LocalClient.
.. code-block:: python
import salt.client
Expand Down
4 changes: 3 additions & 1 deletion salt/client/ssh/wrapper/state.py
Expand Up @@ -533,7 +533,9 @@ def show_sls(mods, saltenv='base', test=None, **kwargs):
def show_low_sls(mods, saltenv='base', test=None, env=None, **kwargs):
'''
Display the low state data from a specific sls or list of sls files on the
master
master.
.. versionadded:: 2016.3.2
CLI Example:
Expand Down
3 changes: 2 additions & 1 deletion salt/cloud/clouds/digital_ocean.py
Expand Up @@ -39,6 +39,7 @@
import salt.config as config
from salt.exceptions import (
SaltCloudConfigError,
SaltInvocationError,
SaltCloudNotFound,
SaltCloudSystemExit,
SaltCloudExecutionFailure,
Expand Down Expand Up @@ -861,7 +862,7 @@ def post_dns_record(**kwargs):
pass
else:
error = '{0}="{1}" ## all mandatory args must be provided: {2}'.format(i, kwargs[i], str(mandatory_kwargs))
raise salt.exceptions.SaltInvocationError(error)
raise SaltInvocationError(error)

domain = query(method='domains', droplet_id=kwargs['dns_domain'])

Expand Down

0 comments on commit 9a82e0c

Please sign in to comment.