Adopt yamllint strict linting

Upgrades yamllint to latest version and adots use of its strict
checking.

Fix all known problems reported by yamllint so we don't have to do
that while touching these files.

Change-Id: I4bdc520d9e2aff086c4b463718bc1e053261a4f5
Story: https://tree.taiga.io/project/tripleo-ci-board/task/381
This commit is contained in:
Sorin Sbarnea 2018-11-15 20:31:14 +00:00
parent 3be1290957
commit 72141b7fab
153 changed files with 634 additions and 544 deletions

View File

@ -15,14 +15,12 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.12.1
rev: v1.13.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
# uncommend once a new yamllint release is made:
# entry: yamllint --strict
entry: yamllint --strict
- repo: https://github.com/openstack-dev/bashate.git
rev: 0.6.0
hooks:

View File

@ -1,3 +1,4 @@
---
environment_type: ovb_host_cloud
# undercloud.conf
@ -37,12 +38,12 @@ external_interface_netmask: 255.255.255.0
# images to copy to the undercloud
images:
- name: overcloud-full
url: "{{ overcloud_image_url }}"
type: tar
- name: ipa_images
url: "{{ ipa_image_url }}"
type: tar
- name: overcloud-full
url: "{{ overcloud_image_url }}"
type: tar
- name: ipa_images
url: "{{ ipa_image_url }}"
type: tar
network_environment_args:
ExternalNetCidr: "{{ undercloud_external_network_cidr }}"
@ -63,7 +64,7 @@ network_environment_args:
TenantNetCidr: 172.16.0.0/24
TenantAllocationPools: [{"start": "172.16.0.10", "end": "172.16.0.250"}]
DnsServers: "{{ overcloud_dns_servers }}"
PublicVirtualFixedIPs: [{ "ip_address": "{{ undercloud_external_network_cidr|nthhost(5) }}" }]
PublicVirtualFixedIPs: [{"ip_address": "{{ undercloud_external_network_cidr|nthhost(5) }}"}]
NeutronGlobalPhysnetMtu: 1350
BondInterfaceOvsOptions: bond_mode=balance-slb

View File

@ -1,3 +1,4 @@
---
artcl_gzip_only: true
artcl_artifact_url: https://ci.centos.org/artifacts/rdo
artcl_publish: true

View File

@ -1,3 +1,4 @@
---
# We run tempest in this topology instead of ping test.
# We set introspection to true and use only the minimal amount of nodes
# for this job, but test all defaults otherwise.
@ -22,7 +23,7 @@ containerized_overcloud: true
# This enables TLS for the undercloud which will also make haproxy bind to the
# configured public-vip and admin-vip.
undercloud_generate_service_certificate: True
undercloud_generate_service_certificate: true
# This enables the deployment of the overcloud with SSL.
ssl_overcloud: false

View File

@ -1,3 +1,4 @@
---
# EXPERIMENTAL FEATURE
# set the working_dir on the undercloud
working_dir: /home/stack
@ -44,12 +45,12 @@ run_tempest: false
tempest_workers: 4
# Config for custom tripleo-heat-templates
#overcloud_templates_path: /home/stack/tripleo-heat-templates
#overcloud_templates_repo: https://git.openstack.org/openstack/tripleo-heat-templates
## use templates_branch when not testing with an unmerged review
#overcloud_templates_branch: master
## use templates_refspec when testing with an unmerged review
#overcloud_templates_refspec:
# overcloud_templates_path: /home/stack/tripleo-heat-templates
# overcloud_templates_repo: https://git.openstack.org/openstack/tripleo-heat-templates
# # use templates_branch when not testing with an unmerged review
# overcloud_templates_branch: master
# # use templates_refspec when testing with an unmerged review
# overcloud_templates_refspec:
# options below direct automatic doc generation by tripleo-collect-logs
artcl_gen_docs: true

View File

@ -42,17 +42,26 @@ flavor_args: >-
timeout_args: "--timeout {{ deploy_timeout }}"
extra_args: "--compute-scale 1 -e {{ overcloud_templates_path }}/environments/network-isolation.yaml -e {{ overcloud_templates_path }}/environments/net-single-nic-with-vlans.yaml -e ~/network-environment.yaml --ntp-server pool.ntp.org"
extra_args: >
--compute-scale 1
-e {{ overcloud_templates_path }}/environments/network-isolation.yaml
-e {{ overcloud_templates_path }}/environments/net-single-nic-with-vlans.yaml
-e ~/network-environment.yaml --ntp-server pool.ntp.org
# Pull out scale_extra_args so the same var can be reused for the call to
# `openstack overcloud delete`
scale_extra_configs: "-e {{ overcloud_templates_path }}/environments/network-isolation.yaml -e {{ overcloud_templates_path }}/environments/net-single-nic-with-vlans.yaml -e /home/stack/network-environment.yaml"
scale_extra_args: "--{{ node_to_scale }}-scale {{ final_scale_value }} {{ scale_extra_configs }} --ntp-server pool.ntp.org"
scale_extra_configs: >
-e {{ overcloud_templates_path }}/environments/network-isolation.yaml
-e {{ overcloud_templates_path }}/environments/net-single-nic-with-vlans.yaml
-e /home/stack/network-environment.yaml
scale_extra_args: >
--{{ node_to_scale }}-scale {{ final_scale_value }} {{ scale_extra_configs }}
--ntp-server pool.ntp.org
# Scale deployment info
node_to_scale: compute # Type of node to scale
initial_scale_value: 1 # Initial number of nodes to deploy
final_scale_value: 2 # Number of additional nodes to add during the scale
node_to_scale: compute # Type of node to scale
initial_scale_value: 1 # Initial number of nodes to deploy
final_scale_value: 2 # Number of additional nodes to add during the scale
# Scale deployment arguments
scale_args: >-

View File

@ -1,3 +1,4 @@
---
# baremetal settings
step_introspect: true
network_isolation_type: public-bond
@ -22,9 +23,9 @@ extra_args: " --control-flavor baremetal --compute-flavor baremetal "
# in order to reduce the overall memory footprint
# This is not required in newton
telemetry_args: >-
{% if release not in ['newton', 'ocata'] %}
-e {{ overcloud_templates_path }}/environments/disable-telemetry.yaml
{% endif %}
{% if release not in ['newton', 'ocata'] %}
-e {{ overcloud_templates_path }}/environments/disable-telemetry.yaml
{% endif %}
run_tempest: false
tempest_config: false

View File

@ -1,3 +1,4 @@
---
# baremetal settings
step_introspect: true
network_isolation_type: multiple-nics

View File

@ -1,3 +1,4 @@
---
artcl_publish: true
artcl_use_zuul_swift_upload: true
artcl_swift_container: artifacts

View File

@ -1,3 +1,4 @@
---
- name: Configure next release repository in the undercloud
hosts: undercloud
tags:
@ -12,7 +13,7 @@
roles:
- role: repo-setup
- role: build-test-packages
- { role: install-built-repo, when: compressed_gating_repo is defined }
- {role: install-built-repo, when: compressed_gating_repo is defined}
- name: Run tripleo-upgrade role to upgrade undercloud
hosts: undercloud
@ -20,4 +21,3 @@
- undercloud-upgrade
roles:
- role: tripleo-upgrade

View File

@ -13,5 +13,4 @@
- name: Create the OVB stack
hosts: localhost
roles:
- { role: ovb-manage-stack, ovb_manage_stack_mode: 'create' }
- {role: ovb-manage-stack, ovb_manage_stack_mode: 'create'}

View File

@ -2,4 +2,4 @@
- name: clean up heat stack
hosts: localhost
roles:
- { role: ovb-manage-stack, ovb_manage_stack_mode: 'delete' }
- {role: ovb-manage-stack, ovb_manage_stack_mode: 'delete'}

View File

@ -1,3 +1,4 @@
---
# Playbook included in OVB setups that use a testenv broker to create the
# OVB stack.
@ -40,9 +41,8 @@
addresses:
- ip_netmask: 10.0.0.1/24
- ip_netmask: 2001:db8:fd00:1000::1/64
create: yes
create: true
- name: Install ipmitool if not installed
yum: name=ipmitool state=latest
become: true

View File

@ -1,3 +1,4 @@
---
# This is the playbook used by the `quickstart.sh` script.
- include: quickstart.yml

View File

@ -15,13 +15,13 @@
- name: Scale overcloud nodes
hosts: undercloud
roles:
- { role: overcloud-scale, artosn_scale_nodes: true, artosn_delete_original_node: false }
- {role: overcloud-scale, artosn_scale_nodes: true, artosn_delete_original_node: false}
# Delete the original node of type that was scaled - ensure overcloud validates after reducing scale
- name: Delete original node of type scaled
hosts: undercloud
roles:
- { role: overcloud-scale, artosn_scale_nodes: false, artosn_delete_original_node: true }
- {role: overcloud-scale, artosn_scale_nodes: false, artosn_delete_original_node: true}
# NOTE(hrybacki: inventory regeneration and overcloud validation must be completed in a second playbook. The
# deleted node is removed from the hosts file. However, it still exists in memory and will cause the

