Skip to content

Commit 5a9be05

Browse files
Merge pull request #378 from lablabs/fix/deprecatios
Fix deprecation warnings
2 parents 528c2dc + 81b2678 commit 5a9be05

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ jobs:
3636
with:
3737
path: "lablabs.rke2"
3838

39+
- name: Remove unnecessary files
40+
run: |
41+
sudo rm -rf /usr/share/dotnet
42+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
43+
3944
- name: Set up Python 3
4045
uses: actions/setup-python@v6
4146
with:
@@ -71,6 +76,11 @@ jobs:
7176
with:
7277
path: "lablabs.rke2"
7378

79+
- name: Remove unnecessary files
80+
run: |
81+
sudo rm -rf /usr/share/dotnet
82+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
83+
7484
- name: Set up Python 3
7585
uses: actions/setup-python@v6
7686
with:

meta/argument_specs.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ argument_specs:
1818

1919
rke2_type:
2020
type: str
21-
choices: ['server', 'agent']
21+
choices: ["server", "agent"]
2222
default: "{{ 'server' if inventory_hostname in groups[rke2_servers_group_name] else 'agent' if inventory_hostname in groups[rke2_agents_group_name] }}"
2323
description: "The node type - server or agent"
2424

@@ -39,7 +39,7 @@ argument_specs:
3939

4040
rke2_api_ip:
4141
type: str
42-
default: "{{ hostvars[groups[rke2_servers_group_name].0]['ansible_default_ipv4']['address'] | default(hostvars[groups[rke2_servers_group_name].0]['ansible_default_ipv6']['address'] ) }}"
42+
default: "{{ hostvars[groups[rke2_servers_group_name].0].ansible_facts['default_ipv4']['address'] | default(hostvars[groups[rke2_servers_group_name].0].ansible_facts['default_ipv6']['address'] ) }}"
4343
description: "Kubernetes API and RKE2 registration IP address. The default Address is the IPv4 of the Server/Master node. In HA mode choose a static IP which will be set as VIP in keepalived. Or if the keepalived is disabled, use IP address of your LB."
4444

4545
rke2_api_private_ip:
@@ -197,7 +197,12 @@ argument_specs:
197197

198198
rke2_artifact:
199199
type: list
200-
default: ["sha256sum-{{ rke2_architecture }}.txt", "rke2.linux-{{ rke2_architecture }}.tar.gz", "rke2-images.linux-{{ rke2_architecture }}.tar.zst"]
200+
default:
201+
[
202+
"sha256sum-{{ rke2_architecture }}.txt",
203+
"rke2.linux-{{ rke2_architecture }}.tar.gz",
204+
"rke2-images.linux-{{ rke2_architecture }}.tar.zst",
205+
]
201206
elements: str
202207
description: "Airgap required artifacts"
203208

@@ -213,7 +218,7 @@ argument_specs:
213218

214219
rke2_airgap_implementation:
215220
type: str
216-
choices: ['download', 'copy', 'exists']
221+
choices: ["download", "copy", "exists"]
217222
default: "download"
218223
description: "Airgap implementation type - download, copy or exists"
219224

@@ -235,7 +240,7 @@ argument_specs:
235240

236241
rke2_architecture:
237242
type: str
238-
choices: ['amd64', 's390x']
243+
choices: ["amd64", "s390x"]
239244
default: "amd64"
240245

241246
description: "Architecture to be downloaded, currently there are releases for amd64 and s390x"

tasks/keepalived.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
2-
32
- name: Update apt cache
43
ansible.builtin.apt:
54
update_cache: true
6-
when: ansible_pkg_mgr == 'apt'
5+
when: ansible_facts['pkg_mgr'] == 'apt'
76

87
- name: Update dnf cache
98
ansible.builtin.dnf:
109
update_cache: true
11-
when: ansible_pkg_mgr == 'dnf'
10+
when: ansible_facts['pkg_mgr'] == 'dnf'
1211

1312
- name: Install packages
1413
ansible.builtin.package:
@@ -29,7 +28,7 @@
2928
owner: root
3029
group: root
3130
mode: 0755
32-
when: ansible_facts['os_family'] == "Debian"
31+
when: ansible_facts['os_family'] == "Debian"
3332
notify: Restart keepalived
3433

3534
- name: Create Kubernetes API health check script for RedHat OS famliy
@@ -39,7 +38,7 @@
3938
owner: root
4039
group: root
4140
mode: 0755
42-
when: ansible_facts['os_family'] == "RedHat"
41+
when: ansible_facts['os_family'] == "RedHat"
4342
notify: Restart keepalived
4443

4544
- name: Create RKE2 Server health check script for Debian OS family
@@ -49,7 +48,7 @@
4948
owner: root
5049
group: root
5150
mode: 0755
52-
when: ansible_facts['os_family'] == "Debian"
51+
when: ansible_facts['os_family'] == "Debian"
5352
notify: Restart keepalived
5453

5554
- name: Create RKE2 Server health check script for RedHat OS family
@@ -59,7 +58,7 @@
5958
owner: root
6059
group: root
6160
mode: 0755
62-
when: ansible_facts['os_family'] == "RedHat"
61+
when: ansible_facts['os_family'] == "RedHat"
6362
notify: Restart keepalived
6463

6564
- name: Create keepalived config file

templates/keepalived.conf.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ vrrp_script chk_rke2server {
2828
}
2929

3030
vrrp_instance VI_1 {
31-
interface {{ ansible_default_ipv4.interface | default(ansible_default_ipv6.interface) }}
31+
interface {{ ansible_facts.default_ipv4.interface | default(ansible_facts.default_ipv6.interface) }}
3232
virtual_router_id 11
3333
{% if groups[rke2_servers_group_name].0 == inventory_hostname|string() %}
3434
state MASTER
@@ -41,11 +41,11 @@ vrrp_instance VI_1 {
4141
{% endif -%}
4242
{% endfor %}
4343
advert_int 1
44-
unicast_src_ip {{ ansible_default_ipv4.address | default(ansible_default_ipv6.address) }}
44+
unicast_src_ip {{ ansible_facts.default_ipv4.address | default(ansible_facts.default_ipv6.address) }}
4545
unicast_peer {
4646
{% for host in groups[rke2_servers_group_name] %}
4747
{% if host|string() != inventory_hostname|string() %}
48-
{{ hostvars[host]['ansible_default_ipv4']['address'] | default(hostvars[host]['ansible_default_ipv6']['address'] ) }}
48+
{{ hostvars[host]['ansible_facts']['default_ipv4']['address'] | default(hostvars[host]['ansible_facts']['default_ipv6']['address'] ) }}
4949
{% endif %}
5050
{% endfor %}
5151
}

templates/kube-vip/kube-vip.yml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ spec:
3535
- name: vip_nodename
3636
valueFrom:
3737
fieldRef:
38-
fieldPath: spec.nodeName
38+
fieldPath: spec.nodeName
3939
- name: vip_interface
40-
value: "{{ rke2_interface | default(ansible_default_ipv4.interface | default(ansible_default_ipv6.interface)) }}"
40+
value: "{{ rke2_interface | default(ansible_facts.default_ipv4.interface | default(ansible_facts.default_ipv6.interface)) }}"
4141
- name: port
4242
value: "{{ rke2_api_port | default('6443')}}"
4343
- name: vip_cidr

0 commit comments

Comments
 (0)