Skip to content

Commit 05e55f0

Browse files
committed
fix: Ansible lint for all ansible roles naming convention
1 parent bfdd778 commit 05e55f0

87 files changed

Lines changed: 817 additions & 44 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ jobs:
8383
- name: Install ansible-lint
8484
run: pip install ansible-lint
8585

86+
- name: Install required collections
87+
run: ansible-galaxy collection install community.docker
88+
8689
- name: Lint ansible/
8790
working-directory: ansible
8891
run: ansible-lint

ansible-k8s/.ansible-lint

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
exclude_paths:
3+
- inventory/group_vars/
4+
- inventory/host_vars/
5+
6+
skip_list:
7+
- var-naming[no-role-prefix]
8+
9+
use_default_rules: true
10+
verbosity: 1

ansible-k8s/playbooks/02-post-install.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
hosts: masters[0]
44
become: true
55
roles:
6-
- post-install
6+
- post_install

ansible-k8s/roles/helm/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
- "{{ helm_binary }}"
3939
- repo
4040
- update
41+
changed_when: "'Update Complete' in helm_update_output.stdout"
42+
register: helm_update_output
4143

4244
- name: Deploy TelemetryFlow Helm release
4345
ansible.builtin.command:

ansible-k8s/roles/maintenance/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
- nodes
3737
changed_when: false
3838
register: top_result
39-
ignore_errors: true
39+
failed_when: false
4040

4141
- name: Display cluster health summary
4242
ansible.builtin.debug:
@@ -75,7 +75,7 @@
7575
snapshot_name: "telemetryflow-{{ ansible_date_time.iso8601_basic_short }}"
7676
snapshot_pod: rke2-etcd-{{ groups['masters'][0] }}
7777
changed_when: true
78-
ignore_errors: true
78+
failed_when: false
7979

8080
- name: Clean up old backups
8181
ansible.builtin.find:
File renamed without changes.

ansible-k8s/roles/post-install/tasks/main.yml renamed to ansible-k8s/roles/post_install/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- wait
1616
- --for=condition=Ready
1717
- node
18-
--all
18+
- --all
1919
- --timeout={{ kubectl_timeout }}s
2020
changed_when: false
2121

@@ -36,6 +36,7 @@
3636
vars:
3737
label: "{{ item[1] }}"
3838
when: node_labels | length > 0
39+
changed_when: true
3940

4041
- name: Apply node taints
4142
ansible.builtin.command:
@@ -54,6 +55,7 @@
5455
vars:
5556
taint: "{{ item }}"
5657
when: node_taints | length > 0
58+
changed_when: true
5759

5860
- name: Display cluster node status
5961
ansible.builtin.command:
File renamed without changes.

ansible-k8s/roles/rke2/tasks/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,22 @@
2323
notify: Restart rke2-{{ rke2_node_type }}
2424

2525
- name: Install RKE2 (server)
26-
ansible.builtin.environment:
27-
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
28-
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
2926
ansible.builtin.command: /tmp/rke2-install.sh
3027
args:
3128
creates: "{{ rke2_binary_path }}/rke2"
29+
environment:
30+
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
31+
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
3232
when: rke2_node_type == 'server'
3333

3434
- name: Install RKE2 (agent)
35-
ansible.builtin.environment:
36-
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
37-
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
38-
INSTALL_RKE2_TYPE: agent
3935
ansible.builtin.command: /tmp/rke2-install.sh
4036
args:
4137
creates: "{{ rke2_binary_path }}/rke2"
38+
environment:
39+
INSTALL_RKE2_VERSION: "{{ rke2_version }}"
40+
INSTALL_RKE2_CHANNEL: "{{ rke2_channel }}"
41+
INSTALL_RKE2_TYPE: agent
4242
when: rke2_node_type == 'agent'
4343

4444
- name: Enable and start RKE2 server

ansible/.ansible-lint

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
exclude_paths:
3+
- keys/
4+
- templates/.gitkeep
5+
- host_vars/.gitkeep
6+
7+
skip_list:
8+
- var-naming[no-role-prefix]
9+
10+
use_default_rules: true
11+
verbosity: 1

0 commit comments

Comments
 (0)