Skip to content

Commit

Permalink
chore: Add yamllint configuration
Browse files Browse the repository at this point in the history
Switch to .yamllint.yml configuration and remove individual rule
overrides for line-length. Some 'truthy' rules are suppressed still but
will be dealt with on a role by role basis.
  • Loading branch information
memes committed Sep 12, 2024
1 parent c821f23 commit 122645e
Show file tree
Hide file tree
Showing 24 changed files with 12 additions and 23 deletions.
1 change: 0 additions & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# These github actions will perform linting using pre-commit.
# yamllint disable rule:line-length
# spell-checker: disable
---
name: pre-commit
Expand Down
7 changes: 7 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
extends: default

rules:
line-length:
max: 120
level: warning
2 changes: 1 addition & 1 deletion ansible/calico.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install Calico as CNI
# yamllint disable rule:truthy rule:line-length
# yamllint disable rule:truthy
---
- name: Prepare all hosts for kubernetes
hosts: servers
Expand Down
2 changes: 1 addition & 1 deletion ansible/cilium.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install Cilium as CNI
# yamllint disable rule:truthy rule:line-length
# yamllint disable rule:truthy
---
- name: Gather facts
hosts: servers
Expand Down
2 changes: 1 addition & 1 deletion ansible/kubernetes.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install kubernetes on hosts
# yamllint disable rule:truthy rule:line-length
# yamllint disable rule:truthy
---
- name: Prepare all hosts for kubernetes
hosts: servers
Expand Down
2 changes: 1 addition & 1 deletion ansible/longhorn.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Install kubernetes on hosts
# yamllint disable rule:truthy rule:line-length
# yamllint disable rule:truthy
---
- name: Prepare all hosts for longhorn
hosts: servers
Expand Down
1 change: 0 additions & 1 deletion inventory/group_vars/servers.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Configure the hosts that are part of the servers group
# yamllint disable rule:line-length
---
ansible_ssh_extra_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
1 change: 0 additions & 1 deletion kubernetes.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Provision kubernetes on bare metal hosts
# yamllint disable rule:line-length
---
- name: Prepare requirements and install Kubernetes on bare-metal hosts
hosts: servers
Expand Down
1 change: 0 additions & 1 deletion provision/boot.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# (Re-)boot the lab servers
# yamllint disable rule:line-length
---
- name: (Re-)boot servers
hosts: servers
Expand Down
1 change: 0 additions & 1 deletion provision/repave.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Playbook to repave servers via PXE
# yamllint disable rule:line-length
---
- name: Prepare for server repave from PXE
hosts: shared
Expand Down
1 change: 0 additions & 1 deletion provision/shutdown.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Shutdown the lab servers
# yamllint disable rule:line-length
---
- name: Power off servers
hosts: servers
Expand Down
1 change: 0 additions & 1 deletion roles/cilium/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Install Cilium as CNI
# yamllint disable rule:line-length
---
- set_fact:
lb_cidr_pool: "{{ lb_cidr_pool | default([]) + [{'cidr': item}] }}"
Expand Down
1 change: 0 additions & 1 deletion roles/crio/tasks/centos.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Perform CentOS specific tasks for CRI-O
# yamllint disable rule:line-length
---
- name: Add CentOS CRI-O package repo
ansible.builtin.get_url:
Expand Down
1 change: 0 additions & 1 deletion roles/crio/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Perform Debian specific tasks for CRI-O
# yamllint disable rule:line-length
---
- name: Fetch repo key for CRI-O apt packages
ansible.builtin.get_url:
Expand Down
1 change: 0 additions & 1 deletion roles/crio/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Install CRI-O runtime
# yamllint disable rule:line-length
---
- name: Configure persistent modules for CRI-O
ansible.builtin.template:
Expand Down
1 change: 0 additions & 1 deletion roles/crio/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yamllint disable rule:line-length
---
required_modules:
- overlay
Expand Down
1 change: 0 additions & 1 deletion roles/kubeadm/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Perform Debian/Ubuntu specific tasks common to all hosts
# yamllint disable rule:line-length
---
- name: Fetch repo key for kubernetes apt packages
ansible.builtin.get_url:
Expand Down
1 change: 0 additions & 1 deletion roles/kubeadm/tasks/init.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yamllint disable rule:line-length
---
- name: Generate kubeadm token
ansible.builtin.command: kubeadm token generate
Expand Down
1 change: 0 additions & 1 deletion roles/kubeadm/tasks/rhel.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Perform CentOS/RHEL specific tasks common to all hosts
# yamllint disable rule:line-length
---
- name: Add Kubernetes yum repo
ansible.builtin.yum_repository:
Expand Down
1 change: 0 additions & 1 deletion roles/kubeadm/vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# yamllint disable rule:line-length
---
cgroup_driver: systemd
ipv4_extra_args: "{{ {'node-cidr-mask-size-ipv4': ipv4_node_mask | string} if (pod_cidrs | ansible.utils.ipv4 | length > 0) else {} }}"
Expand Down
1 change: 0 additions & 1 deletion roles/networking/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Setup static vlan configurations post-deployment
# yamllint disable rule:line-length
---
- name: Configure VLANs on Ubuntu
ansible.builtin.template:
Expand Down
1 change: 0 additions & 1 deletion roles/shared/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Update shared server
# yamllint disable rule:line-length
---
- name: Install required packages
ansible.builtin.package:
Expand Down
1 change: 0 additions & 1 deletion roles/vault/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Manage Vault service
# yamllint disable rule:line-length
---
- name: Copy static hashicorp key
ansible.builtin.copy:
Expand Down
2 changes: 1 addition & 1 deletion shared.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Update shared server playbook
# In my lab, the shared group hosts both shared file services and vault services
# code: language=ansible
# yamllint disable rule:truthy rule:line-length
# yamllint disable rule:truthy
---
- name: Update shared services and files
hosts: shared
Expand Down

0 comments on commit 122645e

Please sign in to comment.