Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2015.5' into merge-forward-2015.8
Browse files Browse the repository at this point in the history
Conflicts:
    doc/conf.py
    salt/daemons/masterapi.py
    salt/minion.py
  • Loading branch information
basepi committed Oct 20, 2015
2 parents 53dd01f + ab18dcf commit c4c889f
Show file tree
Hide file tree
Showing 15 changed files with 216 additions and 103 deletions.
3 changes: 2 additions & 1 deletion conf/minion
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@

# Set the file client. The client defaults to looking on the master server for
# files, but can be directed to look at the local file directory setting
# defined below by setting it to local.
# defined below by setting it to "local". Setting a local file_client runs the
# minion in masterless mode.
#file_client: remote

# The file directory works on environments passed to the minion, each environment
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __getattr__(cls, name):
copyright = '2015 SaltStack, Inc.'

version = salt.version.__version__
latest_release = '2015.8.1' # latest release
latest_release = '2015.8.1' # latest release
previous_release = '2015.5.6' # latest release from previous branch
previous_release_dir = '2015.5' # path on web server for previous branch
build_type = 'latest' # latest, previous, develop, inactive
Expand Down
2 changes: 1 addition & 1 deletion doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ https://github.com/saltstack-formulas/salt-formula
.. _faq-grain-security:

Is Targeting using Grain Data Secure?
=====================================
-------------------------------------

Because grains can be set by users that have access to the minion configuration
files on the local system, grains are considered less secure than other
Expand Down
4 changes: 4 additions & 0 deletions doc/topics/pillar/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ by their ``os`` grain:
company: Foo Industries
.. important::
See :ref:`Is Targeting using Grain Data Secure? <faq-grain-security>` for
important security information.

The above pillar sets two key/value pairs. If a minion is running RedHat, then
the ``apache`` key is set to ``httpd`` and the ``git`` key is set to the value
of ``git``. If the minion is running Debian, those values are changed to
Expand Down
4 changes: 4 additions & 0 deletions doc/topics/targeting/grains.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ to a custom grain, grain data is refreshed.
Grains resolve to lowercase letters. For example, ``FOO``, and ``foo``
target the same grain.

.. important::
See :ref:`Is Targeting using Grain Data Secure? <faq-grain-security>` for
important security information.

Match all CentOS minions:

.. code-block:: bash
Expand Down
4 changes: 3 additions & 1 deletion salt/cloud/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def run(self):
log.info('salt-cloud starting')
try:
mapper = salt.cloud.Map(self.config)
except SaltCloudSystemExit as exc:
self.handle_exception(exc.args, exc)
except SaltCloudException as exc:
msg = 'There was an error generating the mapper.'
self.handle_exception(msg, exc)
Expand Down Expand Up @@ -374,7 +376,7 @@ def print_confirm(self, msg):

def handle_exception(self, msg, exc):
if isinstance(exc, SaltCloudException):
# It's a know exception an we know own to handle it
# It's a known exception and we know how to handle it
if isinstance(exc, SaltCloudSystemExit):
# This is a salt cloud system exit
if exc.exit_code > 0:
Expand Down
204 changes: 136 additions & 68 deletions salt/cloud/clouds/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,17 @@
log = logging.getLogger(__name__)

SIZE_MAP = {
'Micro Instance': 't1.micro',
'Small Instance': 'm1.small',
'Medium Instance': 'm1.medium',
'Large Instance': 'm1.large',
'Extra Large Instance': 'm1.xlarge',
'High-CPU Medium Instance': 'c1.medium',
'High-CPU Extra Large Instance': 'c1.xlarge',
'High-Memory Extra Large Instance': 'm2.xlarge',
'High-Memory Double Extra Large Instance': 'm2.2xlarge',
'High-Memory Quadruple Extra Large Instance': 'm2.4xlarge',
'Cluster GPU Quadruple Extra Large Instance': 'cg1.4xlarge',
'Cluster Compute Quadruple Extra Large Instance': 'cc1.4xlarge',
'Cluster Compute Eight Extra Large Instance': 'cc2.8xlarge',
'Micro Instance': 't2.micro',
'Small Instance': 't2.small',
'Medium Instance': 'm3.medium',
'Large Instance': 'm4.large',
'Extra Large Instance': 'm4.xlarge',
'High-CPU Medium Instance': 'c4.large',
'High-CPU Extra Large Instance': 'c4.xlarge',
'High-Memory Extra Large Instance': 'r3.xlarge',
'High-Memory Double Extra Large Instance': 'r3.2xlarge',
'High-Memory Quadruple Extra Large Instance': 'r3.4xlarge',
'Cluster GPU Quadruple Extra Large Instance': 'g2.8xlarge'
}


