|
|
|
@ -5,29 +5,21 @@
|
|
|
|
|
helm_release_name: lodgeit |
|
|
|
|
helm_chart: ./chart |
|
|
|
|
tasks: |
|
|
|
|
|
|
|
|
|
- name: Get the Node Port |
|
|
|
|
command: > |
|
|
|
|
kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services lodgeit |
|
|
|
|
register: nodePort |
|
|
|
|
|
|
|
|
|
- name: Get the Node IP |
|
|
|
|
command: > |
|
|
|
|
kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}" |
|
|
|
|
register: nodeIP |
|
|
|
|
kubectl get svc/lodgeit -ojsonpath="http://{.spec.clusterIP}:{.spec.ports[0].port}" |
|
|
|
|
register: _url |
|
|
|
|
|
|
|
|
|
- name: Post the paste |
|
|
|
|
shell: "curl -vv --silent -d 'code=test&language=text&webpage=' http://{{ nodeIP.stdout }}:{{ nodePort.stdout }} 2>&1 |grep Location" |
|
|
|
|
register: pasteLocationInfo |
|
|
|
|
|
|
|
|
|
- name: Get the pasteUrl |
|
|
|
|
shell: "echo '{{ pasteLocationInfo.stdout }}' | cut -d' ' -f3" |
|
|
|
|
register: pasteUrl |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Get the paste |
|
|
|
|
command: > |
|
|
|
|
curl -I {{ pasteUrl.stdout }} |
|
|
|
|
register: getPaste |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uri: |
|
|
|
|
url: "{{ _url.stdout }}" |
|
|
|
|
follow_redirects: all |
|
|
|
|
method: POST |
|
|
|
|
body_format: form-urlencoded |
|
|
|
|
body: |
|
|
|
|
code: test |
|
|
|
|
language: text |
|
|
|
|
webpage: "" |
|
|
|
|
return_content: true |
|
|
|
|
register: _paste |
|
|
|
|
failed_when: "'test' not in _paste.content" |