Install salt on a Docker container
1- Old Juniper option
2- other
https://dev.to/trickvi/let-s-get-started-with-salt-55hb | |
---|---|
pull the Master container | docker pull datica/salt-master |
start the container | docker run -it datica/salt-master bash |
edit the /etc/salt/master file | vi /etc/salt/master |
mount the local file to container directory | |
start the master daemon | salt-minion -l debug [ debug mode ] or salt-minion -d [ deamon mode ] |
accept the key | salt-key L salt-key -a fw1 or -A for all |
pull the Minion container | docker pull datica/salt-minion |
https://hub.docker.com/r/juniper/saltstack | |
---|---|
pull the image | |
create/run the container | docker run -it -d -v $PWD:/etc/salt/ juniper/saltstack salt-master -l debug #docker run -d juniper/saltstack salt-master -l debug |
log into the container | docker exec -it <container_Name> bash |
/home/labuser/.local/bin/salt-key | |
start minion | salt-minion -d [ deamon mode ] or -l debug salt-key -l and salt-key -A [ all keys ] |
start proxy | In a separate container: docker run -it -d -v $PWD:/etc/salt/ juniper/saltstack salt-proxy --proxyid=srx300-1-rl102 -l debug Inside another container: docker run -it -d -v $PWD:/etc/salt/ juniper/saltstack salt-master -l debug sudo salt-proxy --proxyid=fw1_proxy -l debug salt-key -l and salt-key -A -y [ all keys ] |
Issue : python interpreter/home/labuser/.local/bin/master /home/labuser/.local/bin/salt-key | labuser@saltsackmaster:/etc/salt$ vi /home/labuser/.local/bin/salt #!/usr/bin/python3 # -*- coding: utf-8 -*- import re import sys from salt.scripts import salt_main if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(salt_main()) |
https://hub.docker.com/r/saltstack/salt | |
---|---|
pull the image | |
create/run the container | |
install junos-eznc + | |
log into the container | |