Expand Down Expand Up @@ -622,57 +620,93 @@ def avail_sizes(call=None):
'ram': '22.5 GiB'
},
},
'High CPU': {
'c1.xlarge': {
'id': 'c1.xlarge',
'cores': '8 (with 2.5 ECUs each)',
'disk': '1680 GiB (4 x 420 GiB)',
'ram': '8 GiB'
'Compute Optimized': {
'c4.large': {
'id': 'c4.large',
'cores': '2',
'disk': 'EBS - 500 Mbps',
'ram': '3.75 GiB'
},
'c4.xlarge': {
'id': 'c4.xlarge',
'cores': '4',
'disk': 'EBS - 750 Mbps',
'ram': '7.5 GiB'
},
'c4.2xlarge': {
'id': 'c4.2xlarge',
'cores': '8',
'disk': 'EBS - 1000 Mbps',
'ram': '15 GiB'
},
'c1.medium': {
'id': 'c1.medium',
'cores': '2 (with 2.5 ECUs each)',
'disk': '340 GiB (1 x 340 GiB)',
'ram': '1.7 GiB'
'c4.4xlarge': {
'id': 'c4.4xlarge',
'cores': '16',
'disk': 'EBS - 2000 Mbps',
'ram': '30 GiB'
},
'c4.8xlarge': {
'id': 'c4.8xlarge',
'cores': '36',
'disk': 'EBS - 4000 Mbps',
'ram': '60 GiB'
},
'c3.large': {
'id': 'c3.large',
'cores': '2 (with 3.5 ECUs each)',
'cores': '2',
'disk': '32 GiB (2 x 16 GiB SSD)',
'ram': '3.75 GiB'
},
'c3.xlarge': {
'id': 'c3.xlarge',
'cores': '4 (with 3.5 ECUs each)',
'cores': '4',
'disk': '80 GiB (2 x 40 GiB SSD)',
'ram': '7.5 GiB'
},
'c3.2xlarge': {
'id': 'c3.2xlarge',
'cores': '8 (with 3.5 ECUs each)',
'cores': '8',
'disk': '160 GiB (2 x 80 GiB SSD)',
'ram': '15 GiB'
},
'c3.4xlarge': {
'id': 'c3.4xlarge',
'cores': '16 (with 3.5 ECUs each)',
'disk': '320 GiB (2 x 80 GiB SSD)',
'cores': '16',
'disk': '320 GiB (2 x 160 GiB SSD)',
'ram': '30 GiB'
},
'c3.8xlarge': {
'id': 'c3.8xlarge',
'cores': '32 (with 3.5 ECUs each)',
'disk': '320 GiB (2 x 160 GiB SSD)',
'cores': '32',
'disk': '640 GiB (2 x 320 GiB SSD)',
'ram': '60 GiB'
}
},
'High I/O': {
'hi1.4xlarge': {
'id': 'hi1.4xlarge',
'cores': '8 (with 4.37 ECUs each)',
'disk': '2 TiB',
'ram': '60.5 GiB'
'i2.xlarge': {
'id': 'i2.xlarge',
'cores': '4',
'disk': 'SSD (1 x 800 GiB)',
'ram': '30.5 GiB'
},
'i2.2xlarge': {
'id': 'i2.2xlarge',
'cores': '8',
'disk': 'SSD (2 x 800 GiB)',
'ram': '61 GiB'
},
'i2.4xlarge': {
'id': 'i2.4xlarge',
'cores': '16',
'disk': 'SSD (4 x 800 GiB)',
'ram': '122 GiB'
},
'i2.8xlarge': {
'id': 'i2.8xlarge',
'cores': '32',
'disk': 'SSD (8 x 800 GiB)',
'ram': '244 GiB'
}
},
'High Memory': {
'm2.2xlarge': {
Expand Down Expand Up @@ -740,51 +774,85 @@ def avail_sizes(call=None):
'ram': '117 GiB'
},
},
'Micro': {
't1.micro': {
'id': 't1.micro',
'General Purpose': {
't2.micro': {
'id': 't2.micro',
'cores': '1',
'disk': 'EBS',
'ram': '615 MiB'
'ram': '1 GiB'
},
},
'Standard': {
'm1.xlarge': {
'id': 'm1.xlarge',
'cores': '4 (with 2 ECUs each)',
'disk': '1680 GB (4 x 420 GiB)',
'ram': '15 GiB'
't2.small': {
'id': 't2.small',
'cores': '1',
'disk': 'EBS',
'ram': '2 GiB'
},
'm1.large': {
'id': 'm1.large',
'cores': '2 (with 2 ECUs each)',
'disk': '840 GiB (2 x 420 GiB)',
'ram': '7.5 GiB'
't2.medium': {
'id': 't2.medium',
'cores': '2',
'disk': 'EBS',
'ram': '4 GiB'
},
'm1.medium': {
'id': 'm1.medium',
'cores': '1',
'disk': '400 GiB',
'ram': '3.75 GiB'
't2.large': {
'id': 't2.large',
'cores': '2',
'disk': 'EBS',
'ram': '8 GiB'
},
'm4.large': {
'id': 'm4.large',
'cores': '2',
'disk': 'EBS - 450 Mbps',
'ram': '8 GiB'
},
'm4.xlarge': {
'id': 'm4.xlarge',
'cores': '4',
'disk': 'EBS - 750 Mbps',
'ram': '16 GiB'
},
'm4.2xlarge': {
'id': 'm4.2xlarge',
'cores': '8',
'disk': 'EBS - 1000 Mbps',
'ram': '32 GiB'
},
'm4.4xlarge': {
'id': 'm4.4xlarge',
'cores': '16',
'disk': 'EBS - 2000 Mbps',
'ram': '64 GiB'
},
'm4.10xlarge': {
'id': 'm4.10xlarge',
'cores': '40',
'disk': 'EBS - 4000 Mbps',
'ram': '160 GiB'
},
'm1.small': {
'id': 'm1.small',
'm3.medium': {
'id': 'm3.medium',
'cores': '1',
'disk': '150 GiB',
'ram': '1.7 GiB'
'disk': 'SSD (1 x 4)',
'ram': '3.75 GiB'
},
'm3.2xlarge': {
'id': 'm3.2xlarge',
'cores': '8 (with 3.25 ECUs each)',
'disk': 'EBS',
'ram': '30 GiB'
'm3.large': {
'id': 'm3.large',
'cores': '2',
'disk': 'SSD (1 x 32)',
'ram': '7.5 GiB'
},
'm3.xlarge': {
'id': 'm3.xlarge',
'cores': '4 (with 3.25 ECUs each)',
'disk': 'EBS',
'cores': '4',
'disk': 'SSD (2 x 40)',
'ram': '15 GiB'
},
'm3.2xlarge': {
'id': 'm3.2xlarge',
'cores': '8',
'disk': 'SSD (2 x 80)',
'ram': '30 GiB'
},
}
}
return sizes
Expand Down
21 changes: 15 additions & 6 deletions salt/cloud/clouds/lxc.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,18 @@ def create(vm_, call=None):
__opts__['internal_lxc_profile'] = __opts__['profile']
del __opts__['profile']

salt.utils.cloud.fire_event(
'event',
'created instance',
'salt/cloud/{0}/created'.format(vm_['name']),
{
'name': vm_['name'],
'profile': vm_['profile'],
'provider': vm_['driver'],
},
transport=__opts__['transport']
)

return ret


Expand Down Expand Up @@ -532,13 +544,10 @@ def get_configured_provider(vm_=None):
{}).get(dalias, {}).get(driver, {})
# in all cases, verify that the linked saltmaster is alive.
if data:
try:
ret = _salt('test.ping', salt_target=data['target'])
if not ret:
raise Exception('error')
return data
except Exception:
ret = _salt('test.ping', salt_target=data['target'])
if not ret:
raise SaltCloudSystemExit(
'Configured provider {0} minion: {1} is unreachable'.format(
__active_provider_name__, data['target']))
return data
return False
5 changes: 2 additions & 3 deletions salt/cloud/clouds/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@ def _authenticate():
'password', get_configured_provider(), __opts__, search_global=False
)
verify_ssl = config.get_cloud_config_value(
'verify_ssl', get_configured_provider(), __opts__, search_global=False
'verify_ssl', get_configured_provider(), __opts__,
default=True, search_global=False
)
if verify_ssl is None:
verify_ssl = True

connect_data = {'username': username, 'password': passwd}
full_url = 'https://{0}:8006/api2/json/access/ticket'.format(url)
Expand Down
Loading

0 comments on commit c4c889f

Please sign in to comment.