Skip to content

Commit

Permalink
Yamllint fixes (kubernetes-sigs#4410)
Browse files Browse the repository at this point in the history
* Lint everything in the repository with yamllint

* yamllint fixes: syntax fixes only

* yamllint fixes: move comments to play names

* yamllint fixes: indent comments in .gitlab-ci.yml file
  • Loading branch information
MarkusTeufelberger authored and k8s-ci-robot committed Apr 1, 2019
1 parent 483f1d2 commit 9ffc65f
Show file tree
Hide file tree
Showing 73 changed files with 322 additions and 281 deletions.
57 changes: 29 additions & 28 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
stages:
- unit-tests
- moderator
Expand All @@ -8,7 +9,7 @@ stages:
variables:
FAILFASTCI_NAMESPACE: 'kargo-ci'
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
# DOCKER_HOST: tcp://localhost:2375
# DOCKER_HOST: tcp://localhost:2375
ANSIBLE_FORCE_COLOR: "true"
MAGIC: "ci check this"
TEST_ID: "$CI_PIPELINE_ID-$CI_BUILD_ID"
Expand All @@ -34,8 +35,8 @@ variables:
# us-west1-a

before_script:
- /usr/bin/python -m pip install -r tests/requirements.txt
- mkdir -p /.ssh
- /usr/bin/python -m pip install -r tests/requirements.txt
- mkdir -p /.ssh

.job: &job
tags:
Expand All @@ -45,7 +46,7 @@ before_script:

.docker_service: &docker_service
services:
- docker:dind
- docker:dind

.create_cluster: &create_cluster
<<: *job
Expand Down Expand Up @@ -232,95 +233,95 @@ before_script:

# Test matrix. Leave the comments for markup scripts.
.coreos_calico_aio_variables: &coreos_calico_aio_variables
# stage: deploy-part1
# stage: deploy-part1
MOVED_TO_GROUP_VARS: "true"

.ubuntu18_flannel_aio_variables: &ubuntu18_flannel_aio_variables
# stage: deploy-part1
# stage: deploy-part1
MOVED_TO_GROUP_VARS: "true"

.centos_weave_kubeadm_variables: &centos_weave_kubeadm_variables
# stage: deploy-part1
# stage: deploy-part1
UPGRADE_TEST: "graceful"

.ubuntu_canal_kubeadm_variables: &ubuntu_canal_kubeadm_variables
# stage: deploy-part1
# stage: deploy-part1
MOVED_TO_GROUP_VARS: "true"

.ubuntu_canal_ha_variables: &ubuntu_canal_ha_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.ubuntu_contiv_sep_variables: &ubuntu_contiv_sep_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.coreos_cilium_variables: &coreos_cilium_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.ubuntu_cilium_sep_variables: &ubuntu_cilium_sep_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.rhel7_weave_variables: &rhel7_weave_variables
# stage: deploy-part1
# stage: deploy-part1
MOVED_TO_GROUP_VARS: "true"

.centos7_flannel_addons_variables: &centos7_flannel_addons_variables
# stage: deploy-part2
# stage: deploy-part2
MOVED_TO_GROUP_VARS: "true"

.debian9_calico_variables: &debian9_calico_variables
# stage: deploy-part2
# stage: deploy-part2
MOVED_TO_GROUP_VARS: "true"

.coreos_canal_variables: &coreos_canal_variables
# stage: deploy-part2
# stage: deploy-part2
MOVED_TO_GROUP_VARS: "true"

.rhel7_canal_sep_variables: &rhel7_canal_sep_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.ubuntu_weave_sep_variables: &ubuntu_weave_sep_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.centos7_calico_ha_variables: &centos7_calico_ha_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.centos7_kube_router_variables: &centos7_kube_router_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.centos7_multus_calico_variables: &centos7_multus_calico_variables
# stage: deploy-part2
# stage: deploy-part2
UPGRADE_TEST: "graceful"

.coreos_alpha_weave_ha_variables: &coreos_alpha_weave_ha_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.coreos_kube_router_variables: &coreos_kube_router_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.ubuntu_rkt_sep_variables: &ubuntu_rkt_sep_variables
# stage: deploy-part1
# stage: deploy-part1
MOVED_TO_GROUP_VARS: "true"

.ubuntu_flannel_variables: &ubuntu_flannel_variables
# stage: deploy-part2
# stage: deploy-part2
MOVED_TO_GROUP_VARS: "true"

.ubuntu_kube_router_variables: &ubuntu_kube_router_variables
# stage: deploy-special
# stage: deploy-special
MOVED_TO_GROUP_VARS: "true"

.opensuse_canal_variables: &opensuse_canal_variables
# stage: deploy-part2
# stage: deploy-part2
MOVED_TO_GROUP_VARS: "true"


Expand Down Expand Up @@ -727,7 +728,7 @@ yamllint:
<<: *job
stage: unit-tests
script:
- yamllint roles
- yamllint .
except: ['triggers', 'master']

tox-inventory-builder:
Expand Down
1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
---
theme: jekyll-theme-slate
2 changes: 1 addition & 1 deletion contrib/azurerm/roles/generate-templates/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
apiVersion: "2015-06-15"

virtualNetworkName: "{{ azure_virtual_network_name | default('KubeVNET') }}"
Expand Down Expand Up @@ -34,4 +35,3 @@ imageReferenceJson: "{{imageReference|to_json}}"

storageAccountName: "sa{{nameSuffix | replace('-', '')}}"
storageAccountType: "{{ azure_storage_account_type | default('Standard_LRS') }}"

1 change: 1 addition & 0 deletions contrib/azurerm/roles/generate-templates/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- set_fact:
base_dir: "{{playbook_dir}}/.generated/"

Expand Down
1 change: 1 addition & 0 deletions contrib/dind/group_vars/all/all.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
# See distro.yaml for supported node_distro images
node_distro: debian
1 change: 1 addition & 0 deletions contrib/dind/group_vars/all/distro.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
distro_settings:
debian: &DEBIAN
image: "debian:9.5"
Expand Down
1 change: 1 addition & 0 deletions contrib/dind/kubespray-dind.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# kubespray-dind.yaml: minimal kubespray ansible playbook usable for DIND
# See contrib/dind/README.md
kube_api_anonymous_auth: true
Expand Down
5 changes: 3 additions & 2 deletions contrib/dind/roles/dind-cluster/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: set_fact distro_setup
set_fact:
distro_setup: "{{ distro_settings[node_distro] }}"
Expand Down Expand Up @@ -33,7 +34,7 @@
# Delete docs
path-exclude=/usr/share/doc/*
path-include=/usr/share/doc/*/copyright
dest: /etc/dpkg/dpkg.cfg.d/01_nodoc
dest: /etc/dpkg/dpkg.cfg.d/01_nodoc
when:
- ansible_os_family == 'Debian'

Expand All @@ -55,7 +56,7 @@
user:
name: "{{ distro_user }}"
uid: 1000
#groups: sudo
# groups: sudo
append: yes

- name: Allow password-less sudo to "{{ distro_user }}"
Expand Down
3 changes: 2 additions & 1 deletion contrib/dind/roles/dind-host/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: set_fact distro_setup
set_fact:
distro_setup: "{{ distro_settings[node_distro] }}"
Expand All @@ -18,7 +19,7 @@
state: started
hostname: "{{ item }}"
command: "{{ distro_init }}"
#recreate: yes
# recreate: yes
privileged: true
tmpfs:
- /sys/module/nf_conntrack/parameters
Expand Down
4 changes: 2 additions & 2 deletions contrib/kvm-setup/roles/kvm-setup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

- name: Upgrade all packages to the latest version (yum)
yum:
name: '*'
state: latest
name: '*'
state: latest
when: ansible_os_family == "RedHat"

- name: Install required packages
Expand Down
3 changes: 1 addition & 2 deletions contrib/network-storage/glusterfs/glusterfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
vars:
ansible_ssh_pipelining: false
roles:
- { role: bootstrap-os, tags: bootstrap-os}
- { role: bootstrap-os, tags: bootstrap-os}

- hosts: all
gather_facts: true
Expand All @@ -22,4 +22,3 @@
- hosts: kube-master[0]
roles:
- { role: kubernetes-pv }

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ galaxy_info:
- wheezy
- jessie
galaxy_tags:
- system
- networking
- cloud
- clustering
- files
- sharing
- system
- networking
- cloud
- clustering
- files
- sharing
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
- name: Ensure Gluster mount directories exist.
file: "path={{ item }} state=directory mode=0775"
with_items:
- "{{ gluster_mount_dir }}"
- "{{ gluster_mount_dir }}"
when: ansible_os_family in ["Debian","RedHat"] and groups['gfs-cluster'] is defined
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ galaxy_info:
- wheezy
- jessie
galaxy_tags:
- system
- networking
- cloud
- clustering
- files
- sharing
- system
- networking
- cloud
- clustering
- files
- sharing
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@
- name: Ensure Gluster brick and mount directories exist.
file: "path={{ item }} state=directory mode=0775"
with_items:
- "{{ gluster_brick_dir }}"
- "{{ gluster_mount_dir }}"
- "{{ gluster_brick_dir }}"
- "{{ gluster_mount_dir }}"

- name: Configure Gluster volume.
gluster_volume:
state: present
name: "{{ gluster_brick_name }}"
brick: "{{ gluster_brick_dir }}"
replicas: "{{ groups['gfs-cluster'] | length }}"
cluster: "{% for item in groups['gfs-cluster'] -%}{{ hostvars[item]['ip']|default(hostvars[item].ansible_default_ipv4['address']) }}{% if not loop.last %},{% endif %}{%- endfor %}"
host: "{{ inventory_hostname }}"
force: yes
state: present
name: "{{ gluster_brick_name }}"
brick: "{{ gluster_brick_dir }}"
replicas: "{{ groups['gfs-cluster'] | length }}"
cluster: "{% for item in groups['gfs-cluster'] -%}{{ hostvars[item]['ip']|default(hostvars[item].ansible_default_ipv4['address']) }}{% if not loop.last %},{% endif %}{%- endfor %}"
host: "{{ inventory_hostname }}"
force: yes
run_once: true

- name: Mount glusterfs to retrieve disk size
mount:
name: "{{ gluster_mount_dir }}"
src: "{{ ip|default(ansible_default_ipv4['address']) }}:/gluster"
src: "{{ ip|default(ansible_default_ipv4['address']) }}:/gluster"
fstype: glusterfs
opts: "defaults,_netdev"
state: mounted
Expand All @@ -63,13 +63,13 @@

- name: Set Gluster disk size to variable
set_fact:
gluster_disk_size_gb: "{{ (mounts_data.ansible_facts.ansible_mounts | selectattr('mount', 'equalto', gluster_mount_dir) | map(attribute='size_total') | first | int / (1024*1024*1024)) | int }}"
gluster_disk_size_gb: "{{ (mounts_data.ansible_facts.ansible_mounts | selectattr('mount', 'equalto', gluster_mount_dir) | map(attribute='size_total') | first | int / (1024*1024*1024)) | int }}"
when: groups['gfs-cluster'] is defined and inventory_hostname == groups['gfs-cluster'][0]

- name: Create file on GlusterFS
template:
dest: "{{ gluster_mount_dir }}/.test-file.txt"
src: test-file.txt
dest: "{{ gluster_mount_dir }}/.test-file.txt"
src: test-file.txt
when: groups['gfs-cluster'] is defined and inventory_hostname == groups['gfs-cluster'][0]

- name: Unmount glusterfs
Expand All @@ -79,4 +79,3 @@
src: "{{ ip|default(ansible_default_ipv4['address']) }}:/gluster"
state: unmounted
when: groups['gfs-cluster'] is defined and inventory_hostname == groups['gfs-cluster'][0]

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
- name: Kubernetes Apps | Lay Down k8s GlusterFS Endpoint and PV
template: src={{item.file}} dest={{kube_config_dir}}/{{item.dest}}
with_items:
- { file: glusterfs-kubernetes-endpoint.json.j2, type: ep, dest: glusterfs-kubernetes-endpoint.json}
- { file: glusterfs-kubernetes-pv.yml.j2, type: pv, dest: glusterfs-kubernetes-pv.yml}
- { file: glusterfs-kubernetes-endpoint-svc.json.j2, type: svc, dest: glusterfs-kubernetes-endpoint-svc.json}
- { file: glusterfs-kubernetes-endpoint.json.j2, type: ep, dest: glusterfs-kubernetes-endpoint.json}
- { file: glusterfs-kubernetes-pv.yml.j2, type: pv, dest: glusterfs-kubernetes-pv.yml}
- { file: glusterfs-kubernetes-endpoint-svc.json.j2, type: svc, dest: glusterfs-kubernetes-endpoint-svc.json}
register: gluster_pv
when: inventory_hostname == groups['kube-master'][0] and groups['gfs-cluster'] is defined and hostvars[groups['gfs-cluster'][0]].gluster_disk_size_gb is defined

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
---
dependencies:
- {role: kubernetes-pv/ansible, tags: apps}
Loading

0 comments on commit 9ffc65f

Please sign in to comment.