View File

@ -3,4 +3,3 @@ features:
- Add support for composable upgrade since Newton release. The workflow for
composable upgrade implement also the one for making mixed upgrade
https://blueprints.launchpad.net/tripleo/+spec/tripleo-composable-upgrade-job

View File

@ -1,4 +1,4 @@
---
features:
- |
Add `undercloud_roles_data` for containerized undercloud

View File

@ -10,11 +10,9 @@ features:
config/general_config/containers_undercloud_minimal.yml
e.g. ./quickstart.sh -c $working_dir/config/general_config/containers_undercloud_minimal.yml --tags all -R master-tripleo-ci -w $working_dir $VIRTHOST
deprecations:
- |
The variable "undercloud_hieradata_override_file" which was the hieradata
override file for the undercloud, was deprecated in favor of the
variables "hieradata_override_file_classic_undercloud" and
"hieradata_override_file_t_h_t_undercloud".

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -10,5 +10,3 @@
shell: >
"{{ working_dir }}"/install-upstream-ipxe.sh
when: step_install_upstream_ipxe|bool

View File

@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- ansible-role-tripleo-baremetal-overcloud
- ansible-role-tripleo-baremetal-overcloud

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -2,4 +2,4 @@
- hosts: localhost
remote_user: root
roles:
- ansible-role-tripleo-baremetal-prep-virthost
- ansible-role-tripleo-baremetal-prep-virthost

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,3 +1,4 @@
---
# Additional packages
undercloud_additional_pkgs:
- vim

View File

@ -1,20 +1,21 @@
---
# Ensure ntp packages are installed
- name: Install ntp packages
package:
name: [ 'ntp', 'ntpdate' ]
name: ['ntp', 'ntpdate']
state: present
# Enable ntpd service
- name: Enable ntpd service
service:
name: 'ntpd'
enabled: yes
enabled: true
# Enable ntpdate service
- name: Enable ntpdate service
service:
name: 'ntpdate'
enabled: yes
enabled: true
# Stop ntpd service
- name: Ensure ntp service is stopped to be able to launch ntpdate
@ -42,7 +43,7 @@
lineinfile:
destfile: /etc/ntp/step-tickers
line: '{{ item }}'
create: yes
create: true
with_items: '{{ undercloud_custom_ntps|default([]) }}'
# Configure ntpdate hardware synchronization
@ -54,7 +55,9 @@
# Sync time now
- name: Synchronize time immediately with ntpdate
shell: ntpdate $(grep ^server /etc/ntp.conf | tail -1 | awk '{print $2}')
shell: |
set -euxo pipefail
ntpdate $(grep ^server /etc/ntp.conf | tail -1 | awk '{print $2}')
changed_when: false
# Start ntpd

View File

@ -1,3 +1,4 @@
---
- name: Provision script execution
shell: >
set -o pipefail &&

View File

@ -1,3 +1,4 @@
---
- name: Check that virthost/undercloud is set
fail:
msg: "You need to set virthost/undercloud before running these playbooks."

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,3 +1,4 @@
---
- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472)
include_role:
name: convert-image

View File

@ -1,3 +1,4 @@
---
- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472)
include_role:
name: fetch-images

View File

@ -152,7 +152,7 @@
chdir: "{{ images_working_dir }}"
- name: Clean up the images working dir
shell: >-
shell: >-
rm -rf {{ images_working_dir }}/overcloud-full.d {{ images_working_dir }}/ironic-python-agent.d/
sudo chown $USER: {{ images_working_dir }}/overcloud-full.* {{ images_working_dir }}/ironic-python-agent.*
when: cleanup_images_working_dir|bool

View File

@ -1,3 +1,4 @@
---
- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472)
include_role:
name: modify-image

View File

