paste post and get

Change-Id: I7ad6f974a4dc9eb7a9c002efb13f776dab852c46
This commit is contained in:
oleksandr k 2020-03-12 20:07:56 +00:00
parent 1cbb18788e
commit f821c5b7b7
1 changed files with 15 additions and 9 deletions

View File

@ -8,7 +8,7 @@
- name: Get the Node Port
command: >
kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services lodgeit
kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services zuul-lodgeit
register: nodePort
- name: Get the Node IP
@ -17,12 +17,18 @@
register: nodeIP
- name: post to lodget
uri:
url: http://{{ nodeIP.stdout }}:{{ nodePort.stdout }}
method: POST
body: "{{ lookup('file','mesos-consul.json') }}"
body_format: json
headers:
Content-Type: "application/json"
- name: Post the paste
command: >
a=$(curl -vv --silent -d "code=test&language=text&webpage=" http://{{ nodeIP.stdout }}:{{ nodePort.stdout }} 2>&1 |grep Location)
A="$(cut -d' ' -f3 <<<$a)"
echo $A
register: pasteUrl
- name: Get the paste
command: >
curl -I {{ pasteUrl.stdout }}
register: getPaste