Fix key-order ansible errors

Also fix some spacing warnings

Change-Id: Iec191273591ee88710438f3bbbf63ec242d0c247
This commit is contained in:
Riccardo Pittau 2023-11-09 11:16:49 +01:00
parent 3ec54b0396
commit a756129b47
11 changed files with 49 additions and 50 deletions

View File

@ -4,7 +4,6 @@ skip_list:
- fqcn[action-core] # Use FQCN for builtin actions
- ignore-errors # Use failed_when and specify error conditions instead of using ignore_errors
- jinja[invalid] # Unrecognized type
- key-order[play] # You can improve the play key order to: name, hosts, connection, become, gather_facts, vars, roles, environment
- meta-no-info # meta/main.yml should contain relevant info
- meta-no-tags # Tags must contain lowercase letters and digits only
- name[casing] #All names should start with an uppercase letter

View File

@ -1,7 +1,7 @@
---
- hosts: localhost
- name: "Remove the master_images folder and deployment kernel/ramdisk for clean redeployments when testing."
hosts: localhost
connection: local
name: "Remove the master_images folder and deployment kernel/ramdisk for clean redeployments when testing."
become: yes
gather_facts: yes
tasks:

View File

@ -1,11 +1,11 @@
---
- hosts: localhost
name: "Gather facts on localhost"
- name: "Gather facts on localhost"
hosts: localhost
become: no
gather_facts: yes
- hosts: baremetal
name: "Create configuration drive files and deploy machines from inventory"
- name: "Create configuration drive files and deploy machines from inventory"
hosts: baremetal
become: no
gather_facts: no
roles:

View File

@ -1,11 +1,11 @@
---
- hosts: localhost
name: "Gather facts on localhost"
- name: "Gather facts on localhost"
hosts: localhost
become: no
gather_facts: yes
- hosts: baremetal
name: "Enroll hardware from inventory into Ironic"
- name: "Enroll hardware from inventory into Ironic"
hosts: baremetal
become: no
gather_facts: no
roles:

View File

@ -16,13 +16,13 @@
# and the example role conditionals below to query current status and
# deploy to nodes.
---
- hosts: localhost
- name: "Collect facts"
hosts: localhost
connection: local
name: "Collect facts"
become: no
gather_facts: yes
- hosts: baremetal
name: "Create configuration drive files and deploy machines from inventory"
- name: "Create configuration drive files and deploy machines from inventory"
hosts: baremetal
become: no
connection: local
roles:

View File

@ -1,6 +1,6 @@
---
- hosts: target
name: "Install Ironic on the target host."
- name: "Install Ironic on the target host."
hosts: target
become: yes
gather_facts: yes
vars:

View File

@ -19,23 +19,23 @@
# other operating systems or if your target node has multiple ethernet
# interfaces.
---
- hosts: localhost
- name: "Collect facts"
hosts: localhost
connection: local
name: "Collect facts"
become: no
gather_facts: yes
- hosts: baremetal
name: "Pull cloud configuration"
become: no
- name: "Pull cloud configuration"
hosts: baremetal
connection: local
become: no
roles:
- role: bifrost-cloud-config
- hosts: baremetal
name: "Unprovision the nodes"
become: no
- name: "Unprovision the nodes"
hosts: baremetal
connection: local
become: no
pre_tasks:
- name: "Pull initial ironic facts"
openstack.cloud.baremetal_node_info:
@ -70,10 +70,10 @@
retries: "{{ available_state_wait_retries | default(45) }}"
delay: "{{ provision_state_retry_interval | default(20) }}"
- hosts: baremetal
name: "Activate the nodes"
become: no
- name: "Activate the nodes"
hosts: baremetal
connection: local
become: no
roles:
- role: bifrost-configdrives-dynamic
when:

View File

