-
-
Save UtahDave/3490482d00f57d8aec4f19e3d8704052 to your computer and use it in GitHub Desktop.
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 -sSk http://192.168.11.10:8000 \ | |
-b ./cookies.txt \ | |
-H "Accept: application/json" \ | |
-H "Content-type: application/json" \ | |
-d '[{ | |
"client": "local_async", | |
"tgt":"overlord", | |
"fun":"state.sls", | |
"kwarg": { "mods": "test.s_test-state1" } | |
}]' |
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 -sSk http://192.168.11.10:8000 \ | |
-b ./cookies.txt \ | |
-H "Accept: application/json" \ | |
-H "Content-type: application/json" \ | |
-d '[{ | |
"client": "local", | |
"tgt":"overlord", | |
"fun":"state.sls", | |
"kwarg": { "mods": "test.s_test-state1" } | |
}]' |
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 | |
JID=$1 | |
echo $JID | |
curl -sSk http://192.168.11.10:8000 \ | |
-b ./cookies.txt \ | |
-H "Accept: application/json" \ | |
-H "Content-type: application/json" \ | |
-d '[{ | |
"client": "runner", | |
"fun":"jobs.lookup_jid", | |
"jid": "${JID}" | |
}]' |
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 -sSk http://192.168.11.10:8000 \ | |
-b ./cookies.txt \ | |
-H "Accept: application/json" \ | |
-H "Content-type: application/json" \ | |
-d '[{ | |
"client": "runner_async", | |
"fun":"state.orch", | |
"kwarg": { "mods": "test.o_test-orch" } | |
}]' |
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 -sSk http://192.168.11.10:8000 \ | |
-b ./cookies.txt \ | |
-H "Accept: application/json" \ | |
-H "Content-type: application/json" \ | |
-d '[{ | |
"client": "runner", | |
"fun":"state.orch", | |
"kwarg": { "mods": "test.o_test-orch" } | |
}]' |
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
[root@sim salt]# salt-run jobs.lookup_jid 20170804141213700914 | |
sim_master: | |
---------- | |
_stamp: | |
2017-08-04T14:12:15.666865 | |
fun: | |
runner.state.orch | |
fun_args: | |
|_ | |
---------- | |
mods: | |
test.o_test-orch | |
jid: | |
20170804141213700914 | |
return: | |
---------- | |
outputter: | |
highstate | |
retcode: | |
1 | |
success: | |
False | |
user: | |
salt |
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
test1: | |
salt.function: | |
- name: test.version | |
- tgt: overlord | |
test2: | |
module.run: | |
- name: network.interfaces | |
- tgt: overlord | |
test3: | |
salt.state: | |
- tgt: overlord | |
- sls: | |
- test.s_test-state1 | |
test4: | |
salt.state: | |
- tgt: overlord | |
- sls: | |
- test.s_test-state2 |
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
# this is run form the master without using api | |
[root@sim ~]# salt-run state.orch test.o_test-orch | |
[ERROR ] Run failed on minions: overlord | |
Failures: | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:51:56.734407 | |
Duration: 0.329 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:51:56.734844 | |
Duration: 0.326 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: foo | |
Result: False | |
Comment: Failure! | |
Started: 12:51:56.735241 | |
Duration: 0.371 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 1.026 ms | |
[ERROR ] Run failed on minions: overlord | |
Failures: | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: aaaa | |
Result: True | |
Comment: Success! | |
Started: 12:51:57.198069 | |
Duration: 0.468 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: fasdfasddfasdfoo | |
Result: True | |
Comment: Success! | |
Started: 12:51:57.198664 | |
Duration: 0.385 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: asdfasdfasdfasdfasdf | |
Result: False | |
Comment: Failure! | |
Started: 12:51:57.199123 | |
Duration: 0.393 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 1.246 ms | |
sim_master: | |
---------- | |
ID: test1 | |
Function: salt.function | |
Name: test.version | |
Result: True | |
Comment: Function ran successfully. Function test.version ran on overlord. | |
Started: 12:51:55.608570 | |
Duration: 262.851 ms | |
Changes: | |
overlord: | |
2016.11.5 | |
---------- | |
ID: test2 | |
Function: module.run | |
Name: network.interfaces | |
Result: True | |
Comment: Module function network.interfaces executed | |
Started: 12:51:55.875565 | |
Duration: 11.064 ms | |
Changes: | |
---------- | |
ret: | |
---------- | |
enp0s3: | |
---------- | |
hwaddr: | |
08:00:27:d2:a5:8b | |
inet: | |
|_ | |
---------- | |
address: | |
10.0.2.15 | |
broadcast: | |
10.0.2.255 | |
label: | |
enp0s3 | |
netmask: | |
255.255.255.0 | |
inet6: | |
|_ | |
---------- | |
address: | |
fe80::a00:27ff:fed2:a58b | |
prefixlen: | |
64 | |
scope: | |
link | |
up: | |
True | |
enp0s8: | |
---------- | |
hwaddr: | |
08:00:27:8b:34:10 | |
inet: | |
|_ | |
---------- | |
address: | |
192.168.11.10 | |
broadcast: | |
192.168.11.255 | |
label: | |
enp0s8 | |
netmask: | |
255.255.255.0 | |
inet6: | |
|_ | |
---------- | |
address: | |
fe80::a00:27ff:fe8b:3410 | |
prefixlen: | |
64 | |
scope: | |
link | |
up: | |
True | |
lo: | |
---------- | |
hwaddr: | |
00:00:00:00:00:00 | |
inet: | |
|_ | |
---------- | |
address: | |
127.0.0.1 | |
broadcast: | |
None | |
label: | |
lo | |
netmask: | |
255.0.0.0 | |
inet6: | |
|_ | |
---------- | |
address: | |
::1 | |
prefixlen: | |
128 | |
scope: | |
host | |
up: | |
True | |
---------- | |
ID: test3 | |
Function: salt.state | |
Result: False | |
Comment: Run failed on minions: overlord | |
Failures: | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:51:56.734407 | |
Duration: 0.329 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:51:56.734844 | |
Duration: 0.326 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: foo | |
Result: False | |
Comment: Failure! | |
Started: 12:51:56.735241 | |
Duration: 0.371 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 1.026 ms | |
Started: 12:51:55.886772 | |
Duration: 470.559 ms | |
Changes: | |
---------- | |
ID: test4 | |
Function: salt.state | |
Result: False | |
Comment: Run failed on minions: overlord | |
Failures: | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: aaaa | |
Result: True | |
Comment: Success! | |
Started: 12:51:57.198069 | |
Duration: 0.468 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: fasdfasddfasdfoo | |
Result: True | |
Comment: Success! | |
Started: 12:51:57.198664 | |
Duration: 0.385 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: asdfasdfasdfasdfasdf | |
Result: False | |
Comment: Failure! | |
Started: 12:51:57.199123 | |
Duration: 0.393 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 1.246 ms | |
Started: 12:51:56.357584 | |
Duration: 462.475 ms | |
Changes: | |
Summary for sim_master | |
------------ | |
Succeeded: 2 (changed=2) | |
Failed: 2 | |
------------ | |
Total states run: 4 | |
Total run time: 1.207 s | |
[root@sim ~]# |
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
# i'm rather confused on this. | |
# However, i do see sub JIDs returning back with the sub-jobs in the event bus | |
10:11 $ ./api-call-runner-async.sh | python -m json.tool | |
{ | |
"return": [ | |
{ | |
"jid": "20170804141213700914", | |
"tag": "salt/run/20170804141213700914" | |
} | |
] | |
} | |
10:12 $ ./api-call-poll.sh 20170804141213700914 | |
20170804141213700914 | |
{"return": [{}]} |
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
# using runner for orch | |
10:05 $ ./api-call-runner-sync.sh | python -m json.tool | |
{ | |
"return": [ | |
{ | |
"data": { | |
"sim_master": { | |
"module_|-test2_|-network.interfaces_|-run": { | |
"__id__": "test2", | |
"__run_num__": 1, | |
"changes": { | |
"ret": { | |
"enp0s3": { | |
"hwaddr": "08:00:27:d2:a5:8b", | |
"inet": [ | |
{ | |
"address": "10.0.2.15", | |
"broadcast": "10.0.2.255", | |
"label": "enp0s3", | |
"netmask": "255.255.255.0" | |
} | |
], | |
"inet6": [ | |
{ | |
"address": "fe80::a00:27ff:fed2:a58b", | |
"prefixlen": "64", | |
"scope": "link" | |
} | |
], | |
"up": true | |
}, | |
"enp0s8": { | |
"hwaddr": "08:00:27:8b:34:10", | |
"inet": [ | |
{ | |
"address": "192.168.11.10", | |
"broadcast": "192.168.11.255", | |
"label": "enp0s8", | |
"netmask": "255.255.255.0" | |
} | |
], | |
"inet6": [ | |
{ | |
"address": "fe80::a00:27ff:fe8b:3410", | |
"prefixlen": "64", | |
"scope": "link" | |
} | |
], | |
"up": true | |
}, | |
"lo": { | |
"hwaddr": "00:00:00:00:00:00", | |
"inet": [ | |
{ | |
"address": "127.0.0.1", | |
"broadcast": null, | |
"label": "lo", | |
"netmask": "255.0.0.0" | |
} | |
], | |
"inet6": [ | |
{ | |
"address": "::1", | |
"prefixlen": "128", | |
"scope": "host" | |
} | |
], | |
"up": true | |
} | |
} | |
}, | |
"comment": "Module function network.interfaces executed", | |
"duration": 14.349, | |
"name": "network.interfaces", | |
"result": true, | |
"start_time": "14:05:21.236242" | |
}, | |
"salt_|-test1_|-test.version_|-function": { | |
"__id__": "test1", | |
"__jid__": "20170804140521001066", | |
"__run_num__": 0, | |
"changes": { | |
"out": "highstate", | |
"ret": { | |
"overlord": "2016.11.5" | |
} | |
}, | |
"comment": "Function ran successfully. Function test.version ran on overlord.", | |
"duration": 270.004, | |
"name": "test.version", | |
"result": true, | |
"start_time": "14:05:20.965555" | |
}, | |
"salt_|-test3_|-test3_|-state": { | |
"__id__": "test3", | |
"__jid__": "20170804140521283664", | |
"__run_num__": 2, | |
"changes": {}, | |
"comment": "Run failed on minions: overlord\nFailures:\n overlord:\n ----------\n ID: always-passes-with-any-kwarg\n Function: test.nop\n Name: foo\n Result: True\n Comment: Success!\n Started: 14:05:21.777164\n Duration: 0.477 ms\n Changes: \n ----------\n ID: always-passes\n Function: test.succeed_without_changes\n Name: foo\n Result: True\n Comment: Success!\n Started: 14:05:21.777755\n Duration: 0.398 ms\n Changes: \n ----------\n ID: always-fails\n Function: test.fail_without_changes\n Name: foo\n Result: False\n Comment: Failure!\n Started: 14:05:21.778247\n Duration: 0.536 ms\n Changes: \n \n Summary for overlord\n ------------\n Succeeded: 2\n Failed: 1\n ------------\n Total states run: 3\n Total run time: 1.411 ms\n", | |
"duration": 499.926, | |
"name": "test3", | |
"result": false, | |
"start_time": "14:05:21.250737" | |
}, | |
"salt_|-test4_|-test4_|-state": { | |
"__id__": "test4", | |
"__jid__": "20170804140521784219", | |
"__run_num__": 3, | |
"changes": {}, | |
"comment": "Run failed on minions: overlord\nFailures:\n overlord:\n ----------\n ID: always-passes-with-any-kwarg\n Function: test.nop\n Name: aaaa\n Result: True\n Comment: Success!\n Started: 14:05:22.248221\n Duration: 0.336 ms\n Changes: \n ----------\n ID: always-passes\n Function: test.succeed_without_changes\n Name: fasdfasddfasdfoo\n Result: True\n Comment: Success!\n Started: 14:05:22.248810\n Duration: 0.411 ms\n Changes: \n ----------\n ID: always-fails\n Function: test.fail_without_changes\n Name: asdfasdfasdfasdfasdf\n Result: False\n Comment: Failure!\n Started: 14:05:22.249327\n Duration: 0.655 ms\n Changes: \n \n Summary for overlord\n ------------\n Succeeded: 2\n Failed: 1\n ------------\n Total states run: 3\n Total run time: 1.402 ms\n", | |
"duration": 452.313, | |
"name": "test4", | |
"result": false, | |
"start_time": "14:05:21.750798" | |
} | |
} | |
}, | |
"outputter": "highstate", | |
"retcode": 1 | |
} | |
] | |
} |
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
always-passes-with-any-kwarg: | |
test.nop: | |
- name: foo | |
- something: else | |
- foo: bar | |
always-passes: | |
test.succeed_without_changes: | |
- name: foo | |
always-fails: | |
test.fail_without_changes: | |
- name: foo |
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
always-passes-with-any-kwarg: | |
test.nop: | |
- name: aaaa | |
- something: bbbb | |
- foo: cccc | |
always-passes: | |
test.succeed_without_changes: | |
- name: fasdfasddfasdfoo | |
always-fails: | |
test.fail_without_changes: | |
- name: asdfasdfasdfasdfasdf |
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
# using local_async client with state | |
09:57 $ ./api-call-poll.sh 20170804135342473481 | |
20170804135342473481 | |
{ | |
"return": [{ | |
"overlord": { | |
"test_|-always-passes_|-foo_|-succeed_without_changes": { | |
"comment": "Success!", | |
"retcode": 2, | |
"start_time": "13:53:43.042870", | |
"name": "foo", | |
"result": true, | |
"duration": 0.265, | |
"__run_num__": 1, | |
"changes": {}, | |
"__id__": "always-passes" | |
}, | |
"test_|-always-fails_|-foo_|-fail_without_changes": { | |
"comment": "Failure!", | |
"_stamp": "2017-08-04T13:53:42.993022", | |
"return": "Error: test.fail_without_changes", | |
"retcode": 2, | |
"success": false, | |
"start_time": "13:53:43.043205", | |
"jid": "20170804135342473481", | |
"name": "foo", | |
"fun": "state.sls", | |
"result": false, | |
"duration": 0.43, | |
"__run_num__": 2, | |
"changes": {}, | |
"id": "overlord", | |
"__id__": "always-fails" | |
}, | |
"test_|-always-passes-with-any-kwarg_|-foo_|-nop": { | |
"comment": "Success!", | |
"name": "foo", | |
"start_time": "13:53:43.042473", | |
"result": true, | |
"duration": 0.312, | |
"__run_num__": 0, | |
"changes": {}, | |
"__id__": "always-passes-with-any-kwarg" | |
} | |
} | |
}] | |
} |
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
# using local client with state | |
09:48 $ ./api-call.sh | python -m json.tool | |
{ | |
"return": [ | |
{ | |
"overlord": { | |
"test_|-always-fails_|-foo_|-fail_without_changes": { | |
"__id__": "always-fails", | |
"__run_num__": 2, | |
"changes": {}, | |
"comment": "Failure!", | |
"duration": 0.449, | |
"name": "foo", | |
"result": false, | |
"start_time": "13:48:31.346456" | |
}, | |
"test_|-always-passes-with-any-kwarg_|-foo_|-nop": { | |
"__id__": "always-passes-with-any-kwarg", | |
"__run_num__": 0, | |
"changes": {}, | |
"comment": "Success!", | |
"duration": 0.38, | |
"name": "foo", | |
"result": true, | |
"start_time": "13:48:31.345591" | |
}, | |
"test_|-always-passes_|-foo_|-succeed_without_changes": { | |
"__id__": "always-passes", | |
"__run_num__": 1, | |
"changes": {}, | |
"comment": "Success!", | |
"duration": 0.317, | |
"name": "foo", | |
"result": true, | |
"start_time": "13:48:31.346062" | |
} | |
} | |
} | |
] | |
} |
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
[root@sim ~]# salt overlord state.apply test.s_test-state1 | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:48:47.948044 | |
Duration: 0.887 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: foo | |
Result: True | |
Comment: Success! | |
Started: 12:48:47.949035 | |
Duration: 0.298 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: foo | |
Result: False | |
Comment: Failure! | |
Started: 12:48:47.949415 | |
Duration: 2.687 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 3.872 ms | |
ERROR: Minions returned with non-zero exit code | |
[root@sim ~]# salt overlord state.apply test.s_test-state2 | |
overlord: | |
---------- | |
ID: always-passes-with-any-kwarg | |
Function: test.nop | |
Name: aaaa | |
Result: True | |
Comment: Success! | |
Started: 12:48:52.887315 | |
Duration: 0.312 ms | |
Changes: | |
---------- | |
ID: always-passes | |
Function: test.succeed_without_changes | |
Name: fasdfasddfasdfoo | |
Result: True | |
Comment: Success! | |
Started: 12:48:52.887717 | |
Duration: 0.268 ms | |
Changes: | |
---------- | |
ID: always-fails | |
Function: test.fail_without_changes | |
Name: asdfasdfasdfasdfasdf | |
Result: False | |
Comment: Failure! | |
Started: 12:48:52.888056 | |
Duration: 0.368 ms | |
Changes: | |
Summary for overlord | |
------------ | |
Succeeded: 2 | |
Failed: 1 | |
------------ | |
Total states run: 3 | |
Total run time: 0.948 ms | |
ERROR: Minions returned with non-zero exit code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment