main.yml 795 B

1234567891011121314151617181920212223242526272829
  1. ---
  2. # Creates the lab workdir and clones some git repositories into it.
  3. #
  4. # Required variables:
  5. #
  6. # lab_sku: ad482 (could require a match between install-labs and this role)
  7. # lab_workdir: ansible_facts['user_dir'] + "/" + (lab_sku | upper)
  8. # lab_repos: list of Git repo URLs to clone and their destination paths
  9. # - url: foo
  10. # path: bar
  11. # branch: main
  12. #
  13. - name: Ensure lab_workdir exists
  14. ansible.builtin.file:
  15. path: "{{ lab_workdir }}"
  16. state: directory
  17. owner: student
  18. group: student
  19. mode: 0755
  20. - name: Clone the git repo(s) into lab_workdir
  21. ansible.builtin.git:
  22. repo: "{{ item.url }}"
  23. dest: "{{ lab_workdir }}/{{ item.path }}"
  24. clone: yes
  25. version: "{{ item.branch | default('main') }}"
  26. loop: "{{ lab_repos }}"
  27. ...