Spaces:
No application file
No application file
- name: Git Repository Setup | |
hosts: all | |
become: yes | |
vars: | |
repo_url: 'https://github.com/jake-molnia/CS_553' | |
repo_dest: '/opt/CS_553' | |
tasks: | |
- name: Check if repository exists | |
stat: | |
path: "{{ repo_dest }}" | |
register: repo_check | |
- name: Remove existing repository if it exists | |
file: | |
path: "{{ repo_dest }}" | |
state: absent | |
when: repo_check.stat.exists | |
- name: Clone the Git repository | |
git: | |
repo: "{{ repo_url }}" | |
dest: "{{ repo_dest }}" | |
version: main | |
- name: Set permissions for the cloned repository | |
file: | |
path: "{{ repo_dest }}" | |
owner: ubuntu | |
group: ubuntu | |
mode: '0755' | |
recurse: yes | |