Skip to content

Commit

Permalink
sandbox: don't update existing install
Browse files Browse the repository at this point in the history
  • Loading branch information
saltydk committed Jan 18, 2025
1 parent eaa5162 commit 38b4887
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions roles/sandbox/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@
---
- name: Create Sandbox directory
ansible.builtin.file:
path: "{{ item }}"
path: "/opt/sandbox"
state: directory
owner: "{{ user.name }}"
group: "{{ user.name }}"
mode: "0775"
recurse: true
with_items:
- /opt/sandbox

- name: Check if git repository exists
ansible.builtin.stat:
path: "/opt/sandbox/.git"
register: git_repo_check

- name: Clone Sandbox repo 'HEAD'
ansible.builtin.git:
Expand All @@ -29,6 +32,7 @@
become_user: "{{ user.name }}"
ignore_errors: true
register: sandbox_clone_status
when: not git_repo_check.stat.exists

- name: Clone Sandbox repo 'master'
ansible.builtin.git:
Expand All @@ -39,7 +43,9 @@
force: true
become: true
become_user: "{{ user.name }}"
when: (sandbox_clone_status is failed)
when:
- not git_repo_check.stat.exists
- sandbox_clone_status is failed

- name: Import default files when missing
ansible.builtin.copy:
Expand Down

0 comments on commit 38b4887

Please sign in to comment.