Skip to content

Commit

Permalink
Verify YAML syntax in gates
Browse files Browse the repository at this point in the history
This patchset implements yamllint test to all *.yml
files.

Also fixes syntax errors to make jobs to pass.

Change-Id: I3186adf9835b4d0cada272d156b17d1bc9c2b799
  • Loading branch information
xNaaro committed Mar 26, 2018
1 parent 7851de5 commit ea1a1de
Show file tree
Hide file tree
Showing 50 changed files with 169 additions and 167 deletions.
15 changes: 15 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends: default
ignore: |
.tox/

rules:
line-length: disable
truthy: disable
braces:
max-spaces-inside: 1
comments:
# Ignore first space in comment because we set default options as:
#openstack_version: "pike"
require-starting-space: true
ignore: |
etc/kolla/globals.yml
3 changes: 2 additions & 1 deletion .zuul.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- project:
check:
jobs:
Expand Down Expand Up @@ -72,7 +73,7 @@
vars:
scenario: aio
roles:
- zuul: openstack-infra/zuul-jobs
- zuul: openstack-infra/zuul-jobs

- job:
name: kolla-ansible-centos-source
Expand Down
30 changes: 15 additions & 15 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ container_proxy:

# By default, Kolla API services bind to the network address assigned
# to the api_interface. Allow the bind address to be an override.
api_interface_address: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
api_interface_address: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"

################
# Chrony options
Expand Down Expand Up @@ -98,14 +98,14 @@ docker_restart_policy_retry: "10"

# Common options used throughout Docker
docker_common_options:
auth_email: "{{ docker_registry_email }}"
auth_password: "{{ docker_registry_password }}"
auth_registry: "{{ docker_registry }}"
auth_username: "{{ docker_registry_username }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_retries: "{{ docker_restart_policy_retry }}"
auth_email: "{{ docker_registry_email }}"
auth_password: "{{ docker_registry_password }}"
auth_registry: "{{ docker_registry }}"
auth_username: "{{ docker_registry_username }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
restart_policy: "{{ docker_restart_policy }}"
restart_retries: "{{ docker_restart_policy_retry }}"


####################
Expand Down Expand Up @@ -336,7 +336,7 @@ supported_policy_format_list:

# In the context of multi-regions, list here the name of all your regions.
multiple_regions_names:
- "{{ openstack_region_name }}"
- "{{ openstack_region_name }}"

openstack_service_workers: "{{ [ansible_processor_vcpus, 5]|min }}"
openstack_service_rpc_workers: "{{ [ansible_processor_vcpus, 3]|min }}"
Expand All @@ -350,11 +350,11 @@ nova_console: "novnc"
# OpenStack authentication string. You should only need to override these if you
# are changing the admin tenant/project or user.
openstack_auth:
auth_url: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}"
username: "admin"
password: "{{ keystone_admin_password }}"
project_name: "admin"
domain_name: "default"
auth_url: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}"
username: "admin"
password: "{{ keystone_admin_password }}"
project_name: "admin"
domain_name: "default"

# Endpoint type used to connect with OpenStack services with ansible modules.
# Valid options are [ public, internal, admin ]
Expand Down
1 change: 0 additions & 1 deletion ansible/kolla-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@
roles:
- { role: baremetal,
tags: baremetal }

2 changes: 1 addition & 1 deletion ansible/roles/baremetal/tasks/post-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
- enable_host_ntp | bool

- name: Synchronizing time one-time
command: ntpd -gq
command: ntpd -gq
become: True
when: enable_host_ntp | bool

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/bifrost/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
mode: "0660"
become: true
with_items:
- "rabbitmq-env.conf"
- "rabbitmq-env.conf"

- name: Template ssh keys
template:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/ceilometer/tasks/register.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
auth: "{{ '{{ openstack_ceilometer_auth }}' }}"
endpoint_type: "{{ openstack_interface }}"
module_extra_vars:
openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
run_once: True

