Giter Site home page Giter Site logo

salt-contrib's Introduction

Salt Contrib

The Salt Contrib is a destination for modules developed by the community. Since Salt modules are nearly infinite in application not all of the modules developed will be shipped with the main salt application. Salt Contrib will hold modules that can be cleanly added to any of the modular components of Salt. This will also act as a gateway for new module development, generally it will be asked that pull requests for new modules be made against the salt-contrib git repo.

Development

https://travis-ci.org/tf198/salt-contrib.png?branch=develop

You can symlink your salt-contrib against a development environment and run the tests against it.

All relevant files will be symlinked to the appropriate location in the target environment, so you can modify linked files and test without having to copy files back and forward. Running salt-contrib/link_contrib.py salt -u will remove all links leaving the salt repo clean.

The contrib.tests target runs only the tests from salt-contrib. A travis config is also included which will run the contrib tests if you enable it.

$ git clone git://github.com/saltstack/salt.git
$ git clone [email protected]:<me>/salt-contrib.git

$ salt-contrib/link_contrib.py salt

$ salt/tests/runtests.py -n contrib.tests -v

You can also link against a state folder so the modules are pushed out to clients via _modules, _states etc

$ salt-contrib/link_contrib.py /srv/salt

For grains, simply make a _grains folder in /srv/salt. Then run sync_grains.

$ saltutil.sync_grains

salt-contrib's People

Contributors

akatrevorjay avatar aphor avatar arif-ali avatar blambert555 avatar cedwards avatar cro avatar daemonthread avatar dwoz avatar emilisto avatar evgenysub avatar gtmanfred avatar h4ck3rm1k3 avatar ihrwein avatar jfindlay avatar kjkuan avatar kmshultz avatar m03 avatar mafrosis avatar mgwilliams avatar nmadhok avatar pentabular avatar ranl avatar s0undt3ch avatar sharan-monikantan avatar techhat avatar terminalmage avatar tf198 avatar thatch45 avatar utahdave avatar whiteinge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salt-contrib's Issues

ec2_tags.py prints stacktrace when run outside of EC2

I am not really a python programmer but this is crazy to me, and my coworker who does claim to be a snake lord was confused too.

Basically, ec2_tags.py raises an exception that is uncatchable unless you import urllib2.exceptions.URLError. The even weirder thing is that the exception is catchable when the code is run directly from python; only when run via salt does this issue manifest itself.

