--- - name: Submit change ansible.builtin.command: git review args: chdir: "{{ repo_path }}" tags: - skip_ansible_lint - name: Get Change-id ansible.builtin.shell: git log -n 1 | awk '/Change-Id/ {print $2}' args: chdir: "{{ repo_path }}" register: _change_id tags: - skip_ansible_lint # documentation: https://gerrit-review.googlesource.com/Documentation/rest-api-changes.html#set-review - name: Set Code-Review and Workflow label using gerrit API ansible.builtin.uri: url: "https://{{ gerrit_host }}/a/changes/{{ _change_id.stdout }}/revisions/current/review" user: admin password: "{{ gerrit_admin_api_key }}" body_format: json body: >- {"labels": { "Code-Review": +2, "Workflow": +1 } } validate_certs: "{{ validate_certs }}" method: POST when: - approve | bool