mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge branch '2014.7' into develop
This commit is contained in:
commit
a00e84b556
@ -46,8 +46,15 @@ def __virtual__():
|
||||
def cert_base_path(cacert_path=None):
|
||||
'''
|
||||
Return the base path for certs from CLI or from options
|
||||
|
||||
cacert_path
|
||||
absolute path to ca certificates root directory
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' tls.cert_base_path
|
||||
'''
|
||||
if not cacert_path:
|
||||
cacert_path = __salt__['config.option']('ca.contextual_cert_base_path')
|
||||
@ -67,6 +74,12 @@ def set_ca_path(cacert_path):
|
||||
'''
|
||||
If wanted, store the aforementioned cacert_path in context
|
||||
to be used as the basepath for further operations
|
||||
|
||||
CLI Example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
salt '*' tls.set_ca_path /etc/certs
|
||||
'''
|
||||
if cacert_path:
|
||||
__opts__['ca.contextual_cert_base_path'] = cacert_path
|
||||
|
@ -17,7 +17,7 @@ This renderer requires the python-gnupg package. Be careful to install the
|
||||
To set things up, you will first need to generate a keypair. On your master,
|
||||
run:
|
||||
|
||||
.. code-block: bash
|
||||
.. code-block:: bash
|
||||
|
||||
# gpg --gen-key --homedir /etc/salt/gpgkeys
|
||||
|
||||
@ -26,33 +26,33 @@ for your application. Be sure to back up your gpg directory someplace safe!
|
||||
|
||||
To retrieve the public key:
|
||||
|
||||
.. code-block: bash
|
||||
.. code-block:: bash
|
||||
|
||||
# gpg --armor --homedir /etc/salt/gpgkeys --armor --export <KEY-NAME> \
|
||||
> exported_pubkey.gpg
|
||||
|
||||
Now, to encrypt secrets, copy the public key to your local machine and run:
|
||||
|
||||
.. code-block: bash
|
||||
.. code-block:: bash
|
||||
|
||||
$ gpg --import exported_pubkey.gpg
|
||||
|
||||
To generate a cipher from a secret:
|
||||
|
||||
.. code-block: bash
|
||||
.. code-block:: bash
|
||||
|
||||
$ echo -n"supersecret" | gpg --homedir --armor --encrypt -r <KEY-name>
|
||||
|
||||
Set up the renderer on your master by adding something like this line to your
|
||||
config:
|
||||
|
||||
.. code-block: yaml
|
||||
.. code-block:: yaml
|
||||
|
||||
renderer: jinja | yaml | gpg
|
||||
|
||||
Now you can include your ciphers in your pillar data like so:
|
||||
|
||||
.. code-block: yaml
|
||||
.. code-block:: yaml
|
||||
|
||||
a-secret: |
|
||||
-----BEGIN PGP MESSAGE-----
|
||||
|
@ -37,8 +37,9 @@ _PKG_TARGETS_32 = {
|
||||
# Test packages with dot in pkg name
|
||||
# (https://github.com/saltstack/salt/issues/8614)
|
||||
_PKG_TARGETS_DOT = {
|
||||
'RedHat': { '6': 'tomcat6-el-2.1-api',
|
||||
'7': 'tomcat-el-2.2-api' }
|
||||
'RedHat': {'5': 'python-migrate0.5',
|
||||
'6': 'tomcat6-el-2.1-api',
|
||||
'7': 'tomcat-el-2.2-api'}
|
||||
}
|
||||
|
||||
|
||||
@ -267,7 +268,10 @@ class PkgTest(integration.ModuleCase,
|
||||
'''
|
||||
os_family = grains.get('os_family', '')
|
||||
os_version = grains.get('osmajorrelease', [''])[0]
|
||||
target = _PKG_TARGETS_DOT.get(os_family, '').get(os_version, '')
|
||||
if os_family in _PKG_TARGETS_DOT:
|
||||
target = _PKG_TARGETS_DOT.get(os_family, '').get(os_version, '')
|
||||
else:
|
||||
target = None
|
||||
if target:
|
||||
ret = self.run_state('pkg.installed', name=target)
|
||||
self.assertSaltTrueReturn(ret)
|
||||
|
Loading…
Reference in New Issue
Block a user