This patch (not a PR because I'm not confident in it enough) fixed it, but I have no idea why:

diff --git a/salt/_grains/ec2_tags.py b/salt/_grains/ec2_tags.py
index 1f03d99..0b4ab8d 100644
--- a/salt/_grains/ec2_tags.py
+++ b/salt/_grains/ec2_tags.py
@@ -53,6 +53,7 @@ from distutils.version import StrictVersion
 import boto.ec2
 import boto.utils
 import salt.log
+import urllib2.exceptions.URLError

 log = logging.getLogger(__name__)

Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? n
@@ -68,9 +69,11 @@ def _get_instance_info():


 def _on_ec2():
-    m = boto.utils.get_instance_metadata(timeout=0.1, num_retries=1)
-    return bool(m)
-
+    try:
+        m = boto.utils.get_instance_metadata(timeout=0.1, num_retries=1)
+        return bool(m)
+    except:
+        return False

 def _get_credentials():
     creds = AWS_CREDENTIALS.copy()

ec2_tags.py does not us-gov-east-1

ec2_tags.py still uses the legacy 'boto' interface, which has been discontinued for some time now.

This means that it doesn't work with the us-gov-east-1 region, and likely other new regions are excluded, too.

The problematic line is:

conn = boto.ec2.connect_to_region(
            region,
            aws_access_key_id=credentials['access_key'],
            aws_secret_access_key=credentials['secret_key'],
        )

Testing with a machine that can access both govcloud regions results in:

>>> print(boto.ec2.connect_to_region('us-gov-east-1'))
None
>>> print(boto.ec2.connect_to_region('us-gov-west-1'))
EC2Connection:ec2.us-gov-west-1.amazonaws.com

While this is really a boto problem, that library has been discontinued. This software should probably be rewritten to use boto3.

ec2_info.py failed to return instance-id on the new C5 instance types

It stopped working because AWS does not consider http://169.254.169.254/latest/meta-data/instance-id/xxx as a valid url any more for the new C5 instance types.
C5:

[ip-*-*-*-* ~]$ python ec2_info.py
...
{'instance-id': None}
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-type
c5.18xlarge
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-id
i-0162ca76e2dd3bfe6
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-id/xxx
[centos@ip-*-*-*-* ~]$

M4:

[ip-*-*-*-* ~]$ python ec2_info.py
...
{'instance-id': 'i-02d9fd190d928ad57'}
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-type
m4.xlarge
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-id
i-02d9fd190d928ad57
[centos@ip-*-*-*-* ~]$ curl -s http://169.254.169.254/latest/meta-data/instance-id/xxx
i-02d9fd190d928ad57
[centos@ip-*-*-*-* ~]$

@qnu

tags with a comma separated list of values ...

ec2_tags.py - There doesn't seem to be a way to accommodate this ... we have some tags that are in the form "services:http,https,foo,bar" - I can't grain match unless I put that whole string in.

link_contrib.py does not link the right files

After running the salt-contrib/link_contrib.py /srv/salt, which does not include the source directory. For example, the right source of the symbol file("/srv/salt/_states/apt_repository.py") is "salt-contrib/states/apt_repository.py", but the it points to "/root/states/apt_repository.py"

local variable 'roles' referenced before assignment

2018-07-19 07:10:05,122 [salt.loader :764 ][CRITICAL][10950] Failed to load grains defined in grain file ec2_tag_roles.ec2_roles in function <function ec2_roles at 0x29ce0c8>, error:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/loader.py", line 757, in grains
ret = funcskey
File "/var/cache/salt/minion/extmods/grains/ec2_tags.py", line 50, in ec2_roles
import os
UnboundLocalError: local variable 'roles' referenced before assignment

Is thos issue only with me ?

Latest apt_repository state fails with runtime TypeError on salt 0.13.2

This is my ppa/salt.sls file:

ppa.salt:
    apt_repository.ubuntu_ppa:
        - user: saltstack
        - name: salt
        - key_id: 0E27C0A6

This is the stack trace I get when I try to run it:

    State: - apt_repository
    Name:      ppa
    Function:  ubuntu_ppa
        Result:    False
        Comment:   An exception occured in this state: Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/salt/state.py", line 1205, in call
    ret = self.states[cdata['full']](*cdata['args'])
  File "/var/cache/salt/minion/extmods/states/apt_repository.py", line 175, in ubuntu_ppa
    'keyserver.ubuntu.com', True, filename)
  File "/var/cache/salt/minion/extmods/states/apt_repository.py", line 93, in present
    text = [' '.join(['deb'] + line_content)]
TypeError: sequence item 2: expected string, dict found

What might this be, @bclermont?

issue with ec2_info.py and aws maintenance metadata

We encountered an issue where ec2_info.py is generating critical errors as it steps through the metadata URL's.

Code is able to extract all other metadata, but dies on maintenance events if it is blank.
url : /latest/meta-data/events/maintenance/
I'm assuming it is due to the response time. I added two lines to _call_aws(url) to print the URL variable contents before establishing a connection.

` .....
PRINTING URL ----- it should be below
/latest/meta-data/events/maintenance/

.....
[CRITICAL] Failed to load grains defined in grain file ec2_info.ec2_info in function <function ec2_info at 0x7f4fff6326e0>, error:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 726, in grains
ret = fun()
File "/var/cache/salt/minion/extmods/grains/ec2_info.py", line 157, in ec2_info
grains.update(_get_ec2_hostinfo())
File "/var/cache/salt/minion/extmods/grains/ec2_info.py", line 73, in _get_ec2_hostinfo
d[_dash_to_snake_case(line[:-1])] = _get_ec2_hostinfo(path + line)
File "/var/cache/salt/minion/extmods/grains/ec2_info.py", line 73, in _get_ec2_hostinfo
d[_dash_to_snake_case(line[:-1])] = _get_ec2_hostinfo(path + line)
File "/var/cache/salt/minion/extmods/grains/ec2_info.py", line 50, in _get_ec2_hostinfo
if line[-1] != "/":
IndexError: string index out of range
`

Curls to these work and confirm maintenance is just blank:

`root@schmoe02:/var/cache/salt/minion/extmods/grains# curl http://169.254.169.254/latest/meta-data/events/
maintenance/

root@schmoe02:/var/cache/salt/minion/extmods/grains# curl http://169.254.169.254/latest/meta-data/events/maintenance/

root@schmoe02:/var/cache/salt/minion/extmods/grains# curl -Iv http://169.254.169.254/latest/meta-data/events/maintenance/

  • Hostname was NOT found in DNS cache
  • Trying 169.254.169.254...
  • Connected to 169.254.169.254 (169.254.169.254) port 80 (#0)

HEAD /latest/meta-data/events/maintenance/ HTTP/1.1
User-Agent: curl/7.35.0
Host: 169.254.169.254
Accept: /

  • HTTP 1.0, assume close after body
    < HTTP/1.0 200 OK
    HTTP/1.0 200 OK
    < Content-Type: text/plain
    Content-Type: text/plain
    < Accept-Ranges: bytes
    Accept-Ranges: bytes
    < ETag: "3389151415"
    ETag: "3389151415"
    < Last-Modified: Thu, 06 Sep 2018 00:01:50 GMT
    Last-Modified: Thu, 06 Sep 2018 00:01:50 GMT
    < Connection: close
    Connection: close
    < Date: Sat, 08 Sep 2018 12:45:12 GMT
    Date: Sat, 08 Sep 2018 12:45:12 GMT
    < Server: EC2ws
    Server: EC2ws

<

  • Closing connection 0
    `

iis.py in _modules

with the original iis.py module, I could get a error comment while trying to get "physicalPath" of iis site.

errors showing below:

image

I changed few codes in "_resource_get_config" function, and works well for me.

previous code:

def _resource_get_config(resource, name, settings):
    '''
    Returns the configuration of the Resource
    '''

    ret = {}
    for i in settings:
            cmd_ret = __salt__['cmd.run_all']([appcmd, 'list', R.upper(), '/{0}.name:{1}'.format(R.lower(), name), '/text:{0}'.format(i)])
        if cmd_ret['retcode'] != 0:
            log.error('can\'t get "{0}" from {1} "{2}"'.format(i, resource, name))
            return False
        ret[i] = cmd_ret['stdout'].strip()
    return ret

new code:

def _resource_get_config(resource, name, settings):
    '''
    Returns the configuration of the Resource
    '''

    ret = {}
    for i in settings:
        if i == 'physicalPath':
            R  = 'vdir'
            cmd_ret = __salt__['cmd.run_all']([appcmd, 'list', R.upper(), '/vdir.name:{0}/'.format(name), '/text:{0}'.format(i)])
        else:
            R = resource
            cmd_ret = __salt__['cmd.run_all']([appcmd, 'list', R.upper(), '/{0}.name:{1}'.format(R.lower(), name), '/text:{0}'.format(i)])
        if cmd_ret['retcode'] != 0:
            log.error('can\'t get "{0}" from {1} "{2}"'.format(i, resource, name))
            return False
        ret[i] = cmd_ret['stdout'].strip()
    return ret

please kindly consider to modify the iis.py code in module function if this do work well, thanks

facter grain facter_blockdevices: should be parsed to a list

The facter grains facter_blockdevices, facter_filesystems and facter_interfaces would be much more useful if the comma separated values would be parsed to a list :)

Currently they are strings where the values are separated by comma only:

    facter_blockdevices:
        sda,sr0
    facter_interfaces:
        eth0,lo,tun0
    facter_filesystems:
        btrfs,ext2,ext3,ext4

IIS configuration fails

I am trying to configure IIS on Windows 2012R2 x64 via salt. I downloaded and linked salt-contrib. Now when I run:

salt-call --local iis.apppool_list

I am getting the following error

[Error 2] The system cannot find the file specified

But when I am running

salt-call --local cmd.run "C:\Windows\system32\inetsrv\appcmd.exe list APPPOOL"

It displays the configured apppools.

feature_refreshurls

saltstack_salt-contrib/states/smx.py:34: [E0602(undefined-variable), _get_latest_feature_version] Undefined variable 'feature_refreshurls'
saltstack_salt-contrib/states/smx.py:36: [E0602(undefined-variable), _get_latest_feature_version] Undefined variable '_parse_list'
saltstack_salt-contrib/states/smx.py:36: [E0602(undefined-variable), _get_latest_feature_version] Undefined variable 'run'

is_file_hidden

saltstack_salt-contrib/modules/wireunlurk/wireunlurk.py:162: [E0602(undefined-variable), _is_app_infected] Undefined variable 'is_file_hidden'
saltstack_salt-contrib/modules/wireunlurk/wireunlurk.py:167: [E0602(undefined-variable), _is_app_infected] Undefined variable 'is_file_hidden'

ec2_info.py doesnt show publickey (404)

Doesnt show public_keys correct. All other data look fine tho.

$ salt-call grains.items
...
        public_keys:
            ----------
            0=foreman_6ab0adbc7_fb3c_4b95_9c65_e83e1e3bc6d3:
                <?xml version="1.0" encoding="iso-8859-1"?>
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
                 <head>
                  <title>404 - Not Found</title>
                 </head>
                 <body>
                  <h1>404 - Not Found</h1>
                 </body>
                </html>

renaming grains/external_ip.py?

Wouldn't it make more sense as "outbound_ip.py"? Most people think of "external ip" as something belonging to the minion itself.

Undefined variable 'updates'

saltstack_salt-contrib/modules/win_update.py:300: [E0602(undefined-variable), PyWinUpdater.GetDownloadResults] Undefined variable 'updates'
saltstack_salt-contrib/modules/win_update.py:304: [E0602(undefined-variable), PyWinUpdater.GetDownloadResults] Undefined variable 'updates'

iis.py - get_data_from_pfx and cert_import_pfx fail on empty password

get_data_from_pfx and cert_import_pfx in the iis execution module, and pfx_present from the state module all fail when attempting to act against a PFX file that was encrypted with an empty password.

When testing the example PFX from the local machine:

C:\Users\Administrator\Downloads>certutil -p "" -dump C:\Company\Certs\mvcforum.pfx
================ Certificate 0 ================
================ Begin Nesting Level 1 ================
Element 0:
Serial Number: d3edc3c61359a9fe
Issuer: CN=mvcforum, O=TestDomain, L=Los Angeles, S=California, C=US
 NotBefore: 8/14/2015 7:38 PM
 NotAfter: 8/11/2025 7:38 PM
Subject: CN=mvcforum, O=TestDomain, L=Los Angeles, S=California, C=US
Signature matches Public Key
Root Certificate: Subject matches Issuer
Cert Hash(sha1): 9b bb 0e 37 ff ad ba 0d 79 53 9f c0 ae b5 1a 3d 59 63 bd b4
----------------  End Nesting Level 1  ----------------
  Provider = Microsoft Enhanced Cryptographic Provider v1.0
Encryption test passed
CertUtil: -dump command completed successfully.

A test of iis.get_data_from_pfx:

m03@salt01:/salt/state/web$ sudo salt 'win2012r2' file.file_exists 'C:\Company\Certs\mvcforum.pfx'
win2012r2:
    True
m03@salt01:/salt/state/web$ sudo salt 'win2012r2' iis.get_data_from_pfx 'C:\Company\Certs\mvcforum.pfx' None
win2012r2:
    False
m03@salt01:/salt/state/web$ sudo salt 'win2012r2' iis.get_data_from_pfx 'C:\Company\Certs\mvcforum.pfx' ''
win2012r2:
    False

Relevant entries from the debug log:

[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20150831095631497642', 'tgt': 'win2012r2', 'ret': '', 'user': '
sudo_m03', 'arg': ['C:\\Company\\Certs\\mvcforum.pfx', None], 'fun': 'iis.get_data_from_pfx'}
[INFO    ] Starting a new job with PID 2728
[INFO    ] Executing command 'certutil -p None -dump C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -p None -dump C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -2147024810
[ERROR   ] stdout: Cannot decode object: The specified network password is not correct. 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: -dump command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could get data from pfx bundle "C:\Company\Certs\mvcforum.pfx", password: "None"
[INFO    ] Returning information for job: 20150831095631497642
[DEBUG   ] Re-using SAuth for ('c:\\salt\\conf\\pki\\minion', 'win2012r2', 'tcp://192.168.1.104:4506')
[INFO    ] User sudo_m03 Executing command iis.get_data_from_pfx with jid 20150831095636444156
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20150831095636444156', 'tgt': 'win2012r2', 'ret': '', 'user': '
sudo_m03', 'arg': ['C:\\Company\\Certs\\mvcforum.pfx', ''], 'fun': 'iis.get_data_from_pfx'}
[INFO    ] Starting a new job with PID 2728
[INFO    ] Executing command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -2147024810
[ERROR   ] stdout: Cannot decode object: The specified network password is not correct. 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: -dump command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could get data from pfx bundle "C:\Company\Certs\mvcforum.pfx", password: ""

A test of iis.cert_import_pfx:

m03@salt01:/salt/state/winrepo$ sudo salt 'win2012r2' iis.cert_import_pfx 'C:\Company\Certs\mvcforum.pfx' None
win2012r2:
    False
m03@salt01:/salt/state/winrepo$ sudo salt 'win2012r2' iis.cert_import_pfx 'C:\Company\Certs\mvcforum.pfx' ''
win2012r2:
    False

Relevant entries from the debug log:

[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20150831094816671972', 'tgt': 'win2012r2', 'ret': '', 'user': '
sudo_m03', 'arg': ['C:\\Company\\Certs\\mvcforum.pfx', None], 'fun': 'iis.cert_import_pfx'}
[INFO    ] Starting a new job with PID 2728
[INFO    ] Executing command 'certutil -f -p None -importpfx C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -f -p None -importpfx C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -214702481
0
[ERROR   ] stdout: CertUtil: -importPFX command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could not import pfx bundle "C:\Company\Certs\mvcforum.pfx"
[INFO    ] Returning information for job: 20150831094816671972
[DEBUG   ] Re-using SAuth for ('c:\\salt\\conf\\pki\\minion', 'win2012r2', 'tcp://192.168.1.104:4506')
[INFO    ] User sudo_m03 Executing command iis.cert_import_pfx with jid 20150831094820116728
[DEBUG   ] Command details {'tgt_type': 'glob', 'jid': '20150831094820116728', 'tgt': 'win2012r2', 'ret': '', 'user': '
sudo_m03', 'arg': ['C:\\Company\\Certs\\mvcforum.pfx', ''], 'fun': 'iis.cert_import_pfx'}
[INFO    ] Starting a new job with PID 2728
[INFO    ] Executing command 'certutil -f -p  -importpfx C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -f -p  -importpfx C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -2147024810
[ERROR   ] stdout: Cannot decode object: The specified network password is not correct. 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: -dump command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could not import pfx bundle "C:\Company\Certs\mvcforum.pfx"

State file:

import-cert-mvcforum-test1:
  iis.pfx_present:
    - name: 'C:\Company\Certs\mvcforum.pfx'

import-cert-mvcforum-test2:
  iis.pfx_present:
    - name: 'C:\Company\Certs\mvcforum.pfx'
    - password: ''

Results:

m03@salt01:/salt/state/web$ sudo salt 'win2012r2' state.sls web.windows.iis.cert_test
win2012r2:
----------
          ID: import-cert-mvcforum-test1
    Function: iis.pfx_present
        Name: C:\Company\Certs\mvcforum.pfx
      Result: False
     Comment: can't get the meta data from the PFX certificate, pass:"", pfx_data: False
     Started: 10:06:58.422000
    Duration: 31.0 ms
     Changes:
----------
          ID: import-cert-mvcforum-test2
    Function: iis.pfx_present
        Name: C:\Company\Certs\mvcforum.pfx
      Result: False
     Comment: can't get the meta data from the PFX certificate, pass:"", pfx_data: False
     Started: 10:06:58.453000
    Duration: 47.0 ms
     Changes:

Summary
------------
Succeeded: 0
Failed:    2
------------
Total states run:     2

Relevant entries from the debug log:

[INFO    ] Executing state iis.pfx_present for C:\Company\Certs\mvcforum.pfx
[INFO    ] Executing command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -2147024810
[ERROR   ] stdout: Cannot decode object: The specified network password is not correct. 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: -dump command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could get data from pfx bundle "C:\Company\Certs\mvcforum.pfx", password: ""
[DEBUG   ] False
[ERROR   ] can't get the meta data from the PFX certificate, pass:"", pfx_data: False
[INFO    ] Completed state [C:\Company\Certs\mvcforum.pfx] at time 10:06:58.453000
[DEBUG   ] Could not LazyLoad iis.mod_init
[INFO    ] Running state [C:\Company\Certs\mvcforum.pfx] at time 10:06:58.453000
[INFO    ] Executing state iis.pfx_present for C:\Company\Certs\mvcforum.pfx
[INFO    ] Executing command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' in directory 'C:\\Users\\Administrator'
[ERROR   ] Command 'certutil -p  -dump C:\\Company\\Certs\\mvcforum.pfx' failed with return code: -2147024810
[ERROR   ] stdout: Cannot decode object: The specified network password is not correct. 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: -dump command FAILED: 0x80070056 (WIN32: 86 ERROR_INVALID_PASSWORD)
CertUtil: The specified network password is not correct.
[ERROR   ] retcode: -2147024810
[ERROR   ] could get data from pfx bundle "C:\Company\Certs\mvcforum.pfx", password: ""
[DEBUG   ] False
[ERROR   ] can't get the meta data from the PFX certificate, pass:"", pfx_data: False
[INFO    ] Completed state [C:\Company\Certs\mvcforum.pfx] at time 10:06:58.500000
[DEBUG   ] File c:\salt\var\cache\salt\minion\accumulator\130177904 does not exist, no need to cleanup.
[INFO    ] Executing command ['attrib', '-R', 'c:\\salt\\var\\cache\\salt\\minion\\sls.p'] in directory 'C:\\Users\\Administrator'
[DEBUG   ] output:

ec2_tags.py causes traceback

This traceback prevents all minions from doing anything. I had to delete /var/cache/salt/minion/extmod/grains/ec2_tags.py* from every instance with ssh. The AWS credentials are defined inside the script.

I am running salt 0.16.0-1precise from the PPA on Ubuntu 12.04.

$ sudo salt-call grains.get tags 
[INFO    ] Configuration file path: /etc/salt/minion
[WARNING ] The function 'grains()' defined in '/usr/lib/pymodules/python2.7/salt/loader.py' is not yet using the new 'default_path' argument to `salt.config.load_config()`. As such, the 'SALT_MINION_CONFIG' environment variable will be ignored
Traceback (most recent call last):
  File "/usr/bin/salt-call", line 11, in <module>
    salt_call()
  File "/usr/lib/pymodules/python2.7/salt/scripts.py", line 76, in salt_call
    client.run()
  File "/usr/lib/pymodules/python2.7/salt/cli/__init__.py", line 255, in run
    caller = salt.cli.caller.Caller(self.config)
  File "/usr/lib/pymodules/python2.7/salt/cli/caller.py", line 47, in __init__
    self.minion = salt.minion.SMinion(opts)
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 205, in __init__
    self.gen_modules()
  File "/usr/lib/pymodules/python2.7/salt/minion.py", line 217, in gen_modules
    self.opts['environment'],
  File "/usr/lib/pymodules/python2.7/salt/pillar/__init__.py", line 57, in compile_pillar
    ret = self.sreq.send('aes', self.auth.crypticle.dumps(load), 3, 7200)
  File "/usr/lib/pymodules/python2.7/salt/crypt.py", line 407, in dumps
    return self.encrypt(self.PICKLE_PAD + self.serial.dumps(obj))
  File "/usr/lib/pymodules/python2.7/salt/payload.py", line 136, in dumps
    return msgpack.dumps(msg)
  File "_msgpack.pyx", line 169, in msgpack._msgpack.packb (msgpack/_msgpack.c:2384)
  File "_msgpack.pyx", line 153, in msgpack._msgpack.Packer.pack (msgpack/_msgpack.c:2020)
  File "_msgpack.pyx", line 136, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1761)
  File "_msgpack.pyx", line 136, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1761)
  File "_msgpack.pyx", line 130, in msgpack._msgpack.Packer._pack (msgpack/_msgpack.c:1611)
TypeError: Expected dict, got TagSet

Running ec2_tags.py on the command line looks great:
$ python /tmp/ec2_tags.py
{'ec2_tags': {u'Name': u'salt'}}

pyobjects renderer: using octal mode specification for File.* states fails

When building a File.managed state, if the mode is specified in octal, the permissions are completely fouled up.

Example:

    File.managed("/etc/apt/apt.conf.d/95vagrant-caching",
             contents='Acquire { Retries "0"; HTTP { Proxy "http://10.0.0.1:8000"; }; };',
             user="root", group="root", mode=0644)

produces:

vagrant@www-vagrant-dev:~$ ls -la /etc/apt/apt.conf.d/95vagrant-caching
-r---w---- 1 root root 72 Feb 26 18:27 /etc/apt/apt.conf.d/95vagrant-caching

The workaround is to specify it in decimal form (i.e. mode=644), or in a string (i.e. mode='0644')

License

Hey Y'all,

What licence is this repo? GPL?

Thanks,

Andrew

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.