Fix ansible-lint nits
Ansible lint has become more fussy about its nit picking, blocking CI. This change makes it happy again. Change-Id: Ifb86c5e071697acda014bb543cab7ebf2b648dc9
This commit is contained in:
parent
8802ff3e0e
commit
a30ac7de48
@ -3,7 +3,7 @@
|
|||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||||
- "{{ ansible_distribution }}.yml"
|
- "{{ ansible_distribution }}.yml"
|
||||||
- "{{ ansible_os_family }}.yml"
|
- "{{ ansible_os_family }}.yml"
|
||||||
skip: true
|
skip: true
|
||||||
@ -12,6 +12,9 @@
|
|||||||
- name: Ensure general system requirements are installed
|
- name: Ensure general system requirements are installed
|
||||||
package:
|
package:
|
||||||
name: "{{ system_requirements }}"
|
name: "{{ system_requirements }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
become: true
|
become: true
|
||||||
# Don't uninstall requirements during teardown since they may already have
|
# Don't uninstall requirements during teardown since they may already have
|
||||||
# been present.
|
# been present.
|
||||||
@ -35,6 +38,9 @@
|
|||||||
- name: Ensure Open vSwitch package is installed
|
- name: Ensure Open vSwitch package is installed
|
||||||
package:
|
package:
|
||||||
name: "{{ tenks_openvswitch_pkg_name }}"
|
name: "{{ tenks_openvswitch_pkg_name }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
- name: Ensure Open vSwitch is started and enabled
|
- name: Ensure Open vSwitch is started and enabled
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||||
- "{{ ansible_distribution }}.yml"
|
- "{{ ansible_distribution }}.yml"
|
||||||
- "{{ ansible_os_family }}.yml"
|
- "{{ ansible_os_family }}.yml"
|
||||||
skip: true
|
skip: true
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
resource:
|
resource:
|
||||||
amount: "{{ spec.count | int }}" # this gets converted back to a string
|
amount: "{{ spec.count | int }}" # this gets converted back to a string
|
||||||
resource_class: "{{ 'CUSTOM_' ~ spec.ironic_config.resource_class | upper | replace('-', '_') }}"
|
resource_class: "{{ 'CUSTOM_' ~ spec.ironic_config.resource_class | upper | replace('-', '_') }}"
|
||||||
traits: "{{ spec.ironic_config.traits | default([])}}"
|
traits: "{{ spec.ironic_config.traits | default([]) }}"
|
||||||
set_fact:
|
set_fact:
|
||||||
tenks_expected_resources: >-
|
tenks_expected_resources: >-
|
||||||
{{ tenks_expected_resources + [resource] }}
|
{{ tenks_expected_resources + [resource] }}
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
extra_args: >-
|
extra_args: >-
|
||||||
-c {{ ironic_python_upper_constraints_url }}
|
-c {{ ironic_python_upper_constraints_url }}
|
||||||
virtualenv: "{{ ironic_virtualenv_path }}"
|
virtualenv: "{{ ironic_virtualenv_path }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
|
|
||||||
# This command will return the UUIDs, regardless of whether
|
# This command will return the UUIDs, regardless of whether
|
||||||
# ironic_deploy_kernel and ironic_deploy_ramdisk are image UUIDs or names.
|
# ironic_deploy_kernel and ironic_deploy_ramdisk are image UUIDs or names.
|
||||||
@ -36,7 +39,7 @@
|
|||||||
# for enrolment to continue.
|
# for enrolment to continue.
|
||||||
when:
|
when:
|
||||||
- item is not none
|
- item is not none
|
||||||
- item != ""
|
- item | length > 0
|
||||||
register: deploy_image_ids
|
register: deploy_image_ids
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
- name: Fail if port is not found
|
- name: Fail if port is not found
|
||||||
fail:
|
fail:
|
||||||
msg: Ironic port with MAC address {{ mac }} not found
|
msg: Ironic port with MAC address {{ mac }} not found
|
||||||
when: uuid.stdout == ""
|
when: not uuid.stdout
|
||||||
|
|
||||||
- name: Get physical network name
|
- name: Get physical network name
|
||||||
set_fact:
|
set_fact:
|
||||||
|
@ -1,55 +1,58 @@
|
|||||||
---
|
---
|
||||||
- name: Ensure Python requirements are installed
|
- name: Ensure Python requirements are installed
|
||||||
pip:
|
pip:
|
||||||
requirements: "{{ '/'.join([role_path, 'files', 'requirements.txt']) }}"
|
requirements: "{{ '/'.join([role_path, 'files', 'requirements.txt']) }}"
|
||||||
extra_args: >-
|
extra_args: >-
|
||||||
-c {{ flavors_python_upper_constraints_url }}
|
-c {{ flavors_python_upper_constraints_url }}
|
||||||
virtualenv: "{{ flavors_virtualenv_path }}"
|
virtualenv: "{{ flavors_virtualenv_path }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
|
|
||||||
- name: Configure Nova flavors
|
- name: Configure Nova flavors
|
||||||
os_nova_flavor:
|
os_nova_flavor:
|
||||||
auth_type: password
|
auth_type: password
|
||||||
name: "{{ item.name | default(item.resource_class) }}"
|
name: "{{ item.name | default(item.resource_class) }}"
|
||||||
# FIXME(w-miller): don't necessarily assume the first disk?
|
# FIXME(w-miller): don't necessarily assume the first disk?
|
||||||
disk: "{{ node_types[item.node_type].volumes.0.capacity | default('0')
|
disk: "{{ node_types[item.node_type].volumes.0.capacity | default('0')
|
||||||
| size_string_to_gb }}"
|
| size_string_to_gb }}"
|
||||||
ram: "{{ node_types[item.node_type].memory_mb }}"
|
ram: "{{ node_types[item.node_type].memory_mb }}"
|
||||||
vcpus: "{{ node_types[item.node_type].vcpus }}"
|
vcpus: "{{ node_types[item.node_type].vcpus }}"
|
||||||
# NOTE(w-miller): I'm not quite sure whether this is janky or beautiful.
|
# NOTE(w-miller): I'm not quite sure whether this is janky or beautiful.
|
||||||
#
|
#
|
||||||
# * Set hardware specs to zero here for scheduling purposes.
|
# * Set hardware specs to zero here for scheduling purposes.
|
||||||
# * Add the resource class name.
|
# * Add the resource class name.
|
||||||
# * Add required and forbidden traits.
|
# * Add required and forbidden traits.
|
||||||
# * Add any custom specs from the user.
|
# * Add any custom specs from the user.
|
||||||
extra_specs: >-
|
extra_specs: >-
|
||||||
{{ hw_specs
|
{{ hw_specs
|
||||||
| combine(resource_class)
|
| combine(resource_class)
|
||||||
| combine(required_traits)
|
| combine(required_traits)
|
||||||
| combine(forbidden_traits)
|
| combine(forbidden_traits)
|
||||||
| combine(item.custom_specs | default({}))
|
| combine(item.custom_specs | default({}))
|
||||||
}}
|
}}
|
||||||
state: "{{ flavors_state }}"
|
state: "{{ flavors_state }}"
|
||||||
vars:
|
vars:
|
||||||
hw_specs:
|
hw_specs:
|
||||||
"resources:DISK_GB": 0
|
"resources:DISK_GB": 0
|
||||||
"resources:MEMORY_MB": 0
|
"resources:MEMORY_MB": 0
|
||||||
"resources:VCPU": 0
|
"resources:VCPU": 0
|
||||||
resource_class: >-
|
resource_class: >-
|
||||||
{{ {
|
{{ {
|
||||||
"resources:CUSTOM_" ~ (
|
"resources:CUSTOM_" ~ (
|
||||||
item.resource_class | upper
|
item.resource_class | upper
|
||||||
| regex_replace('[^A-Z0-9]', '_')): 1
|
| regex_replace('[^A-Z0-9]', '_')): 1
|
||||||
} }}
|
} }}
|
||||||
required_traits: >-
|
required_traits: >-
|
||||||
{{ dict(item.required_traits
|
{{ dict(item.required_traits
|
||||||
| default([])
|
| default([])
|
||||||
| map('regex_replace', '(.*)', 'trait:\1')
|
| map('regex_replace', '(.*)', 'trait:\1')
|
||||||
| zip_longest([], fillvalue='required')) }}
|
| zip_longest([], fillvalue='required')) }}
|
||||||
forbidden_traits: >-
|
forbidden_traits: >-
|
||||||
{{ dict(item.forbidden_traits
|
{{ dict(item.forbidden_traits
|
||||||
| default([])
|
| default([])
|
||||||
| map('regex_replace', '(.*)', 'trait:\1')
|
| map('regex_replace', '(.*)', 'trait:\1')
|
||||||
| zip_longest([], fillvalue='forbidden')) }}
|
| zip_longest([], fillvalue='forbidden')) }}
|
||||||
ansible_python_interpreter: >-
|
ansible_python_interpreter: >-
|
||||||
{{ '/'.join([flavors_virtualenv_path, 'bin', 'python']) }}
|
{{ '/'.join([flavors_virtualenv_path, 'bin', 'python']) }}
|
||||||
loop: "{{ flavors }}"
|
loop: "{{ flavors }}"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
include_vars: "{{ item }}"
|
include_vars: "{{ item }}"
|
||||||
with_first_found:
|
with_first_found:
|
||||||
- files:
|
- files:
|
||||||
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version}}.yml"
|
- "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
|
||||||
- "{{ ansible_distribution }}.yml"
|
- "{{ ansible_distribution }}.yml"
|
||||||
- "{{ ansible_os_family }}.yml"
|
- "{{ ansible_os_family }}.yml"
|
||||||
skip: true
|
skip: true
|
||||||
@ -11,9 +11,11 @@
|
|||||||
|
|
||||||
- name: Ensure package dependencies are installed
|
- name: Ensure package dependencies are installed
|
||||||
package:
|
package:
|
||||||
name: "{{ item }}"
|
name: "{{ vbmcd_packages }}"
|
||||||
state: installed
|
state: installed
|
||||||
loop: "{{ vbmcd_packages }}"
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
# This is useful to get a uniquely generated temporary path.
|
# This is useful to get a uniquely generated temporary path.
|
||||||
@ -32,6 +34,9 @@
|
|||||||
extra_args: >-
|
extra_args: >-
|
||||||
-c {{ vbmcd_python_upper_constraints_url }}
|
-c {{ vbmcd_python_upper_constraints_url }}
|
||||||
virtualenv: "{{ vbmcd_virtualenv_path }}"
|
virtualenv: "{{ vbmcd_virtualenv_path }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
|
|
||||||
- name: Ensure Virtual BMC systemd service is configured
|
- name: Ensure Virtual BMC systemd service is configured
|
||||||
template:
|
template:
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
--username '{{ vbmc_ipmi_username }}'
|
--username '{{ vbmc_ipmi_username }}'
|
||||||
--password '{{ vbmc_ipmi_password }}'
|
--password '{{ vbmc_ipmi_password }}'
|
||||||
--address {{ vbmc_ipmi_address }}
|
--address {{ vbmc_ipmi_address }}
|
||||||
{% if vbmc_libvirt_uri %} --libvirt-uri '{{vbmc_libvirt_uri}}'{% endif %}
|
{% if vbmc_libvirt_uri %} --libvirt-uri '{{ vbmc_libvirt_uri }}'{% endif %}
|
||||||
when: vbmc_state == 'present'
|
when: vbmc_state == 'present'
|
||||||
become: true
|
become: true
|
||||||
tags:
|
tags:
|
||||||
|
@ -29,6 +29,9 @@
|
|||||||
-c {{ wait_for_resources_python_upper_constraints_url }}
|
-c {{ wait_for_resources_python_upper_constraints_url }}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
virtualenv: "{{ wait_for_resources_venv }}"
|
virtualenv: "{{ wait_for_resources_venv }}"
|
||||||
|
register: result
|
||||||
|
until: result is success
|
||||||
|
retries: 3
|
||||||
|
|
||||||
- name: Call wait_for_resources module
|
- name: Call wait_for_resources module
|
||||||
wait_for_resources:
|
wait_for_resources:
|
||||||
|
Loading…
Reference in New Issue
Block a user