mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-10 05:59:30 -02:30
project: fix var-spacing ansible rule (#10266)
* project: fix var-spacing ansible rule Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing on the beginning/end of jinja template Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing of default filter Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix spacing between filter arguments Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix double space at beginning/end of jinja Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> * project: fix remaining jinja[spacing] ansible-lint warning Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch> --------- Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
This commit is contained in:
committed by
GitHub
parent
f8b93fa88a
commit
5d00b851ce
@@ -49,7 +49,7 @@
|
||||
tasks:
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
test_name: "{{ test_id | regex_replace('\\.', '-') }}"
|
||||
|
||||
- name: show vars
|
||||
debug:
|
||||
@@ -57,6 +57,7 @@
|
||||
|
||||
- name: set instance names
|
||||
set_fact:
|
||||
# noqa: jinja[spacing]
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'ha'] -%}
|
||||
["k8s-{{ test_name }}-1", "k8s-{{ test_name }}-2", "k8s-{{ test_name }}-3"]
|
||||
@@ -67,7 +68,7 @@
|
||||
- name: Manage DO instances | {{ state }}
|
||||
community.digitalocean.digital_ocean:
|
||||
unique_name: yes
|
||||
api_token: "{{ lookup('env','DO_API_TOKEN') }}"
|
||||
api_token: "{{ lookup('env', 'DO_API_TOKEN') }}"
|
||||
command: "droplet"
|
||||
image_id: "{{ cloud_image }}"
|
||||
name: "{{ item }}"
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
test_name: "{{ test_id | regex_replace('\\.', '-') }}"
|
||||
|
||||
- name: set instance names
|
||||
set_fact:
|
||||
# noqa: jinja[spacing]
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale'] -%}
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3
|
||||
@@ -39,7 +40,7 @@
|
||||
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("") }}"}'
|
||||
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']
|
||||
@@ -59,7 +60,7 @@
|
||||
|
||||
- name: Make group_vars directory
|
||||
file:
|
||||
path: "{{ inventory_path|dirname }}/group_vars"
|
||||
path: "{{ inventory_path | dirname }}/group_vars"
|
||||
state: directory
|
||||
mode: 0755
|
||||
when: mode in ['scale', 'separate-scale', 'ha-scale']
|
||||
@@ -67,13 +68,13 @@
|
||||
- name: Template fake hosts group vars # noqa no-relative-paths - CI templates are not in role_path
|
||||
template:
|
||||
src: ../templates/fake_hosts.yml.j2
|
||||
dest: "{{ inventory_path|dirname }}/group_vars/fake_hosts.yml"
|
||||
dest: "{{ inventory_path | dirname }}/group_vars/fake_hosts.yml"
|
||||
mode: 0644
|
||||
when: mode in ['scale', 'separate-scale', 'ha-scale']
|
||||
|
||||
- name: Delete group_vars directory
|
||||
file:
|
||||
path: "{{ inventory_path|dirname }}/group_vars"
|
||||
path: "{{ inventory_path | dirname }}/group_vars"
|
||||
state: absent
|
||||
recurse: yes
|
||||
when: delete_group_vars
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
tasks:
|
||||
- name: replace_test_id
|
||||
set_fact:
|
||||
test_name: "{{ test_id |regex_replace('\\.', '-') }}"
|
||||
test_name: "{{ test_id | regex_replace('\\.', '-') }}"
|
||||
|
||||
- name: set instance names
|
||||
set_fact:
|
||||
# noqa: jinja[spacing]
|
||||
instance_names: >-
|
||||
{%- if mode in ['separate', 'ha'] -%}
|
||||
k8s-{{ test_name }}-1,k8s-{{ test_name }}-2,k8s-{{ test_name }}-3
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
vms_files: "{{ vms_files + [lookup('ansible.builtin.template', 'vm.yml.j2') | from_yaml] }}"
|
||||
vars:
|
||||
vms_files: []
|
||||
loop: "{{ range(1, vm_count|int + 1, 1) | list }}"
|
||||
loop: "{{ range(1, vm_count | int + 1, 1) | list }}"
|
||||
loop_control:
|
||||
index_var: vm_id
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
executable: /bin/bash
|
||||
changed_when: false
|
||||
register: vm_ips
|
||||
loop: "{{ range(1, vm_count|int + 1, 1) | list }}"
|
||||
loop: "{{ range(1, vm_count | int + 1, 1) | list }}"
|
||||
loop_control:
|
||||
index_var: vm_id
|
||||
retries: 20
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
- name: Set VM count needed for CI test_id
|
||||
set_fact:
|
||||
vm_count: "{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale', 'ha-recover', 'ha-recover-noquorum'] -%}{{ 3|int }}{%- elif mode == 'aio' -%}{{ 1|int }}{%- else -%}{{ 2|int }}{%- endif -%}"
|
||||
vm_count: "{%- if mode in ['separate', 'separate-scale', 'ha', 'ha-scale', 'ha-recover', 'ha-recover-noquorum'] -%}{{ 3 | int }}{%- elif mode == 'aio' -%}{{ 1 | int }}{%- else -%}{{ 2 | int }}{%- endif -%}"
|
||||
|
||||
- import_tasks: cleanup-old-vms.yml
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user