Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Collect Scm Data Role

The collect_scm_data role collects information from the SCM source to be used throughout the play.

main.yml

---
# tasks file for collect_scm_data

- import_tasks: collect_scm_data.yml
  tags:
    - collect_scm_data
    - create_pipeline

...

collect_scm_data.yml

---

# This assumes the repos are public.
- name: Get repo id
  uri:
    url: "{{ scmurl }}/{{ (pipeline_type == 'cookbook') | ternary('CHEF', '') }}{{ (pipeline_type == 'role') | ternary('CHEFROLES', '') }}/repos/{{ repo_name }}"
    method: GET
    timeout: 120
    validate_certs: False
  register: "repo_data"

- name: Capture repo ID
  set_fact:
    repo_id: "{{ repo_data.json.id }}"

...