mbonato
mbonato

Reputation: 1519

SaltStack: dockerng is not available

I'm quite new to SaltStack. I've setup a salt-master and a salt-minion (via salt-cloud on my ESXi). It works fine so far. However, I cannot get dockerng to run any function on my minion. It always returns 'dockerng.xxxx' is not available:

# salt '*' test.ping
minion1:
    True

$ salt '*' dockerng.version
minion1:
    'dockerng.version' is not available.

However, When I call the same with salt-call directly on the minion:

$ salt-call dockerng.version
[INFO    ] Determining pillar cache
local:
    ----------
    ApiVersion:
        1.23

Any hints/ideas?

Upvotes: 1

Views: 1375

Answers (3)

Stuart Nelson
Stuart Nelson

Reputation: 4202

I encountered this problem while using an image with docker pre-installed. The solution that works for me is to restart the salt-minion daemon:

salt-minion:
  pkg:
    - installed
    - name: salt-minion
  service.running:
    - enable: True
    - require:
      - pkg: salt-minion
      - service: docker
      - pip: docker-py
    - watch:
      - pip: docker-py

taken from http://humankeyboard.com/saltstack/2013/how-to-restart-salt-minion.html

Unfortunately, the dockerng module doesn't work until the second run from the master. I'm still playing with watch and reload_modules trying to get this to work.

https://docs.saltstack.com/en/latest/ref/states/index.html#reloading-modules

Upvotes: 0

smpdave
smpdave

Reputation: 11

I just encountered exactly the same situation. Installing 'docker-py' on the salt-master worked for me. Of course, as suggested by Utah_Dave, docker-py would also be needed on any minion that would be targeted by dockerng.

Upvotes: 1

Utah_Dave
Utah_Dave

Reputation: 4581

Have you installed the python docker module on the minion itself? That's a requirement.

Upvotes: 1

Related Questions