blob: 1a885dbd485ea781693ffe3fe858c7ba49d0ac4b [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
Samuli Silviusf6f5fc42019-02-13 11:00:39 +02006 force_basic_auth: true
Michal Zegan3a7e0732018-12-19 11:51:26 +01007 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
Samuli Silviusf6f5fc42019-02-13 11:00:39 +020016 force_basic_auth: true
Michal Zegan3a7e0732018-12-19 11:51:26 +010017 user: admin
18 password: admin123
19 body_format: json
20 body:
21 name: configure
22 type: groovy
Samuli Silvius379df9c2019-03-26 10:24:39 +020023 content: "{{ lookup('file', '{{ role_path }}/files/configure.groovy') }}"
Michal Zegan3a7e0732018-12-19 11:51:26 +010024 status_code: [204]
25 - name: "execute configuration script"
26 uri:
27 url: "{{ nexus_url }}/service/rest/v1/script/configure/run"
28 method: POST
Samuli Silviusf6f5fc42019-02-13 11:00:39 +020029 force_basic_auth: true
Michal Zegan3a7e0732018-12-19 11:51:26 +010030 user: admin
31 password: admin123
32 body_format: raw
33 headers: { "Content-Type": "text/plain" }
34 when: script.status == 404