@ -5,7 +5,7 @@ build_repo_dir: "{{ ansible_user_dir }}"
artg_dlrn_repo_url: "https://github.com/openstack-packages/DLRN.git"
artg_rdoinfo_repo_url: "https://github.com/redhat-openstack/rdoinfo"
artg_compressed_gating_repo: "/home/stack/gating_repo.tar.gz"
artg_build_one: True
artg_build_one: true
dlrn_target: centos
dlrn_cleanup: false
dlrn_baseurl: "https://trunk.rdoproject.org/centos7/"

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -24,11 +24,11 @@
regexp: '{{ project_item.regexp }}'
line: '{{ project_item.line }}'
with_items:
- { regexp: 'baseurl=.*', line: 'baseurl={{ dlrn_baseurl }}' }
- { regexp: 'distro=.*', line: 'distro={{ artg_distro }}' }
- { regexp: 'source=.*', line: 'source={{ artg_change.branch }}' }
- {regexp: 'baseurl=.*', line: 'baseurl={{ dlrn_baseurl }}'}
- {regexp: 'distro=.*', line: 'distro={{ artg_distro }}'}
- {regexp: 'source=.*', line: 'source={{ artg_change.branch }}'}
loop_control:
loop_var: project_item
loop_var: project_item
- name: Map project name to DLRN project name
register: project_name_mapped
@ -37,7 +37,7 @@
export PROJECT_NAME=$(echo {{ artg_change.project }} | sed "s|openstack/||");
rdopkg findpkg -s $PROJECT_NAME -l rdoinfo | grep ^name | awk '{print $2}'
args:
chdir: '{{ build_repo_dir }}/DLRN'
chdir: '{{ build_repo_dir }}/DLRN'
changed_when: false
- debug:
@ -80,7 +80,7 @@
dest: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped.stdout }}_distro'
refspec: '{{ artg_change.distgit.refspec }}'
version: 'FETCH_HEAD'
accept_hostkey: yes
accept_hostkey: true
when: artg_change.distgit is defined and (artg_repos_dir is not defined or copy_dir is failed)
- name: Run DLRN
@ -103,7 +103,6 @@
exit $?;
done;
args:
chdir: '{{ build_repo_dir }}/DLRN'
chdir: '{{ build_repo_dir }}/DLRN'
register: repo_built
when: artg_build_one|bool

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common
- extras-common

View File

@ -1,3 +1,4 @@
---
# Conditional facts to be set which are common to undercloud and overcloud
- name: set docker_registry_namespace_used
set_fact:
@ -26,8 +27,8 @@
docker_registry_namespace_used: "{{ overcloud_docker_registry_namespace }}"
cacheable: true
when:
- container_build_id is not defined
- use_overcloud_mixed_upgrade|default(false)|bool
- container_build_id is not defined
- use_overcloud_mixed_upgrade|default(false)|bool
tags:
- undercloud-install
@ -58,4 +59,3 @@
var: container_build_id
tags:
- undercloud-install

View File

@ -1,3 +1,4 @@
---
env_vars_to_source_file: env_vars_to_src.sh
reproducer_quickstart_script: reproducer-quickstart.sh.j2
reproducer_quickstart_readme_file: "{{ artcl_collect_dir }}/README-reproducer-quickstart.html"

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -31,4 +31,4 @@
template:
src: dump_variables_hostvars.j2
dest: "{{ dump_vars_log_dir }}/dump_variables_hostvars.json"
become: true
become: true

View File

@ -1,2 +1,3 @@
---
dependencies:
- common

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,3 +1,3 @@
---
dependencies:
- extras-common

View File

@ -38,4 +38,3 @@
pip:
name: '{{ gated_project_name }}'
state: absent

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,3 +1,4 @@
---
- name: Inject into image and install packages
include_role:
name: modify-image
@ -5,5 +6,5 @@
image_to_modify: "{{ ib_repo_image_path }}"
modify_script: "{{ ib_repo_workdir }}/install-built-repo.sh"
modify_image_upload_files:
- src: "/tmp/gating_repo.tar.gz"
dest: "/tmp/gating_repo.tar.gz"
- src: "/tmp/gating_repo.tar.gz"
dest: "/tmp/gating_repo.tar.gz"

View File

@ -1,3 +1,4 @@
---
- name: Setup repos on live host
shell: >
set -o pipefail &&

View File

@ -1,3 +1,4 @@
---
- name: gather facts used by role
setup:
gather_subset: "!min,pkg_mgr"

View File

@ -1,2 +1,3 @@
---
dependencies:
- extras-common

View File

@ -1,3 +1,4 @@
---
- name: ensure libguestfs is installed
yum: name=libguestfs-tools-c state=latest
become: true
@ -57,8 +58,7 @@
{{ item }}
{{ modify_image_working_dir }}
environment:
LIBGUESTFS_BACKEND: direct
LIBGUESTFS_BACKEND: direct
args:
chdir: "{{ modify_image_working_dir }}"
chdir: "{{ modify_image_working_dir }}"
with_items: "{{ modify_image_extract_list }}"

View File

@ -2,9 +2,9 @@
- name: make sure an image and script are provided
fail:
msg:
"In order to use this role image_to_modify and modify_script must be
provided."
msg: |
In order to use this role image_to_modify and modify_script must be
provided.
when: image_to_modify is not defined or (modify_script is not defined and modify_image_upload_files == [])
- include: libguestfs.yml

View File

@ -40,47 +40,47 @@
- become: true
block:
- name: Upload files to image
shell: >
cp {{ item.src }} {{ mount_tempdir }}/{{ item.dest }};
with_items: "{{ modify_image_upload_files }}"
- name: Upload files to image
shell: >
cp {{ item.src }} {{ mount_tempdir }}/{{ item.dest }};
with_items: "{{ modify_image_upload_files }}"
- name: Run script on image
shell: >
chmod 775 {{ mount_tempdir }};
mount -o bind /dev {{ mount_tempdir }}/dev/;
mv {{ mount_tempdir }}/etc/resolv.conf{,_};
echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" > {{ mount_tempdir }}/etc/resolv.conf;
cp {{ modify_script }} {{ mount_tempdir }}/tmp/{{ modify_script|basename }};
{% if initramfs_image|bool %}sed -i "s/sudo //g" {{ mount_tempdir }}/tmp/{{ modify_script|basename }};{% endif %}
set -o pipefail && chroot {{ mount_tempdir }} /bin/bash /tmp/{{ modify_script|basename }} 2>&1
{{ timestamper_cmd }} > {{ working_dir }}/{{ modify_script|basename }}.$(date +%s).log;
mv -f {{ mount_tempdir }}/etc/resolv.conf{_,};
- name: Run script on image
shell: >
chmod 775 {{ mount_tempdir }};
mount -o bind /dev {{ mount_tempdir }}/dev/;
mv {{ mount_tempdir }}/etc/resolv.conf{,_};
echo -e "nameserver 8.8.8.8\nnameserver 8.8.4.4" > {{ mount_tempdir }}/etc/resolv.conf;
cp {{ modify_script }} {{ mount_tempdir }}/tmp/{{ modify_script|basename }};
{% if initramfs_image|bool %}sed -i "s/sudo //g" {{ mount_tempdir }}/tmp/{{ modify_script|basename }};{% endif %}
set -o pipefail && chroot {{ mount_tempdir }} /bin/bash /tmp/{{ modify_script|basename }} 2>&1
{{ timestamper_cmd }} > {{ working_dir }}/{{ modify_script|basename }}.$(date +%s).log;
mv -f {{ mount_tempdir }}/etc/resolv.conf{_,};
- name: Extract files from image
shell: cp {{ mount_tempdir }}/{{ item }} {{ modify_image_working_dir }}/;
with_items: "{{ modify_image_extract_list }}"
ignore_errors: true
- name: Extract files from image
shell: cp {{ mount_tempdir }}/{{ item }} {{ modify_image_working_dir }}/;
with_items: "{{ modify_image_extract_list }}"
ignore_errors: true
- name: Close initramfs image
shell: >
set -o pipefail &&
umount {{ mount_tempdir }}/dev/;
pushd {{ mount_tempdir }};
find . -print | cpio -o -H newc | gzip > {{ image_to_modify_abs_path.stdout }};
popd;
rm -rf "{{ mount_tempdir }}";
when: initramfs_image|bool
- name: Close initramfs image
shell: >
set -o pipefail &&
umount {{ mount_tempdir }}/dev/;
pushd {{ mount_tempdir }};
find . -print | cpio -o -H newc | gzip > {{ image_to_modify_abs_path.stdout }};
popd;
rm -rf "{{ mount_tempdir }}";
when: initramfs_image|bool
- name: Close qcow2 image
shell: >
chroot {{ mount_tempdir }} setfiles /etc/selinux/targeted/contexts/files/file_contexts / ;
umount {{ mount_tempdir }}/dev/;
umount {{ mount_tempdir }};
kpartx -dv {{ image_to_modify_raw }};
qemu-img convert -c -f raw -O qcow2 {{ image_to_modify_raw }} {{ image_to_modify_qcow }};
rm -rf "{{ image_to_modify_raw }}";
losetup -d /dev/loop0;
rm -rf "{{ mount_tempdir }}";
chown -R {{ undercloud_user }}: /home/{{ undercloud_user }}/;
when: not initramfs_image|bool
- name: Close qcow2 image
shell: >
chroot {{ mount_tempdir }} setfiles /etc/selinux/targeted/contexts/files/file_contexts / ;
umount {{ mount_tempdir }}/dev/;
umount {{ mount_tempdir }};
kpartx -dv {{ image_to_modify_raw }};
qemu-img convert -c -f raw -O qcow2 {{ image_to_modify_raw }} {{ image_to_modify_qcow }};
rm -rf "{{ image_to_modify_raw }}";
losetup -d /dev/loop0;
rm -rf "{{ mount_tempdir }}";
chown -R {{ undercloud_user }}: /home/{{ undercloud_user }}/;
when: not initramfs_image|bool

