Skip to content

Instantly share code, notes, and snippets.

@pgporada
Created February 5, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgporada/8e196747d26fa7a7ced5 to your computer and use it in GitHub Desktop.
Save pgporada/8e196747d26fa7a7ced5 to your computer and use it in GitHub Desktop.
Salt/Docker question
#-------------------#
# rancher_agent.sls #
#-------------------#
# This is the end goal
#docker run --rm -it --privileged -v /var/run/docker.sock:/var/run/docker.sock rancher/agent http://192.168.200.42:8080:
# cmd.run
python-pip:
pkg.installed
docker-py:
pip.installed:
- reload_modules: True
- require:
- pkg: python-pip
rancher/agent:
docker.pulled:
- tag: latest
- force: True
- require:
- pip: docker-py
#-------------#
# Salt output #
#-------------#
[root@master /srv/salt]$ salt master state.sls rancher_agent
master:
----------
ID: python-pip
Function: pkg.installed
Result: True
Comment: Package python-pip is already installed.
Started: 14:05:48.291245
Duration: 410.619 ms
Changes:
----------
ID: docker-py
Function: pip.installed
Result: True
Comment: Python package docker-py already installed
Started: 14:05:48.702182
Duration: 387.483 ms
Changes:
----------
ID: rancher/agent
Function: docker.pulled
Result: False
Comment: State 'docker.pulled' found in SLS 'rancher_agent' is unavailable
Started:
Duration:
Changes:
Summary
------------
Succeeded: 2
Failed: 1
------------
Total states run: 3
#-------------------#
# Software versions #
#-------------------#
[root@master /srv/salt]$ salt --version
salt 2014.7.0 (Helium)
[root@master /srv/salt]$ pip list | grep docker
docker-py (0.7.2)
[root@master /srv/salt]$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8/1.4.1
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8/1.4.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment