67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
![]() |
- hosts: "review"
|
||
|
tasks:
|
||
|
- name: Run selenium container
|
||
|
include_role:
|
||
|
name: run-selenium
|
||
|
|
||
|
# Get the group info so that we can check group UUIDs don't change when
|
||
|
# groups are renamed.
|
||
|
- name: Get group UUID
|
||
|
uri:
|
||
|
url: 'http://localhost:8081/a/groups/CI-tools'
|
||
|
method: GET
|
||
|
user: admin
|
||
|
password: secret
|
||
|
status_code: 200
|
||
|
return_content: yes
|
||
|
register: group_raw
|
||
|
|
||
|
- name: Debug serialized json
|
||
|
debug:
|
||
|
var: group_raw
|
||
|
|
||
|
- name: Deserialize returned data to internal variable.
|
||
|
set_fact:
|
||
|
# The first 4 bytes of the returned data are )]}' which is
|
||
|
# invalid json.
|
||
|
group_json: '{{ group_raw.content | regex_replace("^....", "") | from_json }}'
|
||
|
|
||
|
- name: Debug deserialized json
|
||
|
debug:
|
||
|
var: group_json
|
||
|
|
||
|
- name: Run rename playbook
|
||
|
import_playbook: ../rename_repos.yaml
|
||
|
vars:
|
||
|
repolist: /home/zuul/src/opendev.org/opendev/system-config/playbooks/zuul/test_gerrit_renames.yaml
|
||
|
|
||
|
- hosts: "review"
|
||
|
tasks:
|
||
|
- name: Get group UUID of renamed group
|
||
|
uri:
|
||
|
url: 'http://localhost:8081/a/groups/CI-tools-updated'
|
||
|
method: GET
|
||
|
user: admin
|
||
|
password: secret
|
||
|
status_code: 200
|
||
|
return_content: yes
|
||
|
register: group_renamed_raw
|
||
|
|
||
|
- name: Debug serialized json
|
||
|
debug:
|
||
|
var: group_renamed_raw
|
||
|
|
||
|
- name: Deserialize returned data to internal variable.
|
||
|
set_fact:
|
||
|
# The first 4 bytes of the returned data are )]}' which is
|
||
|
# invalid json.
|
||
|
group_renamed_json: '{{ group_renamed_raw.content | regex_replace("^....", "") | from_json }}'
|
||
|
|
||
|
- name: Debug deserialized json
|
||
|
debug:
|
||
|
var: group_renamed_json
|
||
|
|
||
|
- name: Check renamed UUID is consistent
|
||
|
assert:
|
||
|
that: group_renamed_json['id'] == group_json['id']
|