Address ansible-lint issues
Co-Authored-By: Sergii Golovatiuk <sgolovat@redhat.com> Change-Id: I9367af823058ef5f4edd5e671cdbb971f0451422
This commit is contained in:
parent
8ac74a8177
commit
1d03dfbd80
198
meta/main.yml
198
meta/main.yml
@ -1,8 +1,10 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: your name
|
||||
description: your description
|
||||
company: your company (optional)
|
||||
author:
|
||||
- Mathie Bultel
|
||||
- Marius Cornea
|
||||
description: "Manage OpenStack upgrade"
|
||||
company:
|
||||
|
||||
# If the issue tracker for your role is not on github, uncomment the
|
||||
# next line and provide a value
|
||||
@ -15,9 +17,9 @@ galaxy_info:
|
||||
# - GPLv3
|
||||
# - Apache
|
||||
# - CC-BY
|
||||
license: license (GPLv2, CC-BY, etc)
|
||||
license: Apache 2.0
|
||||
|
||||
min_ansible_version: 1.2
|
||||
min_ansible_version: 2.4
|
||||
|
||||
# Optionally specify the branch Galaxy will use when accessing the GitHub
|
||||
# repo for this role. During role install, if no tags are available,
|
||||
@ -32,185 +34,15 @@ galaxy_info:
|
||||
# the ones that apply to your role. If you don't see your
|
||||
# platform on this list, let us know and we'll get it added!
|
||||
#
|
||||
# platforms:
|
||||
# - name: OpenBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - 5.6
|
||||
# - 5.7
|
||||
# - 5.8
|
||||
# - 5.9
|
||||
# - 6.0
|
||||
# - 6.1
|
||||
# - name: Fedora
|
||||
# versions:
|
||||
# - all
|
||||
# - 16
|
||||
# - 17
|
||||
# - 18
|
||||
# - 19
|
||||
# - 20
|
||||
# - 21
|
||||
# - 22
|
||||
# - 23
|
||||
# - 24
|
||||
# - 25
|
||||
# - name: DellOS
|
||||
# versions:
|
||||
# - all
|
||||
# - 10
|
||||
# - 6
|
||||
# - 9
|
||||
# - name: MacOSX
|
||||
# versions:
|
||||
# - all
|
||||
# - 10.10
|
||||
# - 10.11
|
||||
# - 10.12
|
||||
# - 10.7
|
||||
# - 10.8
|
||||
# - 10.9
|
||||
# - name: Synology
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: Junos
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: GenericBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: Void Linux
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: GenericLinux
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: NXOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: IOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: Amazon
|
||||
# versions:
|
||||
# - all
|
||||
# - 2013.03
|
||||
# - 2013.09
|
||||
# - 2016.03
|
||||
# - 2016.09
|
||||
# - name: ArchLinux
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: FreeBSD
|
||||
# versions:
|
||||
# - all
|
||||
# - 10.0
|
||||
# - 10.1
|
||||
# - 10.2
|
||||
# - 10.3
|
||||
# - 11.0
|
||||
# - 8.0
|
||||
# - 8.1
|
||||
# - 8.2
|
||||
# - 8.3
|
||||
# - 8.4
|
||||
# - 9.0
|
||||
# - 9.1
|
||||
# - 9.1
|
||||
# - 9.2
|
||||
# - 9.3
|
||||
# - name: Ubuntu
|
||||
# versions:
|
||||
# - all
|
||||
# - lucid
|
||||
# - maverick
|
||||
# - natty
|
||||
# - oneiric
|
||||
# - precise
|
||||
# - quantal
|
||||
# - raring
|
||||
# - saucy
|
||||
# - trusty
|
||||
# - utopic
|
||||
# - vivid
|
||||
# - wily
|
||||
# - xenial
|
||||
# - yakkety
|
||||
# - zesty
|
||||
# - name: Debian
|
||||
# versions:
|
||||
# - all
|
||||
# - etch
|
||||
# - jessie
|
||||
# - lenny
|
||||
# - sid
|
||||
# - squeeze
|
||||
# - stretch
|
||||
# - wheezy
|
||||
# - name: Alpine
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: EL
|
||||
# versions:
|
||||
# - all
|
||||
# - 5
|
||||
# - 6
|
||||
# - 7
|
||||
# - name: Windows
|
||||
# versions:
|
||||
# - all
|
||||
# - 2012R2
|
||||
# - name: SmartOS
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: opensuse
|
||||
# versions:
|
||||
# - all
|
||||
# - 12.1
|
||||
# - 12.2
|
||||
# - 12.3
|
||||
# - 13.1
|
||||
# - 13.2
|
||||
# - name: SLES
|
||||
# versions:
|
||||
# - all
|
||||
# - 10SP3
|
||||
# - 10SP4
|
||||
# - 11
|
||||
# - 11SP1
|
||||
# - 11SP2
|
||||
# - 11SP3
|
||||
# - 11SP4
|
||||
# - 12
|
||||
# - 12SP1
|
||||
# - name: GenericUNIX
|
||||
# versions:
|
||||
# - all
|
||||
# - any
|
||||
# - name: Solaris
|
||||
# versions:
|
||||
# - all
|
||||
# - 10
|
||||
# - 11.0
|
||||
# - 11.1
|
||||
# - 11.2
|
||||
# - 11.3
|
||||
# - name: eos
|
||||
# versions:
|
||||
# - all
|
||||
# - Any
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
|
||||
galaxy_tags: []
|
||||
galaxy_tags:
|
||||
- system
|
||||
- redhat
|
||||
- upgrade
|
||||
# List tags for your role here, one per line. A tag is
|
||||
# a keyword that describes and categorizes the role.
|
||||
# Users find roles by searching for tags. Be sure to
|
||||
|
@ -34,8 +34,8 @@
|
||||
vars:
|
||||
roles_data: "{{ roles_data_file.stdout }}"
|
||||
set_fact:
|
||||
roles_data: "{{ (roles_data_file.stdout|length > 0) | ternary(roles_data, default_roles_data)}}"
|
||||
custom_roles_used: "{{ (roles_data_file.stdout|length > 0) | ternary(true, false)}}"
|
||||
roles_data: "{{ (roles_data_file.stdout) | ternary(roles_data, default_roles_data) }}"
|
||||
custom_roles_used: "{{ (roles_data_file.stdout) | ternary(true, false) }}"
|
||||
|
||||
- name: assert CephOSD is enabled
|
||||
shell: |
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
- name: set ceph_osd_enabled fact
|
||||
set_fact:
|
||||
ceph_osd_enabled: "{{ (ceph_osd_service.stdout|length > 0) | ternary(true, false) }}"
|
||||
ceph_osd_enabled: "{{ (ceph_osd_service.stdout) | ternary(true, false) }}"
|
||||
|
||||
- name: check if bm nodes are present
|
||||
shell: |
|
||||
@ -55,4 +55,4 @@
|
||||
|
||||
- name: set fact splitstack_deployment
|
||||
set_fact:
|
||||
splitstack_deployment: "{{ (bm_node_present.stdout_lines|length > 0)|ternary(false, true) }}"
|
||||
splitstack_deployment: "{{ (bm_node_present.stdout_lines) | ternary(false, true) }}"
|
||||
|
@ -42,12 +42,16 @@
|
||||
register: ceph_puppet
|
||||
|
||||
- name: set ceph_osds fact
|
||||
vars:
|
||||
ceph_yaml: "{{ (ceph_puppet.stdout | from_yaml).parameter_defaults }}"
|
||||
set_fact:
|
||||
ceph_osds: "{{ (ceph_puppet.stdout | from_yaml).parameter_defaults.ExtraConfig['ceph::profile::params::osds'] | default([]) }}"
|
||||
ceph_osds: "{{ ceph_yaml.ExtraConfig['ceph::profile::params::osds'] | default([]) }}"
|
||||
|
||||
- name: set ceph_osds_pg fact
|
||||
vars:
|
||||
ceph_yaml: "{{ (ceph_puppet.stdout | from_yaml).parameter_defaults }}"
|
||||
set_fact:
|
||||
ceph_osds_pg: "{{ (ceph_puppet.stdout | from_yaml).parameter_defaults.ExtraConfig['ceph::profile::params::osd_pool_default_pg_num'] }}"
|
||||
ceph_osds_pg: "{{ ceph_yaml.ExtraConfig['ceph::profile::params::osd_pool_default_pg_num'] }}"
|
||||
ignore_errors: true
|
||||
|
||||
- name: set ceph_osds_non_collocated fact
|
||||
|
@ -36,7 +36,8 @@
|
||||
shell: |
|
||||
set -o pipefail
|
||||
sed -i -E "s/^[ ]{0,}#.*//" {{ '/'.join(nic_config_env.split('/')[0:-1]) }}/{{ item }}
|
||||
echo y | /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py {{ '/'.join(nic_config_env.split('/')[0:-1]) }}/{{ item }}
|
||||
echo y | /usr/share/openstack-tripleo-heat-templates/tools/yaml-nic-config-2-script.py \
|
||||
{{ '/'.join(nic_config_env.split('/')[0:-1]) }}/{{ item }}
|
||||
when:
|
||||
- "item[0] != '/'"
|
||||
- "tht_directory not in '/'.join(nic_config_env.split('/')[0:-1])"
|
||||
|
@ -3,7 +3,7 @@
|
||||
shell: |
|
||||
source {{ undercloud_rc }}
|
||||
/usr/bin/tripleo-ansible-inventory --plan {{ overcloud_stack_name }} \
|
||||
{% if overcloud_ssh_user != '' %} --ansible_ssh_user {{ overcloud_ssh_user }} {% endif %} \
|
||||
{% if overcloud_ssh_user %} --ansible_ssh_user {{ overcloud_ssh_user }} {% endif %} \
|
||||
--static-yaml-inventory {{ working_dir }}//tripleo-ansible-inventory.yaml
|
||||
|
||||
- name: load inventory file
|
||||
|
@ -35,7 +35,8 @@
|
||||
--discard-comments yes \
|
||||
--template {{ nic_path }}
|
||||
when:
|
||||
- "(item[0] == '/' and tht_directory not in item) or (item[0] != '/' and tht_directory not in '/'.join(nic_config_env.split('/')[0:-1]))"
|
||||
- "(item[0] == '/' and tht_directory not in item) or \
|
||||
(item[0] != '/' and tht_directory not in '/'.join(nic_config_env.split('/')[0:-1]))"
|
||||
with_items:
|
||||
- "{{ nic_template_files.stdout_lines }}"
|
||||
|
||||
|
@ -20,15 +20,8 @@
|
||||
become_user: root
|
||||
register: loaded_ovs
|
||||
|
||||
- when:
|
||||
- not tripleo_ci
|
||||
- >
|
||||
undercloud_reboot or
|
||||
(installed_kernel.stdout != loaded_kernel.stdout) or
|
||||
(installed_ovs.stdout != loaded_ovs.stdout)
|
||||
tags: undercloud_reboot
|
||||
- name: handle undercloud reboot
|
||||
block:
|
||||
|
||||
- name: reboot the undercloud
|
||||
shell: "sleep 2 && shutdown -r now"
|
||||
async: 1
|
||||
@ -83,3 +76,10 @@
|
||||
until: oc_name.stdout.find('{{ overcloud_stack_name }}') != -1
|
||||
retries: "{{ service_readiness_count|default(100)|int }}"
|
||||
delay: 3
|
||||
when:
|
||||
- not tripleo_ci
|
||||
- >
|
||||
undercloud_reboot or
|
||||
(installed_kernel.stdout != loaded_kernel.stdout) or
|
||||
(installed_ovs.stdout != loaded_ovs.stdout)
|
||||
tags: undercloud_reboot
|
||||
|
@ -39,6 +39,10 @@
|
||||
- '\1\n uses_deprecated_params: True'
|
||||
|
||||
- name: Assigns network attributes to Controller role or custom controller roles
|
||||
vars:
|
||||
ctr_desc: >-
|
||||
description: |\n Controller role that has all the controler services loaded and handles
|
||||
Database, Messaging and Network functions.
|
||||
replace:
|
||||
dest: '{{ custom_roles_file.stdout }}'
|
||||
regexp: '^(- name: Controller.*)'
|
||||
@ -46,7 +50,7 @@
|
||||
with_items:
|
||||
- '\1\n networks:\n - External\n - InternalApi\n - Storage\n - StorageMgmt\n - Tenant'
|
||||
- '\1\n tags:\n - primary\n - controller'
|
||||
- '\1\n description: |\n Controller role that has all the controler services loaded and handles\n Database, Messaging and Network functions.'
|
||||
- '\1\n {{ ctr_desc }}'
|
||||
|
||||
- name: Assigns deprecated params to Compute role
|
||||
replace:
|
||||
|
@ -17,8 +17,8 @@
|
||||
replace: "{{ upgrade_composable_scenario }}"
|
||||
when:
|
||||
- tripleo_ci|bool
|
||||
- upgrade_composable_scenario != ""
|
||||
- composable_scenario != ""
|
||||
- upgrade_composable_scenario|default("")
|
||||
- composable_scenario|default("")
|
||||
|
||||
- name: Convert CLI options to parameters
|
||||
include: ../common/convert_cli_opts_params.yaml
|
||||
|
@ -25,7 +25,9 @@
|
||||
|
||||
- block:
|
||||
- name: Ensure ansible-pacemaker module is present in CI.
|
||||
yum: name=ansible-pacemaker state=latest
|
||||
yum:
|
||||
name: ansible-pacemaker
|
||||
state: latest
|
||||
when: tripleo_ci|default(false)|bool
|
||||
tags: ffu_upgrade_playbook
|
||||
become: true
|
||||
|
@ -70,7 +70,9 @@
|
||||
tags: overcloud_update_prepare_containers
|
||||
|
||||
- name: Ensure ansible-pacemaker module is present in CI.
|
||||
yum: name=ansible-pacemaker state=latest
|
||||
yum:
|
||||
name: ansible-pacemaker
|
||||
state: latest
|
||||
when: tripleo_ci|default(false)|bool
|
||||
tags: overcloud_update
|
||||
become: true
|
||||
|
@ -73,7 +73,9 @@
|
||||
tags: overcloud_upgrade_prepare_containers
|
||||
|
||||
- name: Ensure ansible-pacemaker module is present in CI.
|
||||
yum: name=ansible-pacemaker state=latest
|
||||
yum:
|
||||
name: ansible-pacemaker
|
||||
state: latest
|
||||
when: tripleo_ci|default(false)|bool
|
||||
tags: overcloud_upgrade_run
|
||||
become: true
|
||||
|
@ -8,12 +8,14 @@
|
||||
- name: register first controller ip address
|
||||
shell: |
|
||||
source {{ undercloud_rc }}
|
||||
openstack server list -f json | jq -r -c '.[] | select(.Name | contains("controller","ctrl")) | .Networks' | grep -oP '[0-9.]+' | head -1
|
||||
openstack server list -f json | \
|
||||
jq -r -c '.[] | select(.Name | contains("controller","ctrl")) | .Networks' | \
|
||||
grep -oP '[0-9.]+' | head -1
|
||||
register: ctrl_ip
|
||||
|
||||
- name: test undercloud keystone reachability
|
||||
vars:
|
||||
oc_user: "{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
oc_user: "{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
shell: |
|
||||
ssh -q -o StrictHostKeyChecking=no {{ oc_user }}@{{ ctrl_ip.stdout }} curl --silent {{ keystone_endpoint.stdout }}
|
||||
register: uc_keystone_conn
|
||||
@ -90,7 +92,7 @@
|
||||
|
||||
- name: copy certificate to the overcloud nodes and update the trusted store
|
||||
vars:
|
||||
oc_user: "{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
oc_user: "{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
shell: |
|
||||
scp -q -o StrictHostKeyChecking=no {{ working_dir }}/undercloud.pem {{ oc_user }}@{{ item }}:
|
||||
ssh -q -o StrictHostKeyChecking=no {{ oc_user }}@{{ item }} 'sudo cp undercloud.pem /etc/pki/ca-trust/source/anchors/; sudo update-ca-trust extract'
|
||||
|
@ -1,5 +1,5 @@
|
||||
source {{ undercloud_rc }}
|
||||
OC_USER="{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
OC_USER="{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
NODE_IP=$(openstack server show {{ node_name | splitext | first }} -f json | jq -r .addresses | grep -oP '[0-9.]+')
|
||||
|
||||
## wait for galera resource to come back up
|
||||
|
@ -1,5 +1,5 @@
|
||||
source {{ undercloud_rc }}
|
||||
OC_USER="{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
OC_USER="{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
NODE_IP=$(openstack server show {{ node_name | splitext | first }} -f json | jq -r .addresses | grep -oP '[0-9.]+')
|
||||
|
||||
## in case of external loadbalancer haproxy resource is not running on controller nodes
|
||||
|
@ -1,5 +1,5 @@
|
||||
source {{ undercloud_rc }}
|
||||
OC_USER="{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
OC_USER="{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
NODE_IP=$(openstack server show {{ node_name | splitext | first }} -f json | jq -r .addresses | grep -oP '[0-9.]+')
|
||||
|
||||
## wait for rabbitmq resource to come back up
|
||||
|
@ -1,5 +1,5 @@
|
||||
source {{ undercloud_rc }}
|
||||
OC_USER="{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
OC_USER="{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
NODE_IP=$(openstack server show {{ node_name | splitext | first }} -f json | jq -r .addresses | grep -oP '[0-9.]+')
|
||||
|
||||
{% if controller_reboot %}
|
||||
|
@ -1,5 +1,5 @@
|
||||
source {{ undercloud_rc }}
|
||||
OC_USER="{{ (overcloud_ssh_user == '') | ternary('heat-admin', overcloud_ssh_user) }}"
|
||||
OC_USER="{{ (overcloud_ssh_user) | ternary(overcloud_ssh_user, 'heat-admin') }}"
|
||||
NODE_IP=$(openstack server show {{ node_name | splitext | first }} -f json | jq -r .addresses | grep -oP '[0-9.]+')
|
||||
|
||||
## wait for redis resource to come back up
|
||||
|
Loading…
x
Reference in New Issue
Block a user