forked from andrewrothstein/ansible-matchbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
58 lines (57 loc) · 1.63 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: resolve platform specific vars
include_vars: '{{ item }}'
with_first_found:
- files:
- '{{ ansible_distribution }}-{{ ansible_distribution_release }}.yml'
- '{{ ansible_distribution }}.yml'
- '{{ ansible_os_family }}.yml'
skip: true
paths:
- '{{ role_path }}/vars'
- name: check for install in {{ matchbox_install_dir }}
become: yes
become_user: root
stat:
path: '{{ matchbox_install_dir }}'
changed_when: False
register: matchbox_binary
- when: not matchbox_binary.stat.exists
block:
- name: downloading {{ matchbox_tgz_url }}
become: yes
become_user: root
get_url:
url: '{{ matchbox_tgz_url }}'
dest: '{{ matchbox_tmp_tgz }}'
checksum: '{{ matchbox_checksum }}'
mode: 0644
- name: unarchiving {{ matchbox_tmp_tgz }} to {{ matchbox_install_parent_dir }}
become: yes
become_user: root
unarchive:
remote_src: yes
src: '{{ matchbox_tmp_tgz }}'
dest: '{{ matchbox_install_parent_dir }}'
creates: '{{ matchbox_install_dir }}'
always:
- name: rm {{ matchbox_tmp_tgz }}
become: yes
become_user: root
file:
path: '{{ matchbox_tmp_tgz }}'
state: absent
- name: linking {{ matchbox_link_dir }} to {{ matchbox_install_dir }}
become: yes
become_user: root
file:
src: '{{ matchbox_install_dir }}'
dest: '{{ matchbox_link_dir }}'
state: link
- name: linking {{ matchbox_link }} to {{ matchbox_install_exe }}
become: yes
become_user: root
file:
src: '{{ matchbox_install_exe }}'
dest: '{{ matchbox_link }}'
state: link