mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-02-21 13:10:19 -03:30
ansible-lint: add spaces around variables [E206] (#4699)
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
560f50d3cd
commit
e67f848abc
@@ -10,8 +10,8 @@
|
||||
aws_access_key: "{{ aws.access_key }}"
|
||||
aws_secret_key: "{{ aws.secret_key }}"
|
||||
region: "{{ aws.region }}"
|
||||
group_id: "{{ aws.group}}"
|
||||
instance_type: "{{ aws.instance_type}}"
|
||||
group_id: "{{ aws.group }}"
|
||||
instance_type: "{{ aws.instance_type }}"
|
||||
image: "{{ aws.ami_id }}"
|
||||
wait: true
|
||||
count: "{{ aws.count }}"
|
||||
@@ -30,4 +30,4 @@
|
||||
timeout: 300
|
||||
state: started
|
||||
delegate_to: localhost
|
||||
with_items: "{{ec2.instances}}"
|
||||
with_items: "{{ ec2.instances }}"
|
||||
|
||||
@@ -52,20 +52,20 @@
|
||||
tasks:
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{test_id |regex_replace('\\.', '-')}}"
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
|
||||
- name: show vars
|
||||
debug: msg="{{cloud_region}}, {{cloud_image}}"
|
||||
debug: msg="{{ cloud_region }}, {{ cloud_image }}"
|
||||
|
||||
- set_fact:
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'ha'] -%}
|
||||
["k8s-{{test_name}}-1", "k8s-{{test_name}}-2", "k8s-{{test_name}}-3"]
|
||||
["k8s-{{ test_name }}-1", "k8s-{{ test_name }}-2", "k8s-{{ test_name }}-3"]
|
||||
{%- else -%}
|
||||
["k8s-{{test_name}}-1", "k8s-{{test_name}}-2"]
|
||||
["k8s-{{ test_name }}-1", "k8s-{{ test_name }}-2"]
|
||||
{%- endif -%}
|
||||
|
||||
- name: Manage DO instances | {{state}}
|
||||
- name: Manage DO instances | {{ state }}
|
||||
digital_ocean:
|
||||
unique_name: yes
|
||||
api_token: "{{ lookup('env','DO_API_TOKEN') }}"
|
||||
@@ -73,16 +73,16 @@
|
||||
image_id: "{{ cloud_image }}"
|
||||
name: "{{ item }}"
|
||||
private_networking: no
|
||||
region_id: "{{cloud_region}}"
|
||||
size_id: "{{cloud_machine_type}}"
|
||||
ssh_key_ids: "{{ssh_key_id}}"
|
||||
state: "{{state}}"
|
||||
region_id: "{{ cloud_region }}"
|
||||
size_id: "{{ cloud_machine_type }}"
|
||||
ssh_key_ids: "{{ ssh_key_id }}"
|
||||
state: "{{ state }}"
|
||||
wait: yes
|
||||
register: droplets
|
||||
with_items: "{{instance_names}}"
|
||||
with_items: "{{ instance_names }}"
|
||||
|
||||
- debug:
|
||||
msg: "{{droplets}}, {{inventory_path}}"
|
||||
msg: "{{ droplets }}, {{ inventory_path }}"
|
||||
when: state == 'present'
|
||||
|
||||
- name: Template the inventory
|
||||
@@ -92,6 +92,6 @@
|
||||
when: state == 'present'
|
||||
|
||||
- name: Wait for SSH to come up
|
||||
wait_for: host={{item.droplet.ip_address}} port=22 delay=10 timeout=180 state=started
|
||||
with_items: "{{droplets.results}}"
|
||||
wait_for: host={{ item.droplet.ip_address }} port=22 delay=10 timeout=180 state=started
|
||||
with_items: "{{ droplets.results }}"
|
||||
when: state == 'present'
|
||||
|
||||
@@ -14,39 +14,39 @@
|
||||
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{test_id |regex_replace('\\.', '-')}}"
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
|
||||
- set_fact:
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale'] -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2,k8s-{{test_name}}-3
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3
|
||||
{%- elif mode == 'aio' -%}
|
||||
k8s-{{test_name}}-1
|
||||
k8s-{{ test_name }}-1
|
||||
{%- else -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2
|
||||
{%- endif -%}
|
||||
|
||||
- name: Create gce instances
|
||||
gce:
|
||||
instance_names: "{{instance_names}}"
|
||||
instance_names: "{{ instance_names }}"
|
||||
machine_type: "{{ cloud_machine_type }}"
|
||||
image: "{{ cloud_image | default(omit) }}"
|
||||
image_family: "{{ cloud_image_family | default(omit) }}"
|
||||
preemptible: "{{ preemptible }}"
|
||||
service_account_email: "{{ gce_service_account_email }}"
|
||||
pem_file: "{{ gce_pem_file | default(omit)}}"
|
||||
credentials_file: "{{gce_credentials_file | default(omit)}}"
|
||||
pem_file: "{{ gce_pem_file | default(omit) }}"
|
||||
credentials_file: "{{ gce_credentials_file | default(omit) }}"
|
||||
project_id: "{{ gce_project_id }}"
|
||||
zone: "{{cloud_region}}"
|
||||
metadata: '{"test_id": "{{test_id}}", "network": "{{kube_network_plugin}}", "startup-script": "{{startup_script|default("")}}"}'
|
||||
tags: "build-{{test_name}},{{kube_network_plugin}}"
|
||||
zone: "{{ cloud_region }}"
|
||||
metadata: '{"test_id": "{{ test_id }}", "network": "{{ kube_network_plugin }}", "startup-script": "{{ startup_script|default("") }}"}'
|
||||
tags: "build-{{ test_name }},{{ kube_network_plugin }}"
|
||||
ip_forward: yes
|
||||
service_account_permissions: ['compute-rw']
|
||||
register: gce
|
||||
|
||||
- name: Add instances to host group
|
||||
add_host: hostname={{item.public_ip}} groupname="waitfor_hosts"
|
||||
with_items: '{{gce.instance_data}}'
|
||||
add_host: hostname={{ item.public_ip }} groupname="waitfor_hosts"
|
||||
with_items: '{{ gce.instance_data }}'
|
||||
|
||||
- name: Template the inventory
|
||||
template:
|
||||
|
||||
@@ -8,25 +8,25 @@
|
||||
tasks:
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{test_id |regex_replace('\\.', '-')}}"
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
|
||||
- set_fact:
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'ha'] -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2,k8s-{{test_name}}-3
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3
|
||||
{%- else -%}
|
||||
k8s-{{test_name}}-1,k8s-{{test_name}}-2
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2
|
||||
{%- endif -%}
|
||||
|
||||
- name: stop gce instances
|
||||
gce:
|
||||
instance_names: "{{instance_names}}"
|
||||
instance_names: "{{ instance_names }}"
|
||||
image: "{{ cloud_image | default(omit) }}"
|
||||
service_account_email: "{{ gce_service_account_email }}"
|
||||
pem_file: "{{ gce_pem_file | default(omit)}}"
|
||||
credentials_file: "{{gce_credentials_file | default(omit)}}"
|
||||
pem_file: "{{ gce_pem_file | default(omit) }}"
|
||||
credentials_file: "{{ gce_credentials_file | default(omit) }}"
|
||||
project_id: "{{ gce_project_id }}"
|
||||
zone: "{{cloud_region | default('europe-west1-b')}}"
|
||||
zone: "{{ cloud_region | default('europe-west1-b') }}"
|
||||
state: 'stopped'
|
||||
async: 120
|
||||
poll: 3
|
||||
@@ -35,13 +35,13 @@
|
||||
|
||||
- name: delete gce instances
|
||||
gce:
|
||||
instance_names: "{{instance_names}}"
|
||||
instance_names: "{{ instance_names }}"
|
||||
image: "{{ cloud_image | default(omit) }}"
|
||||
service_account_email: "{{ gce_service_account_email }}"
|
||||
pem_file: "{{ gce_pem_file | default(omit)}}"
|
||||
credentials_file: "{{gce_credentials_file | default(omit)}}"
|
||||
pem_file: "{{ gce_pem_file | default(omit) }}"
|
||||
credentials_file: "{{ gce_credentials_file | default(omit) }}"
|
||||
project_id: "{{ gce_project_id }}"
|
||||
zone: "{{cloud_region | default('europe-west1-b')}}"
|
||||
zone: "{{ cloud_region | default('europe-west1-b') }}"
|
||||
state: 'absent'
|
||||
async: 120
|
||||
poll: 3
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
test_name: "kargo-ci-{{ out.stdout_lines[0] }}"
|
||||
|
||||
- set_fact:
|
||||
file_name: "{{ostype}}-{{kube_network_plugin}}-{{commit}}-logs.tar.gz"
|
||||
file_name: "{{ ostype }}-{{ kube_network_plugin }}-{{ commit }}-logs.tar.gz"
|
||||
|
||||
- name: Create a bucket
|
||||
gc_storage:
|
||||
@@ -30,31 +30,31 @@
|
||||
- name: Create a lifecycle template for the bucket
|
||||
template:
|
||||
src: gcs_life.json.j2
|
||||
dest: "{{dir}}/gcs_life.json"
|
||||
dest: "{{ dir }}/gcs_life.json"
|
||||
|
||||
- name: Create a boto config to access GCS
|
||||
template:
|
||||
src: boto.j2
|
||||
dest: "{{dir}}/.boto"
|
||||
dest: "{{ dir }}/.boto"
|
||||
no_log: True
|
||||
|
||||
- name: Download gsutil cp installer
|
||||
get_url:
|
||||
url: https://dl.google.com/dl/cloudsdk/channels/rapid/install_google_cloud_sdk.bash
|
||||
dest: "{{dir}}/gcp-installer.sh"
|
||||
dest: "{{ dir }}/gcp-installer.sh"
|
||||
|
||||
- name: Get gsutil tool
|
||||
script: "{{dir}}/gcp-installer.sh"
|
||||
script: "{{ dir }}/gcp-installer.sh"
|
||||
environment:
|
||||
CLOUDSDK_CORE_DISABLE_PROMPTS: 1
|
||||
CLOUDSDK_INSTALL_DIR: "{{dir}}"
|
||||
CLOUDSDK_INSTALL_DIR: "{{ dir }}"
|
||||
no_log: True
|
||||
failed_when: false
|
||||
|
||||
- name: Apply the lifecycle rules
|
||||
command: "{{dir}}/google-cloud-sdk/bin/gsutil lifecycle set {{dir}}/gcs_life.json gs://{{test_name}}"
|
||||
command: "{{ dir }}/google-cloud-sdk/bin/gsutil lifecycle set {{ dir }}/gcs_life.json gs://{{ test_name }}"
|
||||
environment:
|
||||
BOTO_CONFIG: "{{dir}}/.boto"
|
||||
BOTO_CONFIG: "{{ dir }}/.boto"
|
||||
no_log: True
|
||||
|
||||
- name: Upload collected diagnostic info
|
||||
@@ -63,13 +63,13 @@
|
||||
mode: put
|
||||
permission: public-read
|
||||
object: "{{ file_name }}"
|
||||
src: "{{dir}}/logs.tar.gz"
|
||||
src: "{{ dir }}/logs.tar.gz"
|
||||
headers: '{"Content-Encoding": "x-gzip"}'
|
||||
gs_access_key: "{{ gs_key }}"
|
||||
gs_secret_key: "{{ gs_skey }}"
|
||||
expiration: "{{expire_days * 36000|int}}"
|
||||
expiration: "{{ expire_days * 36000|int }}"
|
||||
failed_when: false
|
||||
no_log: True
|
||||
|
||||
- debug:
|
||||
msg: "A public url https://storage.googleapis.com/{{test_name}}/{{file_name}}"
|
||||
msg: "A public url https://storage.googleapis.com/{{ test_name }}/{{ file_name }}"
|
||||
|
||||
Reference in New Issue
Block a user