Skip to content

Commit 261e51e

Browse files
committed
Fix some new ansible-lint issues.
1 parent 5c4eea4 commit 261e51e

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ Extra args to pass to `kubeadm init` during K8s control plane initialization. E.
4747
Whether to remove the taint that denies pods from being deployed to the Kubernetes master. If you have a single-node cluster, this should definitely be `True`. Otherwise, set to `False` if you want a dedicated Kubernetes master which doesn't run any other pods.
4848

4949
kubernetes_enable_web_ui: false
50+
kubernetes_web_ui_manifest_file: https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
5051

51-
Whether to enable the Kubernetes web dashboard UI (only accessible on the master itself, or proxied).
52+
Whether to enable the Kubernetes web dashboard UI (only accessible on the master itself, or proxied), and the file containing the web dashboard UI manifest.
5253

5354
kubernetes_pod_network_cidr: '10.244.0.0/16'
5455
kubernetes_apiserver_advertise_address: ''

defaults/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ kubernetes_kubeadm_init_extra_opts: ""
1919

2020
kubernetes_allow_pods_on_master: true
2121
kubernetes_enable_web_ui: true
22+
kubernetes_web_ui_manifest_file: https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
2223

2324
kubernetes_pod_network_cidr: '10.244.0.0/16'
2425
kubernetes_apiserver_advertise_address: ''

tasks/kubelet-setup.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
kubelet_args_path: '/etc/systemd/system/kubelet.service.d/10-kubeadm.conf'
1717
kubelet_args_line: "{{ 'Environment=\"KUBELET_EXTRA_ARGS=' + kubernetes_kubelet_extra_args + '\"' }}"
1818
kubelet_args_regexp: '^Environment='
19-
when: kubelet_environment_file.stat.exists == false
19+
when: not kubelet_environment_file.stat.exists
2020

2121
- name: Configure KUBELET_EXTRA_ARGS.
2222
lineinfile:

tasks/master-setup.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
1111
register: kubeadmin_init
1212
failed_when: false
13-
when: kubernetes_init_stat.stat.exists == false
13+
when: not kubernetes_init_stat.stat.exists
1414

1515
- name: Print the init output to screen.
1616
debug:
1717
var: kubeadmin_init.stdout
1818
verbosity: 2
19-
when: kubernetes_init_stat.stat.exists == false
19+
when: not kubernetes_init_stat.stat.exists
2020

2121
- name: Ensure .kube directory exists.
2222
file:
@@ -43,7 +43,7 @@
4343
command: "kubectl taint nodes --all node-role.kubernetes.io/master-"
4444
when:
4545
- kubernetes_allow_pods_on_master
46-
- kubernetes_init_stat.stat.exists == false
46+
- not kubernetes_init_stat.stat.exists
4747

4848
- name: Check if Kubernetes Dashboard UI service already exists.
4949
shell: kubectl get services --namespace kube-system | grep -q kubernetes-dashboard
@@ -53,7 +53,7 @@
5353
when: kubernetes_enable_web_ui
5454

5555
- name: Enable the Kubernetes Web Dashboard UI (if configured).
56-
command: "kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml"
56+
command: "kubectl create -f {{ kubernetes_web_ui_manifest_file }}"
5757
when:
5858
- kubernetes_enable_web_ui
5959
- kubernetes_dashboard_service is failed

tasks/node-setup.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
shell: >
44
{{ kubernetes_join_command }}
55
creates=/etc/kubernetes/kubelet.conf
6+
tags: ['skip_ansible_lint']

0 commit comments

Comments
 (0)