View File

@ -1,3 +1,4 @@
---
os_region: "{{ lookup('env', 'OS_REGION_NAME')|default('regionOne') }}"
os_tenant: "{{ lookup('env', 'OS_TENANT_ID') }}"
os_identity_api_version: "{{ lookup('env', 'OS_IDENTITY_API_VERSION')|default(2) }}"

View File

@ -1,3 +1,4 @@
---
- name: Delete stack
shell: >
echo "Executing 'openstack stack delete {{ stack_name }} --yes'" >> {{ stack_log }};

View File

@ -1,3 +1,4 @@
---
- name: Fail if no auth is provided
fail:
msg: 'Please source credential rc file from your tenant on cloud'
@ -147,54 +148,54 @@
- "{{ groups['subnodes'] }}"
# In case of blank centos image we need to create CI user and update inventory
- block:
- when: hostvars['subnode-0'].ansible_user != "{{ nodepool_user }}"
block:
- name: Setup user
user:
name: "{{ nodepool_user }}"
groups: wheel
append: yes
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Setup user
user:
name: "{{ nodepool_user }}"
groups: wheel
append: true
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Setup keys
authorized_key:
user: "{{ nodepool_user }}"
state: present
key: "{{ lookup('file', '{{ key_location }}') }}"
become: true
become_user: "{{ nodepool_user }}"
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Setup keys
authorized_key:
user: "{{ nodepool_user }}"
state: present
key: "{{ lookup('file', '{{ key_location }}') }}"
become: true
become_user: "{{ nodepool_user }}"
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Allow user to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
line: '{{ nodepool_user }} ALL=(ALL) NOPASSWD:ALL'
validate: 'visudo -cf %s'
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Allow user to have passwordless sudo
lineinfile:
dest: /etc/sudoers
state: present
line: '{{ nodepool_user }} ALL=(ALL) NOPASSWD:ALL'
validate: 'visudo -cf %s'
become: true
delegate_to: "{{ item}}"
with_items:
- "{{ groups['subnodes'] }}"
- name: Add hosts
add_host:
name: "subnode-{{ item.0 }}"
hostname: "{{ item.1.1 }}"
groups: "{{ subnode_groups| join(',') }}"
ansible_user: "{{ nodepool_user }}"
ansible_host: "{{ item.1.1 }}"
ansible_fqdn: "subnode-{{ item.0 }}"
ansible_private_key_file: "{{ private_key_location }}"
subnode_public_ip: "{{ item.1.1 }}"
subnode_private_ip: "{{ item.1.0 }}"
with_indexed_items:
- "{{ subnode_ips.stdout }}"
when: hostvars['subnode-0'].ansible_user != "{{ nodepool_user }}"
- name: Add hosts
add_host:
name: "subnode-{{ item.0 }}"
hostname: "{{ item.1.1 }}"
groups: "{{ subnode_groups| join(',') }}"
ansible_user: "{{ nodepool_user }}"
ansible_host: "{{ item.1.1 }}"
ansible_fqdn: "subnode-{{ item.0 }}"
ansible_private_key_file: "{{ private_key_location }}"
subnode_public_ip: "{{ item.1.1 }}"
subnode_private_ip: "{{ item.1.0 }}"
with_indexed_items:
- "{{ subnode_ips.stdout }}"
- name: Dump hosts to file
template:

View File

