Skip to content

Instantly share code, notes, and snippets.

@austinpapp
Created December 12, 2016 22:33
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 austinpapp/948729bf76ed950f5507621ed89f2959 to your computer and use it in GitHub Desktop.
Save austinpapp/948729bf76ed950f5507621ed89f2959 to your computer and use it in GitHub Desktop.

this is on vagrant so this is exactly what i'm doing. passwords/tokens aren't actually used anywhere other then my vagrant machines

curl http://192.168.50.10:8000/login \
    -H "Accept: application/json" \
    -H "Content-type: application/json" \
    -d '{ "username": "austin", "password":"austin", "eauth":"pam"}'

token=0c6bcdc00716a3fc5b4f46ded424423d4e762e0c
curl http://192.168.50.10:8000/keys \
    -H "Accept: application/json" \
    -H "Content-type: application/json"  \
    -H "X-Auth-Token: 0c6bcdc00716a3fc5b4f46ded424423d4e762e0c" \
    -d '{ "mid": "xxxxxx" }'
[ERROR ] [12/Dec/2016:22:28:09] HTTP Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
response.body = self.handler()
File "/usr/lib/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
self.body = self.oldhandler(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
return self.callable(*self.args, **self.kwargs)
File "/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py", line 1517, in POST
ret = next(result, {}).get('data', {}).get('return', {})
File "/usr/lib/python2.7/site-packages/salt/netapi/rest_cherrypy/app.py", line 998, in exec_lowstate
ret = self.api.run(chunk)
File "/usr/lib/python2.7/site-packages/salt/netapi/__init__.py", line 67, in run
'No authentication credentials given')
EauthAuthenticationError: No authentication credentials given
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |vb|
vb.memory = 1024
end
config.vm.define :master do |master_config|
master_config.vm.box = "bento/centos-7.2"
master_config.vm.host_name = 'saltmaster.local'
master_config.vm.network "private_network", ip: "192.168.50.10"
master_config.vm.synced_folder "saltstack/salt/", "/srv/salt"
master_config.vm.synced_folder "saltstack/pillar/", "/srv/pillar"
master_config.vm.provision :salt do |salt|
salt.master_config = "saltstack/etc/master"
salt.master_key = "saltstack/keys/master_minion.pem"
salt.master_pub = "saltstack/keys/master_minion.pub"
salt.install_type = "stable"
salt.install_master = true
salt.no_minion = true
salt.verbose = true
salt.colorize = true
salt.bootstrap_options = "-P -c /tmp"
end
end
config.vm.define :minion1 do |minion_config|
minion_config.vm.box = "bento/centos-7.2"
minion_config.vm.host_name = 'saltminion1.local'
minion_config.vm.network "private_network", ip: "192.168.50.11"
minion_config.vm.provision :salt do |salt|
salt.minion_config = "saltstack/etc/minion1"
salt.minion_key = "saltstack/keys/minion1.pem"
salt.minion_pub = "saltstack/keys/minion1.pub"
salt.install_type = "stable"
salt.verbose = true
salt.colorize = true
salt.bootstrap_options = "-P -c /tmp"
end
end
end
@UtahDave
Copy link

Can you provide a repo with the vagrant file and all the other required files? That would make it easier to run this Vagrantfile.

@austinpapp
Copy link
Author

@austinpapp
Copy link
Author

didnt get a chance to add the manual steps in but

useradd austin
passwd austin
yum install salt-api

i think that would cover it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment