Skip to content

NX OS Salt Minion Docker Installation Steps

Nicolas Delecroix edited this page Dec 12, 2018 · 2 revisions

NX-OS

Make sure you run at least NX-OS version 9.2(1).

switch# conf t
switch(config)# feature bash-shell
switch(config)# run bash sudo su
bash-4.3#

We're now in the Nexus 9K native Bash shell

Set your DNS, proxy if any, and hostname. Then:

service docker start
docker run --name salt-minion --hostname=<your switch name> --rm --volume "/tmp/nginx_local/nginx_1_be_nxapi.sock:/tmp/nginx_local/nginx_1_be_nxapi.sock:rw" -d ndelecro/nxos-onbox-salt-minion:v1
docker exec -it salt-minion bash

We're now in the Docker container

Verify that the salt-minion is here:

[root@switch ~]# salt-minion --version
salt-minion 2018.3.0-n/a-e1347e7 (Oxygen)
[root@switch ~]#

On the Salt master, execute salt-key -F master and note the master.pub key. Back on the Guest Shell, edit /etc/salt/minion and make those changes:

- #master: salt
+ master: <my master IP>
- #master_finger: ''
+ master_finger: '<the master's public key>'

Start the minion:

chvrf management salt-minion -d

Take a note of the key in the output of this command:

salt-call --local key.finger

On the Salt Master, the key request from the switch should now appear:

salt-key -F master

Make sure that the key is right, and accept it:

salt-key -a <switch hostname>

Verify that the switch minion can now be controlled by the master. For example:

# salt 93180-EX-2 test.ping
93180-EX-2:
    True
#

# salt 93180-EX-2 nxos.show 'show version'
93180-EX-2:
    - Cisco Nexus Operating System (NX-OS) Software
      TAC support: http://www.cisco.com/tac
      Copyright (C) 2002-2018, Cisco and/or its affiliates.
      All rights reserved.
...
root@8675b64bad69:/#

If you run into any issues, run the minion in foreground with logging enabled:

salt-minion -l info