|
2 | 2 | # File: tasks/install.yml - package installation tasks for Nomad
|
3 | 3 |
|
4 | 4 | - name: OS packages
|
5 |
| - package: "name={{ item }} state=present" |
| 5 | + package: |
| 6 | + name: "{{ item }}" |
| 7 | + state: present |
6 | 8 | with_items: "{{ nomad_os_packages }}"
|
7 | 9 | tags: installation
|
8 | 10 |
|
9 | 11 | - name: Check Nomad package checksum file
|
10 | 12 | become: no
|
11 | 13 | connection: local
|
12 |
| - stat: "path={{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" |
| 14 | + stat: |
| 15 | + path: "{{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" |
13 | 16 | run_once: true
|
14 | 17 | register: nomad_checksum
|
15 | 18 |
|
16 | 19 | - name: Get Nomad package checksum file
|
17 | 20 | become: no
|
18 | 21 | connection: local
|
19 |
| - get_url: "url={{ nomad_checksum_file_url }} dest={{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" |
| 22 | + get_url: |
| 23 | + url: "{{ nomad_checksum_file_url }}" |
| 24 | + dest: "{{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS" |
20 | 25 | run_once: true
|
21 | 26 | tags: installation
|
22 | 27 | when: nomad_checksum.stat.exists == False
|
23 | 28 |
|
24 |
| -- name: Get nomad package checksum |
| 29 | +- name: Get Nomad package checksum |
25 | 30 | become: no
|
26 | 31 | connection: local
|
27 | 32 | shell: "grep {{ nomad_pkg }} {{ role_path }}/files/nomad_{{ nomad_version }}_SHA256SUMS"
|
|
32 | 37 | - name: Check Nomad package file
|
33 | 38 | become: no
|
34 | 39 | connection: local
|
35 |
| - stat: "path={{ role_path }}/files/{{ nomad_pkg }}" |
| 40 | + stat: |
| 41 | + path: "{{ role_path }}/files/{{ nomad_pkg }}" |
36 | 42 | run_once: true
|
37 | 43 | register: nomad_package
|
38 | 44 |
|
39 |
| -- name: Download nomad |
| 45 | +- name: Download Nomad |
40 | 46 | become: no
|
41 | 47 | connection: local
|
42 |
| - get_url: "url={{ nomad_zip_url }} dest={{ role_path }}/files/{{ nomad_pkg }} checksum=sha256:{{ nomad_sha256.stdout.split(' ')|first }} timeout=42" |
| 48 | + get_url: |
| 49 | + url: "{{ nomad_zip_url }}" |
| 50 | + dest: "{{ role_path }}/files/{{ nomad_pkg }}" |
| 51 | + checksum: |
| 52 | + sha256: "{{ nomad_sha256.stdout.split(' ')|first }}" |
| 53 | + timeout: 42 |
43 | 54 | run_once: true
|
44 | 55 | tags: installation
|
45 | 56 | when: nomad_package.stat.exists == False
|
46 | 57 |
|
47 |
| -- name: Unarchive nomad |
| 58 | +- name: Unarchive Nomad |
48 | 59 | become: no
|
49 | 60 | connection: local
|
50 |
| - unarchive: "src={{ role_path }}/files/{{ nomad_pkg }} dest={{ role_path }}/files/ creates={{ role_path }}/files/nomad" |
| 61 | + unarchive: |
| 62 | + src: "{{ role_path }}/files/{{ nomad_pkg }}" |
| 63 | + dest: "{{ role_path }}/files/" |
| 64 | + creates: "{{ role_path }}/files/nomad" |
51 | 65 | run_once: true
|
52 | 66 | tags: installation
|
53 | 67 |
|
54 |
| -- name: Install nomad |
55 |
| - copy: "src={{ role_path }}/files/nomad dest=/usr/local/bin/ owner={{ nomad_user }} group={{ nomad_group }} mode=0755" |
| 68 | +- name: Install Nomad |
| 69 | + copy: |
| 70 | + src: "{{ role_path }}/files/nomad" |
| 71 | + dest: /usr/local/bin/ |
| 72 | + owner: "{{ nomad_user }}" |
| 73 | + group: "{{ nomad_group }}" |
| 74 | + mode: 0755 |
56 | 75 | tags: installation
|
57 | 76 |
|
58 | 77 | - name: Cleanup
|
59 | 78 | become: no
|
60 | 79 | connection: local
|
61 |
| - file: "dest={{ role_path }}/files/nomad state=absent" |
| 80 | + file: |
| 81 | + path: "{{ item }}" |
| 82 | + state: absent |
| 83 | + with_fileglob: "{{ role_path }}/files/nomad" |
62 | 84 | run_once: true
|
63 | 85 | tags: installation
|
0 commit comments