-
-
Save Slimmons/6d96fd3bdf55e96e493f61b37a48b561 to your computer and use it in GitHub Desktop.
Trying to send POST data via salt-api curl command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#file at /srv/salt/createDynamicFile/init.sls | |
{% set postdata = data.get('post', {}) %} | |
createFile: | |
cmd.run: | |
- name: touch {{ postdata.fileName }} | |
- cwd: /home/slimmons/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl -k -sS https://192.168.0.172:8080/run \ | |
-H 'Accept: application/x-yaml' \ | |
-H 'Content-type: application/json' \ | |
-d '[{ | |
"client": "local", | |
"tgt": "*", | |
"fun": "state.sls", | |
"kwarg": { | |
"mods": "createDynamicFile" | |
}, | |
"username": "myusername", | |
"password": "mypassword", | |
"eauth": "pam" | |
}]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment