Skip to content

Commit

Permalink
ansible-lint: add spaces around variables [E206] (kubernetes-sigs#4699)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusTeufelberger authored and k8s-ci-robot committed May 2, 2019
1 parent 560f50d commit e67f848
Show file tree
Hide file tree
Showing 88 changed files with 363 additions and 353 deletions.
1 change: 0 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ skip_list:
# The following rules throw errors.
# These either still need to be corrected in the repository and the rules re-enabled or they are skipped on purpose.
- '204'
- '206'
- '301'
- '305'
- '306'
Expand Down
8 changes: 4 additions & 4 deletions cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
pre_tasks:
- name: gather facts from all instances
setup:
delegate_to: "{{item}}"
delegate_to: "{{ item }}"
delegate_facts: true
with_items: "{{ groups['k8s-cluster'] + groups['etcd'] + groups['calico-rr']|default([]) }}"
run_once: true
Expand All @@ -46,7 +46,7 @@
- { role: kubernetes/preinstall, tags: preinstall }
- { role: "container-engine", tags: "container-engine", when: deploy_container_engine|default(true) }
- { role: download, tags: download, when: "not skip_downloads" }
environment: "{{proxy_env}}"
environment: "{{ proxy_env }}"

- hosts: etcd
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
Expand All @@ -65,7 +65,7 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes/node, tags: node }
environment: "{{proxy_env}}"
environment: "{{ proxy_env }}"

- hosts: kube-master
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
Expand Down Expand Up @@ -109,7 +109,7 @@
roles:
- { role: kubespray-defaults}
- { role: kubernetes-apps, tags: apps }
environment: "{{proxy_env}}"
environment: "{{ proxy_env }}"

- hosts: k8s-cluster
any_errors_fatal: "{{ any_errors_fatal | default(true) }}"
Expand Down
4 changes: 3 additions & 1 deletion contrib/azurerm/roles/generate-inventory/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@
vm_list: "{{ vm_list_cmd.stdout }}"

- name: Generate inventory
template: src=inventory.j2 dest="{{playbook_dir}}/inventory"
template:
src: inventory.j2
dest: "{{ playbook_dir }}/inventory"
4 changes: 3 additions & 1 deletion contrib/azurerm/roles/generate-inventory_2/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
vm_roles_list: "{{ vm_list_cmd.stdout }}"

- name: Generate inventory
template: src=inventory.j2 dest="{{playbook_dir}}/inventory"
template:
src: inventory.j2
dest: "{{ playbook_dir }}/inventory"
11 changes: 8 additions & 3 deletions contrib/azurerm/roles/generate-templates/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
- set_fact:
base_dir: "{{playbook_dir}}/.generated/"
base_dir: "{{ playbook_dir }}/.generated/"

- file: path={{base_dir}} state=directory recurse=true
- file:
path: "{{ base_dir }}"
state: directory
recurse: true

- template: src={{item}} dest="{{base_dir}}/{{item}}"
- template:
src: "{{ item }}"
dest: "{{ base_dir }}/{{ item }}"
with_items:
- network.json
- storage.json
Expand Down
4 changes: 2 additions & 2 deletions contrib/dind/roles/dind-cluster/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- name: Null-ify some linux tools to ease DIND
file:
src: "/bin/true"
dest: "{{item}}"
dest: "{{ item }}"
state: link
force: yes
with_items:
Expand Down Expand Up @@ -52,7 +52,7 @@
- rsyslog
- "{{ distro_ssh_service }}"

- name: Create distro user "{{distro_user}}"
- name: Create distro user "{{ distro_user }}"
user:
name: "{{ distro_user }}"
uid: 1000
Expand Down
2 changes: 1 addition & 1 deletion contrib/dind/roles/dind-host/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
- /lib/modules:/lib/modules
- "{{ item }}:/dind/docker"
register: containers
with_items: "{{groups.containers}}"
with_items: "{{ groups.containers }}"
tags:
- addresses

Expand Down
2 changes: 1 addition & 1 deletion contrib/metallb/roles/provision/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- name: "Kubernetes Apps | Install and configure MetalLB"
kube:
name: "MetalLB"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/{{ item.item }}"
state: "{{ item.changed | ternary('latest','present') }}"
become: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
- name: Kubernetes Apps | Lay Down k8s GlusterFS Endpoint and PV
template: src={{item.file}} dest={{kube_config_dir}}/{{item.dest}}
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}
Expand All @@ -12,9 +14,9 @@
kube:
name: glusterfs
namespace: default
kubectl: "{{bin_dir}}/kubectl"
resource: "{{item.item.type}}"
filename: "{{kube_config_dir}}/{{item.item.dest}}"
state: "{{item.changed | ternary('latest','present') }}"
kubectl: "{{ bin_dir }}/kubectl"
resource: "{{ item.item.type }}"
filename: "{{ kube_config_dir }}/{{ item.item.dest }}"
state: "{{ item.changed | ternary('latest','present') }}"
with_items: "{{ gluster_pv.results }}"
when: inventory_hostname == groups['kube-master'][0] and groups['gfs-cluster'] is defined
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Kubernetes Apps | Install and configure Heketi Bootstrap"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/heketi-bootstrap.json"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
- name: "Wait for heketi bootstrap to complete."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Create heketi storage."
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/heketi-storage-bootstrap.json"
state: "present"
vars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Kubernetes Apps | Install and configure GlusterFS daemonset"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/glusterfs-daemonset.json"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
- name: "Kubernetes Apps | Label GlusterFS nodes"
Expand All @@ -33,6 +33,6 @@
- name: "Kubernetes Apps | Install and configure Heketi Service Account"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/heketi-service-account.json"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- name: "Kubernetes Apps | Install and configure Heketi"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/heketi-deployment.json"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
- name: "Ensure heketi is up and running."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

- name: "Kubernetes Apps | Test Heketi"
register: "heketi_service_state"
command: "{{bin_dir}}/kubectl get service heketi-storage-endpoints -o=name --ignore-not-found=true"
command: "{{ bin_dir }}/kubectl get service heketi-storage-endpoints -o=name --ignore-not-found=true"
changed_when: false

- name: "Kubernetes Apps | Bootstrap Heketi"
Expand Down
12 changes: 6 additions & 6 deletions contrib/network-storage/heketi/roles/provision/tasks/secret.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
- register: "clusterrolebinding_state"
command: "{{bin_dir}}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
command: "{{ bin_dir }}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
changed_when: false
- name: "Kubernetes Apps | Deploy cluster role binding."
when: "clusterrolebinding_state.stdout == \"\""
command: "{{bin_dir}}/kubectl create clusterrolebinding heketi-gluster-admin --clusterrole=edit --serviceaccount=default:heketi-service-account"
command: "{{ bin_dir }}/kubectl create clusterrolebinding heketi-gluster-admin --clusterrole=edit --serviceaccount=default:heketi-service-account"
- register: "clusterrolebinding_state"
command: "{{bin_dir}}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
command: "{{ bin_dir }}/kubectl get clusterrolebinding heketi-gluster-admin -o=name --ignore-not-found=true"
changed_when: false
- assert:
that: "clusterrolebinding_state.stdout != \"\""
msg: "Cluster role binding is not present."

- register: "secret_state"
command: "{{bin_dir}}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
command: "{{ bin_dir }}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
changed_when: false
- name: "Render Heketi secret configuration."
become: true
Expand All @@ -22,9 +22,9 @@
dest: "{{ kube_config_dir }}/heketi.json"
- name: "Deploy Heketi config secret"
when: "secret_state.stdout == \"\""
command: "{{bin_dir}}/kubectl create secret generic heketi-config-secret --from-file={{ kube_config_dir }}/heketi.json"
command: "{{ bin_dir }}/kubectl create secret generic heketi-config-secret --from-file={{ kube_config_dir }}/heketi.json"
- register: "secret_state"
command: "{{bin_dir}}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
command: "{{ bin_dir }}/kubectl get secret heketi-config-secret -o=name --ignore-not-found=true"
changed_when: false
- assert:
that: "secret_state.stdout != \"\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
- name: "Kubernetes Apps | Install and configure Heketi Storage"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/heketi-storage.json"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
- name: "Kubernetes Apps | Install and configure Storace Class"
kube:
name: "GlusterFS"
kubectl: "{{bin_dir}}/kubectl"
kubectl: "{{ bin_dir }}/kubectl"
filename: "{{ kube_config_dir }}/storageclass.yml"
state: "{{ rendering.changed | ternary('latest', 'present') }}"
2 changes: 1 addition & 1 deletion contrib/vault/roles/vault/tasks/shared/check_etcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
until: vault_etcd_health_check.status == 200 or vault_etcd_health_check.status == 401
retries: 3
delay: 2
delegate_to: "{{groups['etcd'][0]}}"
delegate_to: "{{ groups['etcd'][0] }}"
run_once: true
failed_when: false
register: vault_etcd_health_check
Expand Down
20 changes: 10 additions & 10 deletions mitogen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
strategy: linear
vars:
mitogen_version: master
mitogen_url: https://github.com/dw/mitogen/archive/{{mitogen_version}}.zip
mitogen_url: https://github.com/dw/mitogen/archive/{{ mitogen_version }}.zip
tasks:
- name: Create mitogen plugin dir
file:
path: "{{item}}"
path: "{{ item }}"
state: directory
become: false
loop:
- "{{playbook_dir}}/plugins/mitogen"
- "{{playbook_dir}}/dist"
- "{{ playbook_dir }}/plugins/mitogen"
- "{{ playbook_dir }}/dist"

- name: download mitogen release
get_url:
url: "{{mitogen_url}}"
dest: "{{playbook_dir}}/dist/mitogen_{{mitogen_version}}.zip"
url: "{{ mitogen_url }}"
dest: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.zip"
validate_certs: true

- name: extract zip
unarchive:
src: "{{playbook_dir}}/dist/mitogen_{{mitogen_version}}.zip"
dest: "{{playbook_dir}}/dist/"
src: "{{ playbook_dir }}/dist/mitogen_{{ mitogen_version }}.zip"
dest: "{{ playbook_dir }}/dist/"

- name: copy plugin
synchronize:
src: "{{playbook_dir}}/dist/mitogen-{{mitogen_version}}/"
dest: "{{playbook_dir}}/plugins/mitogen"
src: "{{ playbook_dir }}/dist/mitogen-{{ mitogen_version }}/"
dest: "{{ playbook_dir }}/plugins/mitogen"
18 changes: 9 additions & 9 deletions roles/adduser/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
- name: User | Create User Group
group:
name: "{{user.group|default(user.name)}}"
system: "{{user.system|default(omit)}}"
name: "{{ user.group|default(user.name) }}"
system: "{{ user.system|default(omit) }}"

- name: User | Create User
user:
comment: "{{user.comment|default(omit)}}"
createhome: "{{user.createhome|default(omit)}}"
group: "{{user.group|default(user.name)}}"
home: "{{user.home|default(omit)}}"
shell: "{{user.shell|default(omit)}}"
name: "{{user.name}}"
system: "{{user.system|default(omit)}}"
comment: "{{ user.comment|default(omit) }}"
createhome: "{{ user.createhome|default(omit) }}"
group: "{{ user.group|default(user.name) }}"
home: "{{ user.home|default(omit) }}"
shell: "{{ user.shell|default(omit) }}"
name: "{{ user.name }}"
system: "{{ user.system|default(omit) }}"
26 changes: 13 additions & 13 deletions roles/container-engine/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
- name: ensure docker-ce repository public key is installed
action: "{{ docker_repo_key_info.pkg_key }}"
args:
id: "{{item}}"
url: "{{docker_repo_key_info.url}}"
id: "{{ item }}"
url: "{{ docker_repo_key_info.url }}"
state: present
register: keyserver_task_result
until: keyserver_task_result is succeeded
Expand All @@ -67,16 +67,16 @@
- name: ensure docker-ce repository is enabled
action: "{{ docker_repo_info.pkg_repo }}"
args:
repo: "{{item}}"
repo: "{{ item }}"
state: present
with_items: "{{ docker_repo_info.repos }}"
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "RedHat", "Suse", "ClearLinux"] or is_atomic) and (docker_repo_info.repos|length > 0)

- name: ensure docker-engine repository public key is installed
action: "{{ dockerproject_repo_key_info.pkg_key }}"
args:
id: "{{item}}"
url: "{{dockerproject_repo_key_info.url}}"
id: "{{ item }}"
url: "{{ dockerproject_repo_key_info.url }}"
state: present
register: keyserver_task_result
until: keyserver_task_result is succeeded
Expand All @@ -90,7 +90,7 @@
- name: ensure docker-engine repository is enabled
action: "{{ dockerproject_repo_info.pkg_repo }}"
args:
repo: "{{item}}"
repo: "{{ item }}"
state: present
with_items: "{{ dockerproject_repo_info.repos }}"
when:
Expand Down Expand Up @@ -123,7 +123,7 @@
baseurl: "{{ extras_rh_repo_base_url }}"
file: "extras"
gpgcheck: yes
gpgkey: "{{extras_rh_repo_gpgkey}}"
gpgkey: "{{ extras_rh_repo_gpgkey }}"
keepcache: "{{ docker_rpm_keepcache | default('1') }}"
proxy: " {{ http_proxy | default('_none_') }}"
when:
Expand All @@ -148,10 +148,10 @@
- name: ensure docker packages are installed
action: "{{ docker_package_info.pkg_mgr }}"
args:
pkg: "{{item.name}}"
force: "{{item.force|default(omit)}}"
conf_file: "{{item.yum_conf|default(omit)}}"
state: "{{item.state | default('present')}}"
pkg: "{{ item.name }}"
force: "{{ item.force|default(omit) }}"
conf_file: "{{ item.yum_conf|default(omit) }}"
state: "{{ item.state | default('present') }}"
update_cache: "{{ omit if ansible_distribution == 'Fedora' else True }}"
register: docker_task_result
until: docker_task_result is succeeded
Expand All @@ -166,7 +166,7 @@
action: "{{ docker_package_info.pkg_mgr }}"
args:
name: "{{ item.name }}"
state: "{{item.state | default('present')}}"
state: "{{ item.state | default('present') }}"
with_items: "{{ docker_package_info.pkgs }}"
register: docker_task_result
until: docker_task_result is succeeded
Expand All @@ -185,7 +185,7 @@

- name: show available packages on ubuntu
fail:
msg: "{{available_packages}}"
msg: "{{ available_packages }}"
when:
- docker_task_result is failed
- ansible_distribution == 'Ubuntu'
Expand Down
Loading

0 comments on commit e67f848

Please sign in to comment.