Skip to content

Commit

Permalink
Merge pull request #2 from jlayze/develop
Browse files Browse the repository at this point in the history
Merge latest develop branch to patch-4
  • Loading branch information
jlayze authored Jul 5, 2017
2 parents 6566f10 + 11777e7 commit f1e7f54
Show file tree
Hide file tree
Showing 31 changed files with 1,064 additions and 226 deletions.
2 changes: 1 addition & 1 deletion doc/topics/cloud/aws.rst
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ EC2 API or AWS Console.
By default, the spot instance type is set to 'one-time', meaning it will
be launched and, if it's ever terminated for whatever reason, it will not
be recreated. If you would like your spot instances to be relaunched after
a termination (by your or AWS), set the ``type`` to 'persistent'.
a termination (by you or AWS), set the ``type`` to 'persistent'.

NOTE: Spot instances are a great way to save a bit of money, but you do
run the risk of losing your spot instances if the current price for the
Expand Down
2 changes: 1 addition & 1 deletion doc/topics/cloud/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Using the example configuration above:
.. note::

Salt Cloud provider configurations within ``/etc/cloud.provider.d/ should not
Salt Cloud provider configurations within ``/etc/cloud.provider.d/`` should not
specify the ``providers`` starting key.

It is also possible to have multiple cloud configuration blocks within the same alias block.
Expand Down
16 changes: 12 additions & 4 deletions salt/cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,9 @@ def create(self, provider, names, **kwargs):
.. code-block:: python
client.create(names=['myinstance'], provider='my-ec2-config',
kwargs={'image': 'ami-1624987f', 'size': 't1.micro',
'ssh_username': 'ec2-user', 'securitygroup': 'default',
'delvol_on_destroy': True})
client.create(provider='my-ec2-config', names=['myinstance'],
image='ami-1624987f', size='t1.micro', ssh_username='ec2-user',
securitygroup='default', delvol_on_destroy=True)
'''
mapper = salt.cloud.Map(self._opts_defaults())
providers = self.opts['providers']
Expand All @@ -399,7 +398,16 @@ def create(self, provider, names, **kwargs):
vm_ = kwargs.copy()
vm_['name'] = name
vm_['driver'] = provider

# This function doesn't require a profile, but many cloud drivers
# check for profile information (which includes the provider key) to
# help with config file debugging and setting up instances. Setting
# the profile and provider defaults here avoids errors in other
# cloud functions relying on these keys. See SaltStack Issue #41971
# and PR #38166 for more information.
vm_['profile'] = None
vm_['provider'] = provider

ret[name] = salt.utils.simple_types_filter(
mapper.create(vm_))
return ret
Expand Down
71 changes: 54 additions & 17 deletions salt/modules/dockermod.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@
username: foo
password: s3cr3t
To login to the configured registries, use the :py:func:`dockerng.login
<salt.modules.dockerng.login>` function. This only needs to be done once for a
To login to the configured registries, use the :py:func:`docker.login
<salt.modules.dockermod.login>` function. This only needs to be done once for a
given registry, and it will store/update the credentials in
``~/.docker/config.json``.
.. note::
For Salt releases before 2016.3.7 and 2016.11.4, :py:func:`dockerng.login
<salt.modules.dockerng.login>` is not available. Instead, Salt will try to
For Salt releases before 2016.3.7 and 2016.11.4, :py:func:`docker.login
<salt.modules.dockermod.login>` is not available. Instead, Salt will try to
authenticate using each of your configured registries for each push/pull,
behavior which is not correct and has been resolved in newer releases.
Expand Down Expand Up @@ -927,9 +927,9 @@ def login(*registries):
.. code-block:: bash
salt myminion dockerng.login
salt myminion dockerng.login hub
salt myminion dockerng.login hub https://mydomain.tld/registry/
salt myminion docker.login
salt myminion docker.login hub
salt myminion docker.login hub https://mydomain.tld/registry/
'''
# NOTE: This function uses the "docker login" CLI command so that login
# information is added to the config.json, since docker-py isn't designed
Expand Down Expand Up @@ -1867,19 +1867,49 @@ def create(image,
binds
Files/directories to bind mount. Each bind mount should be passed in
the format ``<host_path>:<container_path>:<read_only>``, where
``<read_only>`` is one of ``rw`` (for read-write access) or ``ro`` (for
read-only access). Optionally, the read-only information can be left
off the end and the bind mount will be assumed to be read-write.
one of the following formats:
- ``<host_path>:<container_path>`` - ``host_path`` is mounted within
the container as ``container_path`` with read-write access.
- ``<host_path>:<container_path>:<selinux_context>`` - ``host_path`` is
mounted within the container as ``container_path`` with read-write
access. Additionally, the specified selinux context will be set
within the container.
- ``<host_path>:<container_path>:<read_only>`` - ``host_path`` is
mounted within the container as ``container_path``, with the
read-only or read-write setting explicitly defined.
- ``<host_path>:<container_path>:<read_only>,<selinux_context>`` -
``host_path`` is mounted within the container as ``container_path``,
with the read-only or read-write setting explicitly defined.
Additionally, the specified selinux context will be set within the
container.
``<read_only>`` can be either ``ro`` for read-write access, or ``ro``
for read-only access. When omitted, it is assumed to be read-write.
``<selinux_context>`` can be ``z`` if the volume is shared between
multiple containers, or ``Z`` if the volume should be private.
.. note::
When both ``<read_only>`` and ``<selinux_context>`` are specified,
there must be a comma before ``<selinux_context>``.
Binds can be expressed as a comma-separated list or a Python list,
however in cases where both ro/rw and an selinux context are specified,
the binds *must* be specified as a Python list.
Examples:
- ``binds=/srv/www:/var/www:ro``
- ``binds=/srv/www:/var/www:rw``
- ``binds=/srv/www:/var/www``
- ``binds="['/srv/www:/var/www:ro,Z']"``
- ``binds="['/srv/www:/var/www:rw,Z']"``
- ``binds=/srv/www:/var/www:Z``
.. note::
The second and third examples above are equivalent.
The second and third examples above are equivalent to each other,
as are the last two examples.
blkio_weight
Block IO weight (relative weight), accepts a weight value between 10
Expand All @@ -1898,15 +1928,20 @@ def create(image,
comma-separated list or a Python list. Requires Docker 1.2.0 or
newer.
Example: ``cap_add=SYS_ADMIN,MKNOD``, ``cap_add="[SYS_ADMIN, MKNOD]"``
Examples:
- ``cap_add=SYS_ADMIN,MKNOD``
- ``cap_add="[SYS_ADMIN, MKNOD]"``
cap_drop
List of capabilities to drop within the container. Can be passed as a
comma-separated string or a Python list. Requires Docker 1.2.0 or
newer.
Example: ``cap_drop=SYS_ADMIN,MKNOD``,
``cap_drop="[SYS_ADMIN, MKNOD]"``
Examples:
- ``cap_drop=SYS_ADMIN,MKNOD``,
- ``cap_drop="[SYS_ADMIN, MKNOD]"``
command (or *cmd*)
Command to run in the container
Expand Down Expand Up @@ -2030,8 +2065,10 @@ def create(image,
List of DNS search domains. Can be passed as a comma-separated list
or a Python list.
Example: ``dns_search=foo1.domain.tld,foo2.domain.tld`` or
``dns_search="[foo1.domain.tld, foo2.domain.tld]"``
Examples:
- ``dns_search=foo1.domain.tld,foo2.domain.tld``
- ``dns_search="[foo1.domain.tld, foo2.domain.tld]"``
domainname
Set custom DNS search domains
Expand Down
Loading

0 comments on commit f1e7f54

Please sign in to comment.