- name: Associate the ResellerAdmin role and ceilometer user
Expand All @@ -25,6 +25,6 @@
auth: "{{ '{{ openstack_ceilometer_auth }}' }}"
endpoint_type: "{{ openstack_interface }}"
module_extra_vars:
openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
openstack_ceilometer_auth: "{{ openstack_ceilometer_auth }}"
when: enable_swift | bool
run_once: True
1 change: 0 additions & 1 deletion ansible/roles/chrony/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@
with_dict: "{{ chrony_services }}"
notify:
- Restart chrony container

2 changes: 1 addition & 1 deletion ansible/roles/common/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ common_services:
- "/dev/:/dev/"
- "/run/:/run/:shared"
- "kolla_logs:/var/log/kolla/"
# DUMMY_ENVIRONMENT is needed because empty environment is not supported
# DUMMY_ENVIRONMENT is needed because empty environment is not supported
cron:
container_name: cron
enabled: True
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/designate/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
vars:
service: "{{ designate_services['designate-worker'] }}"
template:
src: "{{ item }}"
src: "{{ item }}"
dest: "{{ node_config_directory }}/designate-worker/pools.yaml"
mode: "0660"
become: true
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/destroy/tasks/cleanup_host.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
- name: Destroying Kolla host configuration
become: true
script: ../tools/cleanup-host
script: ../tools/cleanup-host
environment:
enable_haproxy: "{{ enable_haproxy }}"
enable_swift: "{{ enable_swift }}"
Expand Down
1 change: 0 additions & 1 deletion ansible/roles/glance/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@
or glance_conf.changed | bool
or policy_overwriting.changed | bool
or glance_registry_container.changed | bool

1 change: 0 additions & 1 deletion ansible/roles/glance/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,3 @@
notify:
- Restart glance-api container
- Restart glance-registry container

1 change: 0 additions & 1 deletion ansible/roles/haproxy/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,3 @@
with_dict: "{{ haproxy_services }}"
notify:
- "Restart {{ item.key }} container"

3 changes: 1 addition & 2 deletions ansible/roles/horizon/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
with_dict: "{{ horizon_services }}"

- set_fact:
custom_policy: []
custom_policy: []

- include: policy_item.yml
vars:
Expand Down Expand Up @@ -131,4 +131,3 @@
- horizon.enabled | bool
notify:
- Restart horizon container

122 changes: 61 additions & 61 deletions ansible/roles/mariadb/tasks/recover_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,67 +15,67 @@
run_once: true

- block:
- name: Stop MariaDB containers
kolla_docker:
name: "{{ mariadb_service.container_name }}"
action: "stop_container"

- name: Run MariaDB wsrep recovery
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
BOOTSTRAP_ARGS: "--wsrep-recover"
image: "{{ mariadb_service.image }}"
labels:
BOOTSTRAP:
name: "{{ mariadb_service.container_name }}"
restart_policy: "never"
volumes: "{{ mariadb_service.volumes }}"

- name: Stop MariaDB containers
kolla_docker:
name: "{{ mariadb_service.container_name }}"
action: "stop_container"

- name: Copying MariaDB log file to /tmp
shell: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log"

- name: Get MariaDB wsrep recovery seqno
shell: "tail -n 200 /tmp/mariadb_tmp.log | grep Recovered | tail -1 | awk '{print $7}' | awk -F'\n' '{print $1}' | awk -F':' '{print $2}'"
register: wsrep_recovery_seqno

- name: Removing MariaDB log file from /tmp
file: path=/tmp/mariadb_tmp.log state=absent
changed_when: false
check_mode: no

- name: Registering MariaDB seqno variable
set_fact:
seqno: "{{ wsrep_recovery_seqno.stdout_lines[0] }}"
changed_when: false

- name: Comparing seqno value on all mariadb hosts
shell:
cmd: |
if [[ ! -z {{ hostvars[inventory_hostname]['seqno'] }} && ! -z {{ hostvars[item]['seqno'] }} &&
{{ hostvars[inventory_hostname]['seqno'] }} =~ ^[0-9]+$ && {{ hostvars[item]['seqno'] }} =~ ^[0-9]+$ &&
{{ hostvars[inventory_hostname]['seqno'] }} -lt {{ hostvars[item]['seqno'] }} ]]; then echo {{ hostvars[item]['seqno'] }}; fi
with_items: "{{ groups['mariadb'] }}"
register: seqno_compare
args:
executable: /bin/bash
changed_when: false

- name: Writing hostname of host with the largest seqno to temp file
local_action: copy content={{ inventory_hostname }} dest=/tmp/kolla_mariadb_recover_inventory_name mode=0644
changed_when: false
when: seqno_compare.results | map(attribute='stdout') | join('') == ""

- name: Registering mariadb_recover_inventory_name from temp file
set_fact:
mariadb_recover_inventory_name: "{{ lookup('file', '/tmp/kolla_mariadb_recover_inventory_name') }}"
- name: Stop MariaDB containers
kolla_docker:
name: "{{ mariadb_service.container_name }}"
action: "stop_container"

- name: Run MariaDB wsrep recovery
kolla_docker:
action: "start_container"
common_options: "{{ docker_common_options }}"
environment:
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
BOOTSTRAP_ARGS: "--wsrep-recover"
image: "{{ mariadb_service.image }}"
labels:
BOOTSTRAP:
name: "{{ mariadb_service.container_name }}"
restart_policy: "never"
volumes: "{{ mariadb_service.volumes }}"

- name: Stop MariaDB containers
kolla_docker:
name: "{{ mariadb_service.container_name }}"
action: "stop_container"

- name: Copying MariaDB log file to /tmp
shell: "docker cp {{ mariadb_service.container_name }}:/var/log/kolla/mariadb/mariadb.log /tmp/mariadb_tmp.log"

- name: Get MariaDB wsrep recovery seqno
shell: "tail -n 200 /tmp/mariadb_tmp.log | grep Recovered | tail -1 | awk '{print $7}' | awk -F'\n' '{print $1}' | awk -F':' '{print $2}'"
register: wsrep_recovery_seqno

- name: Removing MariaDB log file from /tmp
file: path=/tmp/mariadb_tmp.log state=absent
changed_when: false
check_mode: no

- name: Registering MariaDB seqno variable
set_fact:
seqno: "{{ wsrep_recovery_seqno.stdout_lines[0] }}"
changed_when: false

- name: Comparing seqno value on all mariadb hosts
shell:
cmd: |
if [[ ! -z {{ hostvars[inventory_hostname]['seqno'] }} && ! -z {{ hostvars[item]['seqno'] }} &&
{{ hostvars[inventory_hostname]['seqno'] }} =~ ^[0-9]+$ && {{ hostvars[item]['seqno'] }} =~ ^[0-9]+$ &&
{{ hostvars[inventory_hostname]['seqno'] }} -lt {{ hostvars[item]['seqno'] }} ]]; then echo {{ hostvars[item]['seqno'] }}; fi
with_items: "{{ groups['mariadb'] }}"
register: seqno_compare
args:
executable: /bin/bash
changed_when: false

- name: Writing hostname of host with the largest seqno to temp file
local_action: copy content={{ inventory_hostname }} dest=/tmp/kolla_mariadb_recover_inventory_name mode=0644
changed_when: false
when: seqno_compare.results | map(attribute='stdout') | join('') == ""

- name: Registering mariadb_recover_inventory_name from temp file
set_fact:
mariadb_recover_inventory_name: "{{ lookup('file', '/tmp/kolla_mariadb_recover_inventory_name') }}"
when:
- mariadb_recover_inventory_name is not defined

Expand Down
1 change: 0 additions & 1 deletion ansible/roles/memcached/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@
- service.enabled | bool
- action != "config"
notify: Restart memcached container