@ -1,3 +1,4 @@
---
heat_template_version: newton
description: >
@ -40,29 +41,29 @@ resources:
private_net:
type: OS::Neutron::Net
properties:
name: { get_param: private_net_name }
name: {get_param: private_net_name}
private_subnet:
type: OS::Neutron::Subnet
properties:
network_id: { get_resource: private_net }
cidr: { get_param: private_net_cidr }
gateway_ip: { get_param: private_net_gateway }
network_id: {get_resource: private_net}
cidr: {get_param: private_net_cidr}
gateway_ip: {get_param: private_net_gateway}
allocation_pools:
- start: { get_param: private_net_pool_start }
end: { get_param: private_net_pool_end }
- start: {get_param: private_net_pool_start}
end: {get_param: private_net_pool_end}
router:
type: OS::Neutron::Router
properties:
external_gateway_info:
network: { get_param: public_net_name }
network: {get_param: public_net_name}
router_interface:
type: OS::Neutron::RouterInterface
properties:
router_id: { get_resource: router }
subnet_id: { get_resource: private_subnet }
router_id: {get_resource: router}
subnet_id: {get_resource: private_subnet}
server_security_group:
@ -86,19 +87,19 @@ resources:
type: OS::Heat::ResourceGroup
depends_on: router_interface
properties:
count: { get_param: subnode_count }
count: {get_param: subnode_count}
resource_def:
type: "{{ local_working_dir }}/subnode.yaml"
properties:
name: "{{ prefix }}subnode-%index%"
private_net: { get_resource: private_net }
private_subnet: { get_resource: private_subnet }
private_net: {get_resource: private_net}
private_subnet: {get_resource: private_subnet}
server_security_group: {get_resource: server_security_group}
subnode_flavor: { get_param: subnode_flavor }
public_net_name: { get_param: public_net_name }
key_name: { get_param: key_name }
image: { get_param: image }
subnode_flavor: {get_param: subnode_flavor}
public_net_name: {get_param: public_net_name}
key_name: {get_param: key_name}
image: {get_param: image}
outputs:
subnode_ip_pairs:
value: { get_attr: [subnodes, subnode_ip_pair] }
value: {get_attr: [subnodes, subnode_ip_pair]}

View File

@ -1,3 +1,4 @@
---
heat_template_version: newton
description: >
@ -33,7 +34,7 @@ resources:
type: OS::Neutron::FloatingIP
# depends_on: router_interface, subnode_port
properties:
floating_network: { get_param: public_net_name }
floating_network: {get_param: public_net_name}
port_id: {get_attr: [subnode, addresses, {get_param: private_net}, 0, port]}
subnode:
@ -41,17 +42,17 @@ resources:
properties:
name: {get_param: name}
image: {get_param: image}
flavor: { get_param: subnode_flavor }
key_name: { get_param: key_name }
flavor: {get_param: subnode_flavor}
key_name: {get_param: key_name}
networks:
- network: { get_param: private_net }
- network: { get_param: private_net }
- network: {get_param: private_net}
- network: {get_param: private_net}
security_groups:
- { get_param: server_security_group }
- {get_param: server_security_group}
outputs:
subnode_ip_pair:
description: IP addresses of subnode in network
value:
- get_attr: [subnode_floating_ip, fixed_ip_address]
- get_attr: [subnode_floating_ip, floating_ip_address]
- get_attr: [subnode_floating_ip, fixed_ip_address]
- get_attr: [subnode_floating_ip, floating_ip_address]

View File

@ -1,3 +1,4 @@
---
nodepool_cirros_url: http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
nodepool_cirros_dest: /opt/cache/files/cirros-0.3.5-x86_64-disk.img
nodepool_cirros_checksum: md5:f8ab98ff5e73ebab884d80c9dc9c7290
@ -11,7 +12,7 @@ repos:
- https://git.openstack.org/openstack-dev/devstack
- https://git.openstack.org/openstack-infra/devstack-gate
zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}"
subnode_swap_size: 8388608 # 8GB
subnode_swap_size: 8388608 # 8GB
update_subnodes: true
rdo_cloud_provider: true
packages_list:

View File

@ -9,7 +9,7 @@
- name: Create /etc/nodepool/node_private
lineinfile:
create: yes
create: true
state: present
name: /etc/nodepool/node_private
owner: "{{ ansible_user }}"
@ -18,7 +18,7 @@
- name: Create /etc/nodepool/primary_node_private
lineinfile:
create: yes
create: true
state: present
name: /etc/nodepool/primary_node_private
owner: "{{ ansible_user }}"
@ -46,7 +46,7 @@
- name: Create /etc/nodepool/sub_nodes
lineinfile:
create: yes
create: true
state: present
name: /etc/nodepool/sub_nodes
line: "{{ hostvars[item].subnode_public_ip }}"
@ -61,7 +61,7 @@
- name: Create /etc/nodepool/sub_nodes_private
lineinfile:
create: yes
create: true
state: present
name: /etc/nodepool/sub_nodes_private
line: "{{ hostvars[item].subnode_private_ip }}"

View File

@ -33,28 +33,28 @@
- when: not yum_contentdir.stat.exists
block:
- name: Discover package architecture
command: rpm -q --qf "%{arch}" -f /etc/redhat-release
register: rpm_arch
- name: Discover package architecture
command: rpm -q --qf "%{arch}" -f /etc/redhat-release
register: rpm_arch
- debug:
msg: Package architecture is '{{ rpm_arch.stdout }}'
- debug:
msg: Package architecture is '{{ rpm_arch.stdout }}'
- name: Set contentdir to altarch
set_fact:
yum_contentdir_data: altarch
when: rpm_arch.stdout in ['aarch64', 'ppc64le']
- name: Set contentdir to altarch
set_fact:
yum_contentdir_data: altarch
when: rpm_arch.stdout in ['aarch64', 'ppc64le']
- name: Set contentdir to default centos arch
set_fact:
yum_contentdir_data: centos
when: rpm_arch.stdout not in ['aarch64', 'ppc64le']
- name: Set contentdir to default centos arch
set_fact:
yum_contentdir_data: centos
when: rpm_arch.stdout not in ['aarch64', 'ppc64le']
- name: Populate /etc/yum/vars/contentdir
copy:
dest: /etc/yum/vars/contentdir
content: "{{ yum_contentdir_data }}"
become: true
- name: Populate /etc/yum/vars/contentdir
copy:
dest: /etc/yum/vars/contentdir
content: "{{ yum_contentdir_data }}"
become: true
- name: Install repos (will be removed by toci_gatetest)
package:
@ -98,7 +98,7 @@
service:
name: unbound
state: started
enabled: yes
enabled: true
become: true
- name: start iptables service
@ -131,7 +131,7 @@
with_items:
- "WORKSPACE=/tmp"
- "DEVSTACK_GATE_TIMEOUT=300"
- "REMAINING_TIME=180" # 3 hours for quickstart run
- "REMAINING_TIME=180" # 3 hours for quickstart run
# In case of multinode
- "EXTRA_VARS=' --extra-vars vxlan_mtu=1400'"
become: true
@ -139,26 +139,26 @@
- when: update_subnodes|bool
block:
- name: Update packages
yum:
name: '*'
state: latest
become: true
- name: Update packages
yum:
name: '*'
state: latest
become: true
- name: Reboot hosts
shell: sleep 2 && shutdown -r now
async: 1
poll: 0
ignore_errors: true
become: true
- name: Reboot hosts
shell: sleep 2 && shutdown -r now
async: 1
poll: 0
ignore_errors: true
become: true
- name: Wait for provisioned hosts to become reachable
local_action:
module: wait_for
host: "{{ hostvars[inventory_hostname].subnode_public_ip }}"
port: 22
delay: 35
sleep: 10
state: started
connect_timeout: 10
timeout: 180
- name: Wait for provisioned hosts to become reachable
local_action:
module: wait_for
host: "{{ hostvars[inventory_hostname].subnode_public_ip }}"
port: 22
delay: 35
sleep: 10
state: started
connect_timeout: 10
timeout: 180

View File

@ -1,3 +1,4 @@
---
- name: Check if repo should be changed
set_fact:
proj: "{{ repo_item.replace('.git', '').split('/')[-2:]|join('/') }}:"

View File

@ -3,7 +3,7 @@ release: master
ovb_repo_version: a3786bca1604d6048562af80eca3bcad119e5065
tmp:
idnum: "{{ 100000 |random }}"
idnum: "{{ 100000 |random }}"
os_username: admin
os_password: password
@ -19,40 +19,40 @@ ssh_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"'
undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud"
nodepool_user: 'zuul'
node_groups:
- 'undercloud'
- 'tester'
- 'undercloud'
- 'tester'
templates_dir: "{{ local_working_dir }}/openstack-virtual-baremetal/templates"
ovb_dir: "{{ local_working_dir }}/openstack-virtual-baremetal"
heat_template: "{{ templates_dir }}/quintupleo.yaml"
environment_list:
- "{{ templates_dir }}/resource-registry.yaml"
- "{{ local_working_dir }}/env-{{ idnum }}.yaml"
- "{{ templates_dir }}/resource-registry.yaml"
- "{{ local_working_dir }}/env-{{ idnum }}.yaml"
boot_from_volume: false
baremetal_boot_from_volume_size: 50
undercloud_boot_from_volume_size: 50
latest_guest_image:
newton: CentOS-7-x86_64-GenericCloud-released-latest
ocata: CentOS-7-x86_64-GenericCloud-released-latest
pike: CentOS-7-x86_64-GenericCloud-released-latest
queens: CentOS-7-x86_64-GenericCloud-released-latest
master: CentOS-7-x86_64-GenericCloud-released-latest
rhos-11: rhel-7.4-server-x86_64-latest