@ -51,7 +51,7 @@
virsh --connect {{ test_vm_libvirt_uri }}
vol-create-as {{ test_vm_storage_pool }} {{ vm_name }}.qcow2
{{ test_vm_disk_gib | int + 1 }}G
--format qcow2 {{ prealloc|default("") }}
--format qcow2 {{ prealloc | default("") }}
when: (vm_name + '.qcow2') not in ansible_libvirt_pools[test_vm_storage_pool].volumes
- name: set path to the volume created
@ -108,7 +108,7 @@
when: vbmc_list.stdout.find(vm_name) != -1
- set_fact:
virtual_ipmi_port: "{{ (test_vm_ipmi_port_start|default(623) | int ) + (testvm_json_data | length) }}"
virtual_ipmi_port: "{{ (test_vm_ipmi_port_start | default(623) | int) + (testvm_json_data | length) }}"
- name: plug vm into vbmc
command: vbmc add {{ vm_name }} --libvirt-uri {{ test_vm_libvirt_uri }} --port {{ virtual_ipmi_port }}

View File

@ -96,11 +96,11 @@
- name: truncate explicit list of vm names
set_fact:
test_vm_node_names: "{{ test_vm_node_names[:(test_vm_num_nodes|int)] }}"
test_vm_node_names: "{{ test_vm_node_names[: (test_vm_num_nodes | int)] }}"
- name: generate test vm names
set_fact:
generated_test_vm_node_names: "{{ generated_test_vm_node_names|default([]) + [item] }}"
generated_test_vm_node_names: "{{ generated_test_vm_node_names | default([]) + [item] }}"
with_sequence: count={{ test_vm_num_nodes | int }} format={{ test_vm_node_name_base }}%i
when: test_vm_node_names | length == 0

View File

@ -1,8 +1,8 @@
# Create a default VM
---
- hosts: localhost
- name: "Executes install, enrollment, and testing in one playbook"
hosts: localhost
connection: local
name: "Executes install, enrollment, and testing in one playbook"
become: yes
gather_facts: yes
pre_tasks:

View File

@ -6,9 +6,9 @@
# Execute the installation and VM startup test.
# ansible-playbook -vvvv -i inventory/bifrost_inventory.py test-bifrost.yaml -e download_custom_deploy_image=true -e testing_user=cirros
---
- hosts: localhost
- name: "Prepare testing environment"
hosts: localhost
connection: local
name: "Prepare testing environment"
become: no
gather_facts: yes
tasks:
@ -35,28 +35,28 @@
- import_playbook: enroll-dynamic.yaml
- hosts: baremetal
name: "Test introspection data"
become: no
- name: "Test introspection data"
hosts: baremetal
connection: local
become: no
roles:
- role: bifrost-test-inspection
when: inspect_nodes | default(false) | bool
- import_playbook: deploy-dynamic.yaml
- hosts: baremetal
name: "Prepare for deployment verification"
become: no
- name: "Prepare for deployment verification"
hosts: baremetal
connection: local
become: no
serial: 1
roles:
- role: bifrost-prepare-for-test-dynamic
# The testvm Host group is added by bifrost-prepare-for-test based
# on the contents of the JSON file.
- hosts: test
name: "Tests connectivity to the VM"
- name: "Tests connectivity to the VM"
hosts: test
become: no
gather_facts: no
remote_user: "{{ testing_user }}"
@ -69,9 +69,9 @@
- import_playbook: redeploy-dynamic.yaml
when: redeploy_nodes | default(false) | bool
- hosts: baremetal
- name: "Unprovisions the test node"
hosts: baremetal
connection: local
name: "Unprovisions the test node"
become: no
gather_facts: no
roles:
@ -80,9 +80,9 @@
- role: ironic-delete-dynamic
# The following tasks are intended to test DHCP functionality
- hosts: localhost
- name: "Start VMs that were not enrolled to ironic"
hosts: localhost
connection: local
name: "Start VMs that were not enrolled to ironic"
become: yes
vars:
not_enrolled_data_file: /tmp/baremetal.json.rest
@ -103,9 +103,9 @@
seconds: 30
when: inventory_dhcp | bool
- hosts: localhost
- name: "Executes DHCP test script"
hosts: localhost
connection: local
name: "Executes DHCP test script"
become: yes
gather_facts: yes
vars: