Jacob Molnia
intermidate setup5/maybe done
53b59a6
raw
history blame contribute delete
743 Bytes
---
- 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