1 change: 0 additions & 1 deletion ansible/roles/neutron/tasks/config-neutron-fake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,3 @@
group: "{{ config_owner_group }}"
when: inventory_hostname in groups['compute']
with_sequence: start=1 end={{ num_nova_fake_per_node }}

1 change: 0 additions & 1 deletion ansible/roles/neutron/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,3 @@
with_dict: "{{ neutron_services }}"
notify:
- "Restart {{ item.key }} container"

2 changes: 1 addition & 1 deletion ansible/roles/nova/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ nova_services:
group: "compute"
image: "{{ nova_compute_image_full }}"
environment:
LIBGUESTFS_BACKEND: "direct"
LIBGUESTFS_BACKEND: "direct"
privileged: True
enabled: "{{ not enable_nova_fake | bool }}"
ipc_mode: "host"
Expand Down
1 change: 1 addition & 0 deletions ansible/roles/nova/tasks/bootstrap_xenapi.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
- name: Install package python-os-xenapi
package:
name: python-os-xenapi
Expand Down
1 change: 0 additions & 1 deletion ansible/roles/nova/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,3 @@
with_dict: "{{ nova_services }}"
notify:
- "Restart {{ item.key }} container"

1 change: 0 additions & 1 deletion ansible/roles/openvswitch/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,3 @@
with_dict: "{{ openvswitch_services }}"
notify:
- "Restart {{ item.key }} container"

2 changes: 1 addition & 1 deletion ansible/roles/ovs-dpdk/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ ovsdpdk_services:
####################
ovs_bridge_mappings: "{% for bridge in neutron_bridge_name.split(',') %}physnet{{ loop.index0 + 1 }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}"
ovs_port_mappings: "{% for bridge in neutron_bridge_name.split(',') %} {{ neutron_external_interface.split(',')[loop.index0] }}:{{ bridge }}{% if not loop.last %},{% endif %}{% endfor %}"
dpdk_tunnel_interface : "{{neutron_external_interface}}"
dpdk_tunnel_interface: "{{neutron_external_interface}}"
dpdk_tunnel_interface_address: "{{ hostvars[inventory_hostname]['ansible_' + dpdk_tunnel_interface]['ipv4']['address'] }}"
tunnel_interface_network: "{{ hostvars[inventory_hostname]['ansible_' + dpdk_tunnel_interface]['ipv4']['network']}}/{{hostvars[inventory_hostname]['ansible_' + dpdk_tunnel_interface]['ipv4']['netmask']}}"
tunnel_interface_cidr: "{{dpdk_tunnel_interface_address}}/{{ tunnel_interface_network | ipaddr('prefix') }}"
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/ovs-dpdk/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent']
or inventory_hostname in groups['neutron-vpnaas-agent'])
- ovs_physical_port_policy == 'indexed'
- ovs_physical_port_policy == 'indexed'

- name: Restart ovsdpdk-vswitchd container
vars:
Expand Down Expand Up @@ -86,7 +86,7 @@
or inventory_hostname in groups['neutron-l3-agent']
or inventory_hostname in groups['neutron-metadata-agent']
or inventory_hostname in groups['neutron-vpnaas-agent'])
- ovs_physical_port_policy == 'named'
- ovs_physical_port_policy == 'named'

- name: wait for dpdk tunnel ip
wait_for:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/ovs-dpdk/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- item.value.host_in_groups | bool
with_dict: "{{ ovsdpdk_services }}"
notify:
- "Restart {{ item.key }} container"
- "Restart {{ item.key }} container"

- name: Copying ovs-dpdkctl tool
copy:
Expand Down
1 change: 0 additions & 1 deletion ansible/roles/ovs-dpdk/tasks/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
- item.value.enabled | bool
- item.value.host_in_groups | bool
with_dict: "{{ ovsdpdk_services }}"

Loading

0 comments on commit ea1a1de

Please sign in to comment.