Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

1- Old Juniper option

...


https://dev.to/trickvi/let-s-get-started-with-salt-55hb
pull the Master containerdocker 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 daemonsalt-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 containerdocker 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 containerdocker 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 ]
salt '*' test.ping
salt '*' grains.items

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

-proxy 

/ juniper/saltstack salt-master -l debug


sudo salt-proxy --proxyid=fw1_proxy -l debug

salt-key -l  and salt-key -A -

y    [ all keys ]
salt '*' test.ping
salt '*' grains.items



Issue : python interpreter

/home/labuser/.local/bin/master

/home/labuser/.local/bin/salt-key

Code Block
titleissue
collapsetrue
labuser@saltsackmaster:/etc/salt$ salt --version
-bash: /home/labuser/.local/bin/salt: /usr/bin/python: bad interpreter: No such file or directory



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