|
26 | 26 | - /etc/coredns
|
27 | 27 | - /etc/coredns/zones
|
28 | 28 |
|
29 |
| -- name: Download coredns binary to local folder |
30 |
| - become: false |
31 |
| - get_url: |
32 |
| - url: "https://github.com/coredns/coredns/releases/download/v{{ coredns_version }}/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
33 |
| - dest: "/tmp/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
34 |
| - checksum: "sha256:{{ coredns_checksum }}" |
35 |
| - register: _download_binary |
36 |
| - until: _download_binary is succeeded |
37 |
| - retries: 5 |
38 |
| - delay: 2 |
39 |
| - delegate_to: localhost |
40 |
| - check_mode: false |
| 29 | +- block: |
| 30 | + - name: Download coredns binary to local folder |
| 31 | + become: false |
| 32 | + get_url: |
| 33 | + url: "https://github.com/coredns/coredns/releases/download/v{{ coredns_version }}/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
| 34 | + dest: "/tmp/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
| 35 | + checksum: "sha256:{{ coredns_checksum }}" |
| 36 | + register: _download_binary |
| 37 | + until: _download_binary is succeeded |
| 38 | + retries: 5 |
| 39 | + delay: 2 |
| 40 | + delegate_to: localhost |
| 41 | + check_mode: false |
41 | 42 |
|
42 |
| -- name: Unpack coredns binary |
43 |
| - become: false |
44 |
| - unarchive: |
45 |
| - src: "/tmp/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
46 |
| - dest: "/tmp" |
47 |
| - creates: "/tmp/coredns" |
48 |
| - delegate_to: localhost |
49 |
| - check_mode: false |
| 43 | + - name: Unpack coredns binary |
| 44 | + become: false |
| 45 | + unarchive: |
| 46 | + src: "/tmp/coredns_{{ coredns_version }}_linux_{{ go_arch }}.tgz" |
| 47 | + dest: "/tmp" |
| 48 | + creates: "/tmp/coredns" |
| 49 | + delegate_to: localhost |
| 50 | + check_mode: false |
50 | 51 |
|
51 |
| -- name: Propagate coredns binaries |
| 52 | + - name: Propagate coredns binaries |
| 53 | + copy: |
| 54 | + src: "/tmp/coredns" |
| 55 | + dest: "/usr/local/bin/coredns" |
| 56 | + mode: 0750 |
| 57 | + owner: "{{ coredns_system_user }}" |
| 58 | + group: "{{ coredns_system_group }}" |
| 59 | + notify: restart coredns |
| 60 | + when: not ansible_check_mode |
| 61 | + when: coredns_binary_local_dir | length == 0 |
| 62 | + |
| 63 | +- name: propagate locally distributed coredns binary |
52 | 64 | copy:
|
53 |
| - src: "/tmp/coredns" |
| 65 | + src: "{{ coredns_binary_local_dir }}/coredns" |
54 | 66 | dest: "/usr/local/bin/coredns"
|
55 | 67 | mode: 0750
|
56 | 68 | owner: "{{ coredns_system_user }}"
|
57 | 69 | group: "{{ coredns_system_group }}"
|
| 70 | + when: coredns_binary_local_dir | length > 0 |
58 | 71 | notify: restart coredns
|
59 |
| - when: not ansible_check_mode |
60 | 72 |
|
61 | 73 | - name: Copy the coredns systemd service file
|
62 | 74 | template:
|
|
0 commit comments