blob: 66712d8ffef6ba0194d9cfb3c6a1f771ee33c7e3 [file] [log] [blame]
Michal Zegan3a7e0732018-12-19 11:51:26 +01001---
2- name: "check if the configuration script is uploaded"
3 uri:
4 url: "{{ nexus_url }}/service/rest/v1/script/configure"
5 method: GET
6 force_basic_auth: yes
7 user: admin
8 password: admin123
9 status_code: [200, 404]
10 register: script
11- block:
12 - name: "upload the configuration script"
13 uri:
14 url: "{{ nexus_url }}/service/rest/v1/script"
15 method: POST
16 force_basic_auth: yes
17 user: admin
18 password: admin123
19 body_format: json
20 body:
21 name: configure
22 type: groovy
23 content: "{{ lookup('file', 'files/configure.groovy') }}"
24 status_code: [204]
25 - name: "execute configuration script"
26 uri:
27 url: "{{ nexus_url }}/service/rest/v1/script/configure/run"
28 method: POST
29 force_basic_auth: yes
30 user: admin
31 password: admin123
32 body_format: raw
33 headers: { "Content-Type": "text/plain" }
34 when: script.status == 404