Skip to content

Instantly share code, notes, and snippets.

@maxux
Created September 4, 2018 10:16
Show Gist options
  • Save maxux/dd0657aac75c887f289252f0509aece9 to your computer and use it in GitHub Desktop.
Save maxux/dd0657aac75c887f289252f0509aece9 to your computer and use it in GitHub Desktop.
from zeroos.core0.client import Client
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Missing zero-host host")
sys.exit(1)
hostname = sys.argv[1]
print("[+] connecting to: %s" % hostname)
cl = Client(hostname)
if len(cl.container.find('traefik')) == 0:
print("[+] creating traefik container")
flist = 'https://hub.grid.tf/delandtj/traefik.flist'
id = cl.container.create(flist, nics=[{'type': 'default'}], port={80: 80}, tags=['traefik']).get()
for cid in cl.container.find('traefik'):
id = cid
print("[+] connecting container")
cn = cl.container.client(int(id))
cn.filesystem.upload_file('/tmp/traefik.toml', 'traefik.toml')
cn.system('traefik -c /opt/traefik.toml')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment