Skip to content

Commit

Permalink
Update role to only run upon initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinMFong authored and dpursehouse committed Feb 28, 2017
1 parent 4205a73 commit ae5b858
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tasks/main.yml
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

0 comments on commit ae5b858

Please sign in to comment.