Configure ansible-lint and fix issues found
Copy ansible-lint configuration from kolla-ansible as a starting point. Also replace alint tox job by ansible-lint. Fix various issues found by ansible-lint to make it pass with the current set of rules. Change-Id: I1d6173caadbcf249330512e170af8095464f1237
This commit is contained in:
44
.ansible-lint
Normal file
44
.ansible-lint
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
---
|
||||||
|
# NOTE(priteau): Rule file imported from kolla-ansible
|
||||||
|
strict: true
|
||||||
|
use_default_rules: true
|
||||||
|
skip_list:
|
||||||
|
# [E301] Commands should not change things if nothing needs doing
|
||||||
|
# TODO(mnasiadka): Fix tasks that fail this check in a later iteration
|
||||||
|
- no-changed-when
|
||||||
|
# [E503] Tasks that run when changed should likely be handlers
|
||||||
|
- no-handler
|
||||||
|
# [unnamed-task] All tasks should be named
|
||||||
|
# FIXME(mgoddard): Add names to all tasks
|
||||||
|
- unnamed-task
|
||||||
|
# disable experimental rules
|
||||||
|
- experimental
|
||||||
|
# Package installs should not use latest
|
||||||
|
- package-latest
|
||||||
|
# Most files should not contain tabs
|
||||||
|
- no-tabs
|
||||||
|
# NOTE(frickler): Agreed at Zed PTG not to use FQCN for builtin actions for now, due to
|
||||||
|
# conflicts with open patches and backports.
|
||||||
|
- fqcn-builtins
|
||||||
|
# Allow Jinja templating inside task and play names
|
||||||
|
- name[template]
|
||||||
|
# FQCNs again, now for module actions
|
||||||
|
- fqcn[action]
|
||||||
|
# role name check matching ^*$
|
||||||
|
- role-name
|
||||||
|
# Allow long lines
|
||||||
|
- yaml[line-length]
|
||||||
|
# TODO(frickler): Discuss these in detail, skipping for now to unblock things
|
||||||
|
- command-instead-of-module
|
||||||
|
- command-instead-of-shell
|
||||||
|
- deprecated-local-action
|
||||||
|
- ignore-errors
|
||||||
|
- jinja[spacing]
|
||||||
|
- key-order[task]
|
||||||
|
- name[play]
|
||||||
|
- no-free-form
|
||||||
|
- risky-file-permissions
|
||||||
|
- risky-shell-pipe
|
||||||
|
- run-once[task]
|
||||||
|
- var-naming[no-reserved]
|
||||||
|
- var-naming[no-role-prefix]
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -58,6 +58,7 @@ ansible/*.retry
|
|||||||
ansible/roles/*/tests/*.retry
|
ansible/roles/*/tests/*.retry
|
||||||
|
|
||||||
# Ansible Galaxy roles & collections
|
# Ansible Galaxy roles & collections
|
||||||
|
.ansible
|
||||||
ansible/roles/*\.*/
|
ansible/roles/*\.*/
|
||||||
ansible/collections/
|
ansible/collections/
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- apt
|
- apt
|
||||||
tasks:
|
tasks:
|
||||||
- name: include apt role
|
- name: Include apt role
|
||||||
include_role:
|
include_role:
|
||||||
name: apt
|
name: apt
|
||||||
when: ansible_facts.os_family == 'Debian'
|
when: ansible_facts.os_family == 'Debian'
|
||||||
|
@@ -39,42 +39,42 @@
|
|||||||
fail_msg: One or more Ironic variables are undefined.
|
fail_msg: One or more Ironic variables are undefined.
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Show baremetal node
|
- name: Show baremetal node
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "{{ venv }}/bin/openstack baremetal node show {{ inventory_hostname }}"
|
cmd: "{{ venv }}/bin/openstack baremetal node show {{ inventory_hostname }}"
|
||||||
register: node_show
|
register: node_show
|
||||||
failed_when:
|
failed_when:
|
||||||
- '"HTTP 404" not in node_show.stderr'
|
- '"HTTP 404" not in node_show.stderr'
|
||||||
- node_show.rc != 0
|
- node_show.rc != 0
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
# NOTE: The openstack.cloud.baremetal_node module cannot be used in this
|
# NOTE: The openstack.cloud.baremetal_node module cannot be used in this
|
||||||
# script due to requiring a MAC address pre-defined, instead, this should
|
# script due to requiring a MAC address pre-defined, instead, this should
|
||||||
# be discovered by inpsection following this script.
|
# be discovered by inpsection following this script.
|
||||||
#
|
#
|
||||||
# NOTE: IPMI address must be passed with Redfish address to ensure existing
|
# NOTE: IPMI address must be passed with Redfish address to ensure existing
|
||||||
# Ironic nodes match with new nodes during inspection.
|
# Ironic nodes match with new nodes during inspection.
|
||||||
- name: Create baremetal nodes
|
- name: Create baremetal nodes
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: |
|
cmd: |
|
||||||
{{ venv }}/bin/openstack baremetal node create \
|
{{ venv }}/bin/openstack baremetal node create \
|
||||||
--name {{ inventory_hostname }} \
|
--name {{ inventory_hostname }} \
|
||||||
--driver {{ ironic_driver }} \
|
--driver {{ ironic_driver }} \
|
||||||
{% for key, value in ironic_driver_info.items() %}
|
{% for key, value in ironic_driver_info.items() %}
|
||||||
--driver-info {{ key }}={{ value }} \
|
--driver-info {{ key }}={{ value }} \
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% for key, value in ironic_properties.items() %}
|
{% for key, value in ironic_properties.items() %}
|
||||||
--property {{ key }}={{ value }} \
|
--property {{ key }}={{ value }} \
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
--resource-class {{ ironic_resource_class }}
|
--resource-class {{ ironic_resource_class }}
|
||||||
when:
|
when:
|
||||||
- node_show.rc != 0
|
- node_show.rc != 0
|
||||||
|
|
||||||
- name: Manage baremetal nodes
|
- name: Manage baremetal nodes
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "{{ venv }}/bin/openstack baremetal node manage {{ inventory_hostname }} --wait"
|
cmd: "{{ venv }}/bin/openstack baremetal node manage {{ inventory_hostname }} --wait"
|
||||||
when:
|
when:
|
||||||
- node_show.rc != 0
|
- node_show.rc != 0
|
||||||
delegate_to: "{{ controller_host }}"
|
delegate_to: "{{ controller_host }}"
|
||||||
vars:
|
vars:
|
||||||
# NOTE: Without this, the controller's ansible_host variable will not
|
# NOTE: Without this, the controller's ansible_host variable will not
|
||||||
|
@@ -19,35 +19,35 @@
|
|||||||
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
|
extra_args: "{% if pip_upper_constraints_file %}-c {{ pip_upper_constraints_file }}{% endif %}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Fail if allocation pool start not defined
|
- name: Fail if allocation pool start not defined
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: >
|
||||||
The variable, ironic_serial_console_tcp_pool_start is not defined.
|
The variable, ironic_serial_console_tcp_pool_start is not defined.
|
||||||
This variable is required to run this playbook.
|
This variable is required to run this playbook.
|
||||||
when: not ironic_serial_console_tcp_pool_start
|
when: not ironic_serial_console_tcp_pool_start
|
||||||
|
|
||||||
- name: Fail if allocation pool end not defined
|
- name: Fail if allocation pool end not defined
|
||||||
fail:
|
fail:
|
||||||
msg: >
|
msg: >
|
||||||
The variable, ironic_serial_console_tcp_pool_end is not defined.
|
The variable, ironic_serial_console_tcp_pool_end is not defined.
|
||||||
This variable is required to run this playbook.
|
This variable is required to run this playbook.
|
||||||
when:
|
when:
|
||||||
- not ironic_serial_console_tcp_pool_end
|
- not ironic_serial_console_tcp_pool_end
|
||||||
|
|
||||||
- name: Get list of nodes that we should configure serial consoles on
|
- name: Get list of nodes that we should configure serial consoles on
|
||||||
set_fact:
|
set_fact:
|
||||||
baremetal_nodes: >-
|
baremetal_nodes: >-
|
||||||
{{ query('inventory_hostnames', console_compute_node_limit |
|
{{ query('inventory_hostnames', console_compute_node_limit |
|
||||||
default('baremetal-compute') ) | unique }}
|
default('baremetal-compute') ) | unique }}
|
||||||
|
|
||||||
- name: Reserve TCP ports for ironic serial consoles
|
- name: Reserve TCP ports for ironic serial consoles
|
||||||
include_role:
|
include_role:
|
||||||
name: console-allocation
|
name: console-allocation
|
||||||
vars:
|
vars:
|
||||||
console_allocation_pool_start: "{{ ironic_serial_console_tcp_pool_start }}"
|
console_allocation_pool_start: "{{ ironic_serial_console_tcp_pool_start }}"
|
||||||
console_allocation_pool_end: "{{ ironic_serial_console_tcp_pool_end }}"
|
console_allocation_pool_end: "{{ ironic_serial_console_tcp_pool_end }}"
|
||||||
console_allocation_ironic_nodes: "{{ baremetal_nodes }}"
|
console_allocation_ironic_nodes: "{{ baremetal_nodes }}"
|
||||||
console_allocation_filename: "{{ kayobe_env_config_path }}/console-allocation.yml"
|
console_allocation_filename: "{{ kayobe_env_config_path }}/console-allocation.yml"
|
||||||
when: cmd == "enable"
|
when: cmd == "enable"
|
||||||
|
|
||||||
- name: Enable serial console
|
- name: Enable serial console
|
||||||
@@ -76,37 +76,37 @@
|
|||||||
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Fail if console interface is not ipmitool-socat
|
- name: Fail if console interface is not ipmitool-socat
|
||||||
fail:
|
fail:
|
||||||
msg: >-
|
msg: >-
|
||||||
In order to use the serial console you must set the console_interface to ipmitool-socat.
|
In order to use the serial console you must set the console_interface to ipmitool-socat.
|
||||||
when: node["Console Interface"] != "ipmitool-socat"
|
when: node["Console Interface"] != "ipmitool-socat"
|
||||||
|
|
||||||
- name: Set IPMI serial console terminal port
|
- name: Set IPMI serial console terminal port
|
||||||
vars:
|
vars:
|
||||||
name: "{{ node['Name'] }}"
|
name: "{{ node['Name'] }}"
|
||||||
port: "{{ hostvars[controller_host].console_allocation_result.ports[name] }}"
|
port: "{{ hostvars[controller_host].console_allocation_result.ports[name] }}"
|
||||||
# NOTE: Without this, the controller's ansible_host variable will not
|
# NOTE: Without this, the controller's ansible_host variable will not
|
||||||
# be respected when using delegate_to.
|
# be respected when using delegate_to.
|
||||||
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
||||||
command: >
|
command: >
|
||||||
{{ venv }}/bin/openstack baremetal node set {{ name }} --driver-info ipmi_terminal_port={{ port }}
|
{{ venv }}/bin/openstack baremetal node set {{ name }} --driver-info ipmi_terminal_port={{ port }}
|
||||||
delegate_to: "{{ controller_host }}"
|
delegate_to: "{{ controller_host }}"
|
||||||
environment: "{{ openstack_auth_env }}"
|
environment: "{{ openstack_auth_env }}"
|
||||||
when: >-
|
when: >-
|
||||||
node['Driver Info'].ipmi_terminal_port is not defined or
|
node['Driver Info'].ipmi_terminal_port is not defined or
|
||||||
node['Driver Info'].ipmi_terminal_port | int != port | int
|
node['Driver Info'].ipmi_terminal_port | int != port | int
|
||||||
|
|
||||||
- name: Enable the IPMI socat serial console
|
- name: Enable the IPMI socat serial console
|
||||||
vars:
|
vars:
|
||||||
# NOTE: Without this, the controller's ansible_host variable will not
|
# NOTE: Without this, the controller's ansible_host variable will not
|
||||||
# be respected when using delegate_to.
|
# be respected when using delegate_to.
|
||||||
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
ansible_host: "{{ hostvars[controller_host].ansible_host | default(controller_host) }}"
|
||||||
command: >
|
command: >
|
||||||
{{ venv }}/bin/openstack baremetal node console enable {{ node['Name'] }}
|
{{ venv }}/bin/openstack baremetal node console enable {{ node['Name'] }}
|
||||||
delegate_to: "{{ controller_host }}"
|
delegate_to: "{{ controller_host }}"
|
||||||
environment: "{{ openstack_auth_env }}"
|
environment: "{{ openstack_auth_env }}"
|
||||||
when: not node['Console Enabled']
|
when: not node['Console Enabled']
|
||||||
vars:
|
vars:
|
||||||
matching_nodes: >-
|
matching_nodes: >-
|
||||||
{{ (nodes.stdout | from_json) | selectattr('Name', 'defined') |
|
{{ (nodes.stdout | from_json) | selectattr('Name', 'defined') |
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: Set a fact about the kayobe target virtualenv
|
- name: Set a fact about the kayobe target virtualenv
|
||||||
set_fact:
|
set_fact:
|
||||||
virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}"
|
kayobe_virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}"
|
||||||
when:
|
when:
|
||||||
- ansible_python_interpreter is defined
|
- ansible_python_interpreter is defined
|
||||||
- not ansible_python_interpreter.startswith('/bin')
|
- not ansible_python_interpreter.startswith('/bin')
|
||||||
@@ -47,12 +47,12 @@
|
|||||||
mode: 0755
|
mode: 0755
|
||||||
# Check whether the virtualenv directory is a subdirectory of the
|
# Check whether the virtualenv directory is a subdirectory of the
|
||||||
# global virtualenv directory.
|
# global virtualenv directory.
|
||||||
when: virtualenv.startswith(virtualenv_path)
|
when: kayobe_virtualenv.startswith(virtualenv_path)
|
||||||
become: True
|
become: True
|
||||||
|
|
||||||
- name: Ensure kayobe virtualenv directory exists
|
- name: Ensure kayobe virtualenv directory exists
|
||||||
file:
|
file:
|
||||||
path: "{{ virtualenv }}"
|
path: "{{ kayobe_virtualenv }}"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ ansible_facts.user_uid }}"
|
owner: "{{ ansible_facts.user_uid }}"
|
||||||
group: "{{ ansible_facts.user_gid }}"
|
group: "{{ ansible_facts.user_gid }}"
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
pip:
|
pip:
|
||||||
name: pip
|
name: pip
|
||||||
state: latest
|
state: latest
|
||||||
virtualenv: "{{ virtualenv }}"
|
virtualenv: "{{ kayobe_virtualenv }}"
|
||||||
# Site packages are required for using the dnf module, which is not
|
# Site packages are required for using the dnf module, which is not
|
||||||
# available via PyPI.
|
# available via PyPI.
|
||||||
virtualenv_site_packages: True
|
virtualenv_site_packages: True
|
||||||
@@ -79,14 +79,14 @@
|
|||||||
pip:
|
pip:
|
||||||
name: selinux
|
name: selinux
|
||||||
state: latest
|
state: latest
|
||||||
virtualenv: "{{ virtualenv }}"
|
virtualenv: "{{ kayobe_virtualenv }}"
|
||||||
when:
|
when:
|
||||||
- ansible_facts.os_family == 'RedHat'
|
- ansible_facts.os_family == 'RedHat'
|
||||||
vars:
|
vars:
|
||||||
# Use the system python interpreter since the virtualenv might not
|
# Use the system python interpreter since the virtualenv might not
|
||||||
# exist.
|
# exist.
|
||||||
ansible_python_interpreter: "{{ ansible_facts.python.executable }}"
|
ansible_python_interpreter: "{{ ansible_facts.python.executable }}"
|
||||||
when: virtualenv is defined
|
when: kayobe_virtualenv is defined
|
||||||
|
|
||||||
# If we gathered facts earlier it would have been with a different Python
|
# If we gathered facts earlier it would have been with a different Python
|
||||||
# interpreter. For gathering modes that may use a fact cache, gather facts
|
# interpreter. For gathering modes that may use a fact cache, gather facts
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
filter: "{{ kayobe_ansible_setup_filter }}"
|
filter: "{{ kayobe_ansible_setup_filter }}"
|
||||||
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
|
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
|
||||||
when:
|
when:
|
||||||
- virtualenv is defined
|
- kayobe_virtualenv is defined
|
||||||
- gather_facts is not skipped
|
- gather_facts is not skipped
|
||||||
- lookup('config', 'DEFAULT_GATHERING') != 'implicit'
|
- lookup('config', 'DEFAULT_GATHERING') != 'implicit'
|
||||||
|
|
||||||
@@ -110,15 +110,15 @@
|
|||||||
name: "{{ packages | select | list }}"
|
name: "{{ packages | select | list }}"
|
||||||
state: present
|
state: present
|
||||||
become: True
|
become: True
|
||||||
when: virtualenv is not defined
|
when: kayobe_virtualenv is not defined
|
||||||
|
|
||||||
- name: Ensure kolla-ansible virtualenv has docker SDK for python installed
|
- name: Ensure kolla-ansible virtualenv has docker SDK for python installed
|
||||||
pip:
|
pip:
|
||||||
name: docker
|
name: docker
|
||||||
state: latest
|
state: latest
|
||||||
virtualenv: "{{ virtualenv | default(omit) }}"
|
virtualenv: "{{ kayobe_virtualenv | default(omit) }}"
|
||||||
extra_args: "{% if docker_upper_constraints_file %}-c {{ docker_upper_constraints_file }}{% endif %}"
|
extra_args: "{% if docker_upper_constraints_file %}-c {{ docker_upper_constraints_file }}{% endif %}"
|
||||||
become: "{{ virtualenv is not defined }}"
|
become: "{{ kayobe_virtualenv is not defined }}"
|
||||||
vars:
|
vars:
|
||||||
docker_upper_constraints_file: "{{ pip_upper_constraints_file }}"
|
docker_upper_constraints_file: "{{ pip_upper_constraints_file }}"
|
||||||
when:
|
when:
|
||||||
@@ -127,9 +127,9 @@
|
|||||||
|
|
||||||
- name: Ensure kayobe virtualenv has podman SDK installed
|
- name: Ensure kayobe virtualenv has podman SDK installed
|
||||||
import_role:
|
import_role:
|
||||||
name: openstack.kolla.podman_sdk
|
name: openstack.kolla.podman_sdk
|
||||||
vars:
|
vars:
|
||||||
virtualenv: "{{ virtualenv }}"
|
virtualenv: "{{ kayobe_virtualenv }}"
|
||||||
podman_sdk_upper_constraints_file: "{{ pip_upper_constraints_file }}"
|
podman_sdk_upper_constraints_file: "{{ pip_upper_constraints_file }}"
|
||||||
when:
|
when:
|
||||||
- "'container-engine' in group_names"
|
- "'container-engine' in group_names"
|
||||||
|
@@ -57,7 +57,7 @@
|
|||||||
virtualenv: "{{ kolla_ansible_target_venv }}"
|
virtualenv: "{{ kolla_ansible_target_venv }}"
|
||||||
extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
||||||
become: True
|
become: True
|
||||||
when: "{{ container_engine == 'docker' }}"
|
when: container_engine == 'docker'
|
||||||
|
|
||||||
- name: Ensure kolla-ansible virtualenv has podman SDK installed
|
- name: Ensure kolla-ansible virtualenv has podman SDK installed
|
||||||
pip:
|
pip:
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
virtualenv: "{{ kolla_ansible_target_venv }}"
|
virtualenv: "{{ kolla_ansible_target_venv }}"
|
||||||
extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
||||||
become: True
|
become: True
|
||||||
when: "{{ container_engine == 'podman' }}"
|
when: container_engine == 'podman'
|
||||||
|
|
||||||
- name: Ensure kolla-ansible virtualenv has SELinux bindings installed
|
- name: Ensure kolla-ansible virtualenv has SELinux bindings installed
|
||||||
pip:
|
pip:
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- mdadm
|
- mdadm
|
||||||
roles:
|
roles:
|
||||||
- name: mrlesmithjr.mdadm
|
- role: mrlesmithjr.mdadm
|
||||||
become: True
|
become: True
|
||||||
when:
|
when:
|
||||||
- mdadm_arrays is defined
|
- mdadm_arrays is defined
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
- name: Configure HTTP(S) proxy settings
|
- name: Configure HTTP(S) proxy settings
|
||||||
hosts: seed-hypervisor:seed:overcloud:infra-vms
|
hosts: seed-hypervisor:seed:overcloud:infra-vms
|
||||||
max_fail_percentage: >-
|
max_fail_percentage: >-
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
---
|
---
|
||||||
- name: reload systemd daemon
|
- name: Reload systemd daemon
|
||||||
systemd:
|
systemd:
|
||||||
name: cloud-init
|
name: cloud-init
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
|
@@ -5,5 +5,5 @@
|
|||||||
state: touch
|
state: touch
|
||||||
mode: "u=rw,g=r,o=r"
|
mode: "u=rw,g=r,o=r"
|
||||||
notify:
|
notify:
|
||||||
- reload systemd daemon
|
- Reload systemd daemon
|
||||||
become: True
|
become: True
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
path: /etc/dnf/dnf.conf
|
path: /etc/dnf/dnf.conf
|
||||||
section: "main"
|
section: "main"
|
||||||
option: "{{ item.key }}"
|
option: "{{ item.key }}"
|
||||||
value: "{{ item.value }}"
|
value: "{{ item.value }}"
|
||||||
loop: "{{ query('dict', dnf_config) }}"
|
loop: "{{ query('dict', dnf_config) }}"
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
@@ -14,4 +14,4 @@
|
|||||||
- volumes
|
- volumes
|
||||||
when: "'/' not in volume"
|
when: "'/' not in volume"
|
||||||
vars:
|
vars:
|
||||||
volume: "{{ item.1.split(':')[0] }}"
|
volume: "{{ item.1.split(':')[0] }}"
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- import_tasks: prerequisites.yml
|
- import_tasks: prerequisites.yml
|
||||||
|
|
||||||
- name: list all VMs on hypervisor
|
- name: List all VMs on hypervisor
|
||||||
virt:
|
virt:
|
||||||
command: list_vms
|
command: list_vms
|
||||||
register: all_vms
|
register: all_vms
|
||||||
|
@@ -159,4 +159,4 @@
|
|||||||
# newer versions.
|
# newer versions.
|
||||||
ANSIBLE_COLLECTIONS_SCAN_SYS_PATH: "False"
|
ANSIBLE_COLLECTIONS_SCAN_SYS_PATH: "False"
|
||||||
# NOTE(wszumski): Don't use path configured for kayobe
|
# NOTE(wszumski): Don't use path configured for kayobe
|
||||||
ANSIBLE_COLLECTIONS_PATH:
|
ANSIBLE_COLLECTIONS_PATH: ''
|
||||||
|
@@ -176,7 +176,6 @@ neutron_tenant_network_types: {{ kolla_neutron_ml2_tenant_network_types | join('
|
|||||||
# ulimits:
|
# ulimits:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#############
|
#############
|
||||||
# TLS options
|
# TLS options
|
||||||
#############
|
#############
|
||||||
|
@@ -137,7 +137,7 @@
|
|||||||
- name: Check that no inventory overrides are configured
|
- name: Check that no inventory overrides are configured
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- kolla_ansible_overcloud_inventory_overrides.matched == 0
|
- kolla_ansible_overcloud_inventory_overrides.matched == 0
|
||||||
msg: >
|
msg: >
|
||||||
Overcloud group vars were found when they should not be set.
|
Overcloud group vars were found when they should not be set.
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ kolla_openstack_custom_config_include_globs_default:
|
|||||||
glob: nova/**
|
glob: nova/**
|
||||||
- enabled: '{{ kolla_enable_nova | bool }}'
|
- enabled: '{{ kolla_enable_nova | bool }}'
|
||||||
glob: nova_compute/**
|
glob: nova_compute/**
|
||||||
- enabled: '{{ kolla_enable_octavia | bool }}'
|
- enabled: '{{ kolla_enable_octavia | bool }}'
|
||||||
glob: octavia.conf
|
glob: octavia.conf
|
||||||
- enabled: '{{ kolla_enable_octavia | bool }}'
|
- enabled: '{{ kolla_enable_octavia | bool }}'
|
||||||
glob: octavia/**
|
glob: octavia/**
|
||||||
|
@@ -14,4 +14,4 @@
|
|||||||
vars:
|
vars:
|
||||||
container_name: "{{ item.key }}"
|
container_name: "{{ item.key }}"
|
||||||
container_config: "{{ item.value }}"
|
container_config: "{{ item.value }}"
|
||||||
with_dict: "{{ seed_containers }}"
|
with_dict: "{{ seed_containers }}"
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
|
---
|
||||||
- name: Destroy containers (loop)
|
- name: Destroy containers (loop)
|
||||||
include_tasks: destroy-container.yml
|
include_tasks: destroy-container.yml
|
||||||
vars:
|
vars:
|
||||||
container_name: "{{ item.key }}"
|
container_name: "{{ item.key }}"
|
||||||
container_config: "{{ item.value }}"
|
container_config: "{{ item.value }}"
|
||||||
with_dict: "{{ seed_containers }}"
|
with_dict: "{{ seed_containers }}"
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: Test the swift-block-devices role
|
- name: Test the swift-block-devices role
|
||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- device: "{{ loopback.stdout }}"
|
- device: "{{ loopback.stdout }}"
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: Test the swift-block-devices role
|
- name: Test the swift-block-devices role
|
||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- /dev/fake
|
- /dev/fake
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: Test the swift-block-devices role
|
- name: Test the swift-block-devices role
|
||||||
include_role:
|
include_role:
|
||||||
name: ../../swift-block-devices
|
name: ../../swift-block-devices
|
||||||
vars:
|
vars:
|
||||||
swift_block_devices:
|
swift_block_devices:
|
||||||
- device: "{{ loopback.stdout }}"
|
- device: "{{ loopback.stdout }}"
|
||||||
|
@@ -11,4 +11,3 @@
|
|||||||
- ssh-known-host
|
- ssh-known-host
|
||||||
roles:
|
roles:
|
||||||
- role: ssh-known-host
|
- role: ssh-known-host
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
tags:
|
tags:
|
||||||
- tuned
|
- tuned
|
||||||
roles:
|
roles:
|
||||||
- name: giovtorres.tuned
|
- role: giovtorres.tuned
|
||||||
become: true
|
become: true
|
||||||
when:
|
when:
|
||||||
- tuned_active_builtin_profile != ""
|
- tuned_active_builtin_profile != ""
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
|
---
|
||||||
aio_ips:
|
aio_ips:
|
||||||
controller1: 192.168.33.3
|
controller1: 192.168.33.3
|
||||||
|
@@ -75,10 +75,10 @@ Environments
|
|||||||
|
|
||||||
The following tox environments are provided:
|
The following tox environments are provided:
|
||||||
|
|
||||||
alint
|
|
||||||
Run Ansible linter.
|
|
||||||
ansible
|
ansible
|
||||||
Run Ansible tests for some ansible roles using Ansible playbooks.
|
Run Ansible tests for some ansible roles using Ansible playbooks.
|
||||||
|
ansible-lint
|
||||||
|
Run Ansible linter.
|
||||||
ansible-syntax
|
ansible-syntax
|
||||||
Run a syntax check for all Ansible files.
|
Run a syntax check for all Ansible files.
|
||||||
docs
|
docs
|
||||||
|
24
tox.ini
24
tox.ini
@@ -69,8 +69,28 @@ commands =
|
|||||||
-p {toxinidir}/ansible/roles
|
-p {toxinidir}/ansible/roles
|
||||||
bash -c "source {envdir}/bin/activate && {toxinidir}/tools/test-molecule.sh {posargs}"
|
bash -c "source {envdir}/bin/activate && {toxinidir}/tools/test-molecule.sh {posargs}"
|
||||||
|
|
||||||
[testenv:alint]
|
[testenv:linters]
|
||||||
commands = bash -c "ansible-lint {toxinidir}/ansible/*.yml"
|
# Env vars and deps need to be defined in top level tox env
|
||||||
|
setenv =
|
||||||
|
ANSIBLE_ACTION_PLUGINS = {toxinidir}/ansible/action_plugins
|
||||||
|
ANSIBLE_FILTER_PLUGINS = {toxinidir}/ansible/filter_plugins
|
||||||
|
ANSIBLE_ROLES_PATH = {toxinidir}/ansible/roles
|
||||||
|
|
||||||
|
deps =
|
||||||
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||||
|
-r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands =
|
||||||
|
{[testenv:ansible-lint]commands}
|
||||||
|
|
||||||
|
[testenv:ansible-lint]
|
||||||
|
# Lint only code in ansible/* - ignore various folders used by CI
|
||||||
|
# TODO(priteau): Ignore YAML linting issues in plugins and figure out why
|
||||||
|
# idrac-bootstrap.yml fails.
|
||||||
|
setenv = {[testenv:linters]setenv}
|
||||||
|
deps = {[testenv:linters]deps}
|
||||||
|
commands =
|
||||||
|
ansible-lint -p --exclude etc --exclude kayobe/plugins --exclude playbooks --exclude releasenotes --exclude roles --exclude zuul.d --exclude ansible/idrac-bootstrap.yml
|
||||||
|
|
||||||
[testenv:ansible-syntax]
|
[testenv:ansible-syntax]
|
||||||
commands =
|
commands =
|
||||||
|
Reference in New Issue
Block a user