|
30 | 30 | - rke2_airgap_mode
|
31 | 31 | - rke2_airgap_implementation == 'download'
|
32 | 32 | block:
|
33 |
| - - name: Download sha256 checksum file |
| 33 | + - name: Download sha256 checksum file ( airgap mode ) |
34 | 34 | ansible.builtin.get_url:
|
35 | 35 | url: "{{ rke2_artifact_url }}/{{ rke2_version }}/sha256sum-{{ rke2_architecture }}.txt"
|
36 | 36 | dest: "{{ rke2_artifact_path }}/sha256sum-{{ rke2_architecture }}.txt"
|
37 | 37 | force: yes
|
38 | 38 | mode: 0640
|
39 | 39 | timeout: 30
|
40 |
| - - name: Download RKE2 artifacts and compare with checksums |
| 40 | + - name: Download RKE2 artifacts and compare with checksums ( airgap mode ) |
41 | 41 | ansible.builtin.get_url:
|
42 | 42 | url: "{{ rke2_artifact_url }}/{{ rke2_version }}/{{ item }}"
|
43 | 43 | dest: "{{ rke2_artifact_path }}/{{ item }}"
|
44 | 44 | mode: 0640
|
45 | 45 | checksum: "sha256:{{ rke2_artifact_url }}/{{ rke2_version }}/sha256sum-{{ rke2_architecture }}.txt"
|
46 | 46 | timeout: 30
|
47 | 47 | with_items: "{{ rke2_artifact | reject('search', 'sha256sum') | list }}"
|
| 48 | + - name: Download RKE2 install script ( airgap mode ) |
| 49 | + ansible.builtin.get_url: |
| 50 | + url: "{{ rke2_install_bash_url }}" |
| 51 | + dest: "{{ rke2_install_script_dir }}/rke2.sh" |
| 52 | + mode: 0700 |
| 53 | + timeout: 30 |
48 | 54 | rescue:
|
49 |
| - - name: "Remote downloading failed: Downloading locally and pushing to remote hosts" |
| 55 | + - name: "Remote downloading failed: Downloading locally and pushing to remote hosts ( airgap mode - download locally and push to remote )" |
50 | 56 | ansible.builtin.pause: # Slight delay to make sure you know it's gonna happen and have time to cancel
|
51 | 57 | seconds: 7
|
52 |
| - - name: "Create {{ rke2_airgap_copy_sourcepath }}" |
| 58 | + - name: "Create directory {{ rke2_airgap_copy_sourcepath }}" |
53 | 59 | delegate_to: localhost
|
54 | 60 | run_once: true
|
55 | 61 | ansible.builtin.file:
|
56 | 62 | path: "{{ rke2_airgap_copy_sourcepath }}"
|
57 | 63 | state: directory
|
58 |
| - mode: 0700 |
| 64 | + mode: 0750 |
| 65 | + owner: "{{ lookup('env', 'USER') }}" |
59 | 66 | - name: Download RKE2 checksum locally
|
60 | 67 | delegate_to: localhost
|
61 | 68 | run_once: true
|
|
65 | 72 | dest: "{{ rke2_airgap_copy_sourcepath }}/"
|
66 | 73 | force: yes
|
67 | 74 | mode: 0640
|
| 75 | + owner: "{{ lookup('env', 'USER') }}" |
68 | 76 | timeout: 30
|
69 | 77 | - name: Downloading RKE2 artifacts locally
|
70 | 78 | delegate_to: localhost
|
|
74 | 82 | url: "{{ item }}"
|
75 | 83 | dest: "{{ rke2_airgap_copy_sourcepath }}/"
|
76 | 84 | mode: 0640
|
77 |
| - with_items: "{{ [rke2_artifact_url+'/'+rke2_version+'/'] | product(rke2_artifact) | map('join') | list + [rke2_install_bash_url] }}" |
| 85 | + owner: "{{ lookup('env', 'USER') }}" |
| 86 | + with_items: "{{ [rke2_artifact_url + '/' + rke2_version + '/'] | product(rke2_artifact) | map('join') | list + [rke2_install_bash_url] }}" |
| 87 | + - name: Download RKE2 install script locally |
| 88 | + delegate_to: localhost |
| 89 | + run_once: true |
| 90 | + ansible.builtin.get_url: |
| 91 | + url: "{{ rke2_install_bash_url }}" |
| 92 | + dest: "{{ rke2_airgap_copy_sourcepath }}/rke2.sh" |
| 93 | + mode: 0700 |
| 94 | + owner: "{{ lookup('env', 'USER') }}" |
78 | 95 | - name: Copy local RKE2 files to remote hosts
|
79 | 96 | ansible.builtin.copy:
|
80 |
| - src: "{{ rke2_airgap_copy_sourcepath }}/{{ item }}" |
81 |
| - dest: "{{ rke2_artifact_path }}/{{ item }}" |
| 97 | + src: "{{ rke2_airgap_copy_sourcepath }}/" |
| 98 | + dest: "{{ rke2_artifact_path }}/" |
82 | 99 | mode: 0640
|
83 |
| - with_items: "{{ rke2_artifacts + ['rke2.sh'] }}" |
84 |
| - - name: Set RKE2 install script permissions |
85 |
| - ansible.builtin.file: |
86 |
| - path: "{{ rke2_artifact_path }}/rke2.sh" |
87 |
| - mode: 0750 |
| 100 | + - name: Copy local RKE2 install script to remote hosts |
| 101 | + ansible.builtin.copy: |
| 102 | + src: "{{ rke2_airgap_copy_sourcepath }}/rke2.sh" |
| 103 | + dest: "{{ rke2_install_script_dir }}/rke2.sh" |
| 104 | + mode: 0700 |
88 | 105 |
|
89 | 106 | - name: Copy local RKE2 artifacts
|
90 | 107 | ansible.builtin.copy:
|
|
0 commit comments