salt icon indicating copy to clipboard operation
salt copied to clipboard

salt-ssh pkgrepo.managed doesn't work

Open jeffreyctang opened this issue 11 years ago • 2 comments

This is with 2015.8. I have the following state file: ossec-client.sls:

ossec-client:
  pkgrepo.managed:
    - humanname: OSSEC Client
    - name: deb http://ossec.wazuh.com/repos/apt/ubuntu trusty main
    - key_url: http://ossec.wazuh.com/repos/apt/conf/ossec-key.gpg.key
    - file: /etc/apt/sources.list

When I run via salt-ssh I get:

ip-10-0-5-25.ec2.internal_ids-client_testing:
----------
          ID: ossec-client
    Function: pkgrepo.managed
        Name: deb http://ossec.wazuh.com/repos/apt/ubuntu trusty main
      Result: False
     Comment: Failed to configure repo 'deb http://ossec.wazuh.com/repos/apt/ubuntu trusty main': 'text'
     Started: 21:45:56.072764
    Duration: 65.991 ms
     Changes:

When I run the same state locally on a minion with salt-call --local, it works.

salt-ssh is 2015.8.0 installed from a clone of the git repo.

salt-call is 2015.8.1 installed from repo.saltstack.com

jeffreyctang avatar Nov 02 '15 21:11 jeffreyctang

I've narrowed it down a bit more fileclient.py line 612 makes a salt.util.http.query call, which returns:

{'handle': HTTPResponse(_body=None,buffer=<_io.BytesIO object at 0x7f53bec5b830>,
    code=200,
    effective_url='http://ossec.wazuh.com/repos/apt/conf/ossec-key.gpg.key',
    error=None,
    headers={'Content-Length': '1735',
        'Accept-Ranges': 'bytes',
        'Server': 'Apache/2.4.7 (Ubuntu)',
        'Last-Modified': 'Mon,
        02 Dec 2013 02:31:19 GMT',
        'Connection': 'close',
        'Etag': '"6c7-4ec83f9a0cb87"',
        'Date': 'Mon,
        02 Nov 2015 22:18:11 GMT',
        'Content-Type': 'application/pgp-keys'},
        reason='OK',
        request=<tornado.httpclient.HTTPRequest object at 0x7f53bcd0d190>,
        request_time=0.014953851699829102,
        time_info={})}

The subsequent code is looking for the key 'text', which doesn't seem to be in this object.

jeffreyctang avatar Nov 02 '15 22:11 jeffreyctang

Seems to actually be fixed in 2015.8.1

jeffreyctang avatar Nov 02 '15 22:11 jeffreyctang