forked from dpursehouse/ansible-role-buck
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update role to only run upon initialization
- Loading branch information
1 parent
4205a73
commit ae5b858
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,65 @@ | ||
--- | ||
# tasks file for Buck | ||
- name: Ensure initialization directory exists. | ||
file: | ||
dest: "{{ ansible_env.HOME }}/.config/ansible/" | ||
mode: 0700 | ||
owner: "{{ ansible_env.USER }}" | ||
state: directory | ||
|
||
- name: Check if initialization has been done | ||
stat: path={{ ansible_env.HOME }}/.config/ansible/.initialized_buck | ||
register: initialized_buck | ||
|
||
- name: Create Buck installation directory | ||
file: > | ||
path={{ buck_installation_dir }} | ||
state=directory | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Clone Buck | ||
git: > | ||
repo={{ buck_repository_url }} | ||
dest={{ buck_installation_dir }} | ||
version={{ buck_revision }} | ||
accept_hostkey=yes | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Build Buck | ||
command: > | ||
ant clean default | ||
chdir={{ buck_installation_dir }} | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Create Buck bin directory | ||
file: > | ||
path={{ buck_bin_dir }} | ||
state=directory | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Create buck symlink | ||
file: > | ||
src={{ buck_installation_dir }}/bin/buck | ||
dest={{ buck_bin_dir }}/buck | ||
state=link | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Create buckd symlink | ||
file: > | ||
src={{ buck_installation_dir }}/bin/buckd | ||
dest={{ buck_bin_dir }}/buckd | ||
state=link | ||
tags: buck | ||
when: not initialized_buck.stat.exists | ||
|
||
- name: Create .initialized_buck lock file | ||
file: | ||
path: "{{ ansible_env.HOME }}/.config/ansible/.initialized_buck" | ||
state: touch | ||
become: true | ||
when: not initialized_buck.stat.exists |