diff --git a/.ansible-lint b/.ansible-lint deleted file mode 100644 index 824ace334..000000000 --- a/.ansible-lint +++ /dev/null @@ -1,59 +0,0 @@ -exclude_paths: - - roles/validate-ui/.travis.yml - - roles/virthost-full-cleanup/tasks/main.yml - # we don't want to see failures from sideloaded repos - - ../tripleo-upgrade/ - # These playbooks are from tq repo and checked there - - playbooks/baremetal-full-deploy.yml - - playbooks/baremetal-prep-virthost.yml - - playbooks/deploy-delete.yml - - playbooks/multinode-minion.yml - - playbooks/multinode-multiple-overcloud.yml - - playbooks/multinode.yml - - playbooks/quickstart-extras-standalone.yml - - playbooks/quickstart-extras.yml - - playbooks/scale_nodes.yml - # No any idea why those don't pass linter - - playbooks/build-images-v2.yml - - playbooks/build-test-packages.yml -parseable: true -quiet: false -skip_list: - # TODO(ssbarnea): Gradually remove these skips ASAP - - syntax-check - - internal-error - - unnamed-task - - risky-file-permissions - - ignore-errors - - command-instead-of-module - - meta-no-info - - risky-shell-pipe - - deprecated-command-syntax - - empty-string-compare - - role-name - - experimental - - no-changed-when - - literal-compare - - command-instead-of-shell - - package-latest - - deprecated-local-action - - no-jinja-nesting - -verbosity: 1 -mock_modules: - - authorized_key - - virt - - ini_file - - openvswitch_bridge - - os_stack - - redhat_subscription - - synchronize -mock_roles: - - tripleo-inventory - - repo-setup - - common - - tripleo-upgrade - - fetch-images - - tripleo - - parts/kvm - - collect-logs diff --git a/.gitignore b/.gitignore deleted file mode 100644 index dfb2e591e..000000000 --- a/.gitignore +++ /dev/null @@ -1,64 +0,0 @@ -# If you want to ignore sour editor temp files, please follow this: -# - create ~/.gitignore, add your content -# - git config --global core.excludesfile '~/.gitignore' -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -doc/build/ - -# PyBuilder -target/ - -# virtualenv -.venv/ - -# Files created by releasenotes build -releasenotes/build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index a4a01f90f..000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,53 +0,0 @@ ---- -# to bump run: pre-commit autoupdate -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.3.0 - hooks: - - id: end-of-file-fixer - - id: trailing-whitespace - - id: mixed-line-ending - - id: check-byte-order-marker - - id: check-executables-have-shebangs - - id: check-merge-conflict - - id: check-symlinks - - id: debug-statements - - id: check-yaml - files: .*\.(yaml|yml)$ - - repo: https://github.com/PyCQA/flake8.git - rev: 3.8.4 - hooks: - - id: flake8 - - repo: https://github.com/adrienverge/yamllint.git - rev: v1.25.0 - hooks: - - id: yamllint - files: \.(yaml|yml)$ - types: [file, yaml] - entry: yamllint --strict -f parsable - - repo: https://github.com/ansible/ansible-lint - rev: v5.3.2 - hooks: - - id: ansible-lint - always_run: true - pass_filenames: false - # do not add file filters here as ansible-lint does not give reliable - # results when called with individual files. - # https://github.com/ansible/ansible-lint/issues/611 - verbose: true - # plugins is the standard collection dir for modules - entry: env ANSIBLE_LIBRARY=plugins ansible-lint --force-color -p -v - additional_dependencies: - - 'ansible-core>=2.11,<2.12' - - repo: https://github.com/openstack-dev/bashate.git - rev: 2.0.0 - hooks: - - id: bashate - # Run bashate check for all bash scripts - # Ignores the following rules: - # E006: Line longer than 79 columns (as many scripts use jinja - # templating, this is very difficult) - # E040: Syntax error determined using `bash -n` (as many scripts - # use jinja templating, this will often fail and the syntax - # error will be discovered in execution anyway) - entry: bashate --error . --verbose --ignore=E006,E040 diff --git a/.yamllint b/.yamllint deleted file mode 100644 index 63a9f13b1..000000000 --- a/.yamllint +++ /dev/null @@ -1,10 +0,0 @@ ---- -extends: default - -rules: - line-length: - max: 180 - -#braces: {min-spaces-inside: 1, max-spaces-inside: 10} -ignore: | - /roles/standalone/tasks/main.yml diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 8dada3eda..000000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright {yyyy} {name of copyright owner} - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README.rst b/README.rst index 7d674d300..4ee2c5f13 100644 --- a/README.rst +++ b/README.rst @@ -1,19 +1,10 @@ -======================== -Team and repository tags -======================== +This project is no longer maintained. -.. image:: https://governance.openstack.org/tc/badges/tripleo-quickstart-extras.svg - :target: https://governance.openstack.org/tc/reference/tags/index.html +The contents of this repository are still available in the Git +source code management system. To see the contents of this +repository before it reached its end of life, please check out the +previous commit with "git checkout HEAD^1". -.. Change things from this point on - -================================== -Extra roles for tripleo-quickstart -================================== - -These Ansible role are extending the functionality of tripleo-quickstart to do -end-to-end deployment and testing of TripleO. - -The documentation of each role is located in the individual role folders, and -general usage information is in the `tripleo-quickstart documentation -`_. +For any further questions, please email +openstack-discuss@lists.openstack.org or join #openstack-dev on +OFTC. diff --git a/bindep.txt b/bindep.txt deleted file mode 100644 index 41b90e133..000000000 --- a/bindep.txt +++ /dev/null @@ -1,3 +0,0 @@ -# debian requirements (linters) -libffi-dev [platform:dpkg] -libssl-dev [platform:dpkg] diff --git a/ci-scripts/releasenotes_tox.sh b/ci-scripts/releasenotes_tox.sh deleted file mode 100755 index c37cf598e..000000000 --- a/ci-scripts/releasenotes_tox.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -rm -rf releasenotes/build - -sphinx-build -a -E -W \ - -d releasenotes/build/doctrees \ - -b html \ - releasenotes/source releasenotes/build/html -BUILD_RESULT=$? - -UNCOMMITTED_NOTES=$(git status --porcelain | \ - awk '$1 == "M" && $2 ~ /releasenotes\/notes/ {print $2}') - -if [ "${UNCOMMITTED_NOTES}" ]; then - cat < -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from jinja2 import Environment -from jinja2 import exceptions - -import os -import sys - - -DOCUMENTATION = ''' ---- -python script to read and parse jinja2 templates ---- -''' - -# Jinja Environment -env = Environment() - - -def get_jinja_files(dir_path): - """Get all the .j2 and .jinja2 files""" - files_path = [] - for root, subdir, files in os.walk(dir_path): - for file in files: - if file.endswith('.j2') or file.endswith('.jinja2'): - files_path.append(os.path.join(root, file)) - - return files_path - - -def validate_jinja_templates(file_path): - """Validate jinja templates file""" - try: - with open(file_path) as fobj: - env.parse(fobj.read()) - except exceptions.TemplateSyntaxError as e: - print('%s has template error: %s' % (file_path, e)) - raise(e) - - -if __name__ == "__main__": - base_dir = os.path.join(os.path.dirname(sys.argv[0]), "..") - os.chdir(base_dir) - jinja_files = get_jinja_files(base_dir) - for file_path in jinja_files: - validate_jinja_templates(file_path) - print('Validating: %s' % file_path) diff --git a/config/environments/ovb-common.yml b/config/environments/ovb-common.yml deleted file mode 100644 index 11b78760d..000000000 --- a/config/environments/ovb-common.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -environment_type: ovb_host_cloud - -# undercloud.conf -undercloud_network_cidr: 192.168.24.0/24 -undercloud_local_ip: 192.168.24.1/24 -undercloud_network_gateway: 192.168.24.1 -undercloud_undercloud_public_vip: 192.168.24.2 -undercloud_undercloud_admin_vip: 192.168.24.3 -undercloud_local_interface: eth1 -undercloud_masquerade_network: 192.168.24.0/24 -undercloud_dhcp_start: 192.168.24.5 -undercloud_dhcp_end: 192.168.24.24 -undercloud_inspection_iprange: 192.168.24.25,192.168.24.39 -undercloud_external_network_cidr: 10.0.0.0/24 -undercloud_undercloud_nameservers: "{{ overcloud_dns_servers }}" - -# template copies -undercloud_instackenv_template: "{{ local_working_dir }}/instackenv.json" -image_cache_dir: "{{ working_dir }}/images-cache" - -# baremetal settings -undercloud_type: ovb -step_root_device_size: false -hw_env: ovb_host_cloud -enable_vbmc: false -ovb_setup_connectivity: true -step_set_undercloud_hostname: true - -# adjust mtus -step_adjust_mtu: true -undercloud_local_mtu: "{{ mtu }}" -overcloud_neutron_global_physnet_mtu: "{{ mtu }}" - -# set up external interface -external_interface: eth2 -external_interface_ip: 10.0.0.1 -external_interface_netmask: 255.255.255.0 - -# images to copy to the undercloud -images: - - name: "{{ overcloud_image }}" - url: "{{ overcloud_image_url }}" - type: tar - - name: ipa_images - url: "{{ ipa_image_url }}" - type: tar - -network_environment_args: - ExternalNetCidr: "{{ undercloud_external_network_cidr }}" - ExternalAllocationPools: > - [{'start': '{{ undercloud_external_network_cidr|nthhost(10) }}', - 'end': '{{ undercloud_external_network_cidr|nthhost(50) }}'}] - NeutronExternalNetworkBridge: "" - ControlPlaneSubnetCidr: "{{ undercloud_network_cidr|ipaddr('prefix') }}" - ControlPlaneDefaultRoute: "{{ undercloud_network_cidr|nthhost(1) }}" - EC2MetadataIp: "{{ undercloud_network_cidr|nthhost(1) }}" - ExternalInterfaceDefaultRoute: "{{ undercloud_external_network_cidr|nthhost(1) }}" - InternalApiNetCidr: 172.20.0.0/24 - InternalApiAllocationPools: [{"start": "172.20.0.10", "end": "172.20.0.250"}] - StorageNetCidr: 172.18.0.0/24 - StorageAllocationPools: [{"start": "172.18.0.10", "end": "172.18.0.250"}] - StorageMgmtNetCidr: 172.19.0.0/24 - StorageMgmtAllocationPools: [{"start": "172.19.0.10", "end": "172.19.0.250"}] - 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) }}"}] - NeutronGlobalPhysnetMtu: 1350 - BondInterfaceOvsOptions: bond_mode=balance-slb - -# overcloud deployment settings -flavor_args: "" -validation_args: " " - -# validate / tempest config -floating_ip_cidr: 10.0.0.0/24 -public_net_pool_start: 10.0.0.50 -public_net_pool_end: 10.0.0.100 -public_net_gateway: 10.0.0.1 diff --git a/config/environments/rdocloud-ci.yml.example b/config/environments/rdocloud-ci.yml.example deleted file mode 100644 index 98e95b03d..000000000 --- a/config/environments/rdocloud-ci.yml.example +++ /dev/null @@ -1,40 +0,0 @@ -os_username: "{{ lookup('env','OS_USERNAME') }}" -os_password: "{{ lookup('env','OS_PASSWORD') }}" -os_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}" -os_auth_url: "{{ lookup('env','OS_AUTH_URL') }}" -os_region_name: "{{ lookup('env','OS_REGION_NAME') }}" - -cloud_name: rdocloud -latest_guest_image: - ocata: CentOS-7-x86_64-GenericCloud-1708 - pike: CentOS-7-x86_64-GenericCloud-1708 - queens: CentOS-7-x86_64-GenericCloud-1708 - master: CentOS-7-x86_64-GenericCloud-1708 - -bmc_flavor: ci.m1.small -baremetal_flavor: ci.m1.large -undercloud_flavor: ci.m1.large -provision_net_cidr: 192.168.24.0/24 - -nameserver_from_virthost: false -custom_nameserver: - - 38.145.33.91 -undercloud_undercloud_nameservers: "{{ custom_nameserver }}" -undercloud_undercloud_timezone: 'UTC' -external_net: '38.145.32.0/22' -overcloud_dns_servers: "{{ custom_nameserver }}" -ntp_server: 'pool.ntp.org' - -overcloud_image_url: http://images.rdoproject.org/{{ release }}/rdo_trunk/{{ dlrn_hash|default(dlrn_hash_tag) }}/overcloud-full.tar -ipa_image_url: http://images.rdoproject.org/{{ release }}/rdo_trunk/{{ dlrn_hash|default(dlrn_hash_tag) }}/ironic-python-agent.tar -docker_registry_host: docker.io -docker_registry_namespace: "tripleo{{ release }}" - -mtu: 1350 -mtu_interface: - - eth0 - - eth1 - - "{% if network_isolation|default(true)|bool %}eth2{% endif %}" - -undercloud_local_mtu: "{{ mtu }}" -overcloud_neutron_global_physnet_mtu: "{{ mtu }}" diff --git a/config/environments/rdocloud.yml b/config/environments/rdocloud.yml deleted file mode 100644 index 42eb39fa6..000000000 --- a/config/environments/rdocloud.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -os_username: "{{ lookup('env','OS_USERNAME') }}" -os_password: "{{ lookup('env','OS_PASSWORD') }}" -os_tenant_name: "{{ lookup('env','OS_TENANT_NAME') }}" -os_auth_url: "{{ lookup('env','OS_AUTH_URL') }}" -os_region_name: "{{ lookup('env', 'OS_REGION_NAME') }}" - -cloud_name: rdocloud -latest_guest_image: - ocata: CentOS-7-x86_64-GenericCloud-1708 - pike: CentOS-7-x86_64-GenericCloud-1708 - queens: CentOS-7-x86_64-GenericCloud-1708 - master: CentOS-7-x86_64-GenericCloud-1708 - -bmc_flavor: m1.medium -baremetal_flavor: m1.large -undercloud_flavor: m1.large2 -provision_net_cidr: 192.168.24.0/24 - -nameserver_from_virthost: false -custom_nameserver: - - 1.1.1.1 - - 1.0.0.1 -undercloud_undercloud_nameservers: "{{ custom_nameserver }}" -external_net: '38.145.32.0/22' -overcloud_dns_servers: "{{ custom_nameserver }}" -ntp_server: 'pool.ntp.org' - -overcloud_image_url: http://images.rdoproject.org/{{ release }}/rdo_trunk/{{ dlrn_hash|default(dlrn_hash_tag) }}/overcloud-full.tar -ipa_image_url: http://images.rdoproject.org/{{ release }}/rdo_trunk/{{ dlrn_hash|default(dlrn_hash_tag) }}/ironic-python-agent.tar -docker_registry_host: docker.io -docker_registry_namespace: "tripleo{{ release }}" - -mtu: 1350 -mtu_interface: - - eth0 - - eth1 - - "{% if network_isolation|default(true)|bool %}eth2{% endif %}" - -undercloud_local_mtu: "{{ mtu }}" -overcloud_neutron_global_physnet_mtu: "{{ mtu }}" - -# Browbeat settings -elastic_host: browbeat.test.com -grafana_host: browbeat.test.com diff --git a/config/general_config/centosci-logs.yml b/config/general_config/centosci-logs.yml deleted file mode 100644 index f4b91c5b1..000000000 --- a/config/general_config/centosci-logs.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -artcl_gzip: true -artcl_artifact_url: https://artifacts.ci.centos.org/rdo -artcl_publish: true -artcl_use_rsync: true -artcl_rsync_use_daemon: true -artcl_rsync_path: rdo@artifacts.ci.centos.org::rdo diff --git a/config/general_config/deprecated/containers_minimal.yml b/config/general_config/deprecated/containers_minimal.yml deleted file mode 100644 index ab1a36596..000000000 --- a/config/general_config/deprecated/containers_minimal.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -# 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. -step_introspect: true - -# Tell tripleo how we want things done. -extra_args: >- - --ntp-server pool.ntp.org - -# This featureset is extremely resource intensive, so we disable telemetry -# in order to reduce the overall memory footprint -# Disabled by default in ussuri -telemetry_args: >- - {% if release in ['queens', 'stein', 'train'] %} - -e {{ overcloud_templates_path }}/environments/disable-telemetry.yaml - {% endif %} - -network_isolation: true -network_isolation_type: 'single-nic-vlans' - -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 - -# This enables the deployment of the overcloud with SSL. -ssl_overcloud: false - -# If `run_tempest` is `true`, run tempests tests, otherwise do not -# run them. -test_ping: true -run_tempest: false -tempest_workers: 4 - -# Config for custom tripleo-heat-templates, used in overcloud-prep-config -# overcloud_templates_path: /home/stack/tripleo-heat-templates -# overcloud_templates_repo: https://opendev.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 -artcl_create_docs_payload: - included_deployment_scripts: - - undercloud-install - - overcloud-custom-tht-script - - overcloud-prep-containers - - overcloud-prep-flavors - - overcloud-prep-images - - overcloud-prep-network - - overcloud-deploy - - overcloud-deploy-post - - overcloud-validate - included_static_docs: - - env-setup-virt - table_of_contents: - - env-setup-virt - - undercloud-install - - overcloud-custom-tht-script - - overcloud-prep-containers - - overcloud-prep-flavors - - overcloud-prep-images - - overcloud-prep-network - - overcloud-deploy - - overcloud-deploy-post - - overcloud-validate diff --git a/config/general_config/deprecated/scale_compute.yml b/config/general_config/deprecated/scale_compute.yml deleted file mode 100644 index 96455f5bd..000000000 --- a/config/general_config/deprecated/scale_compute.yml +++ /dev/null @@ -1,108 +0,0 @@ ---- - -# NOTE(hrybacki): This is a hotfix to be removed after -# https://review.openstack.org/#/c/414167/ has been merged. - -validation_args: "" - -control_memory: 16384 -control_vcpu: 4 - -# Define single controller node with two computes to allow for scaling -overcloud_nodes: - - name: control_0 - flavor: control - virtualbmc_port: 6230 - - - name: compute_0 - flavor: compute - virtualbmc_port: 6231 - - - name: compute_1 - flavor: compute - virtualbmc_port: 6232 - -# If `run_tempest` is `true`, run tempests tests, otherwise do not -# run them. -run_tempest: false -tempest_config: false -enable_pacemaker: true -network_isolation: true -network_isolation_type: 'single-nic-vlans' -deploy_timeout: 75 - -# General deployment info -libvirt_args: "--libvirt-type qemu" - -flavor_args: >- - --control-flavor {{flavor_map.control - if flavor_map is defined and 'control' in flavor_map else 'oooq_control'}} - --compute-flavor {{flavor_map.compute - if flavor_map is defined and 'compute' in flavor_map else 'oooq_compute'}} - -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 - -# 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 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 - -# Scale deployment arguments -scale_args: >- - {{ libvirt_args }} - {{ flavor_args }} - {{ timeout_args }} - {{ pacemaker_args }} - {{ scale_extra_args }} - -# Options below direct automatic doc generation by collect-logs -artcl_gen_docs: true -artcl_create_docs_payload: - included_deployment_scripts: - - undercloud-install - - overcloud-custom-tht-script - - overcloud-prep-flavors - - overcloud-prep-images - - overcloud-prep-network - - overcloud-deploy - - overcloud-deploy-post - - overcloud-validate - - scale-deployment - - delete-node - included_static_docs: - - env-setup-virt - table_of_contents: - - env-setup-virt - - undercloud-install - - overcloud-custom-tht-script - - overcloud-prep-flavors - - overcloud-prep-images - - overcloud-prep-network - - overcloud-deploy - - overcloud-deploy-post - - overcloud-validate - - scale-deployment - - delete-node - - overcloud-validate - -# Path to tripleo-heat-templates -overcloud_templates_path: /usr/share/openstack-tripleo-heat-templates - -# Sample call -# ./deploy.sh -v --playbook scale_nodes --config-file config/scale/scale_compute.yml diff --git a/config/general_config/local-logs.yml b/config/general_config/local-logs.yml deleted file mode 100644 index 8f79cd4de..000000000 --- a/config/general_config/local-logs.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# this file is intentionally left blank, it can be used to pass the "local" -# parameter to the collect-logs.sh CI script, resulting in using the default -# settings, collecting logs locally but not attempting to upload them anywhere -# we need at least one dummy value here -artcl_placeholder: true diff --git a/config/general_config/ovb-minimal-pacemaker-public-bond.yml b/config/general_config/ovb-minimal-pacemaker-public-bond.yml deleted file mode 100644 index 57e3b9761..000000000 --- a/config/general_config/ovb-minimal-pacemaker-public-bond.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# baremetal settings -step_introspect: true -network_isolation_type: public-bond -network_isolation: true - -# template copies -baremetal_nic_configs: "{{ local_working_dir }}/openstack-virtual-baremetal/bond-network-templates/nic-configs" -use_resource_registry_nic_configs: true - -# This enables container deployments with Pike and later -containerized_overcloud: >- - {% if release in ['newton', 'ocata'] -%} - false - {%- else -%} - true - {%- endif -%} -delete_docker_cache: true - -extra_args: " --control-flavor baremetal --compute-flavor baremetal " - -# This featureset is extremely resource intensive, so we disable telemetry -# in order to reduce the overall memory footprint -# Disabled by default in ussuri -telemetry_args: >- - {% if release in ['queens', 'stein', 'train'] %} - -e {{ overcloud_templates_path }}/environments/disable-telemetry.yaml - {% endif %} - -run_tempest: false -tempest_config: false -test_ping: true -enable_pacemaker: true diff --git a/config/general_config/ovb-multiple-nics.yml b/config/general_config/ovb-multiple-nics.yml deleted file mode 100644 index c3fa07151..000000000 --- a/config/general_config/ovb-multiple-nics.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# baremetal settings -step_introspect: true -network_isolation_type: multiple-nics -network_isolation: true - -# template copies -baremetal_nic_configs: "{{ local_working_dir }}/openstack-virtual-baremetal/network-templates/nic-configs" -use_resource_registry_nic_configs: true - -# This enables container deployments Pike and after -containerized_overcloud: >- - {% if release in ['newton', 'ocata'] -%} - false - {%- else -%} - true - {%- endif -%} -delete_docker_cache: true - -extra_args: " --control-flavor baremetal --compute-flavor baremetal " - -# This featureset is extremely resource intensive, so we disable telemetry -# 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 %} - -run_tempest: false -tempest_config: false -test_ping: true -enable_pacemaker: true diff --git a/config/general_config/rdoproject-logs.yml b/config/general_config/rdoproject-logs.yml deleted file mode 100644 index 00267eee5..000000000 --- a/config/general_config/rdoproject-logs.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -artcl_publish: true -artcl_use_zuul_swift_upload: true -artcl_swift_container: artifacts -artcl_full_artifact_url: "{{ lookup('env', 'SWIFT_artifacts_URL') }}" diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index e8cbf057c..000000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -openstackdocstheme>=2.0.0 # Apache-2.0 - -sphinx>=2.0.0,!=2.1.0 # BSD -reno>=2.5.0 # Apache-2.0 diff --git a/molecule-requirements.txt b/molecule-requirements.txt deleted file mode 100644 index bc3a401c4..000000000 --- a/molecule-requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -ansible-core>=2.11,<2.12 -ansi2html # GPL (soft-dependency of pytest-html) -docker -paramiko>=2.5.0 # LGPL (soft-dependency of docker that enables ssh protocol) -pytest -pytest-cov -pytest-html -pytest-metadata>=2.0.1,<3.0.0 -pytest-molecule>=1.3.0,<1.3.1 -mock -molecule>=3.0,<3.1 -selinux>=0.2.1 diff --git a/playbooks/baremetal-full-deploy.yml b/playbooks/baremetal-full-deploy.yml deleted file mode 100644 index 3df30fbd7..000000000 --- a/playbooks/baremetal-full-deploy.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- include: baremetal-prep-virthost.yml - when: undercloud_type == 'virtual' and environment_type is defined - -- include: ovb-setup.yml - when: undercloud_type == 'ovb' - -- include: baremetal-full-freeipa.yml - when: deploy_supplemental_node|default(false)|bool - -- include: baremetal-undercloud.yml - when: undercloud_type == 'baremetal' and environment_type is defined - -- include: baremetal-quickstart-extras.yml - -- include: overcloud-validate-ha.yml - when: validate_ha_overcloud|default(false)|bool - -- include: browbeat-minimal.yml - when: enable_minimal_browbeat|default(false)|bool diff --git a/playbooks/baremetal-full-freeipa.yml b/playbooks/baremetal-full-freeipa.yml deleted file mode 100644 index fc195c6da..000000000 --- a/playbooks/baremetal-full-freeipa.yml +++ /dev/null @@ -1,132 +0,0 @@ ---- -- name: Run inventory to add supplemental node - hosts: undercloud - gather_facts: false - tags: - - freeipa-setup - tasks: - - - include_role: - name: tripleo-inventory - vars: - inventory: extra_node - - - name: Add supplemental IP to /etc/hosts - lineinfile: - line: "{{ supplemental_node_ip }} {{ freeipa_server_hostname }}" - path: /etc/hosts - become: true - - - name: set the freeipa_internal_ip - set_fact: - freeipa_internal_ip: "{{ supplemental_node_ip }}" - cacheable: true - -- name: Deploy the FreeIPA server - hosts: supplemental - gather_facts: true - tags: - - freeipa-setup - tasks: - - - name: Create /etc/ci directory for supplemental - become: true - file: - path: /etc/ci - state: directory - owner: root - group: root - mode: 0755 - - - name: Slurp the contents of mirror_info.sh from undercloud - become: true - slurp: - src: '/etc/ci/mirror_info.sh' - register: mirror_info_sh - delegate_to: undercloud - - - name: Write mirror_info.sh contents to file on supplemental - become: true - copy: - dest: '/etc/ci/mirror_info.sh' - content: | - {{ mirror_info_sh['content'] | b64decode }} - - - include_role: - name: repo-setup - vars: - repo_setup_dir: /home/{{ supplemental_user|default('centos') }} - - - name: Set eth2 public IP address - shell: | - ip a add dev eth2 {{ supplemental_node_ip }}/24; - ip l set eth2 up; - ip link set dev eth2 mtu 1450; - ping 10.0.0.1 -c 4 -q; - become: true - changed_when: false - - - include_role: - name: freeipa-setup - -- name: Use supplemental node as DNS server - hosts: undercloud - gather_facts: false - tags: - - freeipa-setup - tasks: - - - name: ensure that DHCP doesn't overwrite DNS settings (CentOS/RHEL >= 8) - become: true - when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version is version(8, '>=') - block: - - name: set 'dns=none' in NetworkManager config file - ini_file: - path: /etc/NetworkManager/NetworkManager.conf - state: present - no_extra_spaces: true - section: main - option: dns - value: none - backup: true - - name: reload NetworkManager service - service: - name: NetworkManager - state: reloaded - - - name: disable unbound service - become: true - service: - name: unbound - state: stopped - ignore_errors: true - - - name: remove any existing entries from the resolv.conf file - become: true - lineinfile: - path: /etc/resolv.conf - regexp: "^nameserver " - state: absent - - - name: set IPA server domain search - become: true - lineinfile: - path: /etc/resolv.conf - insertafter: '^search' - line: "search ooo.test" - state: present - - - name: set IPA server as primary DNS provider - become: true - lineinfile: - path: /etc/resolv.conf - insertafter: '^search' - line: "nameserver {{ freeipa_internal_ip }}" - state: present - - - name: print content of 'resolv.conf' after modifications - become: true - debug: - msg: "Content of resolv.conf: {{ lookup('file', '/etc/resolv.conf') }}" diff --git a/playbooks/baremetal-full-overcloud-prep.yml b/playbooks/baremetal-full-overcloud-prep.yml deleted file mode 100644 index 4f989811f..000000000 --- a/playbooks/baremetal-full-overcloud-prep.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -- name: Prepare the undercloud networks for the overcloud deployment - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-network - tags: - - overcloud-prep-network - -- name: copy over config files - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-config - tags: - - overcloud-prep-config - -- name: Perpare the baremetal overcloud - hosts: undercloud - gather_facts: true - roles: - - baremetal-prep-overcloud - tags: - - baremetal-prep-overcloud - -- name: Prepare overcloud containers - hosts: undercloud - gather_facts: false - roles: - - role: overcloud-prep-containers - tags: - - overcloud-prep-containers - -- name: Prepare the overcloud images for deployment - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-images - tags: - - overcloud-prep-images - -- name: Prepare overcloud flavors - hosts: undercloud - gather_facts: false - roles: - - {role: overcloud-prep-flavors, - when: step_overcloud_prep_flavors|default(true)|bool} - tags: - - overcloud-prep-flavors - -- name: Prepare the SSL Configuration for the overcloud deployment - hosts: undercloud - gather_facts: false - roles: - - {role: overcloud-ssl} - tags: - - overcloud-ssl diff --git a/playbooks/baremetal-full-overcloud-validate.yml b/playbooks/baremetal-full-overcloud-validate.yml deleted file mode 100644 index 365d5039b..000000000 --- a/playbooks/baremetal-full-overcloud-validate.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -- name: Run dump vars on all!localhost - hosts: all:!localhost:!127.0.0.2 - roles: - - dump_vars - -- name: Ensure the overcloud nodes are added to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - overcloud-validate - vars: - inventory: all - roles: - - tripleo-inventory - ignore_errors: true - -# Execute sanity checks agsinst the overcloud deployment -- name: setup dstat performance monitoring - hosts: all:!localhost:!127.0.0.2:!undercloud:!virthost - tags: - - overcloud-validate - roles: - - {role: validate-perf, - when: validate_performance|bool and use_os_tempest | default(true) | bool} - ignore_errors: true - -- name: Sanity check the overcloud services - hosts: undercloud - tags: - - overcloud-validate - gather_facts: false - roles: - - {role: validate-sanity-checks, - when: run_sanity_checks|default(false)|bool} - -# Validate the deployment -- name: Execute netstat for port audit - hosts: overcloud - vars: - execute_netstat: true - roles: - - overcloud-network-discovery - tags: - - overcloud-validate - -# Execute tempest against the overcloud deployment -- name: Validate the deployment - hosts: undercloud - tasks: - - include_tasks: tasks/tempest.yml - vars: - tempest_install_method: distro - tempest_cloud_name: 'overcloud' - when: use_os_tempest | default(true) - environment: - # Disable ssl waarnings - CURL_CA_BUNDLE: "" - tags: - - overcloud-validate - -- name: Kill netstat - hosts: overcloud - vars: - kill_netstat: true - roles: - - overcloud-network-discovery - tags: - - overcloud-validate - -- name: Delete the overcloud - hosts: undercloud - tags: - - overcloud-delete - gather_facts: false - roles: - - {role: overcloud-delete, - when: step_delete_overcloud|default(false)|bool} diff --git a/playbooks/baremetal-full-overcloud.yml b/playbooks/baremetal-full-overcloud.yml deleted file mode 100644 index d6277d64b..000000000 --- a/playbooks/baremetal-full-overcloud.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -- name: Deploy the overcloud - hosts: undercloud - gather_facts: false - tasks: - - name: Deploy the overcloud - include_role: - name: overcloud-deploy - tags: - - overcloud-deploy - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost diff --git a/playbooks/baremetal-full-undercloud.yml b/playbooks/baremetal-full-undercloud.yml deleted file mode 100644 index 275227029..000000000 --- a/playbooks/baremetal-full-undercloud.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: Deploy the undercloud - hosts: undercloud - gather_facts: true - roles: - - undercloud-deploy - tags: - - undercloud-deploy - -- name: Validate the undercloud - hosts: undercloud - roles: - - {role: validate-undercloud, - when: run_validate_undercloud|default(false)|bool} - tags: - - validate-undercloud - -- name: Download amphora image for octavia - hosts: undercloud - gather_facts: false - tags: - - octavia - roles: - - {role: octavia-amphora-download, - when: download_amphora is defined and download_amphora|bool} - -- name: Build images for quickstart - hosts: undercloud - gather_facts: false - roles: - - {role: build-images, when: to_build|default(false)|bool} - tags: - - get-images - - images diff --git a/playbooks/baremetal-prep-virthost.yml b/playbooks/baremetal-prep-virthost.yml deleted file mode 100644 index b1d3874aa..000000000 --- a/playbooks/baremetal-prep-virthost.yml +++ /dev/null @@ -1,205 +0,0 @@ ---- -# Add the virthost to the in-memory inventory. The inventory is not -# wirtten out to disk unless you call the `rebuild-inventory` role. -- name: Add the virthost to the inventory - hosts: localhost - tasks: - - name: Add virthost - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "root" - ansible_host: "{{ virthost }}" - ansible_private_key_file: "{{ ansible_private_key_file_location | default('') }}" - -- include: teardown-provision.yml - -# The `provision.yml` playbook is responsible for -# creating an inventory entry for our `virthost` and for creating an -# unprivileged user on that host for use by our virtual environment. -- include: provision.yml - -# These teardown tasks only make sense after running provision.yml, -# because they assume they are connecting as the `stack` user rather -# than `root`. -- include: teardown-nodes.yml -- include: teardown-environment.yml - -- name: setup yum repos on virthost - hosts: virthost - gather_facts: true - roles: - - repo-setup - tags: - - provision - -# The `environment/setup` role performs any tasks that require `root` -# access on the target host. -- name: Install libvirt packages and configure networks - hosts: virthost - tags: - - environment - roles: - - environment/setup - -- name: Check whether to build images - hosts: virthost - gather_facts: true - roles: - - check-to-build-or-not-to-build - -- name: Add firewalld services and ports - hosts: virthost - gather_facts: false - tasks: - - include_role: - name: baremetal-prep-virthost - tasks_from: add_services_ports_firewalld.yml - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version|int >= 8 - -- name: Find latest Centos image and set facts for undercloud base image. - hosts: virthost - gather_facts: true - tasks: - - block: - - name: Discover latest CentOS qcow2 image - include_role: - name: discover-latest-image - - name: set_fact for undercloud base image - set_fact: - baseos_undercloud_image_url: "{{ discovered_image_url }}" - baseos_image: "{{ ansible_distribution | lower }}" - baseos_image_type: qcow2 - baseos_md5sum: "{{ discovered_md5sum }} {{ discovered_image_name }}" - cacheable: true - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version is version(9, '>=') - -- name: Setup undercloud and baremetal vms and networks in libvirt - hosts: virthost - gather_facts: true - vars: - baseos: true - roles: - - libvirt/setup - -# Add the undercloud node to the generated -# inventory. -- name: Inventory the undercloud - hosts: localhost - gather_facts: true - vars: - inventory: undercloud - roles: - - tripleo-inventory - -- name: Set to_build on undercloud - hosts: undercloud - gather_facts: true - tasks: - - name: set_fact for to_build on undercloud - set_fact: - to_build: "{{ hostvars[groups['virthost'][0]]['to_build'] }}" - cacheable: true - - - name: set_fact for image_cache_dir on undercloud - set_fact: - image_cache_dir: "{{ working_dir }}/images-cache" - cacheable: true - - - name: set_fact for libguestfs_mode on undercloud - set_fact: - libguestfs_mode: false - cacheable: true - - # Always build images even if running a periodic-* named job - # in a check pipeline for testing - - name: Always build images in periodic - set_fact: - to_build: true - cacheable: true - when: "'periodic' in zuul.job" - -- name: Setup the undercloud - hosts: undercloud - gather_facts: true - vars: - non_root_user_setup: false - roles: - - undercloud-setup - -- name: Remove ens3 if not required - hosts: undercloud - gather_facts: false - tasks: - - include_role: - name: baremetal-prep-virthost - tasks_from: remove_ens3.yml - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version|int >= 8 - -- name: Ensure locale has LANG=en_US.UTF-8 - hosts: undercloud - gather_facts: false - tasks: - - include_role: - name: baremetal-prep-virthost - tasks_from: set_locale_UTF_8 - when: - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version|int >= 8 - -- name: Prepare the host for PXE forwarding - hosts: virthost - gather_facts: true - roles: - - baremetal-prep-virthost - -- name: Get images for quickstart - hosts: undercloud - gather_facts: true - vars: - ib_repo_image_inject: "{{ not to_build|bool }}" - ib_repo_run_live: false - modify_image_vc_ram: 4096 - modify_image_vc_cpu: 4 - modify_image_vc_verbose: true - tasks: - - include_role: - name: fetch-images - when: not to_build|bool - - - include_role: - name: repo-setup - vars: - repo_inject_image_path: "/home/{{ undercloud_user }}/{{ overcloud_image }}.qcow2" - repo_run_live: false - when: not to_build|bool - - - include_role: - name: repo-setup - vars: - repo_inject_image_path: "/home/{{ undercloud_user }}/ironic-python-agent.initramfs" - repo_run_live: false - initramfs_image: true - libguestfs_mode: false - when: not to_build|bool - - - include_role: - name: install-built-repo - vars: - ib_repo_image_path: "/home/{{ undercloud_user }}/{{ overcloud_image }}.qcow2" - when: compressed_gating_repo is defined and not to_build|bool - - - include_role: - name: install-built-repo - vars: - ib_repo_image_path: "/home/{{ undercloud_user }}/ironic-python-agent.initramfs" - initramfs_image: true - libguestfs_mode: false - when: compressed_gating_repo is defined and not to_build|bool diff --git a/playbooks/baremetal-quickstart-extras.yml b/playbooks/baremetal-quickstart-extras.yml deleted file mode 100644 index eb69eb0f8..000000000 --- a/playbooks/baremetal-quickstart-extras.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- import_playbook: baremetal-full-undercloud.yml -- import_playbook: baremetal-full-overcloud-prep.yml -- import_playbook: baremetal-full-overcloud.yml -- import_playbook: baremetal-full-overcloud-validate.yml diff --git a/playbooks/baremetal-undercloud-minimal.yml b/playbooks/baremetal-undercloud-minimal.yml deleted file mode 100644 index 4ba67e134..000000000 --- a/playbooks/baremetal-undercloud-minimal.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -- name: Provision undercloud by directly calling provisioning script - hosts: localhost - pre_tasks: - - name: Provision script execution - shell: > - set -o pipefail && - {{ baremetal_provisioning_script }} 2>&1 | tee - "{{ local_working_dir }}/baremetal_provision.log" - when: step_provide_undercloud|bool - - - name: Add the undercloud VM to the inventory - add_host: - name: "{{ undercloud_eth0_ip }}" - groups: undercloud - ansible_user: "root" - ansible_private_key_file: "{{ ansible_private_key_file_location | default('') }}" - ansible_ssh_common_args: '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' - - - name: Copy the private key to the expected location - copy: - src: "{{ ansible_private_key_file_location }}" - dest: "{{ local_working_dir }}/id_rsa_undercloud" - mode: 0600 - -- name: Inventory the undercloud - hosts: localhost - gather_facts: true - vars: - inventory: undercloud - roles: - - tripleo-inventory - -- name: Setup repositories - hosts: undercloud - gather_facts: true - roles: - - repo-setup - tags: - - undercloud-repo-setup - -- name: Install packages - hosts: undercloud - gather_facts: false - roles: - - baremetal-undercloud/packages - tags: - - undercloud-pkgs-install - -# Small playbook with logic for when to build images or not. -# The logic there can be completely overridden by setting the -# to_build variable. -- include: to-build-or-not-to-build.yml - -- name: Run DLRN gate role and install repo - hosts: undercloud - vars: - artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" - artg_repos_dir: "{{ repo_clone_dir|default('/opt/stack/new') }}" - ib_create_web_repo: "{{ to_build|bool }}" - roles: - - {role: build-test-packages, when: build_test_packages|default(false)|bool} - - {role: install-built-repo, when: compressed_gating_repo is defined} - tags: - - build - -- name: Get images for quickstart - hosts: undercloud - gather_facts: false - vars: - ib_repo_image_inject: "{{ not to_build|bool }}" - ib_repo_run_live: false - modify_image_vc_ram: 4096 - modify_image_vc_cpu: 4 - modify_image_vc_verbose: true - roles: - - {role: fetch-images, - when: not to_build|bool} - - {role: repo-setup, - repo_inject_image_path: "$HOME/{{ overcloud_image }}.qcow2", - repo_run_live: false, - when: not to_build|bool} - - {role: repo-setup, - repo_inject_image_path: "$HOME/ironic-python-agent.initramfs", - repo_run_live: false, - initramfs_image: true, - libguestfs_mode: false, - when: not to_build|bool} - - {role: install-built-repo, - ib_repo_image_path: "$HOME/{{ overcloud_image }}.qcow2", - when: compressed_gating_repo is defined and not to_build|bool} - - {role: install-built-repo, - ib_repo_image_path: "$HOME/ironic-python-agent.initramfs", - initramfs_image: true, - libguestfs_mode: false, - when: compressed_gating_repo is defined and not to_build|bool} diff --git a/playbooks/baremetal-undercloud.yml b/playbooks/baremetal-undercloud.yml deleted file mode 100644 index f768f45c2..000000000 --- a/playbooks/baremetal-undercloud.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Baremetal undercloud install - hosts: localhost - roles: - - baremetal-undercloud - tags: - - baremetal-undercloud - -- name: Add the undercloud node to the generated inventory - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - tags: - - undercloud-inventory - -- name: Setup repositories - hosts: undercloud - gather_facts: true - roles: - - repo-setup - tags: - - undercloud-repo-setup - -- name: Install packages - hosts: undercloud - gather_facts: false - roles: - - baremetal-undercloud/packages - tags: - - undercloud-pkgs-install - -- name: Fetch the overcloud images - hosts: undercloud - gather_facts: false - roles: - - fetch-images - tags: - - overcloud-fetch-images diff --git a/playbooks/build-images-v2.yml b/playbooks/build-images-v2.yml deleted file mode 100644 index 11ecde50c..000000000 --- a/playbooks/build-images-v2.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -- name: Add the virthost to the inventory - hosts: localhost - tasks: - - name: Add virthost - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "root" - ansible_host: "{{ virthost }}" - tags: - - provision - -- name: Inventory the virthost - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - tags: - - provision - -- include: teardown-provision.yml - -- include: provision.yml - -- name: Build images - hosts: virthost - roles: - - build-images diff --git a/playbooks/build-test-packages.yml b/playbooks/build-test-packages.yml deleted file mode 100644 index 72cf0f8af..000000000 --- a/playbooks/build-test-packages.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -- name: Add the virthost to the inventory - hosts: localhost - tasks: - - name: Add virthost - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "root" - ansible_host: "{{ virthost }}" - tags: - - provision - -- name: Inventory the virthost - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - tags: - - provision - -- include: teardown.yml - -- include: provision.yml - -- name: Build test packages using DLRN - hosts: virthost - roles: - - build-test-packages diff --git a/playbooks/cleanup-destructive.yml b/playbooks/cleanup-destructive.yml deleted file mode 100644 index 84195bfc4..000000000 --- a/playbooks/cleanup-destructive.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Add virthost to inventory - hosts: localhost - tasks: - - name: Add the virthost to the inventory - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "root" - ansible_host: "{{ virthost }}" - -- name: Clean up tripleo packages and libvirt - hosts: virthost - gather_facts: false - roles: - - virthost-full-cleanup diff --git a/playbooks/collect-logs.yml b/playbooks/collect-logs.yml deleted file mode 100644 index 880a8b945..000000000 --- a/playbooks/collect-logs.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Run dump vars on all!localhost - hosts: all:!localhost:!127.0.0.2 - roles: - - dump_vars - -- name: Ensure the overcloud nodes are added to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - collect-logs - vars: - inventory: all - roles: - - tripleo-inventory - ignore_errors: true - -- name: Collect logs - hosts: all:!localhost:!127.0.0.2 - roles: - - collect-logs - -- name: Create docs, publish logs - hosts: localhost - roles: - - {role: collect-logs, artcl_collect: false} diff --git a/playbooks/content-provider-containers.yml b/playbooks/content-provider-containers.yml deleted file mode 100644 index e07836cf1..000000000 --- a/playbooks/content-provider-containers.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -- name: Build containers for content provider job - hosts: undercloud - tasks: - - name: Build containers for CentOS 8 - include_role: - name: standalone - tasks_from: containers - apply: - tags: - - standalone - when: ansible_distribution_major_version is version('8', '>=') - - - name: Build containers for CentOS 7 - when: ansible_distribution_major_version is version('8', '<') - block: - - - name: Include pre tasks from build-containers role - vars: - buildcontainers_venv: false - include_role: - name: build-containers - tasks_from: pre - - - name: Check for gating repo - stat: - path: "/etc/yum.repos.d/gating.repo" - register: new_repo - - - name: Set proper repos - set_fact: - buildcontainers_rpm_setup_config: >- - http://{{ ansible_default_ipv4.address }}/delorean.repo, - http://{{ ansible_default_ipv4.address }}/delorean-current.repo, - {% if new_repo.stat.exists %} - http://{{ ansible_default_ipv4.address }}/gating.repo, - {% endif %} - {% if release in ['queens'] %} - http://{{ ansible_default_ipv4.address }}/quickstart-centos-ceph-luminous.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-extras.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-opstools.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-updates.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos7-rt.repo, - {% else %} - http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-build-deps.repo, - {% endif %} - http://{{ ansible_default_ipv4.address }}/quickstart-centos-qemu.repo, - http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-deps.repo - - - name: Build containers for provider job - vars: - buildcontainers_venv: false - include_role: - name: build-containers - tags: - - standalone - - undercloud diff --git a/playbooks/deploy-delete.yml b/playbooks/deploy-delete.yml deleted file mode 100644 index 8466ea45e..000000000 --- a/playbooks/deploy-delete.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# This is the playbook used by the `quickstart.sh` script. - -- import_playbook: quickstart-extras.yml - -- name: Collect logs, create docs, publish - hosts: all:!localhost - gather_facts: false - roles: - - {role: tripleo-collect-logs, artcl_collect: true} - -- name: test overcloud deletion - hosts: undercloud - gather_facts: false - roles: - - {role: overcloud-delete} diff --git a/playbooks/deploy-standalone-compute.yml b/playbooks/deploy-standalone-compute.yml deleted file mode 100644 index 15cd83f5c..000000000 --- a/playbooks/deploy-standalone-compute.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -# First, deploy the undercloud. This will also ensure the inventory is properly -# populated with the subnode-1 host and all the needed data. -- hosts: undercloud - gather_facts: true - tags: - - standalone - tasks: - - name: Run External Data Plane management role - include_role: - name: external_data_plane_management - tasks_from: prepare_node.yml - -# Now that we have the updated inventory, we can get to subnode-1 using the -# correct data. Let's bootstrap it! -- hosts: subnode-1 - gather_facts: true - tags: - - standalone - tasks: - - name: Run External Data Plane management role - include_role: - name: external_data_plane_management - tasks_from: prepare_node.yml - -# On undercloud: -# + Deploy standalone -# + Deploy the external compute from within the undercloud -# + Validate external compute -- hosts: undercloud - gather_facts: false - tags: - - standalone - tasks: - - name: Deploy standalone - include_role: - name: external_data_plane_management - tasks_from: deploy_standalone.yml - - name: Deploy remote compute - vars: - target_host: 'subnode-1' - include_role: - name: external_data_plane_management - tasks_from: compute_services_on_target_host.yml - - name: Validate EDPM deploy - vars: - target_host: 'subnode-1' - include_role: - name: external_data_plane_management - tasks_from: validate_edpm.yml diff --git a/playbooks/gate-quickstart.yml b/playbooks/gate-quickstart.yml deleted file mode 100644 index eb5e18067..000000000 --- a/playbooks/gate-quickstart.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# This playbooks is responsible for gating changes in tripleo-quickstart or -# tripleo-quickstart-extras with a possibility to depend on changes from the -# other repo -- name: Gate quickstart changes - hosts: localhost - roles: - - gate-quickstart diff --git a/playbooks/multinode-minion.yml b/playbooks/multinode-minion.yml deleted file mode 100644 index 5df3c432d..000000000 --- a/playbooks/multinode-minion.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- import_playbook: quickstart.yml -- import_playbook: multinode-undercloud.yml -- import_playbook: multinode-undercloud-minion.yml diff --git a/playbooks/multinode-multiple-overcloud.yml b/playbooks/multinode-multiple-overcloud.yml deleted file mode 100644 index 0a3446631..000000000 --- a/playbooks/multinode-multiple-overcloud.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- - -########################## -# Prepare for deployment # -########################## - -# From tripleo-quickstart/playbooks -- import_playbook: quickstart.yml -- import_playbook: multinode-undercloud.yml -- import_playbook: multinode-overcloud-prep.yml - -################################## -# Deploy First stack - overcloud # -################################## - -- name: Deploy the overcloud - hosts: undercloud - gather_facts: false - environment: - TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}" - tasks: - - name: Deploy the overcloud - include_role: - name: overcloud-deploy - - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost - -####################################### -# Deploy Second stack - overcloud-two # -####################################### -- name: Deploy the second overcloud - hosts: undercloud - gather_facts: false - environment: - TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}" - vars: - stack_name: "overcloud-two" - overcloud_cloud_name: "{{ stack_name }}.localdomain" - overcloud_cloud_name_internal: "{{ stack_name }}.internalapi.localdomain" - overcloud_cloud_name_storage: "{{ stack_name }}.storage.localdomain" - overcloud_cloud_name_storage_management: "{{ stack_name }}.storagemgmt.localdomain" - overcloud_cloud_name_ctlplane: "{{ stack_name }}.ctlplane.localdomain" - tasks: - - name: Deploy the second overcloud - include_role: - name: overcloud-deploy - - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost - -###################################### -# Run tempest on overcloud-two stack # -###################################### - -# From tripleo-quickstart/playbooks -- import_playbook: multinode-validate.yml - vars: - tempest_cloud_name: 'overcloud-two' diff --git a/playbooks/multinode-overcloud-mixed-os-deploy.yml b/playbooks/multinode-overcloud-mixed-os-deploy.yml deleted file mode 100644 index 158fefe08..000000000 --- a/playbooks/multinode-overcloud-mixed-os-deploy.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: Deploy the overcloud control stack - hosts: undercloud - gather_facts: false - environment: - TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}" - tasks: - - name: Deploy the overcloud - include_role: - name: overcloud-deploy - vars: - overcloud_roles: "{{ overcloud_roles_mixed }}" - topology_map: "{{ topology_map_mixed }}" - tags: - - overcloud-deploy - - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost diff --git a/playbooks/multinode-overcloud-mixed-os-repos-compute.yml b/playbooks/multinode-overcloud-mixed-os-repos-compute.yml deleted file mode 100644 index a92645272..000000000 --- a/playbooks/multinode-overcloud-mixed-os-repos-compute.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - overcloud-deploy - vars: - inventory: multinode_mixed_os - roles: - - tripleo-inventory - -- name: Create configs on subnodes - hosts: overcloud_compute - roles: - - role: repo-setup - when: not mixed_upgrade|default(false)|bool - tasks: - - name: Create a clean hosts file on subnodes - copy: - dest: /etc/hosts - content: | - 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 - ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 - become: true - - - name: Run atop on overcloud node if configured - include_role: - name: undercloud-setup - tasks_from: atop - - tags: - - undercloud-setup diff --git a/playbooks/multinode-overcloud-prep.yml b/playbooks/multinode-overcloud-prep.yml deleted file mode 100644 index dee2e9c50..000000000 --- a/playbooks/multinode-overcloud-prep.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: Run overcloud prep config - hosts: undercloud - gather_facts: false - roles: - - role: overcloud-prep-config - # only run when we know we have to, save time otherwise - when: mixed_upgrade|default(false)|bool - tags: - - overcloud-prep-config - -- name: Run overcloud prep roles - hosts: undercloud - gather_facts: false - roles: - - {role: overcloud-prep-images, - step_overcloud_image: false, - step_glance_upload: true, - step_register: false} - -- name: Prepare for containerized deployment - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-containers - roles: - - role: overcloud-prep-containers - use_overcloud_mixed_upgrade: "{{ mixed_upgrade|default(false) }}" - -- name: Ensure openvswitch is started and enabled - hosts: overcloud - tags: - - overcloud-deploy - tasks: - - name: Ensure openvswitch is started and enabled - become: true - service: - name: openvswitch - state: started - enabled: true diff --git a/playbooks/multinode-overcloud-update.yml b/playbooks/multinode-overcloud-update.yml deleted file mode 100644 index 058e1ded4..000000000 --- a/playbooks/multinode-overcloud-update.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# the yum repos ALWAYS need to change -- name: Configure next minor release repository on overcloud nodes - hosts: overcloud - gather_facts: false - tags: - - overcloud-update - vars: - repo_setup_script: "repo-setup-update.sh" - repo_setup_log: "repo-setup-update.log" - repo_setup_run_update: false - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - role: repo-setup - when: - - minor_update|default(false)|bool - - not mixed_os|default(false)|bool - -- name: Update containers file before minor update - hosts: undercloud - gather_facts: false - tags: - - overcloud-update - roles: - - role: container-update - when: - - minor_update|default(false)|bool - - not mixed_os|default(false)|bool - -- name: Run tripleo-upgrade role to update the overcloud - hosts: undercloud - gather_facts: true - tags: - - overcloud-update - roles: - - role: tripleo-upgrade - when: overcloud_update|default(false)|bool diff --git a/playbooks/multinode-overcloud-upgrade.yml b/playbooks/multinode-overcloud-upgrade.yml deleted file mode 100644 index db0589771..000000000 --- a/playbooks/multinode-overcloud-upgrade.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -# the yum repos ALWAYS need to change -- name: Configure next release repository in the undercloud - hosts: overcloud - tags: - - overcloud-upgrade - gather_facts: false - vars: - repo_setup_script: "repo-setup-{{ release }}.sh" - repo_setup_log: "repo-setup-{{ release }}.log" - # Avoid running yum update, only set up repos - repo_setup_run_update: false - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - role: repo-setup - when: containerized_overcloud_upgrade|default(false)|bool - -# note: in upstream CI the gerrit change is built on the content-provider -# this task will be skipped upstream -- name: Build the gerrit changes on the relevant release for the upgrade - hosts: overcloud - tags: - - build - gather_facts: false - vars: - repo_setup_script: "repo-setup-{{ release }}.sh" - repo_setup_log: "repo-setup-{{ release }}.log" - # Avoid running yum update, only set up repos - repo_setup_run_update: false - artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - role: build-test-packages - - role: install-built-repo - when: hostvars['undercloud']['compressed_gating_repo'] is defined and mixed_upgrade|default(false)|bool - -- name: Prepare containers for Upgrade - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-containers - roles: - - role: overcloud-prep-containers - # This need the new repo in place. - update_containers: true - # Do not overwrite the deployment log if any. - overcloud_prep_containers_log: "upgrade_overcloud_prep_containers.log" - overcloud_prep_containers_script: "upgrade_overcloud_prep_containers.sh" - when: containerized_overcloud_upgrade|default(false)|bool - -- name: Run tripleo-upgrade role to upgrade overcloud - hosts: undercloud - gather_facts: true - tags: - - overcloud-upgrade - tasks: - - name: Include TripleO upgrade role - include_role: - name: tripleo-upgrade - when: overcloud_upgrade|default(false)|bool or ffu_overcloud_upgrade|default(false)|bool diff --git a/playbooks/multinode-overcloud.yml b/playbooks/multinode-overcloud.yml deleted file mode 100644 index d7f2fb558..000000000 --- a/playbooks/multinode-overcloud.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -- name: Deploy the overcloud - hosts: undercloud - gather_facts: false - environment: - TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}" - tasks: - - name: Deploy the overcloud - include_role: - name: overcloud-deploy - tags: - - overcloud-deploy - - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost diff --git a/playbooks/multinode-standalone-ipa.yml b/playbooks/multinode-standalone-ipa.yml deleted file mode 100644 index e960b6620..000000000 --- a/playbooks/multinode-standalone-ipa.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Add the nodes to the generated inventory - hosts: undercloud - gather_facts: true - vars: - inventory: multinode - roles: - - tripleo-inventory - tags: - - standalone - -- name: Setup the IPA server - hosts: subnode-1 - tags: - - standalone - tasks: - - include_role: - name: ipa-multinode - tasks_from: ipaserver-subnode-install.yml - -- name: Setup the undercloud for IPA server - hosts: undercloud - tags: - - standalone - tasks: - - include_role: - name: ipa-multinode - tasks_from: ipaserver-undercloud-setup.yml diff --git a/playbooks/multinode-standalone-pre.yml b/playbooks/multinode-standalone-pre.yml deleted file mode 100644 index b32bb8b83..000000000 --- a/playbooks/multinode-standalone-pre.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Discover a real branch for a running job - hosts: undercloud - tags: - - standalone - - undercloud - tasks: - - name: Set branch for building containers check jobs - set_fact: - ci_branch: "{{ job.zuul.branch | regex_replace('(stable|cloudsig)/', '') }}" - cacheable: true - when: job.zuul is defined - - - name: Set branch for building containers branchless - set_fact: - ci_branch: "{{ job.branch_override | regex_replace('(stable|cloudsig)/', '') }}" - cacheable: true - when: job.branch_override is defined - -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - standalone - - undercloud - vars: - inventory: multinode - roles: - - tripleo-inventory - -- name: Prepare the undercloud for installation - hosts: undercloud - roles: - - undercloud-setup - tags: - - standalone - - undercloud - -- import_playbook: content-provider-containers.yml diff --git a/playbooks/multinode-standalone-repoclosure.yml b/playbooks/multinode-standalone-repoclosure.yml deleted file mode 100644 index b7d157e34..000000000 --- a/playbooks/multinode-standalone-repoclosure.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - standalone - vars: - inventory: multinode - roles: - - tripleo-inventory - -- name: Enable nested virtualization on the host - hosts: undercloud - gather_facts: true - roles: - - parts/kvm - tags: - - nested_virt - -- name: Prepare the undercloud for installation - hosts: undercloud - roles: - - undercloud-setup - tags: - - standalone - -- name: Test available repos for repoclosure - hosts: undercloud - roles: - - repoclosure - tags: - - standalone diff --git a/playbooks/multinode-standalone-upgrade.yml b/playbooks/multinode-standalone-upgrade.yml deleted file mode 100644 index 53fbb1b8b..000000000 --- a/playbooks/multinode-standalone-upgrade.yml +++ /dev/null @@ -1,131 +0,0 @@ ---- -# Opening up repo-setup as cached variables can cause issue, see -# https://bugs.launchpad.net/tripleo/+bug/1795367 -- name: Standalone upgrade repos setup and host upgrade - hosts: undercloud - tasks: - - - name: Standalone upgrade get new dlrn hash. - include_role: - name: repo-setup - tasks_from: get-dlrn-hash - - - name: Standalone upgrade get new dlrn hash. - include_role: - name: repo-setup - tasks_from: get-dlrn-hash-newest - - - name: Standalone upgrade generate new dlrn repo-setup script. - include_role: - name: repo-setup - tasks_from: create-repo-script - vars: - repo_setup_script: repo_setup_upgrade.sh - repo_setup_run_update: false - # when yum_config_module is enabled - repo_cmd_before_setup_script: repo_cmd_before_setup_upgrade.sh - repo_setup_new_script: repo_setup_upgrade_new.sh - repo_cmd_after_setup_script: repo_cmd_after_setup_upgrade.sh - - # The next task triggers the yum upgrade command in as - # repo_setup_run_update is true in release files by default. - - name: Standalone upgrade setup new repos - include_role: - name: repo-setup - tasks_from: setup_repos - vars: - repo_setup_log: repo_setup_upgrade.log - repo_setup_script: repo_setup_upgrade.sh - when: not use_yum_config_module|default(false)|bool - - # Run setup_repos_new tasks when using yum_config_module - - name: Standalone upgrade setup new repos using yum-config module - include_role: - name: repo-setup - tasks_from: setup_repos_new - vars: - repo_setup_log: repo_setup_upgrade.log - repo_cmd_before_setup_script: repo_cmd_before_setup_upgrade.sh - repo_setup_new_script: repo_setup_upgrade_new.sh - repo_cmd_after_setup_script: repo_cmd_after_setup_upgrade.sh - when: use_yum_config_module|default(false)|bool - - - name: Check and enable the component-ci-testing repo if present - become: true - when: job.component is defined - block: - - name: Stat for the component-ci-testing repo file - stat: - path: "/etc/yum.repos.d/{{ job.component }}-component.repo" - register: component_repo - - name: Enable the component-ci-testing repo if we have one - ini_file: - path: "/etc/yum.repos.d/{{ job.component }}-component.repo" - option: enabled - value: '1' - section: "{{ job.component }}" - no_extra_spaces: true - when: - - component_repo.stat.isreg is defined - - component_repo.stat.isreg - - tags: - - standalone-upgrade - -# This is what is gating the patch in the N version in a N-1->N -# upgrade. -- name: Standalone upgrade runs DLRN gate role and install repo - hosts: undercloud - vars: - artg_compressed_gating_repo: "/home/{{ undercloud_user }}/gating_repo.tar.gz" - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - build-test-packages - - {role: install-built-repo, when: compressed_gating_repo is defined} - tags: - - build - -# NOTE(aschultz): nested virt causes problems in CI so we default to qemu -# and do not do the dynamic virt lookup. -- name: Standalone Upgrade - hosts: undercloud - vars: - standalone_libvirt_type: "{{ standalone_virt_type|default('qemu') }}" - roles: - - standalone-upgrade - tags: - - standalone-upgrade - -# Remove me when os_tempest tempest init gets fixed -- name: Tempest workspace workaround - hosts: undercloud - tasks: - - name: Nuke tempest workspace - file: - path: "{{ item }}" - state: absent - with_items: - - "{{ ansible_user_dir }}/tempest" - - "{{ ansible_user_dir }}/.tempest" - ignore_errors: true - -- name: Validate the Standalone upgrade - hosts: undercloud - # Note(chkumar246): Moved the os_tempest related var at the top - # of play level in order to have scope for the whole of the play - # https://bugs.launchpad.net/tripleo/+bug/1838496 - vars: - tempest_install_method: distro - tempest_cloud_name: 'standalone' - tempest_cidr: '192.168.24.0/24' - tasks: - - include_tasks: tasks/tempest.yml - when: use_os_tempest | default(true) - environment: - # Disable ssl warnings - CURL_CA_BUNDLE: "" - tags: - - standalone-upgrade diff --git a/playbooks/multinode-standalone.yml b/playbooks/multinode-standalone.yml deleted file mode 100644 index ee772b257..000000000 --- a/playbooks/multinode-standalone.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - standalone - vars: - inventory: multinode - roles: - - tripleo-inventory - -- name: Enable nested virtualization on the host - hosts: undercloud - gather_facts: true - roles: - - parts/kvm - tags: - - nested_virt - -- name: Prepare the undercloud for installation - hosts: undercloud - roles: - - undercloud-setup - tags: - - standalone - -- name: Download amphora image for octavia - hosts: undercloud - gather_facts: false - roles: - - {role: octavia-amphora-download, - when: download_amphora is defined and download_amphora|bool} - tags: - - octavia - -# NOTE(aschultz): nested virt causes problems in CI so we default to qemu -# and do not do the dynamic virt lookup. -- name: Deploy Standalone - hosts: undercloud - vars: - standalone_libvirt_type: "{{ standalone_virt_type|default('qemu') }}" - roles: - - standalone - tags: - - standalone - -- name: Run tripleo-validations standalone tests - import_playbook: validations.yml - -- name: Validate the undercloud - hosts: undercloud - gather_facts: false - roles: - - {role: validate-services, when: validate_services|default(false)|bool} - tags: - - standalone - -# Per https://bugs.launchpad.net/tripleo/+bug/1903993 we need to reduce the -# standalone-upgrade runtime. If this is upgrade job fs56 skip tempest include. -- name: Validate the deployment - hosts: undercloud - # Note(chkumar246): Moved the os_tempest related var at the top - # of play level in order to have scope for the whole of the play - # https://bugs.launchpad.net/tripleo/+bug/1838496 - vars: - tempest_install_method: distro - tempest_cloud_name: 'standalone' - tasks: - - include_tasks: tasks/tempest.yml - when: - - job is undefined or (job is defined and - job.featureset is defined and job.featureset != '056') - - use_os_tempest | default(true) - - not job.skip_os_tempest|default(false) - environment: - # Disable ssl warnings - CURL_CA_BUNDLE: "" - tags: - - standalone diff --git a/playbooks/multinode-undercloud-minion.yml b/playbooks/multinode-undercloud-minion.yml deleted file mode 100644 index 145fb7578..000000000 --- a/playbooks/multinode-undercloud-minion.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -# TODO(aschultz): fix tags in here to be undercloud-minion-setup -- name: Collect output from undercloud - hosts: undercloud - gather_facts: false - tasks: - - name: Copy output files - include_role: - name: undercloud-deploy - tasks_from: gather-outputs - tags: - - undercloud-setup - -- name: Write output from undercloud - hosts: overcloud - gather_facts: false - tasks: - - name: Reading and setting undercloud facts from gather-outputs - set_fact: - undercloud_outputs: "{{ hostvars['undercloud']['undercloud_outputs'] }}" - undercloud_passwords: "{{ hostvars['undercloud']['undercloud_passwords'] }}" - - name: write output files to old consistent location - include_role: - name: undercloud-setup - tasks_from: write-outputs - - name: create new consistent location - file: - state: directory - path: "{{ working_dir ~ '/tripleo-deploy/minion' }}" - - name: write output files to new consistent location - include_role: - name: undercloud-setup - tasks_from: write-outputs - vars: - undercloud_outputs_dir: "{{ working_dir ~ '/tripleo-deploy/minion/' }}" - tags: - - undercloud-setup - -- name: Setup the undercloud minion - hosts: overcloud - vars: - # these are the defaults but we should be explicit - minion_enable_heat_engine: true - minion_enable_ironic_conductor: true - tasks: - - name: Include atop setup - include_role: - name: undercloud-setup - tasks_from: atop - - name: Set container update fact from undercloud - set_fact: - update_containers_append_tag: "{{ hostvars['undercloud']['update_containers_append_tag'] | default('') }}" - - name: Include repo-setup - include_role: - name: repo-setup - - name: Include package installs - include_role: - name: undercloud-setup - tasks_from: package_installs - when: package_installs|default(true)|bool - - name: Update built packages - shell: | - {{ ansible_pkg_mgr }} --enablerepo='gating-repo' update -y # noqa 305 - become: true - when: hostvars['undercloud']['compressed_gating_repo'] is defined - tags: - - undercloud-setup - -- name: Deploy the undercloud minion - hosts: overcloud - roles: - - undercloud-minion-deploy - tags: - - undercloud-setup - -- name: Validate minion - hosts: undercloud - vars: - validate_minion_heat_engine: true - validate_minion_ironic_conductor: true - roles: - - validate-minion - tags: - - overcloud-validate diff --git a/playbooks/multinode-undercloud-mixed-os.yml b/playbooks/multinode-undercloud-mixed-os.yml deleted file mode 100644 index ee2aff393..000000000 --- a/playbooks/multinode-undercloud-mixed-os.yml +++ /dev/null @@ -1,95 +0,0 @@ ---- -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - overcloud-deploy - vars: - inventory: multinode_mixed_os - roles: - - tripleo-inventory - -- name: Create configs on subnodes - hosts: overcloud_control - roles: - - role: repo-setup - when: not mixed_upgrade|default(false)|bool - tasks: - - name: Create a clean hosts file on subnodes - copy: - dest: /etc/hosts - content: | - 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 - ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 - become: true - - - name: Run atop on overcloud node if configured - include_role: - name: undercloud-setup - tasks_from: atop - - tags: - - undercloud-setup - -- name: Prepare the undercloud for installation - hosts: undercloud - roles: - - undercloud-setup - tags: - - undercloud-setup - -- name: Install built packages on subnodes - hosts: overcloud_control - vars: - ib_repo_host: undercloud - roles: - - role: repo-setup - when: not mixed_upgrade|default(false)|bool - - role: install-built-repo - when: hostvars['undercloud']['compressed_gating_repo'] is defined and not mixed_upgrade|default(false)|bool - - tags: - - build - -- name: Install the undercloud - tags: undercloud-install - hosts: undercloud - tasks: - - name: get hash set fact mixed_os_dlrn_hash_8 for periodic jobs (no content provider) - when: - - not job.consumer_job | default(false) | bool - - registry_distro_lower is defined - block: - - include_role: - name: repo-setup - tasks_from: tripleo-get-hash-set-fact.yml - vars: - search_tag: "{{ dlrn_hash_tag }}" - tgh_os_version_override: "{{ (ansible_distribution == 'RedHat') | ternary('rhel', 'centos') }}8" - fact_name: "mixed_os_dlrn_hash_8" - - name: "debug dlrn_hash_tag resolution " - debug: - msg: "d_h_t {{ dlrn_hash_tag }} resolved to mixed_os_dlrn_hash_8 {{ mixed_os_dlrn_hash_8 }} " - - name: set fact mixed_os_dlrn_hash_8 for check/gate jobs (with content provider) - when: - - job.consumer_job | default(false) | bool - - job.provider_dlrn_hash_distro is defined - - registry_distro_lower is defined - set_fact: - mixed_os_dlrn_hash_8: "{{ job.provider_dlrn_hash_distro[registry_distro_lower] }}" - - - name: Deploy the undercloud - include_role: - name: undercloud-deploy - -- name: Validate the undercloud - hosts: undercloud - roles: - - validate-undercloud - -- name: Set Libvirt type - hosts: overcloud - roles: - - set-libvirt-type - tags: - - overcloud-deploy diff --git a/playbooks/multinode-undercloud-upgrade.yml b/playbooks/multinode-undercloud-upgrade.yml deleted file mode 100644 index eacce6b1d..000000000 --- a/playbooks/multinode-undercloud-upgrade.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -# the yum repos ALWAYS need to change -- name: Configure next release repository in the undercloud - hosts: undercloud - tags: - - undercloud-upgrade - vars: - repo_setup_script: "repo-setup-{{ lookup('env', 'UPGRADE_RELEASE') }}.sh" - repo_setup_log: "repo-setup-{{ lookup('env', 'UPGRADE_RELEASE') }}.log" - repo_setup_run_update: false - dlrn_hash_path: '' - dlrn_hash_path_newest: '' - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - role: repo-setup - -# note: in upstream CI the gerrit change is built on the content-provider -# this task will be skipped upstream -- name: Build the gerrit changes on the relevant release for the upgrade - hosts: undercloud - tags: - - build - vars: - repo_setup_script: "repo-setup-{{ lookup('env', 'UPGRADE_RELEASE') }}.sh" - repo_setup_log: "repo-setup-{{ lookup('env', 'UPGRADE_RELEASE') }}.log" - repo_setup_run_update: false - dlrn_hash_path: '' - dlrn_hash_path_newest: '' - artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" - # This should not be enabled because the updating of the packages occurs - # durring the upgrade process. For general installation it's ok to have - # this enabled, but this needs to be disabled for upgrades - ib_gating_repo_update: false - roles: - - role: build-test-packages - - {role: install-built-repo, when: compressed_gating_repo is defined} - -- name: Prepare containers for Upgrade - hosts: undercloud - gather_facts: false - tags: - - undercloud-upgrade - roles: - - role: container-update - when: - - containerized_undercloud_upgrade|default(false)|bool - -- name: Run tripleo-upgrade role to upgrade undercloud - hosts: undercloud - tags: - - undercloud-upgrade - roles: - - role: tripleo-upgrade diff --git a/playbooks/multinode-undercloud.yml b/playbooks/multinode-undercloud.yml deleted file mode 100644 index cc064f90c..000000000 --- a/playbooks/multinode-undercloud.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - overcloud-deploy - vars: - inventory: multinode - roles: - - tripleo-inventory - -- name: Create configs on subnodes - hosts: overcloud - pre_tasks: - - name: Include vars when dependency is defined - when: job.dependency is defined or dependency is defined - vars: - tripleo_quickstart_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-quickstart'].src_dir }}" - t_q_dependency_dir: "{{ tripleo_quickstart_dir }}/config/release/dependency_ci/{{ job.dependency|default(dependency) }}" - block: - - name: Load vars from dependency file - include_vars: - file: "{{ t_q_dependency_dir }}/repo_config.yaml" - roles: - # When doing mixed upgrade, we need different repos on undercloud - # vs. overcloud. Rely on $UPGRADE_RELEASE together with - # bootstrap-overcloud-full-minimal.sh to setup overcloud. - - role: repo-setup - when: not mixed_upgrade|default(false)|bool - tasks: - - name: Create a clean hosts file on subnodes - copy: - dest: /etc/hosts - content: | - 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 - ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 - become: true - - - name: Run atop on overcloud node if configured - include_role: - name: undercloud-setup - tasks_from: atop - - tags: - - undercloud-setup - -- name: Prepare the undercloud for installation - hosts: undercloud - roles: - - undercloud-setup - tags: - - undercloud-setup - -- name: Install built packages on subnodes - hosts: overcloud - vars: - ib_repo_host: undercloud - roles: - - role: repo-setup - when: not mixed_upgrade|default(false)|bool - - role: install-built-repo - when: hostvars['undercloud']['compressed_gating_repo'] is defined and not mixed_upgrade|default(false)|bool - - tags: - - build - -- name: Install the undercloud - hosts: undercloud - roles: - - undercloud-deploy - -- name: Validate the undercloud - hosts: undercloud - roles: - - validate-undercloud - -- name: Download amphora image for octavia - hosts: undercloud - gather_facts: false - tags: - - octavia - roles: - - {role: octavia-amphora-download, - when: download_amphora is defined and download_amphora|bool} - -- name: Set Libvirt type - hosts: overcloud - roles: - - set-libvirt-type - tags: - - overcloud-deploy diff --git a/playbooks/multinode-validate.yml b/playbooks/multinode-validate.yml deleted file mode 100644 index 5e9b1fd94..000000000 --- a/playbooks/multinode-validate.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: setup dstat performance monitoring - hosts: overcloud - tags: - - overcloud-validate - roles: - - {role: validate-perf, - when: validate_performance|bool and use_os_tempest | default(true) | bool} - ignore_errors: true - -# Validate the deployment -- name: validate the overcloud - hosts: undercloud - tags: - - overcloud-validate - - undercloud-validate - gather_facts: false - roles: - - {role: validate-services, when: validate_services|default(false)|bool} - -- name: Validate the deployment - hosts: undercloud - # Note(chkumar246): Moved the os_tempest related var at the top - # of play level in order to have scope for the whole of the play - # https://bugs.launchpad.net/tripleo/+bug/1838496 - vars: - tempest_install_method: distro - tempest_cloud_name: 'overcloud' - tempest_cidr: '192.168.24.0/24' - tasks: - - include_tasks: tasks/tempest.yml - when: use_os_tempest | default(true) | bool - environment: - # Disable ssl waarnings - CURL_CA_BUNDLE: "" - tags: - - overcloud-validate - - undercloud-validate diff --git a/playbooks/multinode.yml b/playbooks/multinode.yml deleted file mode 100644 index 52e482d66..000000000 --- a/playbooks/multinode.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -- import_playbook: quickstart.yml -- import_playbook: multinode-undercloud.yml -- import_playbook: multinode-overcloud-prep.yml -- import_playbook: multinode-overcloud.yml -- import_playbook: multinode-overcloud-update.yml -- import_playbook: multinode-overcloud-upgrade.yml -- import_playbook: validations.yml -- import_playbook: multinode-validate.yml diff --git a/playbooks/nodepool-setup.yml b/playbooks/nodepool-setup.yml deleted file mode 100644 index be8efdf4e..000000000 --- a/playbooks/nodepool-setup.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -# setup the nodepool nodes -- name: Setup the provisioned virtual machines to look like nodepool nodes - hosts: subnodes - gather_facts: true - roles: - - nodepool-setup diff --git a/playbooks/ovb-create-stack.yml b/playbooks/ovb-create-stack.yml deleted file mode 100644 index 7cce2b949..000000000 --- a/playbooks/ovb-create-stack.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# Add the virthost to the in-memory inventory. The inventory is not -# written out to disk unless you call the `tripleo-inventory` role. -- name: Add the virthost to the inventory - hosts: localhost - tasks: - - name: Add virthost - add_host: - name: "virthost" - groups: "virthost" - ansible_host: "{{ virthost }}" - -- name: Create the OVB stack - hosts: localhost - roles: - - {role: ovb-manage-stack, ovb_manage_stack_mode: 'create'} diff --git a/playbooks/ovb-delete-stack.yml b/playbooks/ovb-delete-stack.yml deleted file mode 100644 index 2fff5860e..000000000 --- a/playbooks/ovb-delete-stack.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- name: clean up heat stack - hosts: localhost - roles: - - {role: ovb-manage-stack, ovb_manage_stack_mode: 'delete'} diff --git a/playbooks/ovb-setup.yml b/playbooks/ovb-setup.yml deleted file mode 100644 index 2c3683c51..000000000 --- a/playbooks/ovb-setup.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -- include: ovb-create-stack.yml - when: not use_testenv_broker|default(false)|bool - -- include: prepare-slave.yml - when: use_testenv_broker|default(false)|bool - -- name: Inventory the undercloud instance - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - -# Small playbook with logic for when to build images or not. -# The logic there can be completely overridden by setting the -# to_build variable. -- name: When to build images or not - import_playbook: to-build-or-not-to-build.yml - -- name: Setup the undercloud - hosts: undercloud - gather_facts: true - roles: - - undercloud-setup - tasks: - - name: Add eth2 interface from eth2.conf - command: os-net-config -c {{ working_dir }}/eth2.conf -v - become: true - when: - - network_isolation|bool - - use_testenv_broker|default(false)|bool - - - name: Set DNS servers for OVB clouds - undercloud - set_fact: - undercloud_undercloud_nameservers: "{{ custom_nameserver }}" - cacheable: true - - - name: Set DNS servers for OVB clouds - overcloud - set_fact: - overcloud_dns_servers: "{{ custom_nameserver }}" - cacheable: true - -- name: Inventory the undercloud instance - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - -- name: Get images for quickstart - hosts: undercloud - gather_facts: false - vars: - ib_repo_image_inject: "{{ not to_build|bool }}" - ib_repo_run_live: false - modify_image_vc_ram: 4096 - modify_image_vc_cpu: 4 - modify_image_vc_verbose: true - roles: - - {role: fetch-images, - when: not to_build|bool} - - {role: repo-setup, - repo_inject_image_path: "$HOME/{{ overcloud_image }}.qcow2", - repo_run_live: false, - when: not to_build|bool} - - {role: repo-setup, - repo_inject_image_path: "$HOME/ironic-python-agent.initramfs", - repo_run_live: false, - initramfs_image: true, - libguestfs_mode: false, - when: not to_build|bool} - - {role: install-built-repo, - ib_repo_image_path: "$HOME/{{ overcloud_image }}.qcow2", - when: compressed_gating_repo is defined and not to_build|bool} - - {role: install-built-repo, - ib_repo_image_path: "$HOME/ironic-python-agent.initramfs", - initramfs_image: true, - libguestfs_mode: false, - when: compressed_gating_repo is defined and not to_build|bool} diff --git a/playbooks/ovb.yml b/playbooks/ovb.yml deleted file mode 100644 index 0617ffee6..000000000 --- a/playbooks/ovb.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- import_playbook: ovb-setup.yml -- import_playbook: baremetal-full-undercloud.yml -- import_playbook: baremetal-full-overcloud-prep.yml -- import_playbook: baremetal-full-overcloud.yml -- import_playbook: validations.yml -- import_playbook: baremetal-full-overcloud-validate.yml - when: job.enable_overcloud_validate|default(true)|bool diff --git a/playbooks/prepare-slave.yml b/playbooks/prepare-slave.yml deleted file mode 100644 index 087e90028..000000000 --- a/playbooks/prepare-slave.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -# Playbook included in OVB setups that use a testenv broker to create the -# OVB stack. - -- name: Local setup for quickstart - hosts: localhost - connection: local - tasks: - - name: Host setup - shell: > - set -eo pipefail; - echo "127.0.0.1 $(hostname) $(hostname).openstacklocal" | sudo tee -a /etc/hosts; - echo "127.0.0.2 undercloud undercloud.openstacklocal" | sudo tee -a /etc/hosts; - if [ ! -e ${HOME}/.ssh/id_rsa.pub ] ; then - if [[ -e ${HOME}/.ssh/id_rsa ]]; then - ssh-keygen -y -f ${HOME}/.ssh/id_rsa > ${HOME}/.ssh/id_rsa.pub; - else - ssh-keygen -N "" -f ${HOME}/.ssh/id_rsa; - fi - fi; - sudo mkdir -p /root/.ssh; - cat ~/.ssh/id_rsa.pub | sudo tee -a /root/.ssh/authorized_keys | tee -a ~/.ssh/authorized_keys; - sudo rm -rf /etc/puppet /etc/hiera.yaml; - sudo cp {{ tripleo_root }}/tripleo-ci/test-environments/overcloud-cacert.pem /etc/pki/ca-trust/source/anchors/; - sudo update-ca-trust extract; - cp -f {{ lookup('env', 'TE_DATAFILE') }} ~/instackenv.json; - changed_when: true - - - name: Correct the driver for newer releases - # TODO(dtantsur): remove when Pike is not supported - command: sed -i s/pxe_ipmitool/ipmi/ ~/instackenv.json - when: release not in ['newton', 'ocata', 'pike'] - - - name: Create eth2.conf file - blockinfile: - dest: "{{ working_dir }}/eth2.conf" - content: | - network_config: - - type: interface - name: eth2 - use_dhcp: false - mtu: 1450 - addresses: - - ip_netmask: 10.0.0.1/24 - - ip_netmask: 2001:db8:fd00:1000::1/64 - create: true - - - name: Install ipmitool if not installed - package: - name: ipmitool - state: latest # noqa 403 - become: true diff --git a/playbooks/provision_multinodes.yml b/playbooks/provision_multinodes.yml deleted file mode 100644 index 792ddae24..000000000 --- a/playbooks/provision_multinodes.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Multinode - hosts: localhost - gather_facts: false - roles: - - role: multinodes diff --git a/playbooks/quickstart-extras-overcloud-prep.yml b/playbooks/quickstart-extras-overcloud-prep.yml deleted file mode 100644 index 9727b5f6a..000000000 --- a/playbooks/quickstart-extras-overcloud-prep.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -# Prepare any additional configuration files required by the overcloud -- name: Prepare configuration files for the overcloud deployment - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-config - roles: - - overcloud-prep-config - -# Prepare the overcloud for a containerized deployment -- name: Prepare overcloud containers - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-containers - roles: - - overcloud-prep-containers - -# Prepare the overcloud images for deployment -- name: Prepare the overcloud images for deployment - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-images - roles: - - overcloud-prep-images - -# Prepare the overcloud flavor configuration -- name: Prepare overcloud flavors - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-flavors - roles: - - {role: overcloud-prep-flavors, - when: step_overcloud_prep_flavors|bool and undercloud_enable_nova|bool} - -# Prepare the undercloud networks for the overcloud deployment -- name: Prepare the undercloud networks for the overcloud deployment - hosts: undercloud - gather_facts: false - tags: - - overcloud-prep-network - roles: - - overcloud-prep-network - -- name: Prepare the SSL Configuration for the overcloud deployment - hosts: undercloud - gather_facts: false - tags: - - overcloud-scripts - - overcloud-ssl - roles: - - {role: overcloud-ssl} diff --git a/playbooks/quickstart-extras-overcloud.yml b/playbooks/quickstart-extras-overcloud.yml deleted file mode 100644 index 9ac2a6b1d..000000000 --- a/playbooks/quickstart-extras-overcloud.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# Deploy the overcloud -- name: Deploy the overcloud - hosts: undercloud - gather_facts: true - tags: - - overcloud-deploy - roles: - - overcloud-deploy - -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - tags: - - overcloud-deploy - - overcloud-inventory - vars: - inventory: all - roles: - - tripleo-inventory - -# Check the results of the deployment, note after inventory has executed -- name: Check the result of the deployment - hosts: undercloud - tags: - - overcloud-deploy - - overcloud-check - tasks: - - name: Check the overcloud_deployment_result.json if this is CI job - tags: - - overcloud-deploy - block: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost diff --git a/playbooks/quickstart-extras-standalone.yml b/playbooks/quickstart-extras-standalone.yml deleted file mode 100644 index 00b1c91d7..000000000 --- a/playbooks/quickstart-extras-standalone.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- include: quickstart.yml - -# setup for the undercloud -- name: Prepare the node for installation - hosts: undercloud - gather_facts: false - tags: - - standalone - roles: - - undercloud-setup - -- name: Add remove ens3 if not required - hosts: undercloud - gather_facts: true - tasks: - - include_role: - name: baremetal-prep-virthost - tasks_from: remove_ens3.yml - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version|int >= 8 - -- name: Gather facts - hosts: undercloud - become: false - tags: - - standalone - tasks: - - name: Ensure all facts are gathered - setup: - -# Deploy the standalone -- name: Deploy the standalone - hosts: undercloud - gather_facts: true - tags: - - standalone - roles: - - standalone - -- name: Validate the undercloud - hosts: undercloud - gather_facts: false - roles: - - {role: validate-services, when: validate_services|default(false)|bool} - tags: - - standalone - -- name: Validate the deployment - hosts: undercloud - # Note(chkumar246): Moved the os_tempest related var at the top - # of play level in order to have scope for the whole of the play - # https://bugs.launchpad.net/tripleo/+bug/1838496 - - vars: - tempest_install_method: distro - tempest_cloud_name: 'standalone' - tasks: - - include_tasks: tasks/tempest.yml - when: use_os_tempest | default(true) - environment: - # Disable ssl warnings - CURL_CA_BUNDLE: "" - tags: - - standalone diff --git a/playbooks/quickstart-extras-undercloud.yml b/playbooks/quickstart-extras-undercloud.yml deleted file mode 100644 index 988b7897e..000000000 --- a/playbooks/quickstart-extras-undercloud.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -# Deploy the FreeIPA server -- name: Deploy the FreeIPA server - hosts: supplemental - gather_facts: false - tags: - - freeipa-setup - roles: - - {role: freeipa-setup, when: deploy_supplemental_node|bool and enable_tls_everywhere|bool} - -# setup for the undercloud -- name: Setup the undercloud - hosts: undercloud - gather_facts: false - vars: - ansible_user: root - tags: - - undercloud-setup - roles: - - {role: undercloud-setup, when: undercloud_setup|bool} - -# Deploy the undercloud -- name: Deploy the undercloud - hosts: undercloud - gather_facts: false - tags: - - undercloud-deploy - roles: - - undercloud-deploy - -- name: Download amphora image for octavia - hosts: undercloud - gather_facts: false - tags: - - octavia - roles: - - {role: octavia-amphora-download, - when: download_amphora is defined and download_amphora|bool} diff --git a/playbooks/quickstart-extras-validate.yml b/playbooks/quickstart-extras-validate.yml deleted file mode 100644 index f43f6c4cd..000000000 --- a/playbooks/quickstart-extras-validate.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# Validate the deployment -- name: setup dstat performance monitoring - hosts: overcloud - tags: - - overcloud-validate - roles: - - {role: validate-perf, - when: validate_performance|bool and use_os_tempest | default(true) | bool} - ignore_errors: true - -# Execute tempest against the overcloud deployment -- name: Validate the deployment - hosts: undercloud - tasks: - - include_tasks: tasks/tempest.yml - vars: - tempest_install_method: distro - tempest_cloud_name: 'overcloud' - when: use_os_tempest | default(true) - environment: - # Disable ssl waarnings - CURL_CA_BUNDLE: "" - tags: - - overcloud-validate - -# Ensure services and containers are OK -- name: Execute simple service and container validations - hosts: - - undercloud - - overcloud - tags: - - overcloud-validate - - undercloud-validate - gather_facts: false - roles: - - {role: validate-services, when: validate_services|default(false)|bool} diff --git a/playbooks/quickstart-extras.yml b/playbooks/quickstart-extras.yml deleted file mode 100644 index 49c0e7c8e..000000000 --- a/playbooks/quickstart-extras.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# This is the playbook used by the `quickstart.sh` script. - -- import_playbook: quickstart.yml -- import_playbook: quickstart-extras-undercloud.yml -- import_playbook: quickstart-extras-overcloud-prep.yml -- import_playbook: quickstart-extras-overcloud.yml -- import_playbook: quickstart-extras-validate.yml diff --git a/playbooks/repo-setup.yml b/playbooks/repo-setup.yml deleted file mode 100644 index 5a3d9c95c..000000000 --- a/playbooks/repo-setup.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Setup repositories - hosts: undercloud - gather_facts: true - roles: - - repo-setup diff --git a/playbooks/scale_nodes.yml b/playbooks/scale_nodes.yml deleted file mode 100644 index 88113b4a5..000000000 --- a/playbooks/scale_nodes.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- - -################ -# Deploy Nodes # -################ - -# From tripleo-quickstart/playbooks -- import_playbook: quickstart-extras.yml - -############### -# Scale Nodes # -############### - -# Scale nodes w/o delete -- name: Scale overcloud nodes - hosts: undercloud - roles: - - {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} - -# 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 -# 'ansible-role-tripleo-inventory: regenerate ssh config' task to fail when attempting to acces non-existant host vars diff --git a/playbooks/scale_nodes_verify.yml b/playbooks/scale_nodes_verify.yml deleted file mode 100644 index 0c687e0cf..000000000 --- a/playbooks/scale_nodes_verify.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -# 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 -# 'ansible-role-tripleo-inventory: regenerate ssh config' task to fail when attempting to acces non-existant host vars - -# Re-inventory the overcloud -- name: Inventory the overcloud - hosts: undercloud - gather_facts: true - vars: - inventory: all - roles: - - tripleo-inventory diff --git a/playbooks/snapshot-libvirt.yml b/playbooks/snapshot-libvirt.yml deleted file mode 100644 index efcc103c9..000000000 --- a/playbooks/snapshot-libvirt.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Snapshot virts - hosts: virthost - gather_facts: true - vars: - - libvirt_uri: qemu:///system - - overcloud_nodes: - - name: subnode-0 - - name: subnode-1 - roles: - - snapshot-libvirt - become: true diff --git a/playbooks/tasks/tempest.yml b/playbooks/tasks/tempest.yml deleted file mode 100644 index 202ab487e..000000000 --- a/playbooks/tasks/tempest.yml +++ /dev/null @@ -1,237 +0,0 @@ ---- -# Load the skipp list -- name: Run tempest-skip tool to load tests to be skipped - block: - - name: Load tests to be skipped - vars: - list_skipped_release: "{{ release }}" - list_skipped_job: "{{ zuul.job | default(omit) }}" - list_skipped_deployment: "{{ (tempest_cloud_name in ['undercloud']) | ternary('undercloud', 'overcloud') }}" - list_skipped_installer: "{{ (osp_release is defined) | ternary('osp', 'tripleo') }}" - include_role: - name: list_skipped - - - name: Add skiplist tests to tempest_test_blacklist - skip them - set_fact: - tempest_test_blacklist: "{{ tempest_skip_register.skipped_tests }}" - when: not tempest_run_skipped | default(false) | bool - - - name: Add skiplist tests to tempest_test_whitelist - run them - set_fact: - tempest_test_whitelist: "{{ tempest_skip_register.skipped_tests }}" - tempest_test_blacklist: [] - when: tempest_run_skipped | default(false) | bool - - vars: - # when ansible.cfg have the option interpreter_python set to auto, ansible - # executes with the system python instead of virtualenv even though you are - # inside the virtualenv. Setting ansible_python_interpreter here ensures - # that this playbook will be executed the virtualenv python, which have the - # openstac-tempest-skiplist module - ansible_python_interpreter: "{{ local_working_dir }}/bin/python" - list_skipped_yaml_file: "{{ local_working_dir }}/usr/local/share/ansible/roles/validate-tempest/vars/tempest_skip.yml" - when: tempest_use_skiplist | default(true) - delegate_to: localhost - -- name: Run tempest-skip tool to load tests to be executed - block: - - name: Load tests to be executed - vars: - list_allowed_release: "{{ release }}" - list_allowed_job: "{{ zuul.job | default(omit) }}" - list_allowed_group: "{{ tempest_allowed_group | default(omit) }}" - include_role: - name: list_allowed - - - name: Add tests to tempest_test_includelist - set_fact: - tempest_test_includelist: "{{ tempest_allowed_register.allowed_tests }}" - tempest_test_whitelist: "{{ tempest_allowed_register.allowed_tests }}" - vars: - ansible_python_interpreter: "{{ local_working_dir }}/bin/python" - list_allowed_yaml_file: "{{ local_working_dir }}/usr/local/share/ansible/roles/validate-tempest/vars/tempest_allow.yml" - when: - - tempest_test_whitelist is not defined - - not tempest_run_skipped | default(false) | bool - delegate_to: localhost - -- name: set python_cmd - set_fact: - python_cmd: "python{{ ansible_python.version.major }}" - cacheable: true - when: python_cmd is not defined - -- name: Check if virtualenv is in the system - command: "{{ python_cmd }} -m virtualenv --version" - register: virtualenv_exist - failed_when: false - changed_when: false - -- when: virtualenv_exist.rc != 0 - name: Install virtualenv - become: true - package: - state: present - name: > - {% if ansible_python.version.major == 3 %} - python3-virtualenv - {% else %} - python-virtualenv - {% endif %} - - # FIXME(chandankumar): centos9 https://bugs.launchpad.net/tripleo/+bug/1953032/comments/5 - # TODO(marios): centos8 https://bugs.launchpad.net/tripleo/+bug/1976247 -- name: Disable stackviz for CentOS Stream 9 and 8 - set_fact: - tempest_run_stackviz: false - when: ansible_distribution_major_version is version('8', '>=') - -# This will execute os_tempest -- name: Execute os_tempest - when: use_os_tempest | default(true) - block: - - name: Fail the tempest playbook on undefined cloud name and install method - fail: - msg: | - The variable tempest_install_method and tempest_cloud_name is required and - has not been set. - when: - - tempest_install_method is not defined - - tempest_cloud_name is not defined - - # If tempest is running on undercloud, do not set this variable to true - - name: Initialize neutron service for network creation - set_fact: - tempest_service_available_neutron: true - when: tempest_cloud_name not in ['undercloud'] - - - name: Create /root/.config/openstack directory - file: - state: directory - path: "/root/.config/openstack" - mode: 0700 - become: true - - - name: Copy clouds.yaml file to /root directory - block: - - name: Copy clouds.yaml file from user's home to /root directory - copy: - src: '{{ ansible_user_dir }}/.config/openstack/clouds.yaml' - remote_src: true - dest: '/root/.config/openstack/clouds.yaml' - mode: 0600 - become: true - rescue: - - name: Copy clouds.yaml file /etc/openstack to /root directory - copy: - src: '/etc/openstack/clouds.yaml' - remote_src: true - dest: '/root/.config/openstack/clouds.yaml' - mode: 0600 - become: true - - - name: Set network vars - set_fact: - tempest_public_net_physical_type: 'datacentre' - tempest_public_subnet_cidr: '{{ tempest_cidr }}' - tempest_public_subnet_gateway_ip: '{{ tempest_cidr|nthhost(1) }}' - tempest_public_subnet_allocation_pools: '{{ tempest_cidr|nthhost(150) ~ "-" ~ tempest_cidr|nthhost(200) }}' - tempest_network_ping_gateway: "{{ tempest_ping_router|default(true)|bool }}" - tempest_private_net_provider_type: 'geneve' - tempest_private_net_create: true - tempest_router_create: true - when: tempest_cidr is defined - - - name: Handle migration of br-ex network - block: - - name: Check if standalone parameters exists - stat: - path: "{{ working_dir }}/standalone_parameters.yaml" - register: parameter_file - - - name: Read content of standalone parameters file if exists - slurp: - src: "{{ working_dir }}/standalone_parameters.yaml" - register: standalone_parameters - when: parameter_file.stat.exists - - - name: Parse contents - set_fact: - standalone_parameters_yaml: "{{ standalone_parameters['content'] | b64decode | from_yaml }}" - when: parameter_file.stat.exists - - - name: set tempest facts for br-ex network migration - set_fact: - tempest_public_subnet_cidr: '172.16.1.0/24' - tempest_public_subnet_gateway_ip: '172.16.1.2' - tempest_public_subnet_allocation_pools: '172.16.1.100-172.16.1.150' - when: - - parameter_file.stat.exists - - "'NeutronPhysicalBridge' not in (standalone_parameters_yaml | from_yaml)['parameter_defaults']" - when: - - job.environment_type is defined and job.environment_type == "standalone" - - job.bridge_address_prefix is defined and job.bridge_address_prefix == "172.16.1" - - - name: Set tempest workspace related vars - set_fact: - tempest_use_tempestconf: true - tempest_service_setup_host: '{{ inventory_hostname }}' - tempest_workspace: "{{ ansible_user_dir }}/tempest" - stackviz_venv_bin: "{{ ansible_user_dir }}/stackviz_venv/bin" - tempest_test_extra_test: ['keystone_tempest_plugin.tests.api'] - - - name: set facts while running tempest from source - set_fact: - tempest_git_repo: https://opendev.org/openstack/tempest - tempest_tempestconf_git_repo: https://opendev.org/openinfra/python-tempestconf - tempest_tempestconf_venv_bin: "{{ ansible_user_dir }}/tempestconf_venv/bin" - tempest_venv_bin: "{{ ansible_user_dir }}/tempest_venv/bin" - when: tempest_install_method == 'source' - - - name: Set extra facts for tempestconf - vars: - default_cirros_image: /opt/cache/files/cirros-0.5.2-x86_64-disk.img - set_fact: - tempest_tempestconf_profile_extras: - image: "{{ featureset_override['cirros_image'] | default(default_cirros_image) }}" - flavor_min_mem: 128 - retry_image: true - overrides: - identity.v3_endpoint_type: public - validation.ssh_key_type: 'ecdsa' - image.http_image: https://github.com/cirros-dev/cirros/releases/download/0.5.2/cirros-0.5.2-x86_64-disk.img - - # stackviz in venv pulls oslo.db due upstream constraints, - # but it dropped py2 support so on such system we need to skip it - # https://bugs.launchpad.net/tripleo/+bug/1862134 - - name: disable stackviz in python2 environment - set_fact: - tempest_run_stackviz: false - when: - - ansible_distribution_major_version is version('8', '<') - - - name: Run overcloud_network_discovery role - vars: - ansible_become: true - debug: true - execute_netstat: true - kill_netstat: false - include_role: - name: overcloud-network-discovery - - - name: Run os_tempest role - vars: - ansible_become: true - debug: true - tempest_run: 'yes' - include_role: - name: os_tempest - - - name: Run overcloud_network_discovery role to kill netstat service - vars: - ansible_become: true - debug: true - execute_netstat: false - kill_netstat: true - include_role: - name: overcloud-network-discovery diff --git a/playbooks/to-build-or-not-to-build.yml b/playbooks/to-build-or-not-to-build.yml deleted file mode 100644 index c497eb415..000000000 --- a/playbooks/to-build-or-not-to-build.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Decide whether we need to build images - hosts: undercloud - tasks: - - include_role: - name: check-to-build-or-not-to-build diff --git a/playbooks/tobiko.yml b/playbooks/tobiko.yml deleted file mode 100644 index e96c05921..000000000 --- a/playbooks/tobiko.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Prepare and run Tobiko - hosts: undercloud - vars: - debug: true - tobiko_config: true - tobiko_run: true - tempest_cloud_name: overcloud - tags: - - overcloud-validate - - standalone - roles: - - {role: validate-tobiko} diff --git a/playbooks/validations.yml b/playbooks/validations.yml deleted file mode 100644 index aac82a533..000000000 --- a/playbooks/validations.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Execute Validations Framework tests - hosts: undercloud - gather_facts: true - vars: - inventory: "{{ job.validations_inventory|default('tripleo-deploy/tripleo-ansible-inventory.yaml') }}" - vf_log_dir: "/var/log/validations" - tags: - - overcloud-deploy - - undercloud-deploy - - standalone - tasks: - - include_role: - name: validations - when: - - job.enable_validation|default(false)|bool diff --git a/releasenotes/notes/Update_heat_deprecation_references-649da9a605fb40de.yaml b/releasenotes/notes/Update_heat_deprecation_references-649da9a605fb40de.yaml deleted file mode 100644 index bdcf9b03f..000000000 --- a/releasenotes/notes/Update_heat_deprecation_references-649da9a605fb40de.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -fixes: - - | - The references to the Heat command are deprecated from Mitaka release and - we should now be using the OpenStack CLI instead. diff --git a/releasenotes/notes/add-default-cloud-settings-60e48de95aa4c2ac.yaml b/releasenotes/notes/add-default-cloud-settings-60e48de95aa4c2ac.yaml deleted file mode 100644 index 6ef4a948f..000000000 --- a/releasenotes/notes/add-default-cloud-settings-60e48de95aa4c2ac.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -features: - - | - Added public cloud settings. - All public cloud settings can be overridden to deploy on custom cloud - environments. - Added functionality to remove stacks and key pairs from the host cloud. diff --git a/releasenotes/notes/composable_upgrade-50c2b6edc9a1ae82.yaml b/releasenotes/notes/composable_upgrade-50c2b6edc9a1ae82.yaml deleted file mode 100644 index 37dde044c..000000000 --- a/releasenotes/notes/composable_upgrade-50c2b6edc9a1ae82.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -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 diff --git a/releasenotes/notes/custom-undercloud-roles-file-3603a5e98e2b12d5.yaml b/releasenotes/notes/custom-undercloud-roles-file-3603a5e98e2b12d5.yaml deleted file mode 100644 index 35fbcde6a..000000000 --- a/releasenotes/notes/custom-undercloud-roles-file-3603a5e98e2b12d5.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -fixes: - - | - Fix `undercloud_roles_data` to contain a relative path as tripleoclient - expects it. -other: - - | - ``undercloud deploy`` CLI now supports `undercloud_roles_data`. - It can also be defined in `undercloud.conf` as `roles_file` to be - used with ``undercloud install --use-heat`` as well. diff --git a/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml b/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml deleted file mode 100644 index ac04acf43..000000000 --- a/releasenotes/notes/custom-undercloud-roles-file-812cf0871a3d3370.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -features: - - | - Add `undercloud_roles_data` for containerized undercloud - deployments. Allows to specify a custom undercloud roles file which - should be taken into account when preparing docker images for UC. - Defaults to `{{ overcloud_templates_path }}/roles_data_undercloud.yaml`. - - .. note :: The default value can not be changed yet. The command - `openstack undercloud deploy` works only with the static role file - `roles_data_undercloud.yaml` from t-h-t. Custom undercloud roles - data files, like `roles/UndercloudLight.yaml`, need to be copied as - `{{ overcloud_heat_templates }}/roles_data_undercloud.yaml` in order - to use this feature. diff --git a/releasenotes/notes/deploy-undercloud-with-heat-d3f76546f2048fed.yaml b/releasenotes/notes/deploy-undercloud-with-heat-d3f76546f2048fed.yaml deleted file mode 100644 index 51daa637d..000000000 --- a/releasenotes/notes/deploy-undercloud-with-heat-d3f76546f2048fed.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -features: - - | - EXPERIMENTAL feature to install the undercloud with openstack heat - add support for a containerized undercloud. It allows to update the - specified packages, install custom t-h-t templates and fetch work - in progress dependency changes. This can be done deployment runtime, - by an undercloud deploy script defined from a given template. - The feature is invoked by using the config file in - 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". diff --git a/releasenotes/notes/image_build-b094e7078674d3f6.yaml b/releasenotes/notes/image_build-b094e7078674d3f6.yaml deleted file mode 100644 index 5396b7e89..000000000 --- a/releasenotes/notes/image_build-b094e7078674d3f6.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -issues: - - | - Because of very long image modifying by libguestfs, we now implement - a different way to do it by converting image to raw, mounting it - and modifying in the place (usual tripleo-ci way - to do it, as it was before transition to quickstart). - This implementation might be temporary until we figure what happens - with libguestfs. diff --git a/releasenotes/notes/mitaka-eol-523435fd9218f06b.yaml b/releasenotes/notes/mitaka-eol-523435fd9218f06b.yaml deleted file mode 100644 index 21145a183..000000000 --- a/releasenotes/notes/mitaka-eol-523435fd9218f06b.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -prelude: > - This will be the final release that supports Mitaka. Consumers of - tripleo-quickstart that need Mitaka support will need to maintain their own - branch starting from this commit. diff --git a/releasenotes/notes/multinic-network-isolation-update-130956fcb270d4cb.yaml b/releasenotes/notes/multinic-network-isolation-update-130956fcb270d4cb.yaml deleted file mode 100644 index 5bac7ece5..000000000 --- a/releasenotes/notes/multinic-network-isolation-update-130956fcb270d4cb.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -features: - - Added support for other network isolation physical topologies such as - 'multiple-nics', 'bond-with-vlans', and 'public-bond' -deprecations: - - The use of network isolation types 'multi-nic', 'bond_with_vlans', and - 'single_nic_vlans' are deprecated and will be removed in the 'R' release. - Please change these values to 'multiple-nics', 'bond-with-vlans', and - 'single-nic-vlans' accordingly. diff --git a/releasenotes/notes/nova_cellv2_multicell-9d745283581c8626.yaml b/releasenotes/notes/nova_cellv2_multicell-9d745283581c8626.yaml deleted file mode 100644 index 28dffc086..000000000 --- a/releasenotes/notes/nova_cellv2_multicell-9d745283581c8626.yaml +++ /dev/null @@ -1,16 +0,0 @@ ---- -features: - - | - This introduce needed changes to be able to deploy an additional - cell via oooq. If additional_cell is set to true after the - overcloud got deployed the additional cell gets deployed. Todo - this information gets extracted from the overcloud stack, which - is requried as input to the second heat stack, where the additional - cell is managed with. As a reference [1] is the scenario which - is installed adding a single additional cell. - - config/general_config/featureset063.yml is used for the configuration - and config/nodes/1ctlr_1cellctrl_1comp.yml has a nova config - example. - - [1] https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/features/deploy_cellv2_basic.html diff --git a/releasenotes/notes/remove-undercloud-deploy-d91353832f0a7965.yaml b/releasenotes/notes/remove-undercloud-deploy-d91353832f0a7965.yaml deleted file mode 100644 index bb600b9c8..000000000 --- a/releasenotes/notes/remove-undercloud-deploy-d91353832f0a7965.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -other: - - | - The `openstack undercloud deploy` command has been removed. The support for - this method of deployment in the `undercloud-deploy` role has been removed. diff --git a/releasenotes/notes/restore-tags-extras-playbook-3fdc668612708931.yaml b/releasenotes/notes/restore-tags-extras-playbook-3fdc668612708931.yaml deleted file mode 100644 index 4f0ea9235..000000000 --- a/releasenotes/notes/restore-tags-extras-playbook-3fdc668612708931.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -features: - - | - Tags were added in all the playbooks so that it is possible to control - atomically the flow of the entire process. - For details about how to use tags check the chapter *Using tags to - atomically execute specific phases of the deployment* in - [TripleO Quickstart - Getting Started Guide](https://docs.openstack.org/tripleo-quickstart/latest/getting-started.html) diff --git a/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml b/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml deleted file mode 100644 index a53231bd5..000000000 --- a/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -features: - - Added the possibility to give root device hints - for nodes, covering the same type of hints as - Ironic allows. -deprecations: - - Currently only support for disk size hint was possible - on OOOQ. This was using the ``disk_root_device_size`` - setting, as well as the disk property on instackenv.json - This feature is not being removed, but the usage of new - root device hintes feature is prefered. If some device - hints are given using this new env setting, the old - way will be ignored. - In the future, ``disk_root_device_size`` hint will need - to be deprecated. -fixes: - - Currently OOOQ deploys on baremetal, on servers with multiple - disks, is not behaving correctly. There was the possibility - of giving root device hints, but only based on size. On systems - where the disk size was the same, it was impossible to target - the right disk. diff --git a/releasenotes/notes/switch_to_tripleomaster_registry-fd195a8ec8ca511b.yaml b/releasenotes/notes/switch_to_tripleomaster_registry-fd195a8ec8ca511b.yaml deleted file mode 100644 index 3eb35d50a..000000000 --- a/releasenotes/notes/switch_to_tripleomaster_registry-fd195a8ec8ca511b.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -feature: - - | - Switch to tripleomaster registry be default for container images, where - push happens automaticallyon RDO promotion. -deprecations: - - | - The tripleoupstream container registry is not used anymore and may be - retired in the future. diff --git a/releasenotes/notes/undercloud-containers-registry-opts-fe4530037ac3762a.yaml b/releasenotes/notes/undercloud-containers-registry-opts-fe4530037ac3762a.yaml deleted file mode 100644 index d6dfd00f9..000000000 --- a/releasenotes/notes/undercloud-containers-registry-opts-fe4530037ac3762a.yaml +++ /dev/null @@ -1,15 +0,0 @@ ---- -fixes: - - | - Containerized underclouds are allowed to have a custom - `undercloud_docker_registry_tag`. `undercloud_docker_registry_port` - may be omitted, if `undercloud_docker_registry_host` does not - expect a custom port, like 'docker.io'. - - The docker registry host, port and tag for containerized undercloud - services default to the values provided for overcloud deployments. - You may want to alter it, if building images locally with Kolla, or - fetching from remote registries not fitting overcloud deployment cases. - As overcloud deployments may consume images form the undercloud local - registry, it is possible to have `undercloud_docker_*` and - `docker_*` params diverged for containerized underclouds vs overclouds. diff --git a/releasenotes/notes/undercloud-deploy-pike-f14645c4a5442ef8.yaml b/releasenotes/notes/undercloud-deploy-pike-f14645c4a5442ef8.yaml deleted file mode 100644 index 31d06440a..000000000 --- a/releasenotes/notes/undercloud-deploy-pike-f14645c4a5442ef8.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -deprecations: - - | - The experimental containerized undercloud deployments driven via - `undercloud deploy` CLI is not supported anymore for Pike. diff --git a/releasenotes/notes/undercloud_heat_templates_path-a28dd58b923aafae.yaml b/releasenotes/notes/undercloud_heat_templates_path-a28dd58b923aafae.yaml deleted file mode 100644 index f12a6445e..000000000 --- a/releasenotes/notes/undercloud_heat_templates_path-a28dd58b923aafae.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - | - Underclouds and overclouds may be installed with Heat templates fetched - into a custom location defined with ``overcloud_templates_path``. diff --git a/releasenotes/notes/update_deprecated_openstack_command-7821ae15b0f05c76.yaml b/releasenotes/notes/update_deprecated_openstack_command-7821ae15b0f05c76.yaml deleted file mode 100644 index 178eb2dac..000000000 --- a/releasenotes/notes/update_deprecated_openstack_command-7821ae15b0f05c76.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -other: - - | - The nodes registration and configure are done through `openstack overcloud - node import instackenv.json` command from newton release and above. diff --git a/releasenotes/notes/validate_services-ea3d14b982f4f9e8.yaml b/releasenotes/notes/validate_services-ea3d14b982f4f9e8.yaml deleted file mode 100644 index 7e28555d4..000000000 --- a/releasenotes/notes/validate_services-ea3d14b982f4f9e8.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -features: - - New "validate_services" boolean flag in order to check the service state - - New "validate-services" role in charge of container and service state - validation diff --git a/releasenotes/source/_static/.gitkeep b/releasenotes/source/_static/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/releasenotes/source/conf.py b/releasenotes/source/conf.py deleted file mode 100644 index 79a1ca5d9..000000000 --- a/releasenotes/source/conf.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: utf-8 -*- -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# flake8: noqa - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - 'openstackdocstheme', - 'reno.sphinxext', -] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'tripleo-quickstart Release Notes' -copyright = u'2017, TripleO Developers' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = '' -# The short X.Y version. -version = '' - -# The full version, including alpha/beta/rc tags. - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = [] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'openstackdocs' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'tripleo-quickstartReleaseNotesdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'tripleo-quickstartReleaseNotes.tex', u'tripleo-quickstart Release Notes Documentation', - u'2017, TripleO Developers', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'tripleo-quickstartreleasenotes', u'tripleo-quickstart Release Notes Documentation', - [u'2017, TripleO Developers'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'tripleo-quickstartReleaseNotes', u'tripleo-quickstart Release Notes Documentation', - u'2017, TripleO Developers', 'tripleo-quickstartReleaseNotes', 'Ansible based project for setting up TripleO virtual environments', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - -# -- Options for Internationalization output ------------------------------ -locale_dirs = ['locale/'] - -# openstackdocstheme options -repository_name = 'openstack/tripleo-quickstart-extras' -bug_project = 'tripleo' -bug_tag = 'documentation' diff --git a/releasenotes/source/index.rst b/releasenotes/source/index.rst deleted file mode 100644 index 8dec4337a..000000000 --- a/releasenotes/source/index.rst +++ /dev/null @@ -1,18 +0,0 @@ -============================================ -Welcome to tripleo-quickstart Release Notes! -============================================ - -Contents -======== - -.. toctree:: - :maxdepth: 2 - - unreleased - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`search` diff --git a/releasenotes/source/unreleased.rst b/releasenotes/source/unreleased.rst deleted file mode 100644 index 2334dd5cf..000000000 --- a/releasenotes/source/unreleased.rst +++ /dev/null @@ -1,5 +0,0 @@ -============================== - Current Series Release Notes -============================== - - .. release-notes:: diff --git a/roles/baremetal-prep-overcloud/README.md b/roles/baremetal-prep-overcloud/README.md deleted file mode 100644 index 9a5261063..000000000 --- a/roles/baremetal-prep-overcloud/README.md +++ /dev/null @@ -1,49 +0,0 @@ -Role Name -========= - -An Ansible role to setup the undercloud for a deployment on baremetal overcloud nodes. - -Requirements ------------- - -This playbook expects that the undercloud has been installed and setup using one of the roles relevant to baremetal overcloud deployments. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html). - -- step_root_device_size: -- boolean value that will apply disk size hints and rerun introspection if true -- working_dir: <'/home/stack'> -- working directory for the role. Assumes stackrc file is present at this location -- step_adjust_mtu: -- boolean value that will change MTUS on specified nics -- mtu: <1350> -- numerical value to set MTUs -- mtu_interface: <'eth1'> -- list of NICs -- undercloud_type: -- can be overwritten with values like 'baremetal' or 'ovb' -- network_isolation: -- bolean value to test if network isolation wil be used in the deployment -- network_isolation_ipv4_cidr: <"172.16.23.0/24"> - -Dependencies ------------- - -This playbook does not deploy the overcloud. After this playbook runs, call https://github.com/redhat-openstack/ansible-role-tripleo-overcloud. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Prepare for deployment on baremetal overcloud - hosts: virthost - gather_facts: false - roles: - - ansible-role-tripleo-overcloud-prep-baremetal - -License -------- - -Apache - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/baremetal-prep-overcloud/defaults/main.yml b/roles/baremetal-prep-overcloud/defaults/main.yml deleted file mode 100644 index 2d8edc7ff..000000000 --- a/roles/baremetal-prep-overcloud/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -step_install_upstream_ipxe: false - -step_adjust_mtu: false -mtu: 1350 -mtu_interface: - - eth1 - -undercloud_type: virtual -network_isolation: true -network_isolation_ipv4_cidr: "172.16.23.0/24" diff --git a/roles/baremetal-prep-overcloud/meta/main.yml b/roles/baremetal-prep-overcloud/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/baremetal-prep-overcloud/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/baremetal-prep-overcloud/tasks/install-upstream-ipxe.yml b/roles/baremetal-prep-overcloud/tasks/install-upstream-ipxe.yml deleted file mode 100644 index b65eb91e3..000000000 --- a/roles/baremetal-prep-overcloud/tasks/install-upstream-ipxe.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- name: Copy install upstream ipxe script template - template: - src: install-upstream-ipxe.sh.j2 - dest: "{{ working_dir }}/install-upstream-ipxe.sh" - mode: 0755 - -- name: Run install upstream ipxe script - shell: > - "{{ working_dir }}"/install-upstream-ipxe.sh - when: step_install_upstream_ipxe|bool diff --git a/roles/baremetal-prep-overcloud/tasks/main.yml b/roles/baremetal-prep-overcloud/tasks/main.yml deleted file mode 100644 index 6e82cfb87..000000000 --- a/roles/baremetal-prep-overcloud/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: install-upstream-ipxe.yml diff --git a/roles/baremetal-prep-overcloud/templates/install-upstream-ipxe.sh.j2 b/roles/baremetal-prep-overcloud/templates/install-upstream-ipxe.sh.j2 deleted file mode 100644 index 5dd786f40..000000000 --- a/roles/baremetal-prep-overcloud/templates/install-upstream-ipxe.sh.j2 +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -# Script to install the ipxe upstream version - -set -eux - -### --start_docs - -## Use -## =================== - -##.. note:: it may be necessary to install the upstream version of ipxe, to avoid this kind of problems: -## - -## * Install package dependencies -## :: -sudo yum -y install xz-devel gcc - -## * Clone upstream repo -## :: -rm -rf /tmp/ipxe -git clone git://git.ipxe.org/ipxe.git /tmp/ipxe - -## * Compile and replace undionly.kpxe -## :: -pushd /tmp/ipxe/src -make -sudo cp /tmp/ipxe/src/bin/undionly.kpxe /tftpboot/undionly.kpxe -popd - -### --stop_docs diff --git a/roles/baremetal-prep-overcloud/tests/inventory b/roles/baremetal-prep-overcloud/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/baremetal-prep-overcloud/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/baremetal-prep-overcloud/tests/test.yml b/roles/baremetal-prep-overcloud/tests/test.yml deleted file mode 100644 index 009a5c7bb..000000000 --- a/roles/baremetal-prep-overcloud/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-baremetal-overcloud diff --git a/roles/baremetal-prep-virthost/README.md b/roles/baremetal-prep-virthost/README.md deleted file mode 100644 index b9bc2f7b8..000000000 --- a/roles/baremetal-prep-virthost/README.md +++ /dev/null @@ -1,47 +0,0 @@ -Role Name -========= - -An Ansible role to set up a machine to host a virtual undercloud for a TripleO deployment on baremetal nodes. - -Requirements ------------- - -This role assumes that the host machine already has a nic on the provisioning network. The role assigns the nic an IP address. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html) - -- virthost_provisioning_interface: -- NIC for the provisioning interface on the undercloud host -- virthost_provisioning_ip: <192.168.122.1> -- IP address for the provisioning interface on the undercloud host -- virthost_provisioning_netmask: <255.255.255.192> -- Netmask for the provisioning interface on the undercloud host -- virthost_provisioning_hwaddr: <52:54:00:00:76:00> -- MAC address the provisioning interface on the undercloud host -- working_dir: <'/home/stack'> -- working directory for the role. - - -Dependencies ------------- - -The playbook included in this role calls https://github.com/redhat-openstack/ansible-role-tripleo-validate-ipmi and https://github.com/redhat-openstack/ansible-role-tripleo-baremetal-overcloud. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Prepare the host for PXE forwarding - hosts: virthost - gather_facts: false - roles: - - ansible-role-tripleo-baremetal-prep-virthost - -License -------- - -Apache-2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/baremetal-prep-virthost/defaults/main.yml b/roles/baremetal-prep-virthost/defaults/main.yml deleted file mode 100644 index b18ac945b..000000000 --- a/roles/baremetal-prep-virthost/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -virthost_provisioning_interface: eth1 -virthost_provisioning_ip: 192.168.122.1 -virthost_provisioning_netmask: 255.255.255.192 -virthost_provisioning_hwaddr: 52:54:00:00:76:00 diff --git a/roles/baremetal-prep-virthost/meta/main.yml b/roles/baremetal-prep-virthost/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/baremetal-prep-virthost/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/baremetal-prep-virthost/tasks/add_services_ports_firewalld.yml b/roles/baremetal-prep-virthost/tasks/add_services_ports_firewalld.yml deleted file mode 100644 index 78802b5a2..000000000 --- a/roles/baremetal-prep-virthost/tasks/add_services_ports_firewalld.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: ensure public firewalld services are added - become: true - firewalld: - zone: public - service: "{{ item }}" - permanent: true - state: enabled - with_items: - - tftp - - dhcp - - dhcpv6 - - dns diff --git a/roles/baremetal-prep-virthost/tasks/main.yml b/roles/baremetal-prep-virthost/tasks/main.yml deleted file mode 100644 index 65c502207..000000000 --- a/roles/baremetal-prep-virthost/tasks/main.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Copy over provisioning nic script template for rhel7 or centos7 - template: - src: add-provisioning-interface.sh.j2 - dest: "{{ working_dir }}/add-provisioning-interface.sh" - mode: 0755 - when: - - ansible_distribution in ['RedHat', 'CentOS'] - - ansible_distribution_major_version|int <= 7 - -- name: Copy over provisioning nic script template for rhel8 or centos8 - template: - src: add-provisioning-interface-os-major-version-8.sh.j2 - dest: "{{ working_dir }}/add-provisioning-interface.sh" - mode: 0755 - when: - - ansible_distribution in ['RedHat', 'CentOS'] - - ansible_distribution_major_version|int >= 8 - -- name: wait for script file to exist - wait_for: path="{{ working_dir }}/add-provisioning-interface.sh" - -- name: Add provisioning interface to the "brovc" bridge - become: true - shell: > - "{{ working_dir }}"/add-provisioning-interface.sh - changed_when: true diff --git a/roles/baremetal-prep-virthost/tasks/remove_ens3.yml b/roles/baremetal-prep-virthost/tasks/remove_ens3.yml deleted file mode 100644 index aed09ff84..000000000 --- a/roles/baremetal-prep-virthost/tasks/remove_ens3.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Discover if ens3 interface exists - setup: - gather_subset: "!all,!min,network" - register: net - -- name: Check if ifcfg-ens3 exists - become: true - stat: - path: /etc/sysconfig/network-scripts/ifcfg-ens3 - register: ens3_interface - -- name: Remove the interface file - become: true - file: - path: /etc/sysconfig/network-scripts/ifcfg-ens3 - state: absent - when: - - ens3_interface.stat.exists - - "'ens3' not in net.ansible_facts.ansible_interfaces" diff --git a/roles/baremetal-prep-virthost/tasks/set_locale_UTF_8.yml b/roles/baremetal-prep-virthost/tasks/set_locale_UTF_8.yml deleted file mode 100644 index 0386ccaa9..000000000 --- a/roles/baremetal-prep-virthost/tasks/set_locale_UTF_8.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Get current locale and language configuration - shell: localectl status | grep 'LANG' - register: locale_status - changed_when: false - -- name: run localectl to set LANG=en_US.UTF-8 - become: true - command: "localectl set-locale LANG=en_US.UTF-8" - when: '"LANG=en_US.UTF-8" not in locale_status.stdout' diff --git a/roles/baremetal-prep-virthost/templates/add-provisioning-interface-os-major-version-8.sh.j2 b/roles/baremetal-prep-virthost/templates/add-provisioning-interface-os-major-version-8.sh.j2 deleted file mode 100644 index bad10dc42..000000000 --- a/roles/baremetal-prep-virthost/templates/add-provisioning-interface-os-major-version-8.sh.j2 +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs - -## * Remove the stale nmcli bridge port connection from the previous deployment -## :: - -if sudo nmcli con show | grep -i brovc-port1; then - sudo nmcli con delete brovc-port1 -fi - -## * Add the NIC on the provisioning interface to the "brovc" bridge -## :: - -sudo nmcli connection add type ethernet slave-type bridge con-name \ - brovc-port1 ifname {{ virthost_provisioning_interface }} \ - master brovc - -### --stop_docs diff --git a/roles/baremetal-prep-virthost/templates/add-provisioning-interface.sh.j2 b/roles/baremetal-prep-virthost/templates/add-provisioning-interface.sh.j2 deleted file mode 100644 index f4309df8a..000000000 --- a/roles/baremetal-prep-virthost/templates/add-provisioning-interface.sh.j2 +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs - -## Deploying a baremetal overcloud from a virtual machine undercloud -## ================================================================= - -## * The following set up steps are run *on the virthost machine* to allow the undercloud VM -## * to PXE boot the overcloud nodes: - -## Set up the virthost machine for PXE forwarding -## ---------------------------------------------- - -## * Add a static IPADDR to the NIC on provisioning network -## :: - -sudo cat > /etc/sysconfig/network-scripts/ifcfg-{{ virthost_provisioning_interface }} << EOF -NAME={{ virthost_provisioning_interface }} -IPADDR={{ virthost_provisioning_ip }} -NETMASK={{ virthost_provisioning_netmask }} -NM_CONTROLLED=no -DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes -IPV6_FAILURE_FATAL=no -ONBOOT=yes -HWADDR={{ virthost_provisioning_hwaddr }} -PEERDNS=yes -PEERROUTES=yes -IPV6_PEERDNS=yes -IPV6_PEERROUTES=yes -EOF - -## * Bring the NIC down first -## :: - -sudo ifdown {{ virthost_provisioning_interface }} - -## * Bring the NIC up again -## :: - -sudo ifup {{ virthost_provisioning_interface }} - -## * Add the NIC on the provisioning interface to the "brovc" bridge -## :: - -if ! sudo brctl show brovc | grep {{ virthost_provisioning_interface }}; then - sudo brctl addif brovc {{ virthost_provisioning_interface }} -fi - -### --stop_docs diff --git a/roles/baremetal-prep-virthost/templates/ifcfg-virthost-provision.j2 b/roles/baremetal-prep-virthost/templates/ifcfg-virthost-provision.j2 deleted file mode 100644 index 2d889250d..000000000 --- a/roles/baremetal-prep-virthost/templates/ifcfg-virthost-provision.j2 +++ /dev/null @@ -1,16 +0,0 @@ -NAME={{ virthost_provisioning_interface }} -IPADDR={{ virthost_provisioning_ip }} -NETMASK={{ virthost_provisioning_netmask }} -NM_CONTROLLED=no -DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes -IPV6_FAILURE_FATAL=no -ONBOOT=yes -HWADDR={{ virthost_provisioning_hwaddr }} -PEERDNS=yes -PEERROUTES=yes -IPV6_PEERDNS=yes -IPV6_PEERROUTES=yes diff --git a/roles/baremetal-prep-virthost/tests/inventory b/roles/baremetal-prep-virthost/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/baremetal-prep-virthost/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/baremetal-prep-virthost/tests/test.yml b/roles/baremetal-prep-virthost/tests/test.yml deleted file mode 100644 index 3fbe855a8..000000000 --- a/roles/baremetal-prep-virthost/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-baremetal-prep-virthost diff --git a/roles/baremetal-undercloud/README.md b/roles/baremetal-undercloud/README.md deleted file mode 100644 index 8775c13ef..000000000 --- a/roles/baremetal-undercloud/README.md +++ /dev/null @@ -1,360 +0,0 @@ -baremetal-undercloud -==================== - -This role aims to build a baremetal undercloud machine from scratch. Using -tripleo-quickstart, this means that you will be able to provide, prepare and -install the undercloud on a physical machine. - -From the tripleo-quickstart perspective virthost and undercloud will be the -same host. - -Requirements ------------- - -To make all the things working you need to have an environment with all the -things in place: - -**Hardware requirements** - -* A physical machine for the undercloud that can be accessed as root from the - jump host -* At least two other physical machines that will become controller and compute, - for HA three controllers and one compute are needed -* A working network link between overcloud and undercloud, typically the second - net device of the undercloud will talk to the first net device of all the - overcloud machines - -**Software requirements** - -* The tripleo-quickstart quickstart.sh script: - * A config file (i.e. ha.yml) containing all the customizations for the - baremetal environment -* This set of files, dependent from the hardware: - * File undercloud-provisioning.sh - optional, name is not important - * File network-environment.yaml - mandatory - * Directory nic-configs - mandatory if declared inside the - resource_registry section in network-environment.yaml and must contain - all the needed files - * File instackenv.json - mandatory, must contain the ipmi credentials for - the nodes - -Role Variables --------------- - -A typical configuration file will contain something like this: - -```yaml -# Virthost key for accessing newly provided machine -virthost_key: ~/.ssh/customkey - -# Type of undercloud (we're deploying on baremetal otherwise this should be -# virtual) -undercloud_type: baremetal - -# Specify the secondary net interface for overcloud provisioning -undercloud_local_interface: eth1 - -# Specify the external network for undercloud that will be used to route -# overcloud traffic -undercloud_external_network_cidr: 172.20.0.0/24 - -# Declare the additional interface on undercloud to route overcloud traffic -undercloud_networks: - external: - address: 172.20.0.254 - netmask: 255.255.255.0 - device_type: ovs - type: OVSIntPort - ovs_bridge: br-ctlplane - ovs_options: '"tag=1105"' - tag: 1105 - -# Define all the flavors -flavor_map: - control: baremetal - cellcontrol: baremetal - compute: baremetal - storage: baremetal - ceph: baremetal - swift: baremetal - -# Will be used by baremetal-undercloud role -step_provide_undercloud: true -# Will be used by baremetal-prep-overcloud role -step_install_upstream_ipxe: true -# Will be used by overcloud-prep-images role -step_introspect: true - -# Explicitly declare kvm since we are on BM and disable vBMC -libvirt_type: kvm -libvirt_args: "--libvirt-type kvm" -enable_vbmc: false - -# Environment specific variables -baremetal_provisioning_script: "/path/to/undercloud-provisioning.sh" -baremetal_network_environment: "/path/to/network-environment.yaml" -baremetal_instackenv: "/path/to/instackenv.json" -baremetal_nic_configs: "/path/to/nic_configs" - -# Public (Floating) network definition -public_physical_network: "floating" -floating_ip_cidr: "" -public_net_pool_start: "" -public_net_pool_end: "" -public_net_gateway: "" - -extra_args: "--ntp-server --control-scale 3 --compute-scale 2 --ceph-storage-scale 0 --block-storage-scale 0 --swift-storage-scale 0 --templates -e /usr/share/openstack-tripleo-heat-templates/environments/puppet-pacemaker.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e /home/stack/network-environment.yaml" -``` - -A brief explanation of the variables: - -* The variable **undercloud_type** is checked in some of the dependent roles - (see @Dependencies). -* The variable **virthost_key** is optional, if defined it must be a path to a - private ssh key file needed to access to virthost. If you access to the - virthost with the default ssh key of the user launching quickstart.sh then - you don't need to set it. -* The **undercloud_local_interface** needs to be changed accordingly to the - baremetal hardware. -* The **undercloud_external_network_cidr** will be the overcloud external - network that undercloud will route. -* A specific **flavor_map** (in this case baremetal) needs to be applied to - each node kind. -* With **step_provide_undercloud** you can choose if you want to provide the - virthost. -* With **step_introspect** you can choose if you want to introspect nodes. -* With **step_install_upstream_ipxe** you can choose if you want to install - upstream ipxe (useful with some hardware issues). -* The **libvirt_type** and **libvirt_args** must be set to kvm, since we will - work on baremetal with native virtual capabilities. -* **baremetal_provisioning_script** is the script to provide the machine, if - **step_provide_undercloud is false** than this can be omitted. -* **baremetal_network_environment**, **baremetal_instackenv** and *optionally* - **baremetal_nic_configs** will contain all the environment files. -* Depending on the network in which spawned instances will be exposed all the - related parameters (**floating_ip_cidr** and **public_net**\*) must be - declared explicitly. -* **extra_args** will contain all deploy specific (like HA settings) - -The main task of the role is this one: - -```yaml ---- -# tasks file for baremetal-undercloud - -# Do machine provisioning -- include: machine-provisioning.yml - tags: - - machine-provision - -# Prepare machine to be used with TripleO -- include: machine-setup.yml - tags: - - machine-setup - -# Configure repos and packages -- include: undercloud-repos-conf.yml - delegate_to: "{{ virthost }}" - tags: - - undercloud-repos-conf - -# Get overcloud images -- include: overcloud-images.yml - delegate_to: "{{ virthost }}" - tags: - - overcloud-images -``` - -This is basically what each specific tasks does: - -* **machine-provisioning.yml** provides the machine and make it become both - virthost/undercloud -* **machine-setup.yml** prepares the undercloud with ssh connections, users, - sudoers and inventory addition -* **undercloud-repos-conf.yml** repositories and packages configurations -* **overcloud-images.yml** overcloud images retrieving - -Some notes: - -* Even if virthost and undercloud are the same machine, the name "undercloud" - will be inventoried in any case -* Each action is tagged so it is possible to exclude a specific section -* Some variables can be controlled via configuration settings (look above in - @Role usage) - -Dependencies ------------- - -If you don't need to change anything in how the environments gets deployed, -then all the dependencies should be satisfied by the default -**quickstart-extras-requirements.txt** file. - -In any case the roles you will need to deploy an entire environment from -scratch (see @Example Playbook) are: - -* **baremetal-undercloud** (this role) -* **tripleo-inventory** (part of *tripleo-quickstart*) -* **tripleo/undercloud** (part of *tripleo-quickstart*) -* **baremetal-prep-overcloud** -* **overcloud-prep-{config,images,flavors,network}** -* **overcloud-deploy** -* **overcloud-validate** or **overcloud-validate-ha** (if you want to test HA - capabilities) - -Example Playbook ----------------- - -Here's is an example playbook that uses this role in combination to all the -others coming from various related to tripleo-quickstart: - -```yaml ---- -# Provision and initial undercloud setup -- name: Baremetal undercloud install - hosts: localhost - roles: - - baremetal-undercloud - tags: - - undercloud-bm-install - -# Machine at this point is provided -- name: Add the undercloud node to the generated inventory - hosts: localhost - gather_facts: true - roles: - - tripleo-inventory - tags: - - undercloud-inventory - -# Deploy the undercloud -- name: Install undercloud - hosts: undercloud - gather_facts: false - roles: - - tripleo/undercloud - tags: - - undercloud-install - -# Baremetal preparation (with workarounds) -- name: Prepare baremetal for the overcloud deployment - hosts: undercloud - roles: - - baremetal-prep-overcloud - tags: - - baremetal-prep-overcloud - -# Prepare any additional configuration files required by the overcloud -- name: Prepare configuration files for the overcloud deployment - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-config - tags: - - overcloud-prep-config - -# Prepare the overcloud images for deployment -- name: Prepare the overcloud images for deployment - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-images - tags: - - overcloud-prep-images - -# Prepare the overcloud flavor configuration -- name: Prepare overcloud flavors - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-flavors - tags: - - overcloud-prep-flavors - -# Prepare the undercloud networks for the overcloud deployment -- name: Prepare the undercloud networks for the overcloud deployment - hosts: undercloud - gather_facts: false - roles: - - overcloud-prep-network - tags: - - overcloud-prep-network - -# Deploy the overcloud -- name: Deploy the overcloud - hosts: undercloud - gather_facts: true - roles: - - overcloud-deploy - tags: - - overcloud-deploy - -- name: Add the overcloud nodes to the generated inventory - hosts: undercloud - gather_facts: true - vars: - inventory: all - roles: - - tripleo-inventory - tags: - - overcloud-inventory - -# Check the results of the deployment, note after inventory has executed -- name: Check the result of the deployment - hosts: undercloud - tasks: - - name: ensure the deployment result has been read into memory - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - - # overcloud_deploy_result = ["failed", "passed"] - - name: did the deployment pass or fail? - debug: var=overcloud_deploy_result - failed_when: overcloud_deploy_result == "failed" - delegate_to: localhost - tags: - - overcloud-deploy-check -``` - -The steps of the sample playbook are these: - -* First invoked role is baremetal-undercloud -* Then undercloud is inventoried -* Undercloud is prepared for deploying -* Overcloud is then deployed, inventoried and validated - -Quickstart invocation ---------------------- - -You can invoke *quickstart.sh* like this: - -```console -./quickstart.sh \ - --clean \ - --playbook baremetal-undercloud.yml \ - --working-dir /path/to/workdir \ - --config /path/to/config.yml \ - --release \ - --tags all \ - -``` - -Basically this command: - -* Uses the playbook **baremetal-undercloud.yml** -* Uses a custom workdir that is rebuilt from scratch (so if it already exists, - it is dropped, see *--clean*) -* Get all the extra requirements -* Select the config file -* Chooses release (liberty, mitaka, newton, or "master" for ocata) -* Performs all the tasks in the playbook -* Starts the installation on virthost - -License -------- - -Apache - -Author Information ------------------- - -Raoul Scarazzini diff --git a/roles/baremetal-undercloud/defaults/main.yml b/roles/baremetal-undercloud/defaults/main.yml deleted file mode 100644 index 173f5a2a0..000000000 --- a/roles/baremetal-undercloud/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud" - -baremetal_provisioning_log: "{{ local_working_dir }}/baremetal_provision.log" - -undercloud_local_interface: eth1 -undercloud_network_cidr: 192.168.24.0/24 - -step_provide_undercloud: true -step_prepare_undercloud: true diff --git a/roles/baremetal-undercloud/meta/main.yml b/roles/baremetal-undercloud/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/baremetal-undercloud/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/baremetal-undercloud/packages/defaults/main.yml b/roles/baremetal-undercloud/packages/defaults/main.yml deleted file mode 100644 index cf4a84f78..000000000 --- a/roles/baremetal-undercloud/packages/defaults/main.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Additional packages -undercloud_additional_pkgs: - - vim - - tmux - - openssl - - curl - - bind-utils - - net-tools - - git - - lftp - - libguestfs-tools - - sos - -# Configure ntp on undercloud -step_undercloud_ntp: true - -# Custom ntp servers -undercloud_custom_ntps: - - pool.ntp.org diff --git a/roles/baremetal-undercloud/packages/tasks/main.yml b/roles/baremetal-undercloud/packages/tasks/main.yml deleted file mode 100644 index b252ea533..000000000 --- a/roles/baremetal-undercloud/packages/tasks/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# tasks file for baremetal-undercloud's packages subrole - -# Install the Tripleo package (usually python-tripleoclient) -- name: Install TripleO package - become: true - package: - name: "{{ item }}" - state: present - with_items: "{{ undercloud_rpm_dependencies.split() }}" - tags: - - undercloud-tripleo-pkg - -# Install additional packages (if declared) -- name: Install additional packages - become: true - package: - name: "{{ undercloud_additional_pkgs|default([]) }}" - state: present - tags: - - undercloud-additional-pkgs - -# Configure ntp on undercloud -- include: ntp.yml - become: true - when: "{{ step_undercloud_ntp|bool }}" - tags: - - undercloud-ntp diff --git a/roles/baremetal-undercloud/packages/tasks/ntp.yml b/roles/baremetal-undercloud/packages/tasks/ntp.yml deleted file mode 100644 index 2fb39df5d..000000000 --- a/roles/baremetal-undercloud/packages/tasks/ntp.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -# Ensure ntp packages are installed -- name: Install ntp packages - package: - name: ['ntp', 'ntpdate'] - state: present - -# Enable ntpd service -- name: Enable ntpd service - service: - name: 'ntpd' - enabled: true - -# Enable ntpdate service -- name: Enable ntpdate service - service: - name: 'ntpdate' - enabled: true - -# Stop ntpd service -- name: Ensure ntp service is stopped to be able to launch ntpdate - service: - name: 'ntpd' - state: stopped - -# Disable default ntp servers if custom servers are defined -- name: Disable configured servers in ntp.conf (if custom servers are defined) - replace: - destfile: /etc/ntp.conf - regexp: '^server (.*)' - replace: '#server \1' - when: undercloud_custom_ntps is defined - -# Enable custom ntp servers if custom servers are defined -- name: Add new server in ntp.conf (if custom servers are defined) - lineinfile: - destfile: /etc/ntp.conf - line: 'server {{ item }} iburst' - with_items: '{{ undercloud_custom_ntps|default([]) }}' - -# Setup custom ntp servers in step-tickers if custom servers are defined -- name: Set step-ticker (if custom servers are defined) - lineinfile: - destfile: /etc/ntp/step-tickers - line: '{{ item }}' - create: true - with_items: '{{ undercloud_custom_ntps|default([]) }}' - -# Configure ntpdate hardware synchronization -- name: Configure ntpdate to synchronize the hardware clock - lineinfile: - destfile: /etc/sysconfig/ntpdate - regexp: '^SYNC_HWCLOCK=.*' - line: 'SYNC_HWCLOCK=yes' - -# Sync time now -- name: Synchronize time immediately with ntpdate - shell: | - set -euxo pipefail - ntpdate $(grep ^server /etc/ntp.conf | tail -1 | awk '{print $2}') - changed_when: false - -# Start ntpd -- name: Start ntpd service - service: - name: 'ntpd' - state: started diff --git a/roles/baremetal-undercloud/tasks/machine-provisioning.yml b/roles/baremetal-undercloud/tasks/machine-provisioning.yml deleted file mode 100644 index 35ce7ca84..000000000 --- a/roles/baremetal-undercloud/tasks/machine-provisioning.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Provision script execution - shell: > - set -o pipefail && - {{ baremetal_provisioning_script }} 2>&1 {{ timestamper_cmd }} | tee - {{ baremetal_provisioning_log }} - when: step_provide_undercloud|bool diff --git a/roles/baremetal-undercloud/tasks/machine-setup.yml b/roles/baremetal-undercloud/tasks/machine-setup.yml deleted file mode 100644 index ce27f8475..000000000 --- a/roles/baremetal-undercloud/tasks/machine-setup.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -- name: Check that virthost/undercloud is set - fail: - msg: "You need to set virthost/undercloud before running these playbooks." - when: virthost is not defined - -- name: Ensure local working dir exists - file: - path: "{{ local_working_dir }}" - state: directory - -- name: Create empty ssh config file - file: - path: "{{ local_working_dir }}/ssh.config.ansible" - state: touch - -- name: Create initial ssh config file with virthost_key (if defined) - blockinfile: - dest: "{{ local_working_dir }}/ssh.config.ansible" - block: | - Host {{ virthost }} - Hostname {{ virthost }} - IdentityFile {{ virthost_key }} - User root - StrictHostKeyChecking no - UserKnownHostsFile=/dev/null - when: virthost_key is defined - -- name: Add the virthost to the inventory - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "root" - ansible_host: "{{ virthost }}" - -- name: Create virthost/undercloud access key - command: > - ssh-keygen -f {{ undercloud_key }} -N '' - -C 'ansible_generated_virt_host' - -t rsa -b 4096 - args: - creates: "{{ undercloud_key }}" - -- name: Create non-root user on virthost/undercloud - delegate_to: "{{ virthost }}" - user: - name: "{{ non_root_user }}" - state: present - shell: /bin/bash - become: true - -- name: Configure non-root user authorized_keys on virthost/undercloud - delegate_to: "{{ virthost }}" - authorized_key: - user: "{{ non_root_user }}" - key: "{{ lookup('file', undercloud_key|quote + '.pub')|default('') }}" - become: true - -- name: Grant sudo privileges to non-root user on virthost/undercloud - delegate_to: "{{ virthost }}" - copy: - content: | - {{ non_root_user }} ALL=(ALL) NOPASSWD:ALL - dest: /etc/sudoers.d/{{ non_root_user }} - owner: root - group: root - mode: 0440 - become: true - -- name: get undercloud ip - delegate_to: "{{ virthost }}" - shell: | - set -euo pipefail - ip route get 1 | awk '{print $NF;exit}' - register: registered_undercloud_ip - changed_when: false - -- name: Re-add the virthost to the inventory - add_host: - name: "{{ virthost }}" - groups: "virthost" - ansible_fqdn: "{{ virthost }}" - ansible_user: "{{ non_root_user }}" - ansible_host: "{{ virthost }}" - ansible_private_key_file: "{{ undercloud_key }}" - -# Add the undercloud to the in-memory inventory. -- name: Add undercloud machine to inventory - add_host: - name: undercloud - groups: undercloud - ansible_host: undercloud - ansible_fqdn: undercloud - ansible_user: "{{ undercloud_user }}" - ansible_private_key_file: "{{ undercloud_key }}" - ansible_ssh_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"' - ansible_scp_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"' - ansible_sftp_extra_args: '-F "{{ local_working_dir }}/ssh.config.ansible"' - undercloud_ip: "{{ registered_undercloud_ip.stdout }}" diff --git a/roles/baremetal-undercloud/tasks/main.yml b/roles/baremetal-undercloud/tasks/main.yml deleted file mode 100644 index 052968413..000000000 --- a/roles/baremetal-undercloud/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -# tasks file for baremetal-undercloud - -# Do machine provisioning -- include: machine-provisioning.yml - tags: - - machine-provision - -# Prepare machine to be used with TripleO -- include: machine-setup.yml - tags: - - machine-setup diff --git a/roles/build-images/README.md b/roles/build-images/README.md deleted file mode 100644 index 663d905ac..000000000 --- a/roles/build-images/README.md +++ /dev/null @@ -1,79 +0,0 @@ -build-images -============ - -An Ansible role for building TripleO undercloud and overcloud images. The role -can either operate directly against a host (direct) or setup a build -environment inside of a libvirt guest using libguestfs-tools (isolated). - -It starts by creating the overcloud images from the provided yaml files. It -then uses the convert-image role from tripleo-quickstart to turn the -qcow2 image into an undercloud image. Finally, it injects the -previously created overcloud image and ironic-python-agent images into this -new undercloud image. - -Requirements ------------- - -* [convert-image](https://opendev.org/openstack/tripleo-quickstart/src/branch/master/roles/convert-image) role from tripleo-quickstart (if building an undercloud image) -* [fetch-images](https://opendev.org/openstack/tripleo-quickstart/src/branch/master/roles/fetch-images) role from tripleo-quickstart (if using isolated build) -* [modify-image](https://opendev.org/openstack/tripleo-quickstart-extras/src/branch/master/roles/modify-image) role from tripleo-quickstart-extras -* [repo-setup](https://opendev.org/openstack/tripleo-quickstart/src/branch/master/roles/repo-setup/) role from tripleo-quickstart-extras - -Role Variables --------------- - -* `images_working_dir` -- Directory on the host where images and logs will be - placed -* `images_destroy_working_dir` -- Whether to destroy the previous image - directory before starting. (Default true) -* `overcloud_image_build_script` -- Template used for the overcloud image build -* `overcloud_image_build_log` -- Log file for output from the image build - script. -* `build_image_isolated` -- Whether to use libguestfs to create an isolated - build environment. (Default true) -* `build_isolation_image_url` -- URL for image to use as the isolated build - environment. (Currently requires an .md5 file in the same location because - the fetch-images role from quickstart is used to get the image) -* `build_undercloud` -- Whether to build an undercloud image. (Default true) -* `package_images` -- Whether to create tarballs and md5s for all of the - produced images. (Default true) -* `overcloud_repo_paths` -- List of repo paths that will be passed to DIB for - package installs in the overcloud images. These repos will also be copied on - to the undercloud image. -* `image_build_yaml_paths` -- List of yaml files to be passed to the overcloud - image build. (Defaults to yamls packaged in tripleo-common. In order to - produce security hardened images, the alternate overcloud-hardened-images - need to be used instead of the overcloud-images ones). -* `image_build_extract_list` -- List of artifacts to extract from the isolated - build environment after building. -* `inject_images` -- List of artifacts to inject into the undercloud image. Set - to [] to disable injection -* `skip_build_images` -- skip building images if there present or cached - (default: true), setting it to false will add '--no-skip' option to openstack - image build command. -* `base_image_url` -- URL of base image -* `base_image_path` -- path to save base image on host - -Example Usage -------------- - -```yaml ---- -- name: Build images using an isolated build environment - hosts: virthost - roles: - - build-images - -- name: Build images with repos directly installed on the host - hosts: virthost - vars: - build_image_isolated: false - roles: - - build-images - -``` - -License -------- - -Apache diff --git a/roles/build-images/defaults/main.yml b/roles/build-images/defaults/main.yml deleted file mode 100644 index b24a54bd7..000000000 --- a/roles/build-images/defaults/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -images_working_dir: "{{ ansible_user_dir }}/workspace" -images_destroy_working_dir: true -build_image_isolated: true -build_isolation_image_url: https://images.rdoproject.org/CentOS-7-x86_64-GenericCloud.qcow2 -cleanup_images_working_dir: false -skip_build_images: true -build_isolation_image: - name: isolation-image - url: "{{ build_isolation_image_url }}" - type: qcow2 -build_undercloud: true -overcloud_as_undercloud: true -overcloud_repo_paths: - - "/etc/yum.repos.d/delorean*" - - "/etc/yum.repos.d/quickstart-*" - - "{% if ansible_distribution_major_version is version('9', '>=') -%}/etc/yum.repos.d/centos.repo{% endif %}" - - "{% if job is defined and job.component is defined -%}/etc/yum.repos.d/*-component.repo{%- endif -%}" diff --git a/roles/build-images/meta/main.yml b/roles/build-images/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/build-images/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/build-images/tasks/convert-image.yml b/roles/build-images/tasks/convert-image.yml deleted file mode 100644 index 7426aeb5d..000000000 --- a/roles/build-images/tasks/convert-image.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472) - include_role: - name: convert-image diff --git a/roles/build-images/tasks/fetch-images.yml b/roles/build-images/tasks/fetch-images.yml deleted file mode 100644 index d1dbf97cf..000000000 --- a/roles/build-images/tasks/fetch-images.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472) - include_role: - name: fetch-images diff --git a/roles/build-images/tasks/main.yml b/roles/build-images/tasks/main.yml deleted file mode 100644 index e7fc4a814..000000000 --- a/roles/build-images/tasks/main.yml +++ /dev/null @@ -1,202 +0,0 @@ ---- -- name: Delete prior working directory if present - file: - path: "{{ images_working_dir }}" - state: absent - become: true - when: images_destroy_working_dir | bool - -- name: Create the working directory - file: - path: "{{ images_working_dir }}" - state: directory - mode: 0755 - owner: "{{ non_root_user }}" - become: true - -- name: create the repo setup script for the build host - include_role: - name: repo-setup - vars: - repo_run_live: false - repo_setup_dir: "{{ images_working_dir }}" - -- name: Check for extra repo created by repo-setup role - stat: - path: "{{ images_working_dir }}/web-gating.repo" - register: new_repo - -- name: Inject gating repo during image build process - when: - - new_repo.stat.exists - - to_build|bool - block: - - name: set facts for gating repo - set_fact: - gating_repo: "{{ images_working_dir }}/web-gating.repo" - - - name: Append gating repo during image build - set_fact: - overcloud_repo_paths: "{{ overcloud_repo_paths + [ gating_repo ] }}" - -- name: Run the image build script (direct) using oooci-build-images role - vars: - dib_yum_repo_conf: "{{ overcloud_repo_paths }}" - workspace: "{{ images_working_dir }}" - build_all_images: true - tripleo_image_type: "{{ overcloud_image }}" - tripleo_common_path: "/usr/share/tripleo-common" - include_role: - name: oooci-build-images - when: - - not build_image_isolated|bool - - to_build|bool - -- when: build_image_isolated|bool - block: - - name: Make sure /dev/pts exists - shell: | - mkdir -p /dev/pts - mount devpts /dev/pts -t devpts ||: - changed_when: true - - - name: get image to use as isolated build env - include: fetch-images.yml - vars: - image_fetch_dir: "{{ images_working_dir }}" - images: - - "{{ build_isolation_image }}" - - - name: run the repo setup script (isolated) - include: modify-image.yml - vars: - modify_image_working_dir: "{{ images_working_dir }}" - image_to_modify: "{{ images_working_dir }}/{{ build_isolation_image.name }}.qcow2" - modify_script: "{{ images_working_dir }}/repo_setup.sh" - - - name: Set image_build_extract_list for {{ overcloud_image }} - set_fact: - image_build_extract_list: - - "ironic-python-agent.initramfs" - - "ironic-python-agent.kernel" - - "{{ overcloud_image }}.qcow2" - - "{{ overcloud_image }}.initrd" - - "{{ overcloud_image }}.vmlinuz" - when: - - image_build_extract_list is not defined - - not whole_disk_images|bool - - - name: Set image_build_extract_list for {{ overcloud_image }} - set_fact: - image_build_extract_list: - - "ironic-python-agent.initramfs" - - "ironic-python-agent.kernel" - - "{{ overcloud_image }}.qcow2" - when: - - image_build_extract_list is not defined - - whole_disk_images|bool - - - name: run the image build script (isolated) - include: modify-image.yml - vars: - modify_image_working_dir: "{{ images_working_dir }}" - image_to_modify: "{{ images_working_dir }}/{{ build_isolation_image.name }}.qcow2" - modify_script: "{{ images_working_dir }}/overcloud_image_build_script.sh" - modify_image_vc_ram: 16384 - modify_image_vc_cpu: 8 - modify_image_extract_list: "{{ image_build_extract_list }}" - - rescue: - - name: Set image_build_failed fact - set_fact: - image_build_failed: true - - always: - - name: Displaying log files from build isolation image - shell: | - virt-cat -a {{ build_isolation_image.name }}.qcow2 \ - /tmp/builder.log > builder.log 2>&1 || true - virt-cat -a {{ build_isolation_image.name }}.qcow2 \ - /ironic-python-agent.log > ironic-python-agent.log 2>&1 || true - virt-cat -a {{ build_isolation_image.name }}.qcow2 \ - /{{ overcloud_image }}.log > {{ overcloud_image }}.log 2>&1 || true - environment: - LIBGUESTFS_BACKEND: direct - LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" - args: - chdir: "{{ images_working_dir }}" - - -# Note(trown) We got a false positive in the RDO job which is already using this -# because even though the fail was executed it did not actually cause ansible to -# exit with nonzero. I suspect it is some interaction with block, so moving the -# actual fail out of the block. -- name: Throw error msg if image build is failing - fail: msg='*** Image Build Error ***' - when: image_build_failed|default(false)|bool - -- when: build_undercloud|bool - block: - - name: run the repo setup script on overcloud image - include: modify-image.yml - vars: - modify_images_working_dir: "{{ images_working_dir }}" - image_to_modify: "{{ images_working_dir }}/{{ overcloud_image }}.qcow2" - modify_script: "{{ images_working_dir }}/repo_setup.sh" - - - name: convert the overcloud image to an undercloud image - include: convert-image.yml - vars: - convert_image_working_dir: "{{ images_working_dir }}" - - - name: Set inject_images for {{ overcloud_image }} - set_fact: - inject_images: - - "ironic-python-agent.initramfs" - - "ironic-python-agent.kernel" - - "{{ overcloud_image }}.qcow2" - - "{{ overcloud_image }}.initrd" - - "{{ overcloud_image }}.vmlinuz" - when: - - inject_images is not defined - - not whole_disk_images|bool - - - name: Set inject_images for {{ overcloud_image }} - set_fact: - inject_images: - - "ironic-python-agent.initramfs" - - "ironic-python-agent.kernel" - - "{{ overcloud_image }}.qcow2" - when: - - inject_images is not defined - - whole_disk_images|bool - - - name: Inject overcloud/ipa images - command: > - virt-customize -a {{ images_working_dir }}/undercloud.qcow2 - --upload {{ images_working_dir }}/{{ item }}:/home/{{ undercloud_user }}/{{ item }} - --run-command - 'chown {{ undercloud_user }}:{{ undercloud_user }} /home/{{ undercloud_user }}/{{ item }}' - changed_when: true - environment: - LIBGUESTFS_BACKEND: direct - LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}" - with_items: "{{ inject_images }}" - - - name: Compress the undercloud image - shell: | - qemu-img convert -c -O qcow2 undercloud.qcow2 undercloud-compressed.qcow2 - mv undercloud-compressed.qcow2 undercloud.qcow2 - args: - chdir: "{{ images_working_dir }}" - - - name: Create undercloud md5sum - shell: md5sum undercloud.qcow2 > undercloud.qcow2.md5 - args: - chdir: "{{ images_working_dir }}" - -- name: Clean up the images working dir - shell: >- - rm -rf {{ images_working_dir }}/{{ overcloud_image }}.d {{ images_working_dir }}/ironic-python-agent.d/ - sudo chown $USER: {{ images_working_dir }}/{{ overcloud_image }}.* {{ images_working_dir }}/ironic-python-agent.* - when: cleanup_images_working_dir|bool diff --git a/roles/build-images/tasks/modify-image.yml b/roles/build-images/tasks/modify-image.yml deleted file mode 100644 index 46e81813e..000000000 --- a/roles/build-images/tasks/modify-image.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: indirect role include (workaround to https://github.com/ansible/ansible/issues/19472) - include_role: - name: modify-image diff --git a/roles/build-test-packages/README.md b/roles/build-test-packages/README.md deleted file mode 100644 index efde091e2..000000000 --- a/roles/build-test-packages/README.md +++ /dev/null @@ -1,106 +0,0 @@ -build-test-packages -=================== - -An Ansible role for generating custom RPMSs from upstream Gerrit changes in the -TripleO project using DLRN. This repo then can be injected in the tested -environment, a repo file created and a yum update should start using the built -RPMs. - -Requirements ------------- - -* [DLRN](https://github.com/openstack-packages/DLRN) - -Role Variables --------------- - -* `local_working_dir` -- the directory where tripleo-quickstart is located -* `build_repo_dir` -- the directory where the DLRN repo is built. - The variable defaults to the home directory of the user. -* `artg_dlrn_repo_url` -- the URL of the DLRN repository -* `artg_rdoinfo_repo_url` -- the URL of the rdoinfo repository that contains - the project definitions for DLRN -* `artg_compressed_gating_repo` -- a full path to a compressed repository that - contains all the generated rpms -* `artg_change_list` -- a list of changes to gate. Only needed when not running - in Zuul or Gerrit (see below). The format is: -* `artg_requirements` -- used in roles mode, the requirements file to use for - replacing the gated roles -* `artg_skipped_projects` -- a list of projects that are not going to be gated. - This is useful if the project is directly checked out by the gate job as this - retains "Depends-On" functionality for the rest of the projects. Also useful - to skip projects that DLRN cannot build. -* `artg_repos_dir` -- Root directory which contains project directories with - sources for build. -* `artg_build_one` -- Boolean to indicate if dlrn should build one package at a - time. If set to false, dlrn will be run to build all the required packages - in one invocation of dlrn. -* `dlrn_target` -- Target for the DLRN build Can be something like centos or - fedora. Defaults to centos. -* `dlrn_baseurl` -- URL used by DLRN to get the repo definitions when building - packages -* `dlrn_use_local_mirrors` -- use the local repo definitions from - /etc/yum.repos.d/ for CentOS and DLRN while building packages; used upstream - - -Example artg_change_list for just code changes: -```yaml -artg_change_list: - - host: "review.opendev.org" - project: "openstack/tripleo-heat-templates" - branch: "master" - refspec: "refs/changes/1/123456/1" - - host: ... -``` - -Example artg_change_list for code changes and package changes: -```yaml -artg_change_list: - - host: "review.opendev.org" - project: "openstack/tripleo-heat-templates" - branch: "master" - refspec: "refs/changes/1/123456/1" - distgit: - host: "ssh://user@review.rdoproject.org" - project: "openstack/tripleo-heat-templates-distgit" - refspec: "refs/changes/1/123456/1" - - host: ... -``` - -Gating with Zuul or Jenkins ---------------------------- - -The role can also work with Zuul and Jenkins based gating jobs. - -In case of Zuul, the role uses `ZUUL_HOST` and `ZUUL_CHANGES` vars to parse the -full set of dependent changes that were previously -[resolved by Zuul](http://docs.openstack.org/infra/zuul/gating.html#cross-repository-dependencies). - -If we're running in a Jenkins environment with the -[Gerrit Trigger plugin](https://wiki.jenkins-ci.org/display/JENKINS/Gerrit+Trigger), -`GERRIT_HOST`, `GERRIT_CHANGE_ID`, `GERRIT_BRANCH` and -`GERRIT_PATCHSET_REVISION` are used to detect the gated change. The role then -searches for "Depends-On:" lines in the commit message (and recursively in the -commit messages of the dependent changes) and adds all of them to the gating -list. This happens through Gerrit server's public REST API. - -Example Playbook ----------------- - -```yaml ---- -- name: Build custom RPMs - hosts: virthost - roles: - - build-test-packages -``` - -License -------- - -Apache - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/build-test-packages/defaults/main.yml b/roles/build-test-packages/defaults/main.yml deleted file mode 100644 index ad091f23c..000000000 --- a/roles/build-test-packages/defaults/main.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- - -python_cmd: python3 -build_repo_dir: "{{ ansible_user_dir }}" -rdoinfo_repo_name: rdoinfo -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_rdo_packages: [] -ansible_coll_packages: [] -dlrn_target: >- - {%- if (ansible_distribution == "RedHat") and - (dlrn_use_local_mirrors|bool) -%} - redhat-local - {%- elif (ansible_distribution == "RedHat") -%} - redhat - {%- elif (ansible_distribution == "CentOS") and - (ansible_distribution_major_version|int >= 8) and - (dlrn_use_local_mirrors|bool) -%} - centos{{ ansible_distribution_major_version }}-local - {%- elif (ansible_distribution == "CentOS") and - (ansible_distribution_major_version|int >= 8) -%} - centos{{ ansible_distribution_major_version }}-stream - {%- elif (ansible_distribution == "CentOS") and - (ansible_distribution_major_version|int <= 7) and - (dlrn_use_local_mirrors|bool) -%} - centos-local - {%- else -%} - centos - {%- endif -%} - -initial_dlrn_config: >- - {%- if (ansible_distribution == "RedHat") -%} - redhat - {%- elif (ansible_distribution == "CentOS") and - (ansible_distribution_major_version|int >= 8) -%} - centos{{ ansible_distribution_major_version }} - {%- else -%} - centos - {%- endif -%} - - -dlrn_cleanup: false -dlrn_baseurl: >- - {%- if ansible_distribution == "RedHat" and ansible_distribution_major_version|int == 8 -%} - https://trunk.rdoproject.org/rhel8-master - {%- elif (ansible_distribution == "CentOS") and (ansible_distribution_major_version|int >= 8) -%} - https://trunk.rdoproject.org/centos{{ ansible_distribution_major_version }}/ - {%- else -%} - https://trunk.rdoproject.org/centos7/ - {%- endif -%} - -use_components: >- - {%- if (ansible_distribution_major_version|int >= 8) -%} - 1 - {%- else -%} - 0 - {%- endif -%} - -dlrn_use_local_mirrors: false -dlrn_pre_installed: false - -artg_skipped_projects: - - openstack/puppet-openstack-integration - - openstack/puppet-watcher - - openstack/tripleo-quickstart - - openstack/tripleo-quickstart-extras - - openstack/tripleo-upgrade - - x/browbeat - - openstack/tripleo-ha-utils - - openstack/grenade - - openstack/project-config - - openstack/tripleo-ci - - zuul/zuul-jobs - - openstack/openstack-virtual-baremetal - - openstack/openstack-ansible-os_tempest - - openstack/ansible-role-python_venv_build - - openstack/ansible-config_template - - openstack/ansible-role-collect-logs - - openstack/tripleo-ci-internal-jobs - - openstack/tripleo-ci-internal-config - - tripleo-environments - - testproject - - containers/podman - -artg_github_projects: - - containers/ansible-podman-collections - - ansible-collections/community.general - - ansible-collections/ansible.posix - - ansible-collections/ansible.netcommon - -artg_branchless_projects: - - openstack/diskimage-builder - - openstack/octavia-tempest-plugin - - openstack/tempest - - openstack/validations-common - - openstack/validations-libs - - x/tripleo-ipa - - x/whitebox-neutron-tempest-plugin diff --git a/roles/build-test-packages/library/jenkins_deps.py b/roles/build-test-packages/library/jenkins_deps.py deleted file mode 100755 index 9287703ce..000000000 --- a/roles/build-test-packages/library/jenkins_deps.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/env python -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate -import json -import logging -import re -import requests -from ansible.module_utils.basic import * - - -DOCUMENTATION = ''' ---- -module: jenkins_deps -version_added: "2.0" -short_description: Parses the Gerrit commit message and identifies cross repo depenency changes -description: - - Parses the Gerrit commit message and identifies cross repo depenency changes. - The expected format in the commit message is: - Depends-On: [@] - Where is the gerrit Change-Id of the dependent change, - should be a part of a hostname in ALLOWED_HOSTS. -options: - host: - description: - - The hostname of the Gerrit server. - required: True - change_id: - description: - - The change-id of the Gerrit change, starting with I... - required: True - branch: - description: - - The branch of the change. - required: True - patchset_rev: - description: - - The sha hash of the patchset to be tested. Latest will be used if omitted. - required: False -''' - -EXAMPLES = ''' -- jenkins-deps: - host: review.opendev.org - change_id: I387b6bfd763d2d86cad68a3119b0edd0caa237b0 - patchset_rev: d18f21853e2f3be7382a20d0f42232ff3a78b348 -''' - -# we ignore any other host reference -ALLOWED_HOSTS = ['review.opendev.org', - 'review.gerrithub.io', - 'review.rdoproject.org'] - - -def parse_commit_msg(current_host, msg): - '''Look for dependency links in the commit message.''' - tags = [] - for line in iter(msg.splitlines()): - # note: this regexp takes care of sanitizing the input - tag = re.search(r'Depends-On: *(I[0-9a-f]+)@?([0-9a-z\.\-:]*)', - line, re.IGNORECASE) - if tag: - change_id = tag.group(1) - target = tag.group(2) - if target == '': - host = current_host - else: - # match a shorthand hostname for our allowed list - for hostname in ALLOWED_HOSTS: - if target in hostname: - host = hostname - break - else: - logging.warning('Cannot resolve "%s" to a host from the ' - 'ALLOWED HOSTS list', target) - continue - tags.append({'host': host, - 'change_id': change_id, - 'branch': None, - 'revision': None}) - return tags - - -def get_details(host, change_id, branch, revision): - '''Get the details of a specific change''' - url = ''.join(['https://', host, '/changes/?q=change:', change_id]) - try: - req = requests.get(url) - req.raise_for_status() - except requests.exceptions.HTTPError: - return {'fail_msg': ''.join(['warning: failed to query change ' - 'details from ', url])} - # strip XSSI attack prevention prefix - data = json.loads(req.text[4:]) - if len(data) == 0: - return {'fail_msg': ''.join(['warning: no change found with id ', - change_id, ' at ', url])} - elif len(data) == 1: - # not filtering by branch if not necessary - full_id = data[0]['id'] - else: - # there are more than one change with the same ID - try: - full_id = [change['id'] for change - in data if change['branch'] == branch][0] - except IndexError: - return {'fail_msg': ''.join(['warning: no change found with id ', - change_id, ' for branch ', branch, - ' at ', url])} - url = ''.join(['https://', host, '/changes/', full_id, - '?o=ALL_REVISIONS&o=ALL_COMMITS']) - try: - req = requests.get(url) - req.raise_for_status() - except requests.exceptions.HTTPError: - return {'fail_msg': ''.join(['warning: failed to fetch details of ', - change_id, ' from ', url])} - # strip XSSI attack prevention prefix - data = json.loads(req.text[4:]) - if revision is None: - revision = data['current_revision'] - if revision not in data['revisions']: - return {'fail_msg': ''.join(['warning: cannot find revision ', - revision, ' of change ', change_id, - ' at ', url])} - return {'host': host, - 'change_id': str(data['change_id']), - 'project': str(data['project']), - 'branch': str(data['branch']), - 'refspec': str(data['revisions'][revision]['ref']), - 'commit_msg': - str(data['revisions'][revision]['commit']['message'])} - - -def resolve_dep(host, change_id, branch, revision): - '''Dependency resolution. - - Resolve the dependencies in the target commits until there are no more - dependent changes. If the branch or revision is None, it can still resolve - the dependencies. It only uses the branch when the change_id is ambigiuous - and by default uses the latest patchset's revision. - - The function avoids circular dependencies and only allows one change per - project to be added to the output list. - - Returns a list of dictionaries with the dependent changes. - - ''' - resolved_ids = [] - deps = [] - to_resolve = [{'host': host, - 'change_id': change_id, - 'branch': branch, - 'revision': revision}] - output_msg = [] - while len(to_resolve) > 0: - change = to_resolve.pop() - # use the original branch as default - if change['branch'] is None: - change['branch'] = branch - - # avoid circular dependencies - if change['change_id'] in resolved_ids: - continue - - details = get_details(**change) - if 'fail_msg' in details: - output_msg.append(details['fail_msg']) - continue - resolved_ids.append(details['change_id']) - - # allow only one of each project as a dependency - if details['project'] not in (d['project'] for d in deps): - deps.append({'host': change['host'], - 'project': details['project'], - 'branch': details['branch'], - 'refspec': details['refspec']}) - else: - output_msg.append( - ''.join(['warning: skipping ', change['change_id'], ' on ', - change['host'], ' because project "', - details['project'], '" is already a dependency'])) - continue - new_deps = parse_commit_msg(change['host'], details['commit_msg']) - to_resolve.extend(new_deps) - for index in range(len(deps)): - if deps[index]['host'] == 'review.opendev.org': - # redirect change cloning to reduce load on review.opendev.org - deps[index]['host'] = 'opendev.org' - # add https:// prefix for cloning the change - deps[index]['host'] = ''.join(['https://', deps[index]['host']]) - if len(deps) == 0: - output_msg.append('error: failed to resolve the target change') - return {'failed': True, - 'msg': ', '.join(output_msg)} - else: - return {'changed': True, - 'ansible_facts': {'jenkins_change_list': deps}, - 'msg': ', '.join(output_msg)} - - -def main(): - module = AnsibleModule( - argument_spec=dict( - host=dict(required=True, type='str'), - change_id=dict(required=True, type='str'), - branch=dict(required=False, default=None, type='str'), - patchset_rev=dict(required=False, default=None, type='str') - ) - ) - result = resolve_dep(module.params['host'], - module.params['change_id'], - module.params['branch'], - module.params['patchset_rev']) - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/roles/build-test-packages/meta/main.yml b/roles/build-test-packages/meta/main.yml deleted file mode 100644 index bd990ac59..000000000 --- a/roles/build-test-packages/meta/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -galaxy_info: - author: Red Hat - description: | - An Ansible role for generating custom RPMSs from upstream Gerrit changes in - the TripleO project using DLRN. This repo then can be injected in the tested - environment, a repo file created and a yum update should start using the - built RPMs. - license: Apache - platforms: - - name: CentOS - versions: - - 7 - - 8 - - name: EL - versions: - - 7 - - 8 - min_ansible_version: 2.8 - -dependencies: - - extras-common diff --git a/roles/build-test-packages/molecule/default/converge.yml b/roles/build-test-packages/molecule/default/converge.yml deleted file mode 100644 index 2fdf39340..000000000 --- a/roles/build-test-packages/molecule/default/converge.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Converge - hosts: all - tasks: - - name: Include role - include_role: - name: build-test-packages diff --git a/roles/build-test-packages/molecule/default/molecule.yml b/roles/build-test-packages/molecule/default/molecule.yml deleted file mode 100644 index 213781eaa..000000000 --- a/roles/build-test-packages/molecule/default/molecule.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -driver: - name: docker -log: true -platforms: - - name: instance - image: centos:7 -provisioner: - name: ansible - log: true - env: - # ANSIBLE_STDOUT_CALLBACK: yaml - # hack to make it find 'common' role from tq - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${MOLECULE_SCENARIO_DIRECTORY}/../../../../../tripleo-quickstart/roles" -verifier: - name: ansible diff --git a/roles/build-test-packages/molecule/default/verify.yml b/roles/build-test-packages/molecule/default/verify.yml deleted file mode 100644 index e0fbb1198..000000000 --- a/roles/build-test-packages/molecule/default/verify.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Verify - hosts: all diff --git a/roles/build-test-packages/tasks/detect_github_pr.yml b/roles/build-test-packages/tasks/detect_github_pr.yml deleted file mode 100644 index d6a02bac4..000000000 --- a/roles/build-test-packages/tasks/detect_github_pr.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -- name: Parse Gerrit commit message and find "github" links - set_fact: - gh_prs: "{{ zuul.message|default('') | b64decode | regex_search('github: https://github.com/(.+)/pull/(.+)', '\\1', '\\2') }}" - -- when: - - gh_prs | length > 1 - - block: - - name: Construct change if exists - set_fact: - gh_change: - project: "{{ gh_prs[0] }}" - host: "https://github.com/{{ gh_prs[0] }}/pull" - branch: "master" - refspec: "{{ gh_prs[1] }}" - - - name: Make sure source dir for this change exist - file: - path: "{{ ansible_user_dir }}/src/github.com/{{ gh_prs[0] }}" - state: directory - recurse: true - - - name: Fetch the required pull request - git: - repo: "https://github.com/{{ gh_prs[0] }}" - version: "pull/{{ gh_prs[1] }}/head" - refspec: "+refs/pull/{{ gh_prs[1] }}/head:refs/remotes/origin/pull/{{ gh_prs[1] }}/head" - dest: "{{ ansible_user_dir }}/src/github.com/{{ gh_prs[0] }}" - - - name: Add found PRs to artg_change_list - set_fact: - artg_change_list: "{{ artg_change_list }} + [ {{ gh_change }} ]" diff --git a/roles/build-test-packages/tasks/dlrn-build.yml b/roles/build-test-packages/tasks/dlrn-build.yml deleted file mode 100644 index 8b77191ac..000000000 --- a/roles/build-test-packages/tasks/dlrn-build.yml +++ /dev/null @@ -1,176 +0,0 @@ ---- -- name: Set release name - set_fact: - artg_release: "{{ job.branch_override | default(artg_change.branch) | replace('stable/', '') }}" - -- name: print out the release name - debug: - var: artg_release - -- when: artg_release in ['master'] - block: - - name: Set DLRN distro (legacy distgit branch naming) - set_fact: - artg_distro: "rpm-{{ artg_release }}" - - - name: Set DLRN distro for branchless projects - set_fact: - artg_distro: "{{ release }}-rdo" - when: - - release is defined and release not in ['master'] - - artg_change.project in artg_branchless_projects - -- name: Set DLRN distro (new stable branch naming scheme) - set_fact: - artg_distro: "{{ artg_release }}-rdo" - when: artg_release not in ['master'] - -- name: Make sure /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT exists (RHEL) - shell: - cmd: | - export CERTPATH="/usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT" - export CERTDIR=$(dirname $CERTPATH) - [ ! -d $CERTDIR ] && mkdir -p $CERTDIR - touch $CERTPATH - become: true - when: ansible_distribution in ['RedHat'] - -- name: Use local baseurl when using local mirrors - set_fact: - dlrn_baseurl: 'file:///tmp/fake-dlrn-repos' - when: dlrn_use_local_mirrors|bool - -- name: Override projects.ini settings - lineinfile: - dest: '{{ build_repo_dir }}/DLRN/projects.ini' - 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 }}'} - loop_control: - loop_var: project_item - when: osp_release is not defined - -- name: Override projects.ini settings for downstream - lineinfile: - dest: '{{ build_repo_dir }}/DLRN/projects.ini' - regexp: '{{ project_item.regexp }}' - line: '{{ project_item.line }}' - with_items: - - {regexp: 'baseurl=.*', line: 'baseurl={{ dlrn_baseurl }}'} - - {regexp: 'distro=.*', line: 'distro={{ release }}-rdo'} - - {regexp: 'source=.*', line: 'source={{ artg_change.branch }}'} - loop_control: - loop_var: project_item - when: osp_release is defined - -- block: - - name: Map project name to DLRN project name - register: project_name_mapped_output - shell: - chdir: '{{ build_repo_dir }}/DLRN' - cmd: | - source '{{ build_repo_dir }}/dlrn-venv/bin/activate' - set -xeo pipefail - # {{ rdoinfo_repo_name }}/{{ rdoinfo_repo_name.split('info')[0] }}-full.yml will - # return rdo-full.yml and for downstream is osp-full.yml. - rdopkg findpkg -s '{{ artg_change.project | basename }}' \ - -i {{ rdoinfo_repo_name }}/{{ rdoinfo_repo_name.split('info')[0] }}-full.yml - changed_when: false - failed_when: project_name_mapped_output.rc != 0 or not project_name_mapped_output.stdout - - - set_fact: - project_name_mapped: "{{ project_name_mapped_output.stdout | regex_search('name:(.+)', '\\1') | first | trim }}" - - rescue: - - debug: - msg: | - WARNING: Got {{ project_name_mapped_output.rc }} result code trying to build {{ artg_change.project }} - --- STDERR --- - {{ project_name_mapped_output.stderr }} - --- STDOUT --- - {{ project_name_mapped_output.stdout }} - -- when: project_name_mapped is defined - block: - - name: Append project name to package list - set_fact: - artg_rdo_packages: '{{ artg_rdo_packages }} + {{ [ project_name_mapped ] }}' - - - name: Check if project {{ project_name_mapped }} source already exist - stat: - path: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }}/.git' - register: repo_status - - - name: Create data directory if doesn't exist yet - file: - path: "{{ build_repo_dir }}/DLRN/data/" - state: directory - - - name: Copy from ready directories if configured - command: > - cp -raf {{ artg_repos_dir | dirname }}/{{ artg_change.project }} - {{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }} - ignore_errors: true - register: copy_dir - when: artg_repos_dir is defined - - - name: Clone the gated change - git: - repo: '{{ artg_change.host }}/{{ artg_change.project }}' - dest: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }}' - refspec: '{{ artg_change.refspec }}' - version: 'FETCH_HEAD' - when: - - >- - (artg_repos_dir is not defined and not repo_status.stat.exists) or - copy_dir is defined and copy_dir is failed - - - name: Cleanup and checkout the relevant branch - vars: - git_path: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }}' - git_branch: '{{ artg_change.branch }}' - shell: | - set -eu - pushd {{ git_path }} - git clean -ffd - git reset --hard HEAD - git checkout {{ git_branch }} - popd - - - name: Ensure distgit repo is absent, DLRN takes care of cloning based on config - file: - path: "{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }}_distro" - state: absent - - - name: Clone the distgit change - git: - repo: '{{ artg_change.distgit.host }}/{{ artg_change.distgit.project }}' - dest: '{{ build_repo_dir }}/DLRN/data/{{ project_name_mapped }}_distro' - refspec: '{{ artg_change.distgit.refspec }}' - version: 'FETCH_HEAD' - accept_hostkey: true - when: - - artg_change.distgit is defined - - artg_repos_dir is not defined or copy_dir is defined and copy_dir is failed - - - name: Generate DLRN Script - template: - src: run_dlrn.sh.j2 - dest: "{{ build_repo_dir }}/run_dlrn.sh" - mode: 0744 - - - name: Print info about building - debug: - msg: "Building change for {{ project_name_mapped|default('unknown') }}" - - - name: Run DLRN - shell: > - set -o pipefail && - {{ build_repo_dir }}/run_dlrn.sh 2>&1 {{ timestamper_cmd }} >> {{ build_repo_dir }}/dlrn.log - args: - chdir: '{{ build_repo_dir }}' - register: repo_built - when: artg_build_one|bool diff --git a/roles/build-test-packages/tasks/github-pr.yml b/roles/build-test-packages/tasks/github-pr.yml deleted file mode 100644 index 6279cc814..000000000 --- a/roles/build-test-packages/tasks/github-pr.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -- when: artg_change.project in artg_github_projects - block: - - - name: Install packages - package: - name: - - rpm-build - - ansible-macros - - "ansible{% if ansible_distribution_major_version|int >= 9 %}-core{% endif %}" - state: present - disable_gpg_check: true - become: true - register: install - retries: 10 - until: install is success - delay: 10 - - - name: Set collection path - set_fact: - collection_path: >- - {{ ansible_user_dir }}/{{ - zuul.projects['github.com/' + artg_change.project].src_dir| - default('src/github.com/' + artg_change.project) }} - -- when: - - artg_change.project in artg_github_projects - - artg_change.project == "containers/ansible-podman-collections" - block: - - - name: Build collection - shell: >- - ./contrib/build_rpm.sh > ~/ansible-podman-collections-build_rpm.log 2>&1 - args: - chdir: "{{ collection_path }}" - changed_when: true - tags: - - skip_ansible_lint - -- when: - - artg_change.project in artg_github_projects - - artg_change.project != "containers/ansible-podman-collections" - block: - - - name: Create a script to build collection - template: - src: build_collection.sh.j2 - dest: ~/build_collection.sh - mode: 0777 - - - name: Create a spec file for building collection - template: - src: "specs/{{ artg_change.project.split('/')[1].split('.') | join ('-') }}-build.spec.j2" - dest: "{{ collection_path }}/{{ 'ansible-collection-' + (artg_change.project.split('/')[1].split('.') | join ('-')) }}-build.spec" - - - name: Change collection version in galaxy.yml - lineinfile: - path: "{{ collection_path }}/galaxy.yml" - regexp: "^version:.*" - line: 'version: 9.9.9' - - - name: Build collection - shell: >- - ~/build_collection.sh > ~/{{ artg_change.project|replace('/', '-') }}-build_rpm-err.log 2>&1 || true; - ~/build_collection.sh > ~/{{ artg_change.project|replace('/', '-') }}-build_rpm.log 2>&1 - args: - chdir: "{{ collection_path }}" - changed_when: true - tags: - - skip_ansible_lint - -- name: Append project name to package list - set_fact: - ansible_coll_packages: '{{ ansible_coll_packages }} + {{ [ artg_change.project ] }}' - when: artg_change.project in artg_github_projects diff --git a/roles/build-test-packages/tasks/main.yml b/roles/build-test-packages/tasks/main.yml deleted file mode 100644 index fe270c1a9..000000000 --- a/roles/build-test-packages/tasks/main.yml +++ /dev/null @@ -1,330 +0,0 @@ ---- - -# needed to avoid potential failure when role is used without gather -- name: gather facts used by role - setup: - gather_subset: - - '!min' - - user_dir - - python - - processor - - pkg_mgr - - distribution - -- name: Ensure DLRN package dependencies - become: true - package: - state: present - name: - - createrepo - - gcc - - git - - libffi-devel - - mock - - openssl-devel - - redhat-rpm-config - - rsync - - rpm-build - - rpmdevtools - - sqlite - - python3-libselinux - register: package_ensure_dlrndeps - until: package_ensure_dlrndeps is success - retries: 3 - delay: 5 - -- name: Create mock group - become: true - group: - name: mock - state: present - -- name: Add user to mock group - become: true - user: - name: '{{ ansible_user_id }}' - groups: mock - append: true - -- name: Fetch DLRN from source - git: - repo: '{{ artg_dlrn_repo_url }}' - dest: '{{ build_repo_dir }}/DLRN' - version: 'master' - register: _git_clone - until: _git_clone is success - retries: 3 - delay: 5 - when: dlrn_pre_installed|bool - -- name: Ensure DLRN dir is present - file: - path: '{{ build_repo_dir }}/DLRN/' - state: directory - -- name: Remove data files from previous runs - shell: - rm -rf '{{ build_repo_dir }}/DLRN/*' - args: - warn: false - register: result - changed_when: result.stdout or result.stderr - -- name: drop in the templated version of projects.ini - template: - src: projects.ini.j2 - dest: '{{ build_repo_dir }}/DLRN/projects.ini' - -- name: Pip installs - vars: - ansible_python_interpreter: "/usr/bin/{{ python_cmd }}" - block: - - name: Install and update pip - # noqa 403 - pip: - name: pip - virtualenv: "{{ build_repo_dir }}/dlrn-venv" - virtualenv_command: "/usr/bin/{{ python_cmd }} -m venv" - state: latest - extra_args: --upgrade - - - name: Pip install rdopkg - # noqa 403 - pip: - name: rdopkg - virtualenv: "{{ build_repo_dir }}/dlrn-venv" - virtualenv_command: "/usr/bin/{{ python_cmd }} -m venv" - state: latest - when: not dlrn_pre_installed|bool - - - name: Pip install DLRN - # noqa 403 - pip: - name: dlrn - virtualenv: "{{ build_repo_dir }}/dlrn-venv" - virtualenv_command: "/usr/bin/{{ python_cmd }} -m venv" - state: latest - when: not dlrn_pre_installed|bool - -- name: Pip install pre-installed DLRN - shell: > - source {{ build_repo_dir }}/dlrn-venv/bin/activate; - pip install -r requirements.txt; - {{ python_cmd }} setup.py install; - args: - chdir: '{{ build_repo_dir }}/DLRN' - when: dlrn_pre_installed|bool - -- name: copy the DLRN scripts in the virtualenv to the scripts dir - synchronize: - src: "{{ build_repo_dir }}/dlrn-venv/share/dlrn/scripts" - dest: "{{ build_repo_dir }}/DLRN" - delegate_to: "{{ inventory_hostname }}" - -- name: Fetch local rdoinfo copy - git: - repo: '{{ artg_rdoinfo_repo_url }}' - dest: '{{ build_repo_dir }}/DLRN/{{ rdoinfo_repo_name }}' - version: 'master' - register: _git_clone - until: _git_clone is success - retries: 3 - delay: 5 - -- name: Remove ssh reference from dist-git url - shell: > - sed -i -e "s|osp-distgit: git+ssh|osp-distgit: git|g" packages.yml - args: - chdir: "{{ build_repo_dir }}/DLRN/{{ rdoinfo_repo_name }}" - when: ansible_distribution in ['RedHat'] - -- name: Use local {{ ansible_distribution }} mirror if available ( centos 7 and RHEL ) - shell: > - set -o pipefail ; - gawk '{ print $0 }; /^# repos$/ { exit }' {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}.cfg - > {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - cat /etc/yum.repos.d/quickstart-{{ ansible_distribution | lower }}-*.repo >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - find /etc/yum.repos.d -name "delorean*repo" ! -name "delorean*build-deps.repo" -exec cat {} \; -exec echo "" \; - >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - find /etc/yum.repos.d -name "CentOS-Stream-*repo" -not -name "CentOS-Stream*Extras-common*repo" -exec cat {} \; -exec echo "" \; - >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - find /etc/yum.repos.d -name "delorean*build-deps.repo" -exec sed 's/enabled=.*/enabled=1/g' {} \; - >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - {% if ansible_distribution in ["RedHat"] and osp_release is defined %} - find /etc/yum.repos.d -name "osptrunk-deps.repo" -exec sed 's/enabled=.*/enabled=1/g' {} \; - >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - {% endif %} - echo '"""' >> {{ build_repo_dir }}/DLRN/scripts/{{ initial_dlrn_config }}-local.cfg; - mkdir -p /tmp/fake-dlrn-repos/current; - touch /tmp/fake-dlrn-repos/delorean-deps.repo; - touch /tmp/fake-dlrn-repos/current/delorean.repo; - when: - - dlrn_use_local_mirrors|bool - -- name: get env variables for changes and default change list - set_fact: - gerrit_host: "{{ lookup('env', 'GERRIT_HOST') }}" - zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}" - artg_change_list: "{{ artg_change_list|default(job.artg_change_list|default([])) }}" - cacheable: true - -- name: Parse Jenkins changes - jenkins_deps: - host: "{{ lookup('env', 'GERRIT_HOST') }}" - change_id: "{{ lookup('env', 'GERRIT_CHANGE_ID') }}" - branch: "{{ lookup('env', 'GERRIT_BRANCH') }}" - patchset_rev: "{{ lookup('env', 'GERRIT_PATCHSET_REVISION') }}" - when: gerrit_host != "" # noqa 602 - -- name: Add Jenkins changes to the change list - set_fact: - artg_change_list: "{{ artg_change_list|union(jenkins_change_list|default([])) }}" - cacheable: true - -# Below is the list of cases needs to handle while constructing zuul change lists to process -# 1. Gerrit change branch is not equal to project branch -# 2. project name should be present in zuul processed change list -- name: construct zuul deps list but don't cache it so it can be reprepared during upgrades - set_fact: - artg_change_list_prep: "{{ artg_change_list_prep|default([]) + [{'host': item.change_url | regex_search('(^https?://.*?)/', '\\1') | first, - 'project': item.project.name, - 'branch': item.branch, - 'refspec': '/'.join(['refs', 'changes', - item.change[-2:], - item.change, - item.patchset]) }] }}" - with_items: "{{ zuul['items'] }}" - when: - - zuul is defined - - "'change_url' in item" - - item.project.name not in artg_change_list_prep|default([]) | map(attribute='project') |list - - >- - (release is defined and release in item.branch) or - (release is not defined and item.branch == zuul.override_checkout | default(zuul.branch)) or - (osp_release is defined and osp_release in item.branch) or - item.project.name in artg_branchless_projects - -- name: Cache artg_change_list if change list is prepared - set_fact: - artg_change_list: "{{ artg_change_list|union(artg_change_list_prep) }}" - cacheable: true - when: artg_change_list_prep is defined - -- name: Detect github PRs from commit message - include: detect_github_pr.yml - -- name: Print out the change list - debug: - var: artg_change_list - -- name: Check loop devices stat - stat: - path: "/dev/loop{{ item }}" - register: stat_loop_devices - with_sequence: start=0 end=11 - -- name: Set loop_devices_absent fact - set_fact: - loop_devices_absent: "{{ stat_loop_devices.results|selectattr('stat.exists','equalto',false)|map(attribute='item')|list }}" - -- name: Clone and build the specific DLRN projects - include: dlrn-build.yml artg_change={{ item }} - with_items: '{{ artg_change_list|default([]) }}' - when: - - '"-distgit" not in item.project' - - item.project not in artg_skipped_projects - - >- - release in item.branch or - (zuul.project.name | default("") == rdoinfo_repo_name) or - (osp_release is defined and osp_release in item.branch) or - item.project in artg_branchless_projects - - '"github.com" not in item.host' - -- name: Build package using DLRN - when: not artg_build_one|bool - block: - - name: Print info about building - debug: - msg: "Building all changes in the patch together" - - - name: Generate DLRN Script - template: - src: run_dlrn.sh.j2 - dest: "{{ build_repo_dir }}/run_dlrn.sh" - mode: 0744 - - - name: Run DLRN - shell: > - set -o pipefail && - {{ build_repo_dir }}/run_dlrn.sh 2>&1 {{ timestamper_cmd }} >> {{ build_repo_dir }}/dlrn.log - args: - chdir: '{{ build_repo_dir }}' - register: repo_built_multi - -- name: Clone and build the Github PRs - include: github-pr.yml artg_change={{ item }} - with_items: '{{ artg_change_list|default([]) }}' - when: - - '"github.com" in item.host' - - item.project in artg_github_projects - -- name: Clean up loop devices created by mock - file: - path: "/dev/loop{{ item }}" - state: absent - become: true - with_items: "{{ loop_devices_absent }}" - -- block: - - name: Create a directory to hold the rpms - file: - path: '{{ build_repo_dir }}/gating_repo' - state: directory - - - name: Copy the generated rpms - shell: > - set -o pipefail && - rm -rf {{ build_repo_dir }}/gating_repo/*; - [[ $(find {{ build_repo_dir }}/DLRN/data/repos -type f -name '*.rpm') ]] && - find {{ build_repo_dir }}/DLRN/data/repos -type f -name '*.rpm' -print0 | xargs -0 cp -t {{ build_repo_dir }}/gating_repo || - echo "no DLRN builds"; - [[ $(find ~/rpmbuild/RPMS/noarch/*collection*.rpm) ]] && - find ~/rpmbuild/RPMS/noarch -type f -name '*collection*.rpm' -print0 | xargs -0 cp -t {{ build_repo_dir }}/gating_repo || - echo "no collection builds"; - - - name: Run createrepo on generated rpms - command: createrepo gating_repo - args: - chdir: '{{ build_repo_dir }}' - - - name: Compress the repo - # noqa 303 - command: 'tar czf {{ artg_compressed_gating_repo }} gating_repo' - args: - chdir: '{{ build_repo_dir }}' - - - name: Trigger repo injection for quickstart - set_fact: - compressed_gating_repo: "{{ artg_compressed_gating_repo }}" - cacheable: true - when: - - >- - artg_rdo_packages|default([])|length > 0 or - ansible_coll_packages|default([])|length > 0 - -- name: Clean up - file: - path: '{{ item }}' - state: absent - with_items: - - '{{ build_repo_dir }}/dlrn-venv' - - '{{ build_repo_dir }}/gating_repo' - when: dlrn_cleanup|bool - -- name: Clean up DLRN if it was cloned by the playbook - file: - path: '{{ build_repo_dir }}/DLRN' - state: absent - when: - - not dlrn_pre_installed|bool - - dlrn_cleanup|bool diff --git a/roles/build-test-packages/templates/build_collection.sh.j2 b/roles/build-test-packages/templates/build_collection.sh.j2 deleted file mode 100644 index 786d0f314..000000000 --- a/roles/build-test-packages/templates/build_collection.sh.j2 +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# PKG_NAME for example: ansible-collection-ansible-posix -export PKG_NAME={{ 'ansible-collection-' + (artg_change.project.split('/')[1].split('.') | join ('-')) }} -# SUP_PKG_NAME for example: ansible.posix -export SUP_PKG_NAME={{ artg_change.project.split('/')[1] }} -export TMPINSTALLDIR=/tmp/${PKG_NAME}-fpm-install -export VERSION=9.9.9 - -rm -rf "${TMPINSTALLDIR}" -mkdir -p ~/rpmbuild/SOURCES/ -mkdir -p "${TMPINSTALLDIR}/${SUP_PKG_NAME}-${VERSION}" -cp -r . ${TMPINSTALLDIR}/${SUP_PKG_NAME}-${VERSION} -tar -zcvf ~/rpmbuild/SOURCES/${PKG_NAME}-${VERSION}.tar.gz -C ${TMPINSTALLDIR} ${SUP_PKG_NAME}-${VERSION} -rpmbuild -bb ${PKG_NAME}-build.spec diff --git a/roles/build-test-packages/templates/projects.ini.j2 b/roles/build-test-packages/templates/projects.ini.j2 deleted file mode 100644 index a9748d476..000000000 --- a/roles/build-test-packages/templates/projects.ini.j2 +++ /dev/null @@ -1,59 +0,0 @@ -[DEFAULT] -datadir=./data -scriptsdir=./scripts -baseurl={{ dlrn_baseurl }} -distro=rpm-master -source=master -target={{ dlrn_target }} -smtpserver= -reponame=delorean -#templatedir=$VIRTUAL_ENV/dlrn/templates -maxretries=3 -{% if osp_release is defined %} -pkginfo_driver=dlrn.drivers.downstream.DownstreamInfoDriver -{% else %} -pkginfo_driver=dlrn.drivers.rdoinfo.RdoInfoDriver -{% endif %} -tags= -rsyncdest= -rsyncport=22 -workers=1 -gerrit_topic=rdo-FTBFS -database_connection=sqlite:///commits.sqlite -fallback_to_master=1 -use_components={{ use_components }} -{% if osp_release is defined %} -# Details about `release_numbering` and `release_minor` can be found at -# at https://dlrn.readthedocs.io/en/latest/installation.html -# There default values are `0.date.hash` and `0` respectively. -# We are only setting these for downstream case when osp_release -# is defined. For downstream case, we are hardcoding release_numbering=minor.date.hash -# and then just set the release_minor value based on the OSP version -# (e.g. 0 for 16/16.0, 1 for 16.1, 2 for 16.2 etc). -release_numbering=minor.date.hash -release_minor={{ '0' if '.' not in osp_release.split('-')[1] else osp_release.split('-')[1].split('.')[1] }} - -[downstream_driver] -info_files=osp.yml -versions_url=https://trunk.rdoproject.org/centos{{ ansible_distribution_major_version }}-{{ release }}/current/versions.csv -downstream_distro_branch={{ osp_release }}{{ '.0' if '.' not in osp_release else '' }}-rhel-8-trunk -downstream_tag=osp-{{ osp_release.split('-')[1] }}{{ '.0' if '.' not in osp_release else '' }} -downstream_distgit_key=osp-distgit -use_upstream_spec=true -downstream_spec_replace_list=^%global with_doc.+/%global with_doc 0,^%global rhosp.*/%global rhosp 1 -{% endif %} - -[gitrepo_driver] -# Options to be specified if pkginfo_driver is set to -# dlrn.drivers.gitrepo.GitRepoDriver -# -#repo=http://github.com/openstack/rpm-packaging -#directory=/openstack -#skip=openstack-macros,keystoneauth1 -#use_version_from_spec=1 - -[mockbuild_driver] -# options to be specified if build_driver is set to -# dlrn.drivers.mockdriver.MockBuildDriver -# We want to prevent the package from being installed in the Mock env -install_after_build=0 diff --git a/roles/build-test-packages/templates/run_dlrn.sh.j2 b/roles/build-test-packages/templates/run_dlrn.sh.j2 deleted file mode 100644 index 6478f18e1..000000000 --- a/roles/build-test-packages/templates/run_dlrn.sh.j2 +++ /dev/null @@ -1,30 +0,0 @@ -set +e - -cd {{ build_repo_dir }}/DLRN -source {{ build_repo_dir }}/dlrn-venv/bin/activate; -{% if artg_build_one|bool %} -export PKG={{ project_name_mapped }} -{% else %} -export PKG="{{ artg_rdo_packages|join(' --package-name ') }}" -{% endif %} -{% if ansible_distribution|lower == "redhat" %} -export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/openssl/ca-bundle.trust.crt -{% endif %} - -while true; do - dlrn --config-file projects.ini --head-only --package-name $PKG --local \ - --info-repo {{ rdoinfo_repo_name }} \ - {% if not artg_build_one|bool %}--order {% endif %}--dev; - if [ $? -eq 0 ]; then - # SUCCESS - break; - elif [ $? -eq 1 ]; then - # FAILED - exit 1; - elif [ $? -eq 2 ]; then - # RETRY - continue; - fi; - # Unexpected DLRN return code - exit $?; -done; diff --git a/roles/build-test-packages/templates/specs/ansible-netcommon-build.spec.j2 b/roles/build-test-packages/templates/specs/ansible-netcommon-build.spec.j2 deleted file mode 100644 index d503d81fa..000000000 --- a/roles/build-test-packages/templates/specs/ansible-netcommon-build.spec.j2 +++ /dev/null @@ -1,40 +0,0 @@ -%global collection_namespace ansible -%global collection_name netcommon - -Name: ansible-collection-%{collection_namespace}-%{collection_name} -Version: 9.9.9 -Release: 999%{?dist} -Summary: Ansible Network Collection for Common Code - -License: GPLv3+ and BSD and Python -URL: %{ansible_collection_url} -Source: https://github.com/ansible-collections/ansible.netcommon/archive/%{version}/%{name}-%{version}.tar.gz - -BuildRequires: (ansible >= 2.9.10 or ansible-core >= 2.11.0) - -BuildArch: noarch - -%description -%{summary}. - -%prep -%autosetup -n ansible.netcommon-%{version} -sed -i -e '/version:/s/null/%{version}/' galaxy.yml -find -type f ! -executable -type f -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' + -rm -fvr tests/integration bindep.txt .yamllint changelogs/fragments/.keep -find -type f -name '.gitignore' -print -delete - -%build -%ansible_collection_build - -%install -%ansible_collection_install - -%files -%license LICENSE -%doc README.md -%{ansible_collection_files} - -%changelog -* Mon Jul 05 2021 Sagi Shnaidman - 9.9.9 -- Clone this spec from: https://src.fedoraproject.org/rpms/ansible-collection-ansible-netcommon/blob/rawhide/f/ansible-collection-ansible-netcommon.spec diff --git a/roles/build-test-packages/templates/specs/ansible-posix-build.spec.j2 b/roles/build-test-packages/templates/specs/ansible-posix-build.spec.j2 deleted file mode 100644 index fcc5e334c..000000000 --- a/roles/build-test-packages/templates/specs/ansible-posix-build.spec.j2 +++ /dev/null @@ -1,40 +0,0 @@ -%global collection_namespace ansible -%global collection_name posix - -Name: ansible-collection-%{collection_namespace}-%{collection_name} -Version: 9.9.9 -Release: 999%{?dist} -Summary: Ansible Collection targeting POSIX and POSIX-ish platforms - -License: GPLv3+ and Python -URL: %{ansible_collection_url} -Source: https://github.com/ansible-collections/ansible.posix/archive/%{version}/%{name}-%{version}.tar.gz - -BuildRequires: (ansible >= 2.9.10 or ansible-core >= 2.11.0) - -BuildArch: noarch - -%description -%{summary}. - -%prep -%autosetup -n ansible.posix-%{version} -rm -fvr tests/{integration,utils} .github changelogs/fragments/.keep {test-,}requirements.txt shippable.yml -rm -fvr .azure-pipelines -find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' + -find -type f -name '.gitignore' -print -delete - -%build -%ansible_collection_build - -%install -%ansible_collection_install - -%files -%license COPYING -%doc README.md -%{ansible_collection_files} - -%changelog -* Mon Jul 05 2021 Sagi Shnaidman - 9.9.9 -- Clone this spec from: https://src.fedoraproject.org/rpms/ansible-collection-ansible-posix/blob/rawhide/f/ansible-collection-ansible-posix.spec diff --git a/roles/build-test-packages/templates/specs/community-general-build.spec.j2 b/roles/build-test-packages/templates/specs/community-general-build.spec.j2 deleted file mode 100644 index b2ccd54ea..000000000 --- a/roles/build-test-packages/templates/specs/community-general-build.spec.j2 +++ /dev/null @@ -1,41 +0,0 @@ -%global collection_namespace community -%global collection_name general - -Name: ansible-collection-%{collection_namespace}-%{collection_name} -Version: 9.9.9 -Release: 999%{?dist} -Summary: Modules and plugins supported by Ansible community - -License: GPLv3+ and BSD and Python -URL: %{ansible_collection_url} -Source: https://github.com/ansible-collections/community.general/archive/%{version}/%{name}-%{version}.tar.gz - -BuildRequires: (ansible >= 2.9.10 or ansible-core >= 2.11.0) - -BuildArch: noarch - -%description -%{summary}. - -%prep -%autosetup -n community.general-%{version} -rm -fvr .github .azure-pipelines -find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' + -find -type f -name '.gitignore' -print -delete -test -f scripts && sed -i -e 's|env python$|env python3|' scripts/inventory/*.py scripts/vault/*.py || echo 'nothing to do' - -%build -%ansible_collection_build - -%install -%ansible_collection_install -rm -vr %{buildroot}%{ansible_collection_files}/%{collection_name}/tests - -%files -%license COPYING -%doc README.md CHANGELOG.rst -%{ansible_collection_files} - -%changelog -* Mon Jul 05 2021 Sagi Shnaidman - 9.9.9 -- Clone this spec from: https://src.fedoraproject.org/rpms/ansible-collection-community-general/blob/rawhide/f/ansible-collection-community-general.spec diff --git a/roles/check-to-build-or-not-to-build/README.md b/roles/check-to-build-or-not-to-build/README.md deleted file mode 100644 index 1fe07670c..000000000 --- a/roles/check-to-build-or-not-to-build/README.md +++ /dev/null @@ -1,32 +0,0 @@ -check-to-build-or-not-to-build -============================== - -An Ansible role created from the original playbook -to decide whether we need to build images. The role -was created to allow this functionality to run on -hosts other than the undercloud. - -This output of this role is a to_build variable, -that is set to true or false to make image build and -other related workflow decisions in later steps. - -Role Variables: ---------------- -* ` default_projects_need_build_list` -- list of repos can affect the image building itelf - -Example Usage -------------- - -```yaml ---- -- name: Decide whether we need to build images - hosts: undercloud - tasks: - - include_role: - name: check-to-build-or-not-to-build -``` - -License -------- - -Apache diff --git a/roles/check-to-build-or-not-to-build/defaults/main.yml b/roles/check-to-build-or-not-to-build/defaults/main.yml deleted file mode 100644 index 484ceed57..000000000 --- a/roles/check-to-build-or-not-to-build/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -default_projects_need_build_list: - - diskimage-builder - - tripleo-image-elements - - tripleo-puppet-elements - - instack-undercloud - - python-tripleoclient - - tripleo-common - - ironic-python-agent diff --git a/roles/check-to-build-or-not-to-build/tasks/main.yml b/roles/check-to-build-or-not-to-build/tasks/main.yml deleted file mode 100644 index cfbd3c121..000000000 --- a/roles/check-to-build-or-not-to-build/tasks/main.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -# The next two tasks make the list of ZUUL_CHANGES look like our build list -# after we cleanup the extra stuff there, we can just intersect the two -# lists in order to match. -- name: Cleanup front of ZUUL_CHANGES - set_fact: - zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES')|regex_replace('openstack/', '') }}" - -- name: Cleanup end of ZUUL_CHANGES - set_fact: - zuul_changes: "{{ zuul_changes|regex_replace(':[a-z/]*:refs/changes/\\d{2}/\\d+/\\d+','') }}" - -- name: Split zuul_changes to a list - set_fact: - zuul_changes: "{{ zuul_changes.split('^') }}" - -- name: compare zuul_changes list to our always_build_list - set_fact: - projects_need_build: "{{ zuul_changes | intersect(projects_need_build_list|default(default_projects_need_build_list)) }}" - -- name: Default to using cached images - set_fact: - to_build: false - cacheable: true - -- name: Build images when we have a change in the always build list - set_fact: - to_build: true - cacheable: true - when: projects_need_build != [] - -- name: Always build images in the periodic and component jobs - set_fact: - to_build: true - cacheable: true - when: lookup('env', 'PERIODIC')|default('0')|int == 1 or job.component is defined diff --git a/roles/container-build/README.md b/roles/container-build/README.md deleted file mode 100644 index 43dc0c023..000000000 --- a/roles/container-build/README.md +++ /dev/null @@ -1,5 +0,0 @@ -container-build -=============== - -This role will deploy a simple Docker registry v2 in a container, -build and push container images into that local registry. diff --git a/roles/container-build/defaults/main.yaml b/roles/container-build/defaults/main.yaml deleted file mode 100644 index 113dd9959..000000000 --- a/roles/container-build/defaults/main.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -# Copyright 2020 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -content_provider_registry_ip: 127.0.0.1 -content_provider_registry_port: 5001 -container_registry_namespace: tripleomaster -container_tag: current-tripleo -container_file: /usr/share/openstack-tripleo-common/container-images/tripleo_containers.yaml -# Notes(chandankumar): openstack- prefix is used from victoria release onwards -docker_prep_prefix: >- - {% if (build_container_images|default(false)|bool and - not job.provider_job|default(false)|bool) or - release not in ['queens', 'pike', 'stein', 'train', 'ussuri'] -%} - openstack - {%- else -%} - {{ ansible_distribution | lower }}-binary - {%- endif -%} -# Temporary pin to 8.2 because of LP #1902846 -containers_base_image: "{{ job.containers_base_image|default('ubi8') }}" -container_registry_image: quay.io/tripleoci/registry:2 -container_registry_image_fallback: quay.rdoproject.org/ceph/registry:2 -container_exclude_distro: "{{ ansible_distribution|lower }}{{ ansible_distribution_major_version}}" -# Extra config needs to be passed to tcib tool -# https://docs.openstack.org/tripleo-ansible/latest/roles/role-tripleo_container_image_build.html#r-o-l-e-d-e-f-a-u-l-t-s -container_extra_config: - tcib_args: - TRIPLEO_ANSIBLE_REQ: /usr/share/openstack-tripleo-common-containers/container-images/kolla/tripleo-ansible-ee/requirements.yaml diff --git a/roles/container-build/meta/main.yaml b/roles/container-build/meta/main.yaml deleted file mode 100644 index 90f744dcd..000000000 --- a/roles/container-build/meta/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Copyright 2020 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -dependencies: - - extras-common diff --git a/roles/container-build/tasks/main.yaml b/roles/container-build/tasks/main.yaml deleted file mode 100644 index 8eec4a4b1..000000000 --- a/roles/container-build/tasks/main.yaml +++ /dev/null @@ -1,147 +0,0 @@ ---- -# Copyright 2020 Red Hat, Inc. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -- name: Deploy the content provider registry - block: - - name: 'Deploy the content provider registry from {{ container_registry_image }}' - become: true - shell: >- - podman run - -d - --network=host - --name docker_registry - -e REGISTRY_HTTP_ADDR="0.0.0.0:{{ content_provider_registry_port }}" - -e REGISTRY_LOG_LEVEL=debug - {{ container_registry_image }} - tags: - - skip_ansible_lint - rescue: - - name: "Deploy the content provider registry from {{ container_registry_image_fallback }}" - become: true - shell: >- - podman run - -d - --network=host - --name docker_registry - -e REGISTRY_HTTP_ADDR="0.0.0.0:{{ content_provider_registry_port }}" - -e REGISTRY_LOG_LEVEL=debug - {{ container_registry_image_fallback }} - tags: - - skip_ansible_lint - -- name: Open port for content provider registry - become: true - command: >- - iptables -I INPUT -p tcp --dport {{ content_provider_registry_port }} -j ACCEPT - changed_when: true - -- name: Set container_image_build_volumes fact - set_fact: - container_image_build_volumes: - - "/etc/yum.repos.d:/etc/distro.repos.d:z" - - "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z" - - "/etc/pki/ca-trust:/etc/pki/ca-trust:z" - when: - - (ansible_distribution == 'RedHat') or (ansible_distribution_major_version|int < 8) - -- name: Set container_image_build_volumes fact for CentOS - set_fact: - container_image_build_volumes: - - "/etc/yum.repos.d:/etc/distro.repos.d:z" - - "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z" - - "/etc/dnf/vars:/etc/dnf/vars:z" - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version|int >= 8 - -- name: Check if /opt/gating_repo exists - stat: - path: /opt/gating_repo - register: gating_stat - -- name: Add gating repo to mount volumes if exists - set_fact: - container_image_build_volumes: - '{{ container_image_build_volumes + ["/opt/gating_repo:/opt/gating_repo:z"] }}' - when: gating_stat.stat.exists|bool - -- name: Include exclude_containers and ci_branch from build-containers role - when: zuul is defined - block: - - - name: Include vars from build-containers to include exclude_containers - include_vars: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-ci'].src_dir }}/roles/build-containers/vars/main.yaml" - - - name: Set ci_branch for building containers check jobs - include_tasks: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-ci'].src_dir }}/roles/build-containers/tasks/set_ci_branch.yml" - - - name: Set branch - set_fact: - branch: "{{ osp_release | default(ci_branch) }}" - -- name: Add tcib_extra params - set_fact: - tcib_extras: - - "tcib_release={{ ansible_distribution_major_version }}" - - "tcib_python_version={{ (ansible_distribution_major_version|int < 9) | ternary ('3.6', '3.9') }}" - when: release not in ['train', 'ussuri', 'victoria'] - -- name: Add tcib extra config params - when: - - container_extra_config is defined - - release not in ['train', 'wallaby'] - block: - - name: Generate config params - copy: - dest: "{{ ansible_user_dir }}/extra_config.yaml" - content: | - {{ container_extra_config | to_nice_yaml }} - - - name: Set tcib config params - set_fact: - tcib_extra_config: "{{ ansible_user_dir }}/extra_config.yaml" - - -- name: Build and push container images to the local registry - collections: - - tripleo.operator - include_role: - name: tripleo_container_image_build - vars: - # TODO(tkajinam): With Ansible 2.14, the playbook triggered by the command - # gets stuck if -vvv is set. We temporarily remove --debug - # as a workaround until we find out the appropriate fix. - # https://github.com/ansible/ansible-runner/issues/1164 - # tripleo_container_image_build_debug: true - tripleo_container_image_build_generate_scripts: true - tripleo_container_image_build_namespace: "{{ container_registry_namespace }}" - tripleo_container_image_build_tag: "{{ container_tag }}" - tripleo_container_image_build_push: true - tripleo_container_image_build_registry: "{{ content_provider_registry_ip }}:{{ content_provider_registry_port }}" - tripleo_container_image_build_rhel_modules: "{{ rhel_modules|default('') }}" - tripleo_container_image_build_volumes: "{{ container_image_build_volumes }}" - tripleo_container_image_build_work_dir: "{{ working_dir }}/container-builds" - tripleo_container_image_build_prefix: "{{ docker_prep_prefix }}" - tripleo_container_image_build_timeout: 10000 - tripleo_container_image_build_base: "{{ containers_base_image }}" - tripleo_container_image_build_excludes: "{{ exclude_containers[branch][container_exclude_distro]|default([]) }}" - tripleo_container_image_build_tcib_extras: "{{ tcib_extras | default([]) }}" - tripleo_container_image_build_extra_config: "{{ tcib_extra_config | default('') }}" - tripleo_container_image_build_distro: "{{ (ansible_distribution == 'RedHat') | ternary('rhel', 'centos') }}" - -- name: Pull and push non *tripleo* container images to local registry - import_tasks: non_tripleo_containers.yml - when: job.provider_job|default(false)|bool diff --git a/roles/container-build/tasks/non_tripleo_containers.yml b/roles/container-build/tasks/non_tripleo_containers.yml deleted file mode 100644 index df0ca720e..000000000 --- a/roles/container-build/tasks/non_tripleo_containers.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -- name: Filter non-tripleo containers - when: osp_release is not defined - block: - - - name: Fetch tripleo containers - command: cat "{{ container_file }}" - register: all_containers - changed_when: false - - - name: Store tripleo containers - set_fact: - containers: "{{ all_containers.stdout | from_yaml }}" - - - name: Filter out non-tripleo containers - set_fact: - non_tripleo_containers: "{{ containers.container_images | json_query('[?image_source != `tripleo`]') }}" - - - name: Filter out non-tripleo containers excluding kolla image_source - set_fact: - non_tripleo_containers: "{{ non_tripleo_containers | json_query('[?image_source != `kolla`]') }}" - when: release in ["train"] - - - name: Store non-tripleo containers - set_fact: - non_tripleo_containers: "{{ non_tripleo_containers | map(attribute='imagename') | list }}" - -- name: Override non-tripleo containers for Downstream CI - set_fact: - non_tripleo_containers: "{{ downstream_ci_non_tripleo_containers | default([]) }}" - when: osp_release is defined - -- name: Print non-tripleo containers - debug: - msg: "{{ non_tripleo_containers }}" - -- name: "Pull containers from {{ docker_registry_host }}" - become: true - command: 'podman pull {{ item }}' - register: pull_success - changed_when: true - ignore_errors: true - loop: "{{ non_tripleo_containers }}" - -- name: List down missing containers - set_fact: - missing_containers: "{{ missing_containers | default([]) + [pull_output.item] }}" - when: pull_output is failed - loop: "{{ pull_success.results }}" - loop_control: - loop_var: pull_output - -- name: Pull failed containers from RDO registry - become: true - command: "podman pull docker://quay.rdoproject.org/ceph/{{ item.split('/')[-1] }}" - register: rdo_pull_success - ignore_errors: true - loop: "{{ missing_containers }}" - changed_when: true - when: - - missing_containers | default([]) | length > 0 - - osp_release is not defined - -- name: Fallback to docker.io registry - when: - - rdo_pull_success is not skipped - - rdo_pull_success is failed - - missing_containers | default([]) | length > 0 - - osp_release is not defined - block: - - - name: List down missing containers - set_fact: - rdo_missing_containers: "{{ rdo_missing_containers | default([]) + [ pull_output.item] }}" - when: pull_output is failed - loop: "{{ rdo_pull_success.results }}" - loop_control: - loop_var: pull_output - - - name: Pull failed containers from dockerhub - become: true - command: "podman pull {{ item.split('/')[-1] }}" - register: docker_pull_success - loop: "{{ rdo_missing_containers }}" - changed_when: true - ignore_errors: true - when: rdo_missing_containers | default([]) | length > 0 - - - name: Fail the job on failure of all fallback registry - when: - - docker_pull_success is not skipped - - docker_pull_success is failed - block: - - - name: List down missing containers - set_fact: - docker_missing_containers: "{{ docker_missing_containers | default([]) + [pull_output.item] }}" - when: pull_output is failed - loop: "{{ docker_pull_success.results }}" - loop_control: - loop_var: pull_output - - - name: Fail the job if missing containers exists - fail: - msg: "Failed to pull following containers: {{ docker_missing_containers }}" - when: docker_missing_containers | default([]) | length > 0 - -- name: Push non-tripleo containers to the content provider registry - become: true - block: - - - name: Make sure buildah is installed - package: - name: "buildah" - state: present - - # NOTE(mwhahaha): use buildah because --format can only be specified with buildah push. - # Additionally we could switch to oci, but v2v2 is what we convert on the undercloud. - - name: Push non-tripleo containers (ceph, alertmanager, prometheus) to the content provider registry - shell: > - buildah push --format=v2s2 --tls-verify=False --log-level debug \ - $(buildah images -q {{ item.split('/')[-1] }}) \ - docker://{{ content_provider_registry_ip }}:{{ content_provider_registry_port }}/{{ docker_registry_namespace }}/{{ item.split('/')[-1] }}; - with_items: "{{ non_tripleo_containers }}" - retries: 3 - delay: 5 - register: non_tripleo - until: non_tripleo is not failed - changed_when: false - tags: - - skip_ansible_lint - -- name: Dump non-tripleo containers output to file - local_action: - module: copy - content: "{{ non_tripleo }}" - dest: "{{ ansible_user_dir }}/non_tripleo_containers.log" - when: non_tripleo is defined diff --git a/roles/container-prep/README.md b/roles/container-prep/README.md deleted file mode 100644 index 649588fd6..000000000 --- a/roles/container-prep/README.md +++ /dev/null @@ -1,9 +0,0 @@ -container-prep -============== - -The containers used by TripleO are now in use in multiple parts of the -workflow. This role is a common role for containers that can be used -to setup either for the undercloud, standalone or overcloud-prep-containers. - -Role Variables --------------- diff --git a/roles/container-prep/defaults/main.yml b/roles/container-prep/defaults/main.yml deleted file mode 100644 index dad32e291..000000000 --- a/roles/container-prep/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -update_containers: false diff --git a/roles/container-prep/meta/main.yml b/roles/container-prep/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/container-prep/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/container-prep/tasks/main.yml b/roles/container-prep/tasks/main.yml deleted file mode 100644 index 7c675fd4c..000000000 --- a/roles/container-prep/tasks/main.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -# Conditional facts to be set which are common to undercloud and overcloud - -# confirmed variables for deploy and mixed upgrade -# GOOD -# docker_registry_namespace -# http://opendev.org/openstack/tripleo-quickstart/tree/config/release/tripleo-ci/CentOS-7/master-undercloud-queens-overcloud.yml - -- name: set docker_registry_namespace_used - set_fact: - docker_registry_namespace_used: "{{ docker_registry_namespace }}" - tags: - - undercloud-install - -# get_build_command is passing the current hash -# plus the latest dlrn hash and I'm not sure why -# http://opendev.org/openstack/tripleo-ci/tree/roles/run-test/templates/oooq_common_functions.sh.j2#n155 -- when: get_build_command is defined - block: - - name: execute build_command - shell: | - echo {{ get_build_command }} # noqa 305 - register: build_command_output - tags: - - undercloud-install - - - name: set container_build_id from get_build_command - set_fact: - container_build_id: "{{ build_command_output.stdout }}" - cacheable: true - tags: - - undercloud-install - -# docker_image_tag is set to the dlrn hash but uses the tag -# as a backup default -# "{{ dlrn_hash|default(dlrn_hash_tag) }}" -- name: set container_build_id from docker_image_tag - set_fact: - container_build_id: "{{ docker_image_tag }}" - cacheable: true - when: get_build_command is not defined - tags: - - undercloud-install - -# docker_image_tag is set to the dlrn hash newest but uses the tag -# as a backup default -# container_build_id needs to be set to dlrn_hash_newest in downstream -# minor update job before update to pull correct container images from -# registry -- name: set container_build_id from dlrn_hash_newest - set_fact: - container_build_id: "{{ dlrn_hash_newest | default(dlrn_hash_tag_newest) }}" - cacheable: true - when: - - get_build_command is not defined - - override_docker_image_tag|default(false)|bool - tags: - - undercloud-upgrade - - overcloud-update - -# overcloud_docker_image_tag is set to overcloud_dlrn_hash -# I don't see where overcloud_dlrn_hash is set -# http://codesearch.openstack.org/?q=overcloud_dlrn_hash&i=nope&files=&repos= -- name: set mixed upgrade container_build_id - set_fact: - container_build_id: "{{ overcloud_docker_image_tag }}" - docker_registry_namespace_used: "{{ overcloud_docker_registry_namespace }}" - cacheable: true - when: - - container_build_id is not defined - - use_overcloud_mixed_upgrade|default(false)|bool - tags: - - undercloud-install - -- name: Set update_containers_append_tag for the play - set_fact: - update_containers_append_tag: "{{ lookup('pipe','date +-updated-%Y%m%d%H%M%S') }}" - cacheable: true - when: - - update_containers_append_tag is undefined - - (update_containers is defined and update_containers|bool) or (standalone_container_prep_updates is defined and standalone_container_prep_updates|bool) - - not build_container_images|default(false)|bool - - not job.consumer_job | default(false) | bool - tags: - - undercloud-install - -- name: echo container_build_id - debug: - var: container_build_id - tags: - - undercloud-install - -- name: Remove old container_build_id file - become: true - file: - state: absent - dest: /tmp/container_build_id - tags: - - undercloud-install - -- name: Save container_build_id on disk - copy: - content: "{{ container_build_id }}" - dest: /tmp/container_build_id - tags: - - undercloud-install diff --git a/roles/container-update/README.md b/roles/container-update/README.md deleted file mode 100644 index bbbad8943..000000000 --- a/roles/container-update/README.md +++ /dev/null @@ -1,13 +0,0 @@ -container-update -================ - -This role levarages from the container-prep role which updates the needed -parameters to set up the containers-prepare-parameter file and updates with -the right values. It is mostly intended for upgrades and updates workflows in -which we need to update the containers registry details before performing the -upgrade. - -Role Variables --------------- - -- containers_file: -- File containing the ContainerImagePrepare definition. diff --git a/roles/container-update/defaults/main.yml b/roles/container-update/defaults/main.yml deleted file mode 100644 index 05940ca26..000000000 --- a/roles/container-update/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -containers_file: containers-prepare-parameter.yaml diff --git a/roles/container-update/meta/main.yml b/roles/container-update/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/container-update/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/container-update/tasks/main.yml b/roles/container-update/tasks/main.yml deleted file mode 100644 index 4f0173022..000000000 --- a/roles/container-update/tasks/main.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: "Check if {{ containers_file }} exists" - stat: - path: "{{ working_dir }}/{{ containers_file }}" - register: stat_cont_file - -- name: "Render {{ containers_file }} if it doesn't exist." - include_role: - name: undercloud_deploy - tasks_from: create-scripts.yml - when: not stat_cont_file.stat.exists - -- name: "Substitute containers registry to {{ docker_registry_host|default('nothing') }}/{{ docker_registry_namespace_used|default('nothing') }}" - replace: - path: "{{ working_dir }}/{{ containers_file }}" - regexp: '^(\s*namespace:).*' - replace: "\\1 {{ docker_registry_host }}/{{ docker_registry_namespace_used }}" - when: - - docker_registry_host is defined - - docker_registry_namespace_used is defined - -- name: "Substitute tag to {{ container_build_id|default('nothing') }}" - replace: - path: "{{ working_dir }}/{{ containers_file }}" - regexp: '^(\s*tag:).*' - replace: "\\1 {{ container_build_id }}" - when: container_build_id is defined - -- name: "Substitute name_prefix to {{ docker_prep_prefix|default('nothing') }}" - replace: - path: "{{ working_dir }}/{{ containers_file }}" - regexp: '^(\s*name_prefix:).*' - replace: "\\1 {{ docker_prep_prefix }}" - when: docker_prep_prefix is defined - -- name: "Substitute ceph_namespace to {{ docker_ceph_image|default('nothing') }}" - replace: - path: "{{ working_dir }}/{{ containers_file }}" - regexp: '^(\s*ceph_namespace:).*' - replace: "\\1 {{ docker_ceph_namespace }}" - when: docker_ceph_namespace is defined - -- name: "Substitute ceph_tag to {{ docker_ceph_tag|default('nothing') }}" - replace: - path: "{{ working_dir }}/{{ containers_file }}" - regexp: '^(\s*ceph_tag:).*' - replace: "\\1 {{ docker_ceph_tag }}" - when: docker_ceph_tag is defined diff --git a/roles/create-zuul-based-reproducer/README.md b/roles/create-zuul-based-reproducer/README.md deleted file mode 100644 index 2d1a8db32..000000000 --- a/roles/create-zuul-based-reproducer/README.md +++ /dev/null @@ -1,85 +0,0 @@ -create-zuul-based-reproducer -============================ - -This role creates a launcher-playbook and a wrapper Bash script to -allow users to reproduce CI jobs using a local Zuul installation. - -Role Variables --------------- - -For the defaults of these variables, see the defaults/main.yml file in this role. - -* reproducer_zuul_based_quickstart_script: Bash script to kick the generated launcher playbook -* reproducer_zuul_based_quickstart_readme_file: The documentation file with user instructions -* reproducer_zuul_based_launcher_playbook: Template to create a launcher playbook with variable -to reproduce the job run -* launcher_env_setup_playbook: Template to create a playbook to set up the launcher environment -From the extras-common role: -* artcl_collect_dir: "{{ local_working_dir }}/collected_files" - -Dependencies ------------- - -The role is run within the collect-logs role. - -Example Playbook ----------------- - -This role generates a launcher-playbook and overrides RPM and PyPi mirrors for Centos 8: - -- hosts: localhost - tasks: - - name: Add the localhost to the inventory - add_host: - name: "localhost" - groups: "localhost" - ansible_host: 127.0.0.1 - ansible_connection: local - - - name: Add the primary to the inventory - add_host: - name: "localhost" - groups: "primary" - ansible_fqdn: "localhost" - ansible_user: "{{ lookup('env', 'USER') }}" - ansible_private_key_file: "/home/{{ ansible_user }}/.ssh/{{ user_pri_key | default('id_rsa') }}" - ansible_host: "localhost" - -- import_playbook: playbooks/pre.yaml - -- hosts: localhost - vars: - depends_on: - - https://review.opendev.org/xxxxxx - zuul_yaml: >- - - project: - check: - jobs: - - tripleo-ci-centos-7-multinode-1ctlr-featureset010-dlrn-hash-tag - - - job: - name: tripleo-ci-centos-7-multinode-1ctlr-featureset010-dlrn-hash-tag - parent: tripleo-ci-centos-7-multinode-1ctlr-featureset010 - vars: - mirror_fqdn: mirror.mtl01.inap.opendev.org - package_mirror: http://mirror.centos.org/centos - pypi_fqdn: mirror01.ord.rax.opendev.org - featureset_override: - dlrn_hash_tag: - 8127e43f39ac9b9e14d4a5a10bcbf41f122f32d7_d2efe5df - dlrn_hash_tag_newest: - ca4990cebac0be87ee4a7273f519574bc1027c8f_a1ff18dc - tasks: - - include_role: - name: ansible-role-tripleo-ci-reproducer - - -License -------- - -Apache 2.0 - -Author Information ------------------- - -OpenStack diff --git a/roles/create-zuul-based-reproducer/defaults/main.yml b/roles/create-zuul-based-reproducer/defaults/main.yml deleted file mode 100644 index 8d8383177..000000000 --- a/roles/create-zuul-based-reproducer/defaults/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -reproducer_zuul_based_quickstart_script: reproducer-zuul-based-quickstart.sh.j2 -reproducer_fresh_box_setup_script: reproducer-fresh-box-setup.sh.j2 -reproducer_zuul_based_quickstart_readme_file: "{{ artcl_collect_dir }}/README-reproducer.html" -reproducer_zuul_based_launcher_playbook: launcher-playbook.yaml.j2 -launcher_env_setup_playbook: launcher-env-setup-playbook.yaml.j2 -zuul_reproducer_dir: reproducer-quickstart -mirror_path: mirror.mtl01.inap.opendev.org diff --git a/roles/create-zuul-based-reproducer/meta/main.yml b/roles/create-zuul-based-reproducer/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/create-zuul-based-reproducer/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/create-zuul-based-reproducer/tasks/main.yml b/roles/create-zuul-based-reproducer/tasks/main.yml deleted file mode 100644 index cf57769c7..000000000 --- a/roles/create-zuul-based-reproducer/tasks/main.yml +++ /dev/null @@ -1,109 +0,0 @@ ---- -- name: Check if collect directory exists - stat: - path: "{{ artcl_collect_dir }}" - register: collect_dir - -- name: Create collect directory - file: - path: "{{ artcl_collect_dir }}" - state: directory - when: not collect_dir.stat.exists - -- name: Create the reproducer-quickstart directory - file: - path: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}" - state: directory - -- name: Create the reproducer-quickstart/scripts directory - file: - path: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/scripts" - state: directory - -- name: Copy the generated toci templates and files - copy: - src: "/home/{{ undercloud_user }}/src/opendev.org/openstack/tripleo-ci/{{ item }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/{{ item }}" - mode: 0755 - with_items: - - "toci_gate_test.sh" - - "toci_quickstart.sh" - - "scripts/common_vars.bash" - - "scripts/oooq_common_functions.sh" - -- name: Check if featureset-override exists - stat: - path: "/home/{{ undercloud_user }}/src/opendev.org/openstack/tripleo-ci/featureset-override.yaml" - register: featureset_override_file - -- name: Add the featureset-override if it exists - copy: - src: "/home/{{ undercloud_user }}/src/opendev.org/openstack/tripleo-ci/featureset-override.yaml" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/featureset-override.yaml" - mode: 0755 - when: featureset_override_file.stat.exists - -- name: Check if releases.sh file exits - stat: - path: '/home/{{ undercloud_user }}/workspace/logs/releases.sh' - register: releases_file_result - -- name: Get releases.sh file output - set_fact: - releases_file_output: | - {{ lookup('file', '/home/{{ undercloud_user }}/workspace/logs/releases.sh') | replace('export' , ' export') }} - when: releases_file_result.stat.exists - -- name: Get featureset-override file output - set_fact: - featureset_override_file_output: | - {{ lookup('file', '/home/{{ undercloud_user }}/src/opendev.org/openstack/tripleo-ci/featureset-override.yaml') }} - when: featureset_override_file.stat.exists - -- name: Create the zuul-based launcher-env-setup-playbook from template - template: - src: "{{ launcher_env_setup_playbook }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/launcher-env-setup-playbook.yaml" - mode: 0755 - -- name: Create the zuul-based launcher-playbook from template - template: - src: "{{ reproducer_zuul_based_launcher_playbook }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/launcher-playbook.yaml" - mode: 0755 - -- name: Create the zuul-based reproducer file from template - template: - src: "{{ reproducer_zuul_based_quickstart_script }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/reproducer-zuul-based-quickstart.sh" - mode: 0755 - -- name: Create the reproducer-fresh-box-setup script - template: - src: "{{ reproducer_fresh_box_setup_script }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/reproducer-fresh-box-setup.sh" - mode: 0755 - -- name: Copy the tripleo-quickstart install-deps script - copy: - src: "/home/{{ undercloud_user }}/src/opendev.org/openstack/tripleo-quickstart/{{ item }}" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/{{ item }}" - mode: 0755 - with_items: - - "install-deps.sh" - -- name: Tar the files needed for the zuul-based reproducer script - archive: - path: - - "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/launcher-env-setup-playbook.yaml" - - "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/launcher-playbook.yaml" - - "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/reproducer-zuul-based-quickstart.sh" - - "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/install-deps.sh" - - "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/reproducer-fresh-box-setup.sh" - dest: "{{ artcl_collect_dir }}/{{ zuul_reproducer_dir }}/reproducer-zuul-based-quickstart.tar" - mode: 0755 - -- name: Create zuul-based reproducer script documentation from template - template: - src: README-reproducer-zuul-based-quickstart.html.j2 - dest: "{{ reproducer_zuul_based_quickstart_readme_file }}" diff --git a/roles/create-zuul-based-reproducer/templates/README-reproducer-zuul-based-quickstart.html.j2 b/roles/create-zuul-based-reproducer/templates/README-reproducer-zuul-based-quickstart.html.j2 deleted file mode 100644 index f0efa590c..000000000 --- a/roles/create-zuul-based-reproducer/templates/README-reproducer-zuul-based-quickstart.html.j2 +++ /dev/null @@ -1,326 +0,0 @@ - - - -WARNING - WIP - NOT FOR GENERAL USE - README for Quickstart Job Zuul-based Reproducer Script - - - - - -

WARNING - WIP - NOT FOR GENERAL USE - How to reproduce a job result using the Zuul-based reproducer playbooks and script

-

Check the top-level logs directory for a tar file reproducer-zuul-based-quickstart.tar. -This tar archive contains three files: -

    -
  • launcher-env-setup-playbook.yaml - a playbook to clone repos and set up -an Ansible environment to launch jobs
  • -
  • launcher-playbook.yaml - a playbook that installs and starts up Zuul, Gerrit and -other required services, and also creates and launches a reproducer job using -the same dlrn hashes as in CI
  • -
  • reproducer-zuul-based-quickstart.sh - a Bash script to provide an interface -to run the above playbooks with various options
  • -
-Running these playbooks will set up Zuul, Gerrit, and related services in containers -on the local system, and will then create a reproducer job which can be run on a -cloud personal tenant or via libvirt on the local system. -If no reproducer-zuul-based-quickstart.tar file is found, that usually means an -infra failure before Quickstart could start or a problem in collecting logs. -Check on IRC OFTC channel #tripleo to see if there's an ongoing infra -issue.

- - -
-

-To setup and run the reproducer you must first decide where it will run -- on a pet (your laptop) or on cattle (rdo-cloud vm or other -temporary environment)? For each case see notes below for required setup. - -

-If this is the first time you are running the reproducer you must -ensure you have an externally routable network in your RDO-cloud tenant called -'private'. That is you will need a router attached to the external network that -is also attached to your network called 'private' (which you may need to create). -Assuming you have a clouds.yaml that let's you talk to RDO cloud you can use -the following commands to create the required setup: -

-
-    openstack --os-cloud rdo-cloud network create private
-    openstack --os-cloud rdo-cloud subnet create private --network private --gateway 192.168.0.1 --subnet-range 192.168.0.0/24
-    openstack --os-cloud rdo-cloud router create privaterouter
-    openstack --os-cloud rdo-cloud router set --external-gateway 38.145.32.0/22  privaterouter
-    openstack --os-cloud rdo-cloud router add subnet privaterouter private
-
-
-

- -Alternatively log in to RDO cloud horizon and create the network and router -that way. - -
-

Cattle

-If you're using a temporary environment like RDO-cloud vm to run the -reproducer you can use the script inside the reproducer-quickstart/ directory -from the logs of the job you are reproducing. The script is acalled -reproducer-fresh-box-setup.sh: - -

-    curl -o reproducer-fresh-box-setup.sh http://logs.openstack.org/79/657779/2/check/tripleo-ci-centos-7-containers-multinode/67d8eb6/logs/reproducer-quickstart/reproducer-fresh-box-setup.sh
-    chmod 775 reproducer-fresh-box-setup.sh
-    ./reproducer-fresh-box-setup.sh -u marios -p password -c reprozuul
-
- -

note: If you're using an RDO-cloud vm be sure to use at least m1.large2 -flavour as we've hit hard disk limits with m1.large

-

There are two required parameters -u USER and -p PASS -which correspond to the RDO cloud username and password. These are written to -the generated $HOME/.config/openstack/clouds.yaml file expected by the -reproducer. -

-

This script creates the default user 'reprozuul' with passwordless sudo -privileges, creates $HOME/.config/openstack/clouds.yaml with the -u USER and --p PASS parameters and creates the required ssh keypair. It must run as root, -or as a user with passwordless sudo. -

-

The script finally switches to the newly created user and outputs the newly -created public key. You must upload this key to gerrit (both -opendev.org as well -as rdoproject.org). -

-
-

Pet

- -If you are running the reproducer on a non-transient machine, that is your -laptop or any other box which isn't temporary (a pet), then you need: - -
    -
  • Ensure user running reproducer has passwordless sudo
  • -
  • That user has $HOME/.config/openstack/clouds.yaml with "rdo-cloud" entry
  • -
  • A ssh keypair generated with -m PEM -t rsa and uploaded - to gerrit (both opendev.org - as well as rdoproject.org). -
  • -
  • A externally routable network in your RDO-cloud tenant named 'private'. - See example commands above if you need to create this or log in to - RDO cloud horizon and verify your setup or create as needed. -
- -You only need to do these things once on your pet and then rerun reproducer or -update as needed. - -
    -
  • Example clouds.yaml:
  • -
    -CLOUDS_YAML_PATH=$HOME/.config/openstack/
    -mkdir -p $CLOUDS_YAML_PATH
    -/bin/bash -c "cat <>$CLOUDS_YAML_PATH/clouds.yaml
    -clouds:
    -  rdo-cloud:
    -    identity_api_version: 3
    -    region_name: regionOne
    -    auth:
    -      auth_url: https://phx2.cloud.rdoproject.org:13000/v3
    -      password: $RDO_PASS
    -      project_name: $RDO_USER
    -      username: $RDO_USER
    -      user_domain_name: Default
    -      project_domain_name: Default
    -    regions:
    -    - name: regionOne
    -      values:
    -        networks:
    -        - name: 38.145.32.0/22
    -          routes_externally: true
    -        - name: private
    -EOF"
    -
    -
    -
-
    -
    -
  • Create an ssh key pair without a pass phrase:
  • -
      -
    • The ssh key pair is configurable - see variables ssh_path - user_pri_key. The default key is:~/.ssh/id_rsa[.pub]
    • -
    • Note: Use the following to create keys: ssh-keygen -m PEM -t rsa - See FAQ below for more information about ssh keys requirements. -
    -
-
-
- - -
-

-wget or curl the reproducer-quickstart/reproducer-zuul-based-quickstart.tar file. -


-    curl -Lo reproducer-zuul-based-quickstart.tar http://logs.openstack.org/79/657779/2/check/tripleo-ci-centos-7-standalone-upgrade/92fd476/logs/reproducer-quickstart/reproducer-zuul-based-quickstart.tar
-    tar -xvf reproducer-zuul-based-quickstart.tar
-
-One of the extracted files is the script called ./reproducer-zuul-based-quickstart.sh -and you can run it with --help to see available options. -
-
-Note: If the local $USERNAME does not match the gerrit user IDs for -opendev.org or - rdoproject.org) -then you will need to supply the -ug (upstream gerrit) and -rg (rdo gerrit) -parameters: - -
    -
-

-    mkdir WORKSPACE
-    ./reproducer-zuul-based-quickstart.sh --workspace WORKSPACE -ug slim_shady -rg slim_shadier
-
-

-Monitor the output and follow any instructions - for example the script will -exit and require re-run once the user is added to the docker group. -
-
-
- - -
-

-The Bash script is not required although it is the supported path. -The playbooks can be run directly using ansible-playbook. -The Bash script contains some package installation and Docker user/group setup -that you will need to cover prior to running the playbooks directly. -Please see the Bash scripts for details, especially if you are running the -reproducer for the first time on the local environment. -The playbooks can be run as follows: -

    -
  • Note that the launcher-env-setup-playbook.yaml will clone -repos and set up 'roles', 'playbooks', and 'library' directories -from which the tasks will be executed.
  • -
  • ansible-playbook ./launcher-env-setup-playbook.yaml
  • -
  • ansible-playbook ./launcher-playbook.yaml $OPTIONS
  • -
-The launcher-playbook.yaml includes comments on how to run the playbook -with the same options listed in the Bash script section above. -

-
- - -
-

-The reproducer can be launched such that if there is an error the environment will -remain up and running available to the developer to debug. - -

    -
  • For example:
  • - -
-
  • cd ~/tripleo-ci-reproducer
  • -
  • docker-compose exec scheduler zuul autohold --tenant tripleo-ci-reproducer --job tripleo-ci-centos-7-standalone --reason debug --project test1
  • -

    -
    - - -
    -

    - -

      -
    • The Bash scripts runs with --tags all passed to the -launcher-playbook.yaml. -
    • -
    • -After the initial docker setup has run, it is not necessary to run through -those setup steps for every reproducer. The launcher-playbook.yaml -can be run with --skip-tags start after the initial run. -
    • -

      -
    - - -
    -

    -The launcher-playbook.yaml will create and push a job -to a test1 testproject repo in a temp directory. This job will start and the -related Zuul infrastructure logs can be viewed in:
    -

    -cd ~/tripleo-ci-reproducer
    -docker-compose logs --tail=10 -f
    -# Just view the scheduler and executor logs:
    -docker-compose logs --tail=10 -f scheduler executor
    -
    -
    -To see the job progress, you can access the web consoles of: -
      -
    • Gerrit: http://localhost:8080
    • -
    • Zuul: http://localhost:9000
    • -
    • Logs: http://localhost:8000
    • -
    -If you are accessing a remote machine, replace localhost with the ip address. -

    -
    - - -
    -

    -

      -
    • Gerrit keys
      -If your ssh keys have being created with a new version of OpenSSH, Zuul will -fail when running with these keys as there is a Paramiko bug [1]. -It is recommended that keys be generated as follows: -ssh-keygen -m PEM -t rsa - accepting the passwordless option. -Then update the public keys used with Gerrit upstream and RDO Gerrit.
      -[1] https://storyboard.openstack.org/#!/story/2004842
    • -
    -
      -
    • If you currently do not have access to upstream-cloudinit-[centos-7, fedora-28] :
    • - -
      -source the openrc from the openstack-nodepool tenant
      -openstack image list | grep upstream-cloudinit
      -glance member-create ${IMAGE_ID} ${YOUR_TENANT_ID}
      -glance member-create ${IMAGE_ID} ${YOUR_TENANT_ID}
      -
      -
      -
    -

    -

    -
    - - - - - diff --git a/roles/create-zuul-based-reproducer/templates/launcher-env-setup-playbook.yaml.j2 b/roles/create-zuul-based-reproducer/templates/launcher-env-setup-playbook.yaml.j2 deleted file mode 100644 index 253518736..000000000 --- a/roles/create-zuul-based-reproducer/templates/launcher-env-setup-playbook.yaml.j2 +++ /dev/null @@ -1,67 +0,0 @@ -# This playbook will clone repos and set up a directory -# structure for running the launcher-playbook to start -# the Zuul-based reproducer and run a job. - -{% raw %} -- name: setup - hosts: localhost - tasks: - - name: Create directory structure - file: - path: "{{ item }}" - state: directory - with_items: - - git - - roles - - library - - playbooks/tripleo-ci-reproducer - - - name: Clone repos needed for reproducer - git: - repo: https://opendev.org/openstack/tripleo-quickstart.git - dest: "git/tripleo-quickstart" - version: 'FETCH_HEAD' - accept_hostkey: true - update: no - refspec: "{{ ooo_quickstart_refspec | default('HEAD') }}" - - - name: Clone ansible role for reproducer - git: - repo: https://github.com/rdo-infra/ansible-role-tripleo-ci-reproducer.git - dest: "git/ansible-role-tripleo-ci-reproducer" - version: 'FETCH_HEAD' - accept_hostkey: true - update: no - refspec: "{{ reproducer_role_refspec | default('HEAD') }}" - - - name: Copy roles and libraries for tripleo-quickstart - synchronize: - src: 'git/tripleo-quickstart/{{ item }}/' - dest: '{{ item }}/' - with_items: - - roles - - library - - - name: Copy setup files from tripleo-quickstart - synchronize: - src: 'git/tripleo-quickstart/{{ item }}' - dest: "./{{ item }}" - with_items: - - install-deps.sh - - - name: requirements from ansible-role-tripleo-ci-reproducer - synchronize: - src: 'git/ansible-role-tripleo-ci-reproducer/{{ item }}' - dest: './{{ item }}' - with_items: - - bindep.txt - - requirements.txt - - - name: Copy ansible-role-tripleo-ci-reproducer roles and playbooks - synchronize: - src: 'git/ansible-role-tripleo-ci-reproducer{{ item.src_dir }}' - dest: '{{ item.dest_dir }}/' - with_items: - - { src_dir: '', dest_dir: 'roles' } - - { src_dir: '/playbooks/tripleo-ci-reproducer/', dest_dir: 'playbooks/tripleo-ci-reproducer' } -{% endraw %} diff --git a/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 b/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 deleted file mode 100644 index a83c5b302..000000000 --- a/roles/create-zuul-based-reproducer/templates/launcher-playbook.yaml.j2 +++ /dev/null @@ -1,138 +0,0 @@ -# First install Ansible and run the launcher-env-setup-playbook. -# -# From the same dir, run: -# >> ansible-playbook launcher-playbook.yaml -vv -# -# To run the libvirt option (available for non-OVB jobs): -# Clone https://github.com/openstack/tripleo-quickstart and run: -# >> ansible-playbook launcher-playbook.yaml \ -# -e nodepool_provider=libvirt \ -# -e mirror_path=mirror.mtl01.inap.opendev.org -# -# To split mirror_path into different values for packages and pypi, use f.e.: -# ... -# -e mirror_fqdn=mirror.mtl01.inap.opendev.org \ -# -e package_mirror=http://mirror.centos.org/centos -# -e pypi_fqdn=mirror.mtl02.inap.opendev.org \ -# -# To run on a different cloud defined in clouds.yaml ( default is rdo-cloud): -# >> ansible-playbook launcher-playbook.yaml \ -# -e cloud_name='' -# -# To run with a different clouds.yaml -# >> ansible-playbook launcher-playbook.yaml \ -# -e clouds_yaml_path='' -# -# To force the job into failing status in order to hold the nodes (temporary option): -# >> ansible-playbook launcher-playbook.yaml \ -# -e force_post_failure=true -# -# If your upstream gerrit user or rdo gerit user (and/or keys) are different -# from your current $USER, there are options to set for each of those values. -# See the reproducer-zuul-based-quickstart.sh for the options details. - -{% raw %} -- hosts: localhost - tasks: - - name: Add the localhost to the inventory - add_host: - name: "localhost" - groups: "localhost" - ansible_host: 127.0.0.1 - ansible_connection: local - - - name: Add the primary to the inventory - add_host: - name: "localhost" - groups: "primary" - ansible_fqdn: "localhost" - ansible_user: "{{ lookup('env', 'USER') }}" - ansible_private_key_file: "/home/{{ ansible_user }}/.ssh/{{ user_pri_key | default('id_rsa') }}" - ansible_host: "localhost" -{% endraw %} - -- import_playbook: playbooks/tripleo-ci-reproducer/pre.yaml - -- hosts: localhost - vars: - {% raw -%} - clouds_yaml_path: "/home/{{ ansible_user }}/.config/openstack/clouds.yaml" - {% endraw -%} - ovb_key_name: tripleo-ci-team - mirror_path: "{{ mirror_path }}" - zuul_site_mirror_fqdn: "{{ zuul_site_mirror_fqdn | default(mirror_path) }}" - mirror_fqdn: "{{ mirror_fqdn | default(mirror_path) }}" - pypi_fqdn: "{{ pypi_fqdn | default(mirror_path) }}" - {% if package_mirror is defined -%} - package_mirror: "{{ package_mirror }}" - {% endif -%} - launch_job_branch: {{ zuul.branch }} - {% if 'periodic' not in zuul.job -%} - depends_on: - - {{ zuul.change_url }} - {% endif %} - - zuul_yaml: >- - - project: - check: - jobs: - - {{ zuul.job }}-dlrn-hash-tag - - - job: - name: {{ zuul.job }}-dlrn-hash-tag - parent: {{ zuul.job }} - vars: - {% if 'ovb' in zuul.job -%} - {% raw -%} - cloud_secrets: - rdocloud: - {{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('username: (.+)') }} - {{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('password: (.+)') }} - {{ lookup('file', '{{ clouds_yaml_path }}') | regex_search('project_name: (.+)') }} - auth_url: https://phx2.cloud.rdoproject.org:13000/v3 - region_name: regionOne - identity_api_version: 3 - user_domain_name: Default - project_domain_name: Default - key_name: {{ ovb_key_name }} - {% endraw -%} - cloud_settings: - rdocloud: - public_ip_net: 38.145.32.0/22 - undercloud_flavor: m1.large - baremetal_flavor: m1.large - bmc_flavor: m1.medium - extra_node_flavor: m1.small - baremetal_image: CentOS-7-x86_64-GenericCloud-1804_02 - remove_ovb_after_job: false - {% endif -%} - {% raw -%} - zuul_site_mirror_fqdn: {{ zuul_site_mirror_fqdn }} - mirror_fqdn: {{ mirror_fqdn }} - pypi_fqdn: {{ pypi_fqdn }} - package_mirror: {{ package_mirror }} - {% endraw -%} - {% if releases_file_output is defined -%} - ready_releases_file: | - {{ releases_file_output | replace('export', ' export') }} - {% endif -%} - {% if 'periodic' in zuul.job -%} - force_periodic: true - {% endif -%} - registry_login_enabled: false - featureset_override: - {% if job.featureset_override is defined -%} - {{ job.featureset_override | to_nice_yaml | indent(14) }} - {% endif -%} - {% if releases_file_output is not defined -%} - {% if dlrn_hash is defined or ('undercloud' in hostvars and 'dlrn_hash' in hostvars['undercloud']) -%} - dlrn_hash_tag: {{ hostvars['undercloud'].dlrn_hash }} - {% endif -%} - {% if dlrn_hash_newest is defined or ('undercloud' in hostvars and 'dlrn_hash_newest' in hostvars['undercloud']) -%} - dlrn_hash_tag_newest: {{ hostvars['undercloud'].dlrn_hash_newest }} - {%- endif %} - {%- endif %} - - tasks: - - import_role: - name: ansible-role-tripleo-ci-reproducer diff --git a/roles/create-zuul-based-reproducer/templates/reproducer-fresh-box-setup.sh.j2 b/roles/create-zuul-based-reproducer/templates/reproducer-fresh-box-setup.sh.j2 deleted file mode 100644 index bf491617b..000000000 --- a/roles/create-zuul-based-reproducer/templates/reproducer-fresh-box-setup.sh.j2 +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash - -REPRO_USER=${REPRO_USER:=reprozuul} -REPRO_DEPS="tar curl screen" -RDO_USER="" -RDO_PASS="" -CLOUDS_YAML_PATH=".config/openstack/" -usage () { - echo "Usage: $0 [options]" - echo "" - echo "Options:" - echo " -u, --rdo-user" - echo " Username for RDO cloud to be written to" - echo " $CLOUDS_YAML_PATH/clouds.yaml. REQUIRED." - echo " -p, --rdo-pass" - echo " Password for RDO cloud to be written to" - echo " $CLOUDS_YAML_PATH/clouds.yaml. REQUIRED." - echo " -c, --create-user" - echo " Local user to create for running reproducer." - echo " Defaults to $REPRO_USER" - echo " -h, --help print this help and exit" -} - -set -e - -# Input argument assignments -while [ "x$1" != "x" ]; do - - case "$1" in - --rdo-user|-u) - RDO_USER=$2 - shift - ;; - - --rdo-pass|-p) - RDO_PASS=$2 - shift - ;; - - --create-user|-c) - REPRO_USER=$2 - shift - ;; - - --help|-h) - usage - exit - ;; - - --) shift - break - ;; - - -*) echo "ERROR: unknown option: $1" >&2 - usage >&2 - exit 2 - ;; - - *) break - ;; - esac - - shift -done - -# check required params - rdo user/pass -for param in "$RDO_USER" "$RDO_PASS" ; do - if [[ $param = "" ]]; then - echo "error --rdo-user and --rdo-pass are required parameters" - exit 1 - fi -done - -# create user -sudo adduser $REPRO_USER -echo "$REPRO_USER ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/$REPRO_USER - -# install packages -sudo yum -y install $REPRO_DEPS - -# write clouds.yaml -CLOUDS_YAML_PATH="/home/$REPRO_USER/.config/openstack/" -sudo mkdir -p $CLOUDS_YAML_PATH -sudo /bin/bash -c "cat <>$CLOUDS_YAML_PATH/clouds.yaml -clouds: - rdo-cloud: - identity_api_version: 3 - region_name: regionOne - auth: - auth_url: https://phx2.cloud.rdoproject.org:13000/v3 - password: $RDO_PASS - project_name: $RDO_USER - username: $RDO_USER - user_domain_name: Default - project_domain_name: Default - regions: - - name: regionOne - values: - networks: - - name: 38.145.32.0/22 - routes_externally: true - - name: private -EOF" - -sudo chown -R $REPRO_USER:$REPRO_USER /home/$REPRO_USER/.config - -# create keys -mkdir keystemp -pushd keystemp -ssh-keygen -m PEM -t rsa -N "" -f id_rsa -ssh_path=/home/$REPRO_USER/.ssh -sudo mkdir $ssh_path -sudo mv id_rsa* $ssh_path -sudo chmod 700 $ssh_path -sudo chmod 600 $ssh_path/id_rsa -sudo chmod 644 $ssh_path/id_rsa.pub -sudo chown -R $REPRO_USER:$REPRO_USER $ssh_path -popd -rm -rf keystemp - -echo "Fresh box setup complete - now go upload the public key in" -echo "$CLOUDS_YAML_PATH to Gerrit - both upstream and rdo. Then you are ready " -echo "to run the reproducer. Here is the public key you must upload:" -sudo cat /home/$REPRO_USER/.ssh/id_rsa.pub -echo "Switching to $REPRO_USER" -sudo su - $REPRO_USER diff --git a/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 b/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 deleted file mode 100644 index 9f5406688..000000000 --- a/roles/create-zuul-based-reproducer/templates/reproducer-zuul-based-quickstart.sh.j2 +++ /dev/null @@ -1,340 +0,0 @@ -#!/bin/bash - -# See documentation for using the reproducer script: -# README-reproducer-zuul-based-quickstart.html -# (in the same top-level logs directory as this reproducer script). - -: ${WORKSPACE:=$(mktemp -d -t reproduce-tmp.XXXXX)} -: ${LIBVIRT:=0} -: ${CLOUD_NAME:="rdo-cloud"} -: ${CLOUDS_YAML_PATH:="/home/$USER/.config/openstack/clouds.yaml"} -: ${OVB_KEY_NAME:="tripleo-ci-team"} -: ${FORCE_POST_FAILURE:=0} -: ${UPSTREAM_GERRIT_USER:="$USER"} -: ${RDO_GERRIT_USER:="$USER"} -: ${USER_SSH_KEY:="id_rsa"} -: ${USER_SSH_PUB_KEY:="$USER_SSH_KEY.pub"} -: ${SSH_KEY_PATH:="/home/$USER/.ssh"} -: ${UPSTREAM_GERRIT_SSH_KEY:="id_rsa"} -: ${RDO_GERRIT_SSH_KEY:="id_rsa"} -: ${EXTRA_PARAMS:=""} -: ${CONTAINER_MODE:="podman"} -: ${OVERWRITE_WORKSPACE:="0"} - -usage () { - echo "Usage: $0 [options]" - echo "" - echo "Options:" - echo " -w, --workspace " - echo " directory where the repos and directories" - echo " are created. Defaults to creating a directory in /tmp" - echo " -l, --libvirt" - echo " Runs a 2-node multinode job or singlenode job on a" - echo " single virthost using libvirt to create the nodes." - echo " If a singlenode reproducer is run, two VMs will still be created." - echo " -c, --cloud-name" - echo " Host cloud, specified in the clouds.yaml, to target" - echo " Defaults to rdo-cloud" - echo " -cp, --clouds-yaml-path" - echo " Full path to the clouds.yaml file" - echo " Defaults to /home/$USER/.config/openstack/clouds.yaml" - echo " -ok, --ovb-key-name" - echo " Name of the key to use in the host tenant for OVB deployments" - echo " Defaults to tripleo-ci-team" - echo " -f, --force-post-failure" - echo " Force job to fail so that the nodes will be held." - echo " Temporary solution" - echo " -ug, --upstream-gerrit-user" - echo " Set the upstream gerrit user required to clone repos." - echo " Defaults to the current $USER" - echo " -rg, --rdo-gerrit-user" - echo " Set the upstream RDO user required to clone RDO-related repos." - echo " Defaults to the current $USER" - echo " -k, --ssh-key" - echo " private ssh key used to set up an access nodes." - echo " Defaults to id_rsa." - echo " -kp, --ssh-key-public" - echo " public ssh key used to set up an access nodes." - echo " Defaults to $USER_SSH_KEY.pub" - echo " -skp, --ssh-key-path" - echo " Path to directory where user ssh keys are stored." - echo " Defaults to /home/$USER/.ssh" - echo " -ugk, --upstream-gerrit-key" - echo " Set the upstream gerrit private key." - echo " Defaults to the $USER_SSH_KEY." - echo " -rgk, --rdo-gerrit-key" - echo " Set the upstream RDO user key." - echo " Defaults to the $USER_SSH_KEY." - echo " -e, --extra-params" - echo " File or/and parameters used to override default" - echo " parameters for playbooks. Multiple files" - echo " can be passed [-e @file1.yml -e @file2.yml ...]" - echo " and arguments [-e var=value -e var2=value2 ...]" - echo " -o, --overwrite-workspace" - echo " default is to not overwrite any local modifications" - echo " to the workspace dir made by the user" - echo " -h, --help print this help and exit" -} - -set -e - -# Input argument assignments -while [ "x$1" != "x" ]; do - - case "$1" in - --workspace|-w) - # realpath fails if /some/path doesn't exist. It is created later - WORKSPACE=$(realpath $2 || echo -n $2) - shift - ;; - - --libvirt|-l) - LIBVIRT=1 - ;; - - --cloud-name|-c) - CLOUD_NAME=$2 - shift - ;; - - --clouds-yaml-path|-cp) - CLOUDS_YAML_PATH=$2 - shift - ;; - - --ovb-key-name|-ok) - OVB_KEY_NAME=$2 - shift - ;; - - --force-post-failure|-f) - FORCE_FAILURE=1 - ;; - - --upstream-gerrit-user|-ug) - UPSTREAM_GERRIT_USER=$2 - shift - ;; - - --rdo-gerrit-user|-rg) - RDO_GERRIT_USER=$2 - shift - ;; - - --ssh-key|-k) - USER_SSH_KEY=$2 - shift - ;; - - --ssh-key-public|-kp) - USER_SSH_PUB_KEY=$2 - shift - ;; - - --ssh-key-path|-skp) - SSH_KEY_PATH=$2 - shift - ;; - - --upstream-gerrit-key|-ugk) - UPSTREAM_GERRIT_SSH_KEY=$2 - shift - ;; - - --rdo-gerrit-key|-rgk) - RDO_GERRIT_SSH_KEY=$2 - shift - ;; - - --extra-params|-e) - [[ ${2::1} == "@" ]] && EXTRA_PARAMS+=("-e @$(realpath ${2#@}) ") || EXTRA_PARAMS+=("-e ${2} ") - shift - ;; - - --container-cli|-cont) - CONTAINER_MODE=$2 - shift - ;; - - --overwrite-workspace|-o) - OVERWRITE_WORKSPACE="1" - ;; - - --help|-h) - usage - exit - ;; - - --) shift - break - ;; - - -*) echo "ERROR: unknown option: $1" >&2 - usage >&2 - exit 2 - ;; - - *) break - ;; - esac - - shift -done - -set -x - -if [[ "$LIBVIRT" == "1" ]]; then - echo "check if virt flags are enabled on the cpu" - grep -q 'vmx\|smx' /proc/cpuinfo || LIBVIRT_ERROR=true - # grep hypervisor returns true on virt - echo "check if linux is running in a hypervisor" - grep -q 'hypervisor' /proc/cpuinfo && LIBVIRT_ERROR=true || true - dmesg | grep kvm | grep -i disabled && LIBVIRT_ERROR=true || true - if [[ ! -z "$LIBVIRT_ERROR" ]]; then - echo -e "\e[31m ERROR: -l, libvirt attempted on a machine w/o libvirt capabilities, or on a virtual instance \e[0m" - fi - if [ ! -f "$WORKSPACE/libvirt_nodepool_vars.yml" ]; then - cp "$WORKSPACE/roles/libvirt/setup/overcloud/vars/libvirt_nodepool_vars.yml" "$WORKSPACE" - fi - -fi - -curl -o bindep.txt https://raw.githubusercontent.com/rdo-infra/ansible-role-tripleo-ci-reproducer/master/bindep.txt - -source install-deps.sh -# install just enough python -install_deps -# install bindep -install_bindep -# checks the $PWD for a file named -# bindep.txt and installs -# dependencies listed in the file. -install_package_deps_via_bindep -# Ensure pip is updated -sudo pip install --upgrade pip - -if [[ "$CONTAINER_MODE" == "docker" ]]; then - if [ -x "/usr/bin/docker" ] ; then - # Fail as early as possible if the docker - # group is not setup appropriately. - # This has to be done AFTER package intalls. - # Set up docker groups - if ! groups | grep -Eq "docker|dockerroot"; then - echo "$USER is not in the docker|dockerroot group." - if grep -q docker: /etc/group; then - DG=docker - elif grep -q dockerroot: /etc/group; then - DG=dockerroot - elif ! grep -q docker /etc/group; then - sudo groupadd docker - DG=docker - fi - sudo usermod -aG $DG $USER - echo -e "\e[31m WARNING: The script has exited the current shell in order to setup \ - the user groups via usermod correctly. Please re-execute the script. \e[0m" - exec sg $DG newgrp `id -gn` - fi - - # This can only be checked after rpms are installed. - # Check the Docker config - if [[ -f /etc/docker/daemon.json ]]; then - if cat /etc/docker/daemon.json | grep '"group": "docker"'; then - echo "docker group is already added to /etc/docker/daemon.json" - elif cat /etc/docker/daemon.json | grep '"group": "dockerroot"'; then - echo "dockerroot group is already added to /etc/docker/daemon.json" - elif (( $(cat /etc/docker/daemon.json | wc -m) > 3 )); then - echo -e "\e[31m /etc/docker/daemon.json is populated. \ - Exit this script and either clear the file or add the docker group. \e[0m" | xargs - exit 1 - else - echo "The docker|dockerroot group will be added to /etc/docker/daemon.json." - fi - fi - - # Ensure the docker process has been restarted - sudo systemctl restart docker - fi -fi - -# Start from a clean workspace -export WORKSPACE -if [ "$OVERWRITE_WORKSPACE" == 1 ] || [ ! -d "$WORKSPACE" ]; then - mkdir -p $WORKSPACE - rsync -a *-playbook.yaml $WORKSPACE - cd $WORKSPACE - - # Run the playbook to set up the launcher env - PATH=${HOME}/.local/bin:$PATH ansible-playbook \ - $WORKSPACE/launcher-env-setup-playbook.yaml \ - -vv \ - ${EXTRA_PARAMS[@]} -else - cd $WORKSPACE -fi - -# Set the options selected into EXTRA_PARAMS -if [[ "$LIBVIRT" == "1" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e nodepool_provider=libvirt " - EXTRA_PARAMS="$EXTRA_PARAMS -e mirror_path=mirror.mtl01.inap.opendev.org " -fi - -if [[ "$LIBVIRT" == "0" && "$CLOUD_NAME" != "rdo-cloud" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e cloud_name=$CLOUD_NAME " -fi - -if [[ "$CLOUDS_YAML_PATH" != "/home/$USER/.config/openstack/clouds.yaml" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e clouds_yaml_path=$CLOUDS_YAML_PATH " -fi - -if [[ "$OVB_KEY_NAME" != "tripleo-ci-team" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e ovb_key_name=$OVB_KEY_NAME " -fi - -if [[ "$FORCE_POST_FAILURE" == "1" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e force_post_failure=true " -fi - -if [[ "$UPSTREAM_GERRIT_USER" != "$USER" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e upstream_gerrit_user=$UPSTREAM_GERRIT_USER " -fi - -if [[ "$RDO_GERRIT_USER" != "$USER" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e rdo_gerrit_user=$RDO_GERRIT_USER " -fi - -if [[ "$USER_SSH_KEY" != "id_rsa" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e user_pri_key=$USER_SSH_KEY " -fi - -if [[ "$USER_SSH_PUB_KEY" != "$USER_SSH_KEY.pub" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e user_pub_key=$USER_SSH_PUB_KEY " -fi - -if [[ "$SSH_KEY_PATH" != "/home/$USER/.ssh" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e ssh_path=$SSH_KEY_PATH " -fi - -if [[ "$UPSTREAM_GERRIT_SSH_KEY" != "$USER_SSH_KEY" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e upstream_gerrit_key=$UPSTREAM_GERRIT_SSH_KEY " -fi - -if [[ "$RDO_GERRIT_SSH_KEY" != "$USER_SSH_KEY" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e rdo_gerrit_key=$RDO_GERRIT_SSH_KEY " -fi - -# to customize your libvirt nodepool settings -# edit $WORKSPACE/libvirt_nodepool_vars.yml -if [[ "$LIBVIRT" == "1" ]]; then - EXTRA_PARAMS="$EXTRA_PARAMS -e @libvirt_nodepool_vars.yml " -fi - -echo "EXTRA_PARAMS = $EXTRA_PARAMS" -sleep 3 - -# Run the launcher playbook -PATH=${HOME}/.local/bin:$PATH ansible-playbook \ - $WORKSPACE/launcher-playbook.yaml \ - -e container_mode="$CONTAINER_MODE" \ - -vv \ - --tags all \ - ${EXTRA_PARAMS[@]} diff --git a/roles/discover-latest-image/README.md b/roles/discover-latest-image/README.md deleted file mode 100644 index 5edb70c72..000000000 --- a/roles/discover-latest-image/README.md +++ /dev/null @@ -1,35 +0,0 @@ -Role Name -========= - -An Ansible role to discover latest Centos image. - -Requirements ------------- - -This role is currently written for Centos-9 and can be extended to Centos-8 on need basis. - -Role Variables --------------- - -* base_url: Base Url from where we can pull the Centos Image. -* qcow_prefix: Qcow2 image prefix on base_url which will be used as a filter to find latest Centos Image. - - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Discover latest CentOS qcow2 image - include_role: - name: discover-latest-image - - 2. Sample config to use the facts from discover-latest-image - - - name: set_fact for undercloud base image - set_fact: - baseos_undercloud_image_url: "{{ discovered_image_url }}" - baseos_image: "{{ ansible_distribution | lower }}" - baseos_image_type: qcow2 - baseos_md5sum: "{{ discovered_md5sum }} {{ discovered_image_name }}" - cacheable: true diff --git a/roles/discover-latest-image/defaults/main.yaml b/roles/discover-latest-image/defaults/main.yaml deleted file mode 100644 index c94253de4..000000000 --- a/roles/discover-latest-image/defaults/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -base_url: https://cloud.centos.org/centos/{{ ansible_distribution_major_version }}-stream/x86_64/images/ -qcow_prefix: CentOS-Stream-GenericCloud- diff --git a/roles/discover-latest-image/tasks/main.yaml b/roles/discover-latest-image/tasks/main.yaml deleted file mode 100644 index f952fc764..000000000 --- a/roles/discover-latest-image/tasks/main.yaml +++ /dev/null @@ -1,45 +0,0 @@ ---- -- name: Create a temporary file - tempfile: - state: file - register: tempfile - -- name: Remove the file at temporary file path. - file: - path: "{{ tempfile.path }}" - state: absent - -- name: Fetch publication page - get_url: - url: "{{ base_url }}?C=M;O=A" - dest: "{{ tempfile.path }}" - -- name: Find qcow2 url - shell: | - sed -n "/qcow2/ s/.*href=\"\({{ qcow_prefix }}.*.qcow2\)\">.*/\1/p" {{ tempfile.path }} | tail -1 - register: get_qcow_image_name - -- name: Remove the file at temporary file path. - file: - path: "{{ tempfile.path }}" - state: absent - -- name: Fetch md5sum file - get_url: - url: "{{ base_url }}/{{ get_qcow_image_name.stdout }}.MD5SUM" - dest: "{{ tempfile.path }}" - -- name: Find MD5 value - command: "awk -F ' = ' '/MD5/ {print $2}' {{ tempfile.path }}" - register: get_md5_value - -- name: Remove the file at temporary file path. - file: - path: "{{ tempfile.path }}" - state: absent - -- name: "Set expected facts Image: {{ base_url }}{{ get_qcow_image_name.stdout }} Md5sum: {{ get_md5_value.stdout }} " - set_fact: - discovered_image_name: "{{ get_qcow_image_name.stdout }}" - discovered_image_url: "{{ base_url }}{{ get_qcow_image_name.stdout }}" - discovered_md5sum: "{{ get_md5_value.stdout }}" diff --git a/roles/dump_vars/defaults/main.yml b/roles/dump_vars/defaults/main.yml deleted file mode 100644 index 7aea7ff75..000000000 --- a/roles/dump_vars/defaults/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -dump_vars_log_dir: /var/log/extra/ diff --git a/roles/dump_vars/meta/main.yml b/roles/dump_vars/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/dump_vars/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/dump_vars/tasks/main.yml b/roles/dump_vars/tasks/main.yml deleted file mode 100644 index d88f4940f..000000000 --- a/roles/dump_vars/tasks/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -- name: Prepare directory with extra logs - become: true - file: - dest: "{{ dump_vars_log_dir }}" - state: directory - mode: 0777 - -- name: generate dump_variables_vars script - template: - src: dump_variables_vars.j2 - dest: "{{ dump_vars_log_dir }}/dump_variables_vars.yaml" - -- name: generate dump_variables_environment script - template: - src: dump_variables_environment.j2 - dest: "{{ dump_vars_log_dir }}/dump_variables_environment.yaml" - -- name: generate dump_variables_group_names script - template: - src: dump_variables_group_names.j2 - dest: "{{ dump_vars_log_dir }}/dump_variables_group_names.yaml" - -- name: generate dump_variables_groups script - template: - src: dump_variables_groups.j2 - dest: "{{ dump_vars_log_dir }}/dump_variables_groups.yaml" - -- name: generate dump_variables_hostvars script - template: - src: dump_variables_hostvars.j2 - dest: "{{ dump_vars_log_dir }}/dump_variables_hostvars.yaml" diff --git a/roles/dump_vars/templates/dump_variables_environment.j2 b/roles/dump_vars/templates/dump_variables_environment.j2 deleted file mode 100644 index ade376253..000000000 --- a/roles/dump_vars/templates/dump_variables_environment.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ environment | to_nice_yaml }} diff --git a/roles/dump_vars/templates/dump_variables_group_names.j2 b/roles/dump_vars/templates/dump_variables_group_names.j2 deleted file mode 100644 index b4614df46..000000000 --- a/roles/dump_vars/templates/dump_variables_group_names.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ group_names | to_nice_yaml }} diff --git a/roles/dump_vars/templates/dump_variables_groups.j2 b/roles/dump_vars/templates/dump_variables_groups.j2 deleted file mode 100644 index d723fdc48..000000000 --- a/roles/dump_vars/templates/dump_variables_groups.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ groups | to_nice_yaml }} diff --git a/roles/dump_vars/templates/dump_variables_hostvars.j2 b/roles/dump_vars/templates/dump_variables_hostvars.j2 deleted file mode 100644 index 55ec8e922..000000000 --- a/roles/dump_vars/templates/dump_variables_hostvars.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ hostvars | to_nice_yaml }} diff --git a/roles/dump_vars/templates/dump_variables_vars.j2 b/roles/dump_vars/templates/dump_variables_vars.j2 deleted file mode 100644 index ed21a941a..000000000 --- a/roles/dump_vars/templates/dump_variables_vars.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ vars | to_nice_yaml }} diff --git a/roles/external_data_plane_management/README.md b/roles/external_data_plane_management/README.md deleted file mode 100644 index 3a010585c..000000000 --- a/roles/external_data_plane_management/README.md +++ /dev/null @@ -1,14 +0,0 @@ -External Data Plane Management -============================== - -An Ansible role to deploy standalone compute. - - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Deploy the compute node - include_role: - name: external-data-plane-management diff --git a/roles/external_data_plane_management/defaults/main.yml b/roles/external_data_plane_management/defaults/main.yml deleted file mode 100644 index 2fcf04a05..000000000 --- a/roles/external_data_plane_management/defaults/main.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# Containers images used in deployment -tripleo_iscsid_image: "{{ docker_registry_host }}/{{ docker_registry_namespace }}/openstack-iscsid:{{ docker_image_tag }}" -tripleo_logrotate_crond_image: "{{ docker_registry_host }}/{{ docker_registry_namespace }}/openstack-cron:{{ docker_image_tag }}" -tripleo_nova_compute_container_image: "{{ docker_registry_host }}/{{ docker_registry_namespace }}/openstack-nova-compute:{{ docker_image_tag }}" -tripleo_nova_libvirt_container_image: "{{ docker_registry_host }}/{{ docker_registry_namespace }}/openstack-nova-libvirt:{{ docker_image_tag }}" -tripleo_ovn_controller_image: "{{ docker_registry_host }}/{{ docker_registry_namespace }}/openstack-ovn-controller:{{ docker_image_tag }}" - -# tripleo-standalone-vars script related vars -tripleo_standalone_vars: "/home/{{ ansible_user }}/src/opendev.org/openstack/tripleo-ansible/scripts/tripleo-standalone-vars" -config_download_dir: "/home/{{ ansible_user }}/tripleo-deploy" -role_type: "Standalone" -target_host: undercloud - -timestamper_cmd: >- - | awk '{ print strftime("%Y-%m-%d %H:%M:%S |"), $0; fflush(); }' - -# Vars required for compute service deployment -tripleo_network_config_template: templates/ci/multinode.j2 -neutron_public_interface_name: eth0 -tripleo_selinux_mode: permissive -tripleo_hosts_entries_overcloud_hosts_entries: - - 192.168.24.1 standalone.ctlplane.localdomain standalone.ctlplane -tripleo_container_registry_insecure_registries: - - "{{ docker_registry_host }}" - -# VIP of the standalone -ctlplane_ip: 192.168.24.3 - -# Vars needed when allinone compute deployment is done -ctlplane_dns_nameservers: - - 127.0.0.1 - - 1.1.1.1 -dns_search_domains: [] -tripleo_ovn_dbs: - - 192.168.24.1 - -# Values for validation -tempest_cidr: '192.168.24.0/24' diff --git a/roles/external_data_plane_management/meta/main.yml b/roles/external_data_plane_management/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/external_data_plane_management/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/external_data_plane_management/tasks/compute_services_on_target_host.yml b/roles/external_data_plane_management/tasks/compute_services_on_target_host.yml deleted file mode 100644 index 0ba7ecf8b..000000000 --- a/roles/external_data_plane_management/tasks/compute_services_on_target_host.yml +++ /dev/null @@ -1,96 +0,0 @@ ---- -# It contains following tasks: -# - Set hostname for target node -# - Copy standalone env vars to subnode-1 -# - Change localhost to target hostname -# - Deploy compute services. - -- name: Copy id_rsa key to working_dir - become: true - copy: - src: /etc/nodepool/id_rsa - dest: "{{ working_dir }}/.ssh/edpm_rsa" - owner: "{{ ansible_user }}" - mode: 0600 - -- name: Copy tripleo-inventory as EDPM env - become: true - copy: - src: /usr/share/ansible/tripleo-inventory/ - dest: "{{ working_dir }}/tripleo-deploy/edpm-inventory/" - remote_src: true - directory_mode: 0755 - owner: "{{ ansible_user }}" - -- name: Copy 99 standalone var into EDPM inventory - copy: - src: "{{ working_dir }}/99-standalone-vars" - dest: "{{ working_dir }}/tripleo-deploy/edpm-inventory/99-standalone-vars" - remote_src: true - -- name: Manipulate inventory - block: - - name: Get subnode IP - register: subnode_ip - slurp: - path: /etc/nodepool/sub_nodes - - - name: Get inventory content - register: original_inventory - slurp: - path: "{{ working_dir }}/tripleo-deploy/edpm-inventory/02-computes" - - - name: Set inventory host content - set_fact: - inventory_hosts: | - { - hosts: { - {{ target_host }}: { - ansible_host: "{{ subnode_ip['content']|b64decode|trim }}", - ansible_ssh_private_key_file: '{{ working_dir }}/.ssh/edpm_rsa', - ansible_ssh_common_args: '-o StrictHostKeyChecking=no' - } - } - } - - - name: Update inventory content - set_fact: - updated_inventory: >- - {%- set _inventory = original_inventory['content']|b64decode|from_yaml %} - {%- set _hosts = inventory_hosts |from_yaml %} - {%- set _ = _inventory['Compute'].update( _hosts ) %} - {{ _inventory }} - - - name: Output new inventory as clean yaml - copy: - dest: "{{ working_dir }}/tripleo-deploy/edpm-inventory/02-computes" - content: "{{ updated_inventory | from_yaml | to_nice_yaml }}" - -- name: Rename the host_vars file to target host - copy: - src: "{{ working_dir }}/tripleo-deploy/edpm-inventory/host_vars/localhost" - dest: "{{ working_dir }}/tripleo-deploy/edpm-inventory/host_vars/{{ target_host }}" - remote_src: true - -- name: Remove the old file - file: - path: "{{ working_dir }}/tripleo-deploy/edpm-inventory/host_vars/localhost" - state: absent - -- name: Generate parameter file for deploy_compute task - template: - src: compute-parameter.yaml.j2 - dest: "{{ working_dir }}/edpm-compute-parameter.yaml" - mode: 0644 - -- name: Generate deploy_compute.sh script - template: - src: deploy_compute.sh.j2 - dest: "{{ working_dir }}/deploy_compute.sh" - mode: 0755 - -- name: Run deploy_compute.sh script - shell: > - set -o pipefail && - {{ working_dir }}/deploy_compute.sh - 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/deploy_compute.log diff --git a/roles/external_data_plane_management/tasks/deploy_standalone.yml b/roles/external_data_plane_management/tasks/deploy_standalone.yml deleted file mode 100644 index ed07fb3dd..000000000 --- a/roles/external_data_plane_management/tasks/deploy_standalone.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Set proper container params before deploying standalone - include_role: - name: container-prep - -- name: Deploy Standalone - include_role: - name: standalone - -- import_tasks: generate_tripleo_standalone_vars.yml diff --git a/roles/external_data_plane_management/tasks/generate_tripleo_standalone_vars.yml b/roles/external_data_plane_management/tasks/generate_tripleo_standalone_vars.yml deleted file mode 100644 index da92cdb01..000000000 --- a/roles/external_data_plane_management/tasks/generate_tripleo_standalone_vars.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Playbook to generate Tripleo Standalone var file -- name: Find config_download directory - find: - path: "{{ config_download_dir }}" - patterns: 'standalone-ansible-*' - recurse: false - file_type: directory - register: dir_path - -- name: set fact for config_download_dir path - set_fact: - config_download_path: "{{ dir_path.files[0].path }}" - -- name: Generate Tripleo Standalone var file - shell: | - python3 {{ tripleo_standalone_vars }} -c {{ config_download_path }} \ - -r {{ role_type }} - args: - chdir: "/home/{{ ansible_user }}" diff --git a/roles/external_data_plane_management/tasks/install_required_packages.yml b/roles/external_data_plane_management/tasks/install_required_packages.yml deleted file mode 100644 index 9c2201c3a..000000000 --- a/roles/external_data_plane_management/tasks/install_required_packages.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Install Required packages - become: true - package: - name: - - ansible-collection-containers-podman - - python3-tenacity - - tripleo-ansible - - ansible-role-chrony - state: present diff --git a/roles/external_data_plane_management/tasks/main.yml b/roles/external_data_plane_management/tasks/main.yml deleted file mode 100644 index f4d8e56dd..000000000 --- a/roles/external_data_plane_management/tasks/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Do not do anything - fail: - msg: "This role doesn't do anything unless you include a specific task file" diff --git a/roles/external_data_plane_management/tasks/prepare_node.yml b/roles/external_data_plane_management/tasks/prepare_node.yml deleted file mode 100644 index 5961adaf1..000000000 --- a/roles/external_data_plane_management/tasks/prepare_node.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# A set of tasks for bootstrapping the node -- name: Add the nodes to the generated inventory - vars: - inventory: multinode - include_role: - name: tripleo-inventory - -- name: Prepare nodes with repositories and custom builds - include_role: - name: undercloud-setup - -- name: Set proper container params - include_role: - name: container-prep diff --git a/roles/external_data_plane_management/tasks/validate_edpm.yml b/roles/external_data_plane_management/tasks/validate_edpm.yml deleted file mode 100644 index 5291c6cc7..000000000 --- a/roles/external_data_plane_management/tasks/validate_edpm.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Generate validate_edpm.sh script - template: - src: validate_edpm.sh.j2 - dest: "{{ working_dir }}/validate_external_compute.sh" - mode: 0755 - -- name: Run validate_external_compute.sh script - shell: > - set -o pipefail && - {{ working_dir }}/validate_external_compute.sh - 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/validate_external_compute.log diff --git a/roles/external_data_plane_management/templates/compute-parameter.yaml.j2 b/roles/external_data_plane_management/templates/compute-parameter.yaml.j2 deleted file mode 100644 index 49cd82a78..000000000 --- a/roles/external_data_plane_management/templates/compute-parameter.yaml.j2 +++ /dev/null @@ -1,18 +0,0 @@ ---- -# Parameter file for the deploy-overcloud-compute.yml playbook - -ctlplane_ip: "{{ ctlplane_ip }}" -tripleo_iscsid_image: "{{ tripleo_iscsid_image }}" -tripleo_logrotate_crond_image: "{{ tripleo_logrotate_crond_image }}" -tripleo_nova_compute_container_image: "{{ tripleo_nova_compute_container_image }}" -tripleo_nova_libvirt_container_image: "{{ tripleo_nova_libvirt_container_image }}" -tripleo_ovn_controller_image: "{{ tripleo_ovn_controller_image }}" -tripleo_selinux_mode: "{{ tripleo_selinux_mode }}" -neutron_public_interface_name: "{{ neutron_public_interface_name }}" -tripleo_network_config_template: "{{ tripleo_network_config_template }}" -ctlplane_dns_nameservers: {{ ctlplane_dns_nameservers }} -tripleo_container_registry_insecure_registries: {{ tripleo_container_registry_insecure_registries }} -tripleo_hosts_entries_overcloud_hosts_entries: {{ tripleo_hosts_entries_overcloud_hosts_entries|to_json }} -# For now, don't load firewall -deploy_tripleo_openstack_run_firewall: false -tripleo_sshd_configure_firewall: true diff --git a/roles/external_data_plane_management/templates/deploy_compute.sh.j2 b/roles/external_data_plane_management/templates/deploy_compute.sh.j2 deleted file mode 100644 index 63ad9b89b..000000000 --- a/roles/external_data_plane_management/templates/deploy_compute.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -sudo ansible-playbook -i {{ working_dir }}/tripleo-deploy/edpm-inventory \ - -e @{{ working_dir }}/edpm-compute-parameter.yaml \ - /usr/share/ansible/tripleo-playbooks/deploy-overcloud-compute.yml diff --git a/roles/external_data_plane_management/templates/validate_edpm.sh.j2 b/roles/external_data_plane_management/templates/validate_edpm.sh.j2 deleted file mode 100644 index ab2626276..000000000 --- a/roles/external_data_plane_management/templates/validate_edpm.sh.j2 +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -# {{ target_host }} -set -eux - -# Discover new compute nodes -sudo podman exec -it nova_api nova-manage cell_v2 discover_hosts --verbose - -# Export standalone cloud -export OS_CLOUD=standalone - -# Export some needed variables -export GATEWAY='{{ tempest_cidr|nthhost(1) }}' -export PUBLIC_NETWORK_CIDR='{{ tempest_cidr }}' -export PRIVATE_NETWORK_CIDR=192.168.74.0/28 -export PUBLIC_NET_START='{{ tempest_cidr|nthhost(150) }}' -export PUBLIC_NET_END='{{ tempest_cidr|nthhost(200) }}' -export DNS_SERVER=1.1.1.1 -export HYPER='{{ hostvars[target_host].ansible_fqdn }}' -export INSTANCE_NAME=myserver-$HYPER - -# List Available Zones -openstack availability zone list - -# List hosts -openstack host list - -# List Hypervisors -openstack hypervisor list - -# List Compute Services -openstack compute service list - -# List network agents -openstack network agent list - -# Steps to validate host -# copied from https://github.com/fultonj/zed/blob/main/standalone/verify.sh - -openstack keypair create --private-key ~/test_key default -openstack keypair list -# create basic security group to allow ssh/ping/dns -openstack security group create basic -# allow ssh -openstack security group rule create basic --protocol tcp --dst-port 22:22 --remote-ip 0.0.0.0/0 -# allow ping -openstack security group rule create --protocol icmp basic -# allow DNS -openstack security group rule create --protocol udp --dst-port 53:53 basic -openstack network create --external --provider-physical-network datacentre --provider-network-type flat public -openstack network create --internal private -openstack subnet create public-net \ - --subnet-range $PUBLIC_NETWORK_CIDR \ - --no-dhcp \ - --gateway $GATEWAY \ - --allocation-pool start=$PUBLIC_NET_START,end=$PUBLIC_NET_END \ - --network public -openstack subnet create private-net \ - --subnet-range $PRIVATE_NETWORK_CIDR \ - --network private -openstack floating ip create public - -openstack router create vrouter -openstack router set vrouter --external-gateway public -openstack router add subnet vrouter private-net -openstack flavor create --ram 512 --disk 1 --ephemeral 0 --vcpus 1 --public m1.tiny -curl https://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img -o /home/zuul/cirros-0.4.0-x86_64-disk.img -openstack image create cirros --container-format bare --disk-format qcow2 --public --file /home/zuul/cirros-0.4.0-x86_64-disk.img -openstack image list -openstack server create \ - --nic none \ - --os-compute-api-version 2.74 --hypervisor-hostname $HYPER \ - --flavor m1.tiny --image cirros --key-name default \ - $INSTANCE_NAME - -while true; do - INSTANCE_STATUS=$(openstack server show ${INSTANCE_NAME} -f json | jq -r '.status') - case "${INSTANCE_STATUS}" in - "ACTIVE") - echo "${INSTANCE_NAME} reached 'ACTIVE' status" - break - ;; - "ERROR") - echo "${INSTANCE_NAME} failed" - exit 1 - esac -done diff --git a/roles/extras-common/README.md b/roles/extras-common/README.md deleted file mode 100644 index c8cbb316a..000000000 --- a/roles/extras-common/README.md +++ /dev/null @@ -1,52 +0,0 @@ -extras-common -============= - -This Ansible role contains defaults for variables used in more than 2 roles -throughout the tripleo-quickstart-extras repository. All other roles in this -repository depend on this one. - -Individual role variable defaults override the values from this role, so it is -important to remove their definitions from the original role defaults when -moving any variable over here. - -This role depends on the "common" role from tripleo-quickstart repository which -serves the same purpose as this one. - -Role Variables --------------- - -- `containerized_overcloud: -- use containers to deploy the overcloud -- `enable_tls_everywhere`: -- enable TLS encryption on all OpenStack - services -- `overcloud_ipv6`: -- enable IPv6 deployment on the overcloud -- `undercloud_network_cidr`: <'192.168.24.0/24'> -- the network cidr for the - undercloud, note this is also currently the default cidr used in other CI - environments for tripleo. -- `timestamper_cmd`: beginning with the shell pipe character, this command - prepends a timestamp to the deployment and test commands throughout the - roles. Can be disabled by specifying this command as an empty string. -- `local_docker_registry_host`: <"{{undercloud_network_gateway|default(undercloud_network_cidr|nthhost(1))}}"> -- host of the local (undercloud) docker registry -- `docker_registry_host`: <'docker.io'> -- host of the primary docker registry -- `docker_registry_namespace`: <'tripleomaster'> -- namespace of - docker images used for TripleO deployment -- `docker_image_tag`: <'latest'> -- tag of docker images used for - TripleO deployment -- `docker_prep_prefix`: <'centos-binary-'> Prefix for container image names -- `docker_prep_suffix: <''> Suffix for container image names -- `docker_ceph_namespace: <'docker.io/ceph'> Namespace for the ceph container - image -- `docker_ceph_image: <'daemon'> Name of the ceph container image -- `docker_ceph_tag: <'v4.0.10-stable-4.0-nautilus-centos-7-x86_64'> Tag for the - ceph container image -- `composable_scenario`: <''> -- path to the composable scenarios used at deployment time -- `upgrade_composable_scenario`: <''> -- path to the composable scenarios used at upgrade time -- `undercloud_rpm_dependencies`: <'python-tripleoclient'> -- Dependency packages for undercloud deployments. -- `baremetal_provision`: Deploy baremetal with "openstack overcloud node provision" and deployed-server, instead of with heat/nova -- `undercloud_enable_nova`: -- sets up the 'enable_nova' - option in undercloud.conf. -- `undercloud_enable_mistral`: <'true'> -- sets up the 'enable_mistral' option - in undercloud.conf for the undercloud and install ara in the mistral executor container before deploying the overcloud. -- `network_provision`: Deploy composable network with "openstack - overcloud network provision" and deployed-networks, instead of with heat -- `whole_disk_images`: -- shows if we want to use partition or whole disk images (this will be available starting on Ocata) -- `overcloud_image`: <'overcloud-full'> Name of overcloud image to build/download/deploy without any file extension diff --git a/roles/extras-common/defaults/main.yml b/roles/extras-common/defaults/main.yml deleted file mode 100644 index dc2a2e337..000000000 --- a/roles/extras-common/defaults/main.yml +++ /dev/null @@ -1,197 +0,0 @@ ---- -# vars related to content provider job -local_registry_ip: 127.0.0.1 -local_registry_port: 5001 - -overcloud_ipv6: false -containerized_overcloud: >- - {% if release in ['newton', 'ocata', 'pike'] -%} - false - {%- else -%} - true - {%- endif -%} -containerized_undercloud: >- - {% if release not in ['newton','ocata','pike','queens'] -%} - true - {%- else -%} - false - {%- endif -%} -containerized_undercloud_upgrade: >- - {% if release not in ['newton','ocata','pike'] -%} - true - {%- else -%} - false - {%- endif -%} -containerized_overcloud_upgrade: >- - {% if release in ['newton', 'ocata'] -%} - false - {%- else -%} - true - {%- endif -%} -undercloud_container_cli: podman -# the variable is only used in overcloud-deploy role -# for stein and beyond, so it's safe to set it to podman, -# as for stable branches before stein the variable won't be used. -overcloud_container_cli: podman -local_docker_registry_host: "{{ undercloud_network_gateway|default(undercloud_network_cidr|nthhost(1)) }}" -docker_registry_host: >- - {% if job.consumer_job | default(false) | bool -%} - {% if registry_distro is defined and - registry_distro | default('') | length > 0 -%} - {{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }} - {%- else -%} - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }} - {%- endif -%} - {%- else -%} - docker.io - {%- endif -%} -docker_registry_namespace: "tripleo{{ release }}" -docker_image_tag: current-tripleo - -# set default and convert job.build_container_images to native -build_container_images: "{{ job.build_container_images|default(false)|bool }}" - -# docker prefix -# Notes(chandankumar): openstack- prefix is used from victoria release onwards -docker_prep_prefix: >- - {% if (build_container_images|default(false)|bool and - not job.provider_job|default(false)|bool) or - release not in ['queens', 'pike', 'stein', 'train', 'ussuri'] -%} - openstack - {%- else -%} - {{ ansible_distribution | lower }}-binary - {%- endif -%} -# docker suffix -docker_prep_suffix: "" - -# NOTE(dviroel): for stable/wallaby and beyond, we will maintain centos9 hardcoded as -# distribution version for now, since we don't have a different namespace with promoted -# ceph daemon containers. -docker_ceph_namespace: >- - {% if job is defined and job.docker_ceph_namespace is defined -%} - {{ job.docker_ceph_namespace }} - {%- elif job.consumer_job | default(false) | bool -%} - {%- if registry_distro is defined and - registry_distro | default('') | length > 0 -%} - {{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}/{{ docker_registry_namespace }} - {%- else -%} - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace }} - {%- endif -%} - {%- elif release in ['train','victoria'] -%} - quay.io/ceph - {%- else -%} - quay.rdoproject.org/tripleo{{release}}centos9 - {%- endif -%} -docker_ceph_image: >- - {% if job is defined and job.docker_ceph_image is defined -%} - {{ job.docker_ceph_image }} - {%- else -%} - daemon - {%- endif -%} -docker_ceph_tag: >- - {% if job is defined and job.docker_ceph_tag is defined -%} - {{ job.docker_ceph_tag }} - {%- elif release in ['pike'] -%} - v3.0.3-stable-3.0-jewel-centos-7-x86_64 - {%- elif release in ['queens'] -%} - v3.2.14-stable-3.2-luminous-centos-7-x86_64 - {%- elif release in ['stein','train','ussuri','victoria'] -%} - v4.0.19-stable-4.0-nautilus-centos-7-x86_64 - {%- else -%} - current-ceph - {%- endif -%} -rhel_containers: >- - {% if ansible_distribution == 'RedHat' -%} - true - {%- else -%} - false - {%- endif -%} -additional_insecure_registry: >- - {% if job.registry_ip_address_branch is defined and release in ['queens'] -%} - true - {%- else -%} - false - {%- endif -%} -deployed_server: false -overcloud_templates_path: /usr/share/openstack-tripleo-heat-templates -enable_tls_everywhere: false -undercloud_enable_novajoin: >- - {% if release in ['queens', 'stein', 'train'] -%} - true - {%- else -%} - false - {%- endif -%} -undercloud_generate_service_certificate: true -undercloud_network_cidr: 192.168.24.0/24 -undercloud_undercloud_nameservers: - - 8.8.8.8 -timestamper_cmd: >- - | awk '{ print strftime("%Y-%m-%d %H:%M:%S |"), $0; fflush(); }' -composable_scenario: "" -upgrade_composable_scenario: "" -artcl_collect_dir: "{{ local_working_dir }}/collected_files" -undercloud_rpm_dependencies: >- - python-tripleoclient - -# moved from overcloud-deploy -# If `test_ping` is `true`, run a simple ping test to validate the -# overcloud. -test_ping: true - -# install and execute dstat across nodes -validate_performance: true - -# If `validate_services` is `true`, run the validate-services role -validate_services: false - -# If `baremetal_provision` is `true`, deploy baremetal with "openstack overcloud node provision" and deployed-server, instead of with heat/nova -baremetal_provision: false - -# If `network_provision` is `true`, deploy network with "openstack overcloud network provision" and deployed-networks, instead of with heat -network_provision: false - -# If `undercloud_enable_nova` is `true`, the undercloud will have running glance and nova services -undercloud_enable_nova: >- - {% if release in ['queens', 'stein', 'train', 'ussuri'] -%} - true - {%- else -%} - false - {%- endif %} - -step_overcloud_prep_flavors: >- - {% if release in ['newton','ocata','pike','queens','stein','train', 'ussuri'] -%} - true - {%- else -%} - false - {%- endif -%} - -# Set the location for the downloaded amphora image when download_amphora is true -octavia_amphora_path: >- - {% if release in ['queens'] -%} - /usr/share/openstack-octavia-amphora-images/amphora-x64-haproxy.qcow2 - {%- else -%} - {{ working_dir }}/amphora.qcow2 - {%- endif %} - -undercloud_enable_mistral: >- - {% if release in ['queens', 'stein', 'train'] -%} - true - {%- else -%} - false - {%- endif %} -undercloud_enable_zaqar: >- - {% if release in ['queens', 'stein', 'train'] -%} - true - {%- else -%} - false - {%- endif %} -undercloud_enable_heat: "{{ not ephemeral_heat|default(false) }}" -whole_disk_images: >- - {% if job is defined and job.whole_disk_images is defined -%} - {{ job.whole_disk_images }} - {%- elif release in ['train','ussuri','victoria'] -%} - false - {%- else -%} - true - {%- endif -%} -overcloud_image: overcloud-full diff --git a/roles/extras-common/meta/main.yml b/roles/extras-common/meta/main.yml deleted file mode 100644 index 4972fab69..000000000 --- a/roles/extras-common/meta/main.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -dependencies: - - common - -galaxy_info: - author: Red Hat - description: | - This Ansible role contains defaults for variables used in more than 2 roles - throughout the tripleo-quickstart-extras repository. All other roles in this - repository depend on this one. - license: Apache - platforms: - - name: CentOS - versions: - - 7 - - 8 - - name: EL - versions: - - 7 - - 8 - min_ansible_version: 2.8 diff --git a/roles/extras-common/tasks/main.yml b/roles/extras-common/tasks/main.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/freeipa-setup/README.md b/roles/freeipa-setup/README.md deleted file mode 100644 index 3f236f00e..000000000 --- a/roles/freeipa-setup/README.md +++ /dev/null @@ -1,45 +0,0 @@ -FreeIPA Setup -============= - -An Ansible role to setup a FreeIPA server - -Requirements ------------- - -This role requires a running host to deploy FreeIPA - -Role Variables --------------- - -- `freeipa_hostname`: <'ipa.tripleodomain'> -- Hostname for the FreeIPA server -- `freeipa_ip`: <'192.168.24.250'> -- IP for the FreeIPA server -- `directory_manager_password`: -- Password for the directory manager -- `freeipa_admin_password`: -- FreeIPA server admin password -- `undercloud_fqdn`: <'undercloud.tripleodomain'> -- FQDN for the undercloud -- `provisioning_cidr`: <'{{ freeipa_ip }}/24'> -- If set, it adds the given CIDR to the -provisioning interface (which is hardcoded to eth1) -- `supplemental_user`: The user which is used to deploy FreeIpa on the supplemental node -- `ipa_server_install_params`: <''> -- Additional parameters to pass to the ipa-server-install command -- `prepare_ipa`: If set to true, it will install novajoin or tripleo-ipa in the - undercloud, and run a script that will create the required privileges/permissions - in FreeIPA, as well as the undercloud host entry. This requires - 'enable_tls_everywhere' to be set to true, and the following variables to be - properly defined: 'freeipa_admin_password', 'freeipa_server_hostname', - 'overcloud_cloud_domain', 'undercloud_undercloud_hostname'. If you plan to do - this yourself, you can set this variable to false. Defaults to true. -- `undercloud_enable_novajoin`: <'true'> -- uses old novajoin service to register - overcloud nodes into IPA when 'enable_tls_everywhere' is enabled. - -Example Playbook ----------------- - -Sample playbook to call the role - -```yaml -# Deploy the FreeIPA Server -- name: Deploy FreeIPA - hosts: freeipa_host - gather_facts: false - roles: - - freeipa-setup -``` diff --git a/roles/freeipa-setup/defaults/main.yml b/roles/freeipa-setup/defaults/main.yml deleted file mode 100644 index 4d45762e3..000000000 --- a/roles/freeipa-setup/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -freeipa_hostname: "ipa.tripleodomain" -freeipa_ip: "{{ undercloud_network_cidr|nthhost(250) }}" -undercloud_fqdn: "undercloud.tripleodomain" -provisioning_cidr: "{{ undercloud_network_cidr }}" -supplemental_user: "stack" -freeipa_subcas: [] -prepare_ipa: true -# location which the novajoin-ipa-setup will store the FreeIPA token -freeipa_otp_key: /tmp/ipa-otp.txt diff --git a/roles/freeipa-setup/meta/main.yml b/roles/freeipa-setup/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/freeipa-setup/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/freeipa-setup/tasks/ipa_prep.yml b/roles/freeipa-setup/tasks/ipa_prep.yml deleted file mode 100644 index d25d412b6..000000000 --- a/roles/freeipa-setup/tasks/ipa_prep.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -- name: Validate FreeIPA Admin password was passed - fail: msg="freeipa_admin_password is not passed and or blank" - when: - - deploy_supplemental_node|bool and not hostvars['supplemental'].freeipa_admin_password|default('') - - not freeipa_admin_password|default('') - -- name: Validate FreeIPA Server hostname was passed - fail: msg="freeipa_server_hostname is not passed and or blank" - when: freeipa_server_hostname is not defined or ( freeipa_server_hostname is defined and freeipa_server_hostname == "" ) - -- name: Validate a domain for the cloud was given - fail: msg="overcloud_cloud_domain is not passed and or blank" - when: overcloud_cloud_domain is not defined or ( overcloud_cloud_domain is defined and overcloud_cloud_domain == "" ) - -- name: Validate a undercloud hostname was given - fail: msg="undercloud_undercloud_hostname is not passed and or blank" - when: undercloud_undercloud_hostname is not defined or ( undercloud_undercloud_hostname is defined and undercloud_undercloud_hostname == "" ) - -- name: Install tripleo-ipa preparation script - template: - src: ipa_prep.sh.j2 - dest: "~{{ supplemental_user }}/ipa_prep.sh" - mode: 0755 - -- name: Run the tripleo-ipa preparation script - shell: > - set -o pipefail && - ~{{ supplemental_user }}/ipa_prep.sh 2>&1 {{ timestamper_cmd }} > - ~{{ supplemental_user }}/ipa_prep.sh.log - changed_when: true - -- name: Fetch the otp key - fetch: - src: "{{ freeipa_otp_key }}" - dest: "{{ freeipa_otp_key }}" - flat: true diff --git a/roles/freeipa-setup/tasks/main.yml b/roles/freeipa-setup/tasks/main.yml deleted file mode 100644 index f29b99df1..000000000 --- a/roles/freeipa-setup/tasks/main.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- - -- block: - - name: Set FreeIPA admin password - set_fact: - freeipa_admin_password: "{{ lookup('pipe','uuidgen') }}" - cacheable: true - when: freeipa_admin_password is not defined - - - name: Set directory manager password - set_fact: - directory_manager_password: "{{ lookup('pipe','uuidgen') }}" - cacheable: true - when: directory_manager_password is not defined - - - name: Create FreeIPA deployment script - template: - src: deploy_freeipa.sh.j2 - dest: "~{{ supplemental_user }}/deploy_freeipa.sh" - mode: 0744 - - - name: Deploy FreeIPA - become: true - shell: "~{{ supplemental_user }}/deploy_freeipa.sh &> ~{{ supplemental_user }}/deploy_freeipa.log" - -- include: ipa_prep.yml - when: enable_tls_everywhere|bool and prepare_ipa|bool and not undercloud_enable_novajoin|bool - tags: - - undercloud-install diff --git a/roles/freeipa-setup/templates/deploy_freeipa.sh.j2 b/roles/freeipa-setup/templates/deploy_freeipa.sh.j2 deleted file mode 100644 index 62a251bf2..000000000 --- a/roles/freeipa-setup/templates/deploy_freeipa.sh.j2 +++ /dev/null @@ -1,124 +0,0 @@ -#! /bin/bash - -set -eux - -### ---start_docs - -## Setup FreeIPA -## ============= - -## * Set required environment variables:: - -export TRIPLEO_DOMAIN=ooo.test -export CA_SERVER_HOSTNAME=ipa.$TRIPLEO_DOMAIN -export CA_ADMIN_PASS={{ freeipa_admin_password }} -export CA_DIR_MANAGER_PASS={{ directory_manager_password }} -export UNDERCLOUD_FQDN=undercloud.$TRIPLEO_DOMAIN -export IPA_SERVER_IP={{ supplemental_node_ip }} - -## * Set IPA hostname:: - -hostnamectl set-hostname --static $CA_SERVER_HOSTNAME - -## * Prepare the hosts file -## .. note:: This must be at the top of /etc/hosts -## :: - -sed -i "1i$IPA_SERVER_IP $CA_SERVER_HOSTNAME" /etc/hosts - -## * Install required system packages:: -DISABLE_REPO_CMD="yum-config-manager --disable" - -{% if ansible_distribution_major_version is version("8", "==") -%} - -DISABLE_REPO_CMD="dnf config-manager --set-disabled" -dnf module enable -y idm:DL1/{dns,adtrust,client,server,common} - -{% endif %} - -{{ ansible_pkg_mgr }} install -yq ipa-server \ - ipa-server-dns curl iptables - -## * Update NSS (required for CA server to launch during deploy) - -{{ ansible_pkg_mgr }} update -y nss - -## * Increase system entropy (to prevent slow down during IPA installation):: - -{% if ansible_distribution_major_version is version("7", "<=") -%} - -curl -Lo ius-release.rpm https://repo.ius.io/ius-release-el7.rpm -rpm -Uvh ius-release*.rpm - -{% endif %} - -{{ ansible_pkg_mgr }} install -y haveged -systemctl start haveged.service - -## * Install FreeIPA:: - -ipa-server-install -U \ - -r `hostname -d|tr "[a-z]" "[A-Z]"` \ - -p $CA_DIR_MANAGER_PASS \ - -a $CA_ADMIN_PASS \ - --hostname `hostname -f ` \ - --ip-address=$IPA_SERVER_IP \ - --setup-dns \ -{% if custom_nameserver is defined -%} -{% for dns in custom_nameserver %} - --forwarder={{ dns }} \ -{% endfor %} -{% else %} - --auto-forwarders \ -{% endif %} -{% if cloudenv is not defined or cloudenv not in ['internal'] -%} - --auto-reverse {{ ipa_server_install_params|default('') }} -{% endif %} -## * Set CA to create CRL on restart -sed -i "s/ca.crl.MasterCRL.publishOnStart=.*/ca.crl.MasterCRL.publishOnStart=true/" /etc/pki/pki-tomcat/ca/CS.cfg -systemctl restart pki-tomcatd@pki-tomcat.service - -## * Set iptables rules:: - -cat << EOF > freeipa-iptables-rules.txt -# Firewall configuration written by system-config-firewall -# Manual customization of this file is not recommended. -*filter -:INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] --A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT --A INPUT -p icmp -j ACCEPT --A INPUT -i lo -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT -#TCP ports for FreeIPA --A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 389 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 636 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 88 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 464 -j ACCEPT --A INPUT -m state --state NEW -m tcp -p tcp --dport 53 -j ACCEPT -#UDP ports for FreeIPA --A INPUT -m state --state NEW -m udp -p udp --dport 88 -j ACCEPT --A INPUT -m state --state NEW -m udp -p udp --dport 464 -j ACCEPT --A INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT --A INPUT -m state --state NEW -m udp -p udp --dport 53 -j ACCEPT --A INPUT -j REJECT --reject-with icmp-host-prohibited --A FORWARD -j REJECT --reject-with icmp-host-prohibited -COMMIT -EOF - -iptables-restore < freeipa-iptables-rules.txt - -# Setup sub-CAs -{% for subca in freeipa_subcas %} - {% if loop.first %} - echo $CA_ADMIN_PASS | kinit admin - ipa caacl-add-ca hosts_services_caIPAserviceCert --cas=ipa - {% endif %} - ipa ca-add --subject=CN={{subca}} {{subca}} - ipa caacl-add-ca hosts_services_caIPAserviceCert --cas={{subca}} -{% endfor %} - -### ---stop_docs diff --git a/roles/freeipa-setup/templates/ipa_prep.sh.j2 b/roles/freeipa-setup/templates/ipa_prep.sh.j2 deleted file mode 100644 index c201a405b..000000000 --- a/roles/freeipa-setup/templates/ipa_prep.sh.j2 +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -eux - -### --start_docs - -## Set up the necessary permissions/privileges in novajoin -## ======================================================= - -## * Install ansible and tripleo-ipa - -{% if ansible_distribution_major_version is version("9", ">=") -%} -sudo {{ ansible_pkg_mgr }} install -yq ansible-core ansible-tripleo-ipa -ansible-galaxy collection install -v community.general -p ~/.ansible/collections -{% else %} -sudo {{ ansible_pkg_mgr }} install -yq ansible ansible-tripleo-ipa -{% endif %} - -## * Set up FreeIPA permissions and privileges and register the undercloud. -## :: - -export IPA_ADMIN_USER=admin -export IPA_PRINCIPAL=admin -{% if deploy_supplemental_node|bool %} -export IPA_ADMIN_PASSWORD={{ hostvars['supplemental'].freeipa_admin_password }} -export IPA_PASSWORD={{ hostvars['supplemental'].freeipa_admin_password }} -{% else %} -export IPA_ADMIN_PASSWORD={{ freeipa_admin_password }} -export IPA_PASSWORD={{ freeipa_admin_password }} -{% endif %} -export IPA_SERVER_HOSTNAME={{ freeipa_server_hostname }} -export IPA_REALM=$(echo {{ overcloud_cloud_domain }} | awk '{print toupper($0)}') -export IPA_DOMAIN={{ overcloud_cloud_domain }} -export UNDERCLOUD_FQDN={{ undercloud_undercloud_hostname }} -export CLOUD_DOMAIN="{{ overcloud_cloud_domain }}" - -echo $IPA_PASSWORD | kinit $IPA_ADMIN_USER@$IPA_REALM - -ansible-playbook --ssh-extra-args \ - "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \ - /usr/share/ansible/tripleo-playbooks/ipa-server-create-role.yaml - -ansible-playbook --ssh-extra-args \ - "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \ - /usr/share/ansible/tripleo-playbooks/ipa-server-register-undercloud.yaml \ - | grep -o '"ipa_otp = .*"$' | sed 's/ipa_otp = //' > {{ freeipa_otp_key }} - -ansible-playbook --ssh-extra-args \ - "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" \ - /usr/share/ansible/tripleo-playbooks/ipa-server-create-principal.yaml - -### --stop_docs diff --git a/roles/gate-quickstart/defaults/main.yml b/roles/gate-quickstart/defaults/main.yml deleted file mode 100644 index a39c313e1..000000000 --- a/roles/gate-quickstart/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -gated_projects: - - openstack/tripleo-quickstart - - openstack/tripleo-quickstart-extras diff --git a/roles/gate-quickstart/library/jenkins_deps.py b/roles/gate-quickstart/library/jenkins_deps.py deleted file mode 100644 index 8a356f7ae..000000000 --- a/roles/gate-quickstart/library/jenkins_deps.py +++ /dev/null @@ -1,223 +0,0 @@ -#!/usr/bin/env python -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import json -import logging -import re -import requests -# see http://docs.ansible.com/developing_modules.html#common-module-boilerplate -from ansible.module_utils.basic import * - - -DOCUMENTATION = ''' ---- -module: jenkins_deps -version_added: "2.0" -short_description: Parses the Gerrit commit message and identifies cross repo dependency changes -description: - - Parses the Gerrit commit message and identifies cross repo dependency changes. - The expected format in the commit message is: - Depends-On: [@] - Where is the gerrit Change-Id of the dependent change, - should be a part of a hostname in ALLOWED_HOSTS. -options: - host: - description: - - The hostname of the Gerrit server. - required: True - change_id: - description: - - The change-id of the Gerrit change, starting with I... - required: True - branch: - description: - - The branch of the change. - required: True - patchset_rev: - description: - - The sha hash of the patchset to be tested. Latest will be used if omitted. - required: False -''' - -EXAMPLES = ''' -- jenkins-deps: - host: review.opendev.org - change_id: I387b6bfd763d2d86cad68a3119b0edd0caa237b0 - patchset_rev: d18f21853e2f3be7382a20d0f42232ff3a78b348 -''' - -# we ignore any other host reference -ALLOWED_HOSTS = ['review.opendev.org', - 'review.gerrithub.io', - 'review.rdoproject.org'] - - -def parse_commit_msg(current_host, msg): - '''Look for dependency links in the commit message.''' - tags = [] - for line in iter(msg.splitlines()): - # note: this regexp takes care of sanitizing the input - tag = re.search(r'Depends-On: *(I[0-9a-f]+)@?([0-9a-z\.\-:]*)', - line, re.IGNORECASE) - if tag: - change_id = tag.group(1) - target = tag.group(2) - if target == '': - host = current_host - else: - # match a shorthand hostname for our allowed list - for hostname in ALLOWED_HOSTS: - if target in hostname: - host = hostname - break - else: - logging.warning('Cannot resolve "%s" to a host from the ' - 'ALLOWED HOSTS list', target) - continue - tags.append({'host': host, - 'change_id': change_id, - 'branch': None, - 'revision': None}) - return tags - - -def get_details(host, change_id, branch, revision): - '''Get the details of a specific change''' - url = ''.join(['https://', host, '/changes/?q=change:', change_id]) - try: - req = requests.get(url, verify=False) - req.raise_for_status() - except requests.exceptions.HTTPError: - return {'fail_msg': ''.join(['warning: failed to query change ' - 'details from ', url])} - # strip XSSI attack prevention prefix - data = json.loads(req.text[4:]) - if len(data) == 0: - return {'fail_msg': ''.join(['warning: no change found with id ', - change_id, ' at ', url])} - elif len(data) == 1: - # not filtering by branch if not necessary - full_id = data[0]['id'] - else: - # there are more than one change with the same ID - try: - full_id = [change['id'] for change - in data if change['branch'] == branch][0] - except IndexError: - return {'fail_msg': ''.join(['warning: no change found with id ', - change_id, ' for branch ', branch, - ' at ', url])} - url = ''.join(['https://', host, '/changes/', full_id, - '?o=ALL_REVISIONS&o=ALL_COMMITS']) - try: - req = requests.get(url, verify=False) - req.raise_for_status() - except requests.exceptions.HTTPError: - return {'fail_msg': ''.join(['warning: failed to fetch details of ', - change_id, ' from ', url])} - # strip XSSI attack prevention prefix - data = json.loads(req.text[4:]) - if revision is None: - revision = data['current_revision'] - if revision not in data['revisions']: - return {'fail_msg': ''.join(['warning: cannot find revision ', - revision, ' of change ', change_id, - ' at ', url])} - return {'host': host, - 'change_id': str(data['change_id']), - 'project': str(data['project']), - 'branch': str(data['branch']), - 'refspec': str(data['revisions'][revision]['ref']), - 'commit_msg': - str(data['revisions'][revision]['commit']['message'])} - - -def resolve_dep(host, change_id, branch, revision): - '''Dependency resolution. - - Resolve the dependencies in the target commits until there are no more - dependent changes. If the branch or revision is None, it can still resolve - the dependencies. It only uses the branch when the change_id is ambiguous - and by default uses the latest patchset's revision. - - The function avoids circular dependencies and only allows one change per - project to be added to the output list. - - Returns a list of dictionaries with the dependent changes. - ''' - - resolved_ids = [] - deps = [] - to_resolve = [{'host': host, - 'change_id': change_id, - 'branch': branch, - 'revision': revision}] - output_msg = [] - while len(to_resolve) > 0: - change = to_resolve.pop() - # use the original branch as default - if change['branch'] is None: - change['branch'] = branch - - # avoid circular dependencies - if change['change_id'] in resolved_ids: - continue - - details = get_details(**change) - if 'fail_msg' in details: - output_msg.append(details['fail_msg']) - continue - resolved_ids.append(details['change_id']) - - # allow only one of each project as a dependency - if details['project'] not in (d['project'] for d in deps): - deps.append({'host': change['host'], - 'project': details['project'], - 'branch': details['branch'], - 'refspec': details['refspec']}) - else: - output_msg.append( - ''.join(['warning: skipping ', change['change_id'], ' on ', - change['host'], ' because project "', - details['project'], '" is already a dependency'])) - continue - new_deps = parse_commit_msg(change['host'], details['commit_msg']) - to_resolve.extend(new_deps) - if len(deps) == 0: - output_msg.append('error: failed to resolve the target change') - return {'failed': True, - 'msg': ', '.join(output_msg)} - else: - return {'changed': True, - 'ansible_facts': {'artg_change_list': deps}, - 'msg': ', '.join(output_msg)} - - -def main(): - module = AnsibleModule( - argument_spec=dict( - host=dict(required=True, type='str'), - change_id=dict(required=True, type='str'), - branch=dict(required=False, default=None, type='str'), - patchset_rev=dict(required=False, default=None, type='str') - ) - ) - result = resolve_dep(module.params['host'], - module.params['change_id'], - module.params['branch'], - module.params['patchset_rev']) - module.exit_json(**result) - - -if __name__ == "__main__": - main() diff --git a/roles/gate-quickstart/meta/main.yml b/roles/gate-quickstart/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/gate-quickstart/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/gate-quickstart/tasks/checkout.yml b/roles/gate-quickstart/tasks/checkout.yml deleted file mode 100644 index 698f950be..000000000 --- a/roles/gate-quickstart/tasks/checkout.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -- name: Get the project name - set_fact: - gated_project_name: '{{ gated_change.project | regex_replace("^.*/", "") }}' - -- name: Set project name when there is a dependency on tripleo-quickstart - set_fact: - gated_project_name: 'tripleo-quickstart-gate-repo' - when: gated_change.project == "openstack/tripleo-quickstart" - -- name: | - Remove previously checked out git repo - (workaround for ansible bug https://github.com/ansible/ansible-modules-core/issues/5504 ) - file: - path: '{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}' - state: absent - # do not remove the repo if it was cloned by the jenkins job - when: gated_change.project != lookup('env', 'GERRIT_PROJECT') - -- name: Check out the gated change - git: - repo: 'https://{{ gated_change.host }}/{{ gated_change.project }}' - dest: '{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}' - refspec: '{{ gated_change.refspec }}' - version: 'FETCH_HEAD' - # do not check out the gated change if it was already cloned by the jenkins job - when: gated_change.project != lookup('env', 'GERRIT_PROJECT') - -# do this only for the roles -- when: gated_change.project != "openstack/tripleo-quickstart" - block: - - name: Modify requirements - replace: - dest: '{{ lookup("env", "WORKSPACE") }}/tripleo-quickstart/quickstart-extras-requirements.txt' - regexp: '^.*egg={{ gated_project_name }}$' - replace: 'file://{{ lookup("env", "WORKSPACE") }}/{{ gated_project_name }}/#egg={{ gated_project_name }}' - - name: Make sure the package is not installed in our venv - pip: - name: '{{ gated_project_name }}' - state: absent diff --git a/roles/gate-quickstart/tasks/main.yml b/roles/gate-quickstart/tasks/main.yml deleted file mode 100644 index d8fafb80c..000000000 --- a/roles/gate-quickstart/tasks/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -# This playbooks is responsible for gating quickstart and the extra roles -# together with optional dependencies between them. -- name: Parse Jenkins changes - jenkins_deps: - host: "{{ lookup('env', 'GERRIT_HOST') }}" - change_id: "{{ lookup('env', 'GERRIT_CHANGE_ID') }}" - branch: "{{ lookup('env', 'GERRIT_BRANCH') }}" - patchset_rev: "{{ lookup('env', 'GERRIT_PATCHSET_REVISION') }}" - when: - - artg_change_list is not defined - - lookup('env', 'GERRIT_HOST') != "" - -- name: Check out the specific changes - include: checkout.yml gated_change={{ item }} - with_items: '{{ artg_change_list }}' - when: item.project in gated_projects diff --git a/roles/install-built-repo/README.md b/roles/install-built-repo/README.md deleted file mode 100644 index 07f432205..000000000 --- a/roles/install-built-repo/README.md +++ /dev/null @@ -1,62 +0,0 @@ -install-built-repo -================== - -Install built packages on host and/or within the image. -This Ansible role allows installation of packages which were built by DLRN - on a live host or within an image. - -Requirements ------------- - -No requirements. - -Role Variables --------------- - -* `ib_repo_install_script` - path to repositories install script template -* `ib_repo_install_log` - path to repositories install script log -* `ib_repo_run_live`: false/true - where to run repo install script on host (live host that playbook runs on it) (default: true) -* `ib_gating_repo_enabled`: true/false - whether to enable built repo or not (default: true) -* `ib_gating_repo_update`: true/false - whether to do a yum update with the gating repo (default: true) This only works if ib_gating_repo_enabled is also enabled. WARNING: This may inadvertently update packages outside of what is being provided by the gating repo. -* `ib_repo_file_path`: path to compressed repo built by `build-test-packages` role -* `ib_repo_image_inject`: false/true - where to inject and run repo install script on specified image (default: false) -* `ib_repo_image_path`: path to image, in case of injecting repositories into the image -* `ib_repo_host`: host where built repo exists, if it's not the same host where this roles runs -* `ib_create_web_repo`: false/true - Create web accessible repository in directory with built packages (default: false) - -Dependencies ------------- -* `modify-image` role in TripleO Quickstart extras repository - - -Example Playbook ----------------- - -Including an example of how to use this role - - --- - - name: Run repo install - hosts: undercloud - gather_facts: false - roles: - - install-built-repo - - - name: Run repo install - hosts: undercloud - gather_facts: false - vars: - ib_repo_image_inject: true - ib_repo_image_path: "{{ working_dir }}/{{ overcloud_image }}.qcow2" - roles: - - install-built-repo - - -License -------- - -Apache 2.0 - -Author Information ------------------- - -OpenStack diff --git a/roles/install-built-repo/defaults/main.yml b/roles/install-built-repo/defaults/main.yml deleted file mode 100644 index 55659d7d1..000000000 --- a/roles/install-built-repo/defaults/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -ib_repo_workdir: '{{ working_dir }}' -ib_repo_install_script: install-built-repo.sh.j2 -ib_repo_install_log: "{{ ib_repo_workdir }}/install_built_repo.log" -ib_repo_run_live: true -ib_repo_file_path: "{{ ib_repo_workdir }}/gating_repo.tar.gz" -ib_repo_image_inject: false -ib_repo_image_path: "{{ ib_repo_workdir }}/{{ overcloud_image }}.qcow2" -ib_gating_repo_enabled: true -ib_gating_repo_update: true -ib_create_web_repo: "{{ job.provider_job | default(false) }}" -# Configure host where gate_repo files exists, if it's not the host -# where this role is executed -# ib_repo_host: diff --git a/roles/install-built-repo/meta/main.yml b/roles/install-built-repo/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/install-built-repo/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/install-built-repo/tasks/inject_repo.yml b/roles/install-built-repo/tasks/inject_repo.yml deleted file mode 100644 index 199c15565..000000000 --- a/roles/install-built-repo/tasks/inject_repo.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -- name: Inject into image and install packages - include_role: - name: modify-image - vars: - 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" diff --git a/roles/install-built-repo/tasks/install_built_repo.yml b/roles/install-built-repo/tasks/install_built_repo.yml deleted file mode 100644 index 4bee62445..000000000 --- a/roles/install-built-repo/tasks/install_built_repo.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Setup repos on live host - shell: > - set -o pipefail && - {{ ib_repo_workdir }}/install-built-repo.sh 2>&1 {{ timestamper_cmd }} > - {{ ib_repo_install_log }} - become: true - changed_when: true diff --git a/roles/install-built-repo/tasks/main.yml b/roles/install-built-repo/tasks/main.yml deleted file mode 100644 index 0a97cbc0a..000000000 --- a/roles/install-built-repo/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,pkg_mgr" - when: > - ansible_pkg_mgr is not defined - -- name: Create repo setup script - template: - src: "{{ ib_repo_install_script }}" - dest: "{{ ib_repo_workdir }}/install-built-repo.sh" - mode: 0755 - -- when: ib_repo_host is defined - block: - - name: Fetch repo to localhost - fetch: "src={{ ib_repo_file_path }} dest={{ local_working_dir }}/gating_repo.tar.gz flat=yes" - delegate_to: "{{ ib_repo_host }}" - register: fetch_local_repo - until: fetch_local_repo is not failed - retries: 5 - - - name: Upload repo to host for install - copy: "src={{ local_working_dir }}/gating_repo.tar.gz dest=/tmp/gating_repo.tar.gz" - -- name: Copy compressed repo to /tmp - command: cp -f {{ ib_repo_file_path }} /tmp/gating_repo.tar.gz - when: ib_repo_host is not defined - -- include: install_built_repo.yml - when: ib_repo_run_live|bool - -- include: inject_repo.yml - when: ib_repo_image_inject|bool diff --git a/roles/install-built-repo/templates/install-built-repo.sh.j2 b/roles/install-built-repo/templates/install-built-repo.sh.j2 deleted file mode 100644 index 0d7564f2e..000000000 --- a/roles/install-built-repo/templates/install-built-repo.sh.j2 +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -set -x - -mkdir -p /opt -pushd /opt -tar xzf /tmp/gating_repo.tar.gz - -cat > /etc/yum.repos.d/gating.repo << EOF -[gating-repo] -name=Gating repository -baseurl=file:///opt/gating_repo -enabled={{ ib_gating_repo_enabled | bool | ternary('1', '0') }} -gpgcheck=0 -priority=1 -EOF - -{% if ib_create_web_repo|bool %} -ps -ef | grep -i python3 | grep http.server | awk '{print $2}' | xargs --no-run-if-empty kill -9 || true -pushd /opt/gating_repo -iptables -I INPUT -p tcp --dport 8766 -j ACCEPT -nohup python3 -m http.server 8766 1>{{ working_dir }}/pkg_mgr_mirror.log 2>{{ working_dir }}/pkg_mgr_mirror_error.log & -popd -cat > {{ working_dir }}//web-gating.repo << EOF -[gating-repo] -name=Gating repository -baseurl=http://localhost:8766/ -enabled={{ ib_gating_repo_enabled | bool | ternary('1', '0') }} -gpgcheck=0 -priority=1 -EOF -{% endif %} - -{% if ib_gating_repo_enabled|bool and ib_gating_repo_update|bool %} -# FIXME(ykarel) Exclude kernel update due to -# https://bugs.launchpad.net/tripleo/+bug/1987632 -{{ ansible_pkg_mgr }} --exclude=kernel* --enablerepo="gating-repo" update -y -{% endif %} diff --git a/roles/ipa-multinode/README.md b/roles/ipa-multinode/README.md deleted file mode 100644 index 72c42834e..000000000 --- a/roles/ipa-multinode/README.md +++ /dev/null @@ -1,69 +0,0 @@ -ipa-multinode -============= - -An Ansible role to install and configure a two-node setup where -the IPA server is running on the secondary node and a standalone -deployment is run on the primary node. - -Requirements ------------- - -* https://opendev.org/x/tripleo-ipa - -Role Variables --------------- - -* `freeipa_internal_ip` -- IP for the FreeIPA server -* `standalone_hostname` -- Hostname for secondary node -* `freeipa_server_hostname` -- Hostname for the FreeIPA server -* `overcloud_cloud_name` -- Cloud name for overcloud -* `overcloud_cloud_domain` -- Cloud domain for overcloud -* `overcloud_cloud_name_internal` -- Internal name for overcloud -* `overcloud_cloud_name_storage` -- Storage cloud name for overcloud -* `overcloud_cloud_name_storage_management` -- Storage namangement cloud name for overcloud -* `overcloud_cloud_name_ctlplane` -- Controlplane cloud name for overcloud -* `freeipa_admin_password` -- FreeIPA server admin password -* `enable_tls` -- Boolean value if FreeIPA server will be used in the deployment -* `ipa_domain` -- IPA domain name -* `cloud_domain` -- IPA cloud domain name -* `ipa_nameserver` -- IPA name server -* `ipa_realm` -- IPA realm -* `freeipa_directory_password` -- Password for the directory manager -* `freeipa_principal` -- FreeIPA principal -* `undercloud_cloud_domain` -- Undercloud cloud domain -* `tls_packages` -- TLS dependacy packages -* `ipa_packages` -- FreeIPA packages - -Example Usage -------------- - -```yaml ---- -- name: Setup the IPA server - hosts: subnode-1 - tags: - - standalone - tasks: - - include_role: - name: ipa-multinode - tasks_from: ipaserver-subnode-install.yml - -- name: Setup the undercloud for IPA server - hosts: undercloud - tags: - - standalone - tasks: - - include_role: - name: ipa-multinode - tasks_from: ipaserver-undercloud-setup.yml -``` - -License -------- - -Apache - -Author Information ------------------- - -TripleO-CI Team diff --git a/roles/ipa-multinode/defaults/main.yml b/roles/ipa-multinode/defaults/main.yml deleted file mode 100644 index 8db4534a5..000000000 --- a/roles/ipa-multinode/defaults/main.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -freeipa_internal_ip: "{{ hostvars['subnode-1'].inventory_ip }}" -standalone_hostname: "standalone-0.{{ tripleo_domain }}" -tripleo_domain: ooo.test -undercloud_cloud_domain: "{{ tripleo_domain }}" -freeipa_server_hostname: "ipa.{{ tripleo_domain }}" -overcloud_cloud_name: "overcloud.{{ tripleo_domain }}" -overcloud_cloud_domain: "{{ tripleo_domain }}" -overcloud_cloud_name_internal: "overcloud.internalapi.{{ tripleo_domain }}" -overcloud_cloud_name_storage: "overcloud.storage.{{ tripleo_domain }}" -overcloud_cloud_name_storage_management: "overcloud.storagemgmt.{{ tripleo_domain }}" -overcloud_cloud_name_ctlplane: "overcloud.ctlplane.{{ tripleo_domain }}" -freeipa_admin_password: fce95318204114530f31f885c9df588f -# vars for new tls work -enable_tls: true -ipa_domain: "{{ tripleo_domain }}" -cloud_domain: "{{ tripleo_domain }}" -ipa_nameserver: "ipa.{{ tripleo_domain }}" -ipa_realm: "{{ ipa_domain | upper }}" -freeipa_directory_password: "{{ freeipa_admin_password }}" -freeipa_principal: admin -tls_packages: - - ipa-client - - python3-pip - - openssl-perl -ipa_packages: - - ipa-server - - ipa-server-dns - - curl - - iptables -forwarder_address_default: 1.1.1.1 -openstack_git_root: "{{ ansible_user_dir }}/src/opendev.org/openstack" diff --git a/roles/ipa-multinode/meta/main.yml b/roles/ipa-multinode/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/ipa-multinode/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml b/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml deleted file mode 100644 index de185e720..000000000 --- a/roles/ipa-multinode/tasks/ipaserver-subnode-install.yml +++ /dev/null @@ -1,205 +0,0 @@ ---- -- set_fact: - subnode_1_ip: "{{ hostvars['subnode-1'].inventory_ip }}" - -- name: set the freeipa_internal_ip - set_fact: - inventory_hostname: "{{ subnode_1_ip }}" - undercloud_ipv4_address: "{{ hostvars['undercloud']['ansible_default_ipv4'].address }}" - standalone_control_virtual_ip: "{{ undercloud_network_cidr|nthhost(210) }}" - cacheable: true - -- include_role: - name: repo-setup - vars: - repo_setup_dir: /home/{{ ansible_user|default('centos') }} - -- name: set FQDN - shell: hostnamectl set-hostname --static {{ ipa_nameserver }} - become: true - -- name: install required packages - shell: dnf module -y enable pki-deps pki-core idm:DL1 - become: true - when: - - ansible_distribution|lower in ['redhat', 'centos'] - - ansible_distribution_major_version is version('8', '==') - -- name: install FreeIPA packages - become: true - package: - name: '{{ ipa_packages }}' - state: latest - -- name: set python_cmd - set_fact: - python_cmd: "python{{ ansible_python.version.major }}" - cacheable: true - when: python_cmd is not defined - -- name: check if FreeIPA is configured - shell: > - {{ python_cmd }} -c 'import sys; from ipaserver.install.installutils import is_ipa_configured; print(is_ipa_configured())' - register: ipa_install - -- name: Add subnode IP to /etc/hosts - shell: - cmd: | - sed -i "1i{{ subnode_1_ip }} {{ ipa_nameserver }}" /etc/hosts - become: true - -- name: check if unbound was in use - stat: - path: /etc/unbound/forwarding.conf - register: unbound_forwarding - -- when: unbound_forwarding.stat.exists == true - block: - - name: get forwarding addresses if unbound is used - become: true - shell: - "cat /etc/unbound/forwarding.conf | grep -o 'forward-addr: .*' | cut -f2- -d' '" - register: forwarder_addresses_output - - - name: print out forwarder addresses - debug: - msg: "{{ item }}" - with_items: "{{ forwarder_addresses_output.stdout_lines }}" - - # some forwarders have format xxxx:xxxx:xxxx::xxxx - # In those cases, use the default 1.1.1.1 - - name: set forwarder_address - set_fact: - forwarder_address: >- - {% if not '::' in forwarder_addresses_output.stdout_lines[0] -%} - "{{ forwarder_addresses_output.stdout_lines[0] }}" - {%- else -%} - "{{ forwarder_address_default }}" - {%- endif -%} - - - name: disable unbound service - become: true - service: - name: unbound - state: stopped - - - name: configure FreeIPA - with unbound forwarder - shell: > - ipa-server-install --realm {{ ipa_realm }} - --ds-password {{ freeipa_directory_password }} - --admin-password {{ freeipa_admin_password }} - --hostname {{ ipa_nameserver }} - --setup-dns - {% if (forwarder_addresses_output is defined) %} - {% if ((not '::' in forwarder_addresses_output.stdout_lines[0]) and - (forwarder_addresses_output.stdout_lines|length > 0) ) %} - {% for fw in forwarder_addresses_output.stdout_lines %} - --forwarder {{ fw }} - {% endfor %} - {% endif %} - {% endif %} - --forwarder {{ job.public_name_server|default(forwarder_address_default) }} - --unattended - --ip-address {{ subnode_1_ip }} - --no-dnssec-validation - become: true - when: - ipa_install.stdout == 'False' - -- name: configure FreeIPA - no unbound forwarder - shell: > - ipa-server-install --realm {{ ipa_realm }} - --ds-password {{ freeipa_directory_password }} - --admin-password {{ freeipa_admin_password }} - --hostname {{ ipa_nameserver }} - --setup-dns - --forwarder {{ job.public_name_server|default(forwarder_address_default) }} - --unattended - --ip-address {{ subnode_1_ip }} - --no-dnssec-validation - become: true - when: - - ipa_install.stdout == 'False' - - unbound_forwarding.stat.exists == false - -# This needs to be set on the FreeIPA server so that the overcloud nodes -# can pull the certificate. If this isn't set, the overcloud nodes will -# have an HTML 404 Not Found response stored in their certificate files -# instead of a valid DER encoded certificate. This eventually snowballs and -# causes openssl operations to fall during the overcloud installation -# process. -- name: configure FreeIPA to publish Master CRL at start - become: true - lineinfile: - path: /etc/pki/pki-tomcat/ca/CS.cfg - regexp: '^ca.crl.MasterCRL.publishOnStart=(.*)$' - line: 'ca.crl.MasterCRL.publishOnStart=true' - -# Add recusion back into ipa node to work around some clouds not using internal -# networks for their nodes. LP#1957083, https://access.redhat.com/solutions/5753431 -- name: Hack recursion back in to named - become: true - lineinfile: - path: /etc/named/ipa-options-ext.conf - line: "allow-recursion { any; };" - -- name: restart FreeIPA server - become: true - service: - name: ipa - state: restarted - -- name: installation notice - debug: - msg: - - "FreeIPA has been installed on {{ inventory_hostname }} with the following - administrator credentials:" - - "user: {{ freeipa_principal }}" - - "password: {{ freeipa_admin_password }}" - -- name: Check DNS works - shell: > - dig +tries=5 +timeout=5 redhat.com - register: dig_output_com - -- debug: - msg: "{{ dig_output_com.stdout }}" - -- name: Check curl works with DNS - shell: > - curl -s -S https://trunk.rdoproject.org/centos8/component/tripleo/ | grep 'consistent' - register: curl_output - -- debug: - msg: "{{ curl_output.stdout }}" - -- name: Add DNS entries - become: true - shell: > - echo "{{ freeipa_admin_password }}" | kinit admin ; - ipa dnsrecord-add ooo.test standalone-0 --a-rec "{{ undercloud_ipv4_address }}"; - ipa dnsrecord-add ooo.test overcloud.ctlplane --a-rec "{{ standalone_control_virtual_ip }}"; - ipa dnsrecord-add ooo.test overcloud --a-rec "{{ standalone_control_virtual_ip }}"; - ipa dnsrecord-add ooo.test overcloud.internalapi --a-rec "{{ standalone_control_virtual_ip }}"; - ipa dnsrecord-add ooo.test overcloud.storage --a-rec "{{ standalone_control_virtual_ip }}"; - ipa dnsrecord-add ooo.test overcloud.storagemgmt --a-rec "{{ standalone_control_virtual_ip }}"; - -- name: Show DNS entries - standalone-0 - become: true - shell: > - echo "{{ freeipa_admin_password }}" | kinit admin ; - ipa dnsrecord-show ooo.test standalone-0 - register: standalone_record - -- name: Show DNS entries - overcloud - become: true - shell: > - echo "{{ freeipa_admin_password }}" | kinit admin ; - ipa dnsrecord-show ooo.test overcloud - register: overcloud_record - -- debug: - msg: "{{ standalone_record.stdout }}" - -- debug: - msg: "{{ overcloud_record.stdout }}" diff --git a/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml b/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml deleted file mode 100644 index b1ed03f1b..000000000 --- a/roles/ipa-multinode/tasks/ipaserver-undercloud-setup.yml +++ /dev/null @@ -1,296 +0,0 @@ ---- -- set_fact: - subnode_1_ip: "{{ hostvars['subnode-1'].inventory_ip }}" - standalone_hostname: "standalone-0.{{ tripleo_domain }}" - tripleo_domain: ooo.test - ipa_domain: "{{ tripleo_domain }}" - ipa_realm: "{{ ipa_domain | upper }}" - ipa_user: admin - ipa_password: "{{ freeipa_admin_password }}" - ipa_nameserver: "ipa.{{ tripleo_domain }}" - undercloud_hostname: "standalone-0.{{ tripleo_domain }}" - cloud_domain: "{{ tripleo_domain }}" - undercloud_cloud_domain: "{{ tripleo_domain }}" - freeipa_server_hostname: "ipa.{{ tripleo_domain }}" - freeipa_admin_password: fce95318204114530f31f885c9df588f - enable_tls: true - cacheable: true - -- name: Add subnode IP to /etc/hosts - lineinfile: - line: "{{ subnode_1_ip }} {{ freeipa_server_hostname }}" - path: /etc/hosts - become: true - -- name: Add {{ subnode_1_ip }} host to freeipa group - add_host: - name: "{{ freeipa_internal_ip }}" - groups: freeipa - -- name: set FQDN - become: true - hostname: - name: "{{ undercloud_hostname }}" - -- name: set hostname properly - become: true - lineinfile: - dest: /etc/hosts - line: "127.0.0.1 undercloud.localdomain localhost localhost.localdomain" - regexp: '^127\.0\.0\.1' - -- name: Including non_root_user_setup tasks list - include_role: - name: undercloud-setup - tasks_from: non_root_user_setup - tags: - - standalone - when: non_root_user_setup|bool - -- name: Including repo-setup role - include_role: - name: repo-setup - tags: - - standalone - -- name: Including package_installs tasks - include_role: - name: undercloud-setup - tasks_from: package_installs - when: package_installs|bool - -- name: Including hostname tasks - include_role: - name: undercloud-setup - tasks_from: hostname - tags: - - standalone - when: hostname_correction|bool or step_set_undercloud_hostname|bool - -- name: install tls dependencies - become: true - package: - name: '{{ tls_packages }}' - state: latest - when: - - enable_tls | bool - -# We need to update /etc/resolv.conf so that the undercloud can use FreeIPA -# for DNS. We also need to make sure it's the first line in -# /etc/resolv.conf otherwise we'll fail to find FreeIPA (e.g., -# ipa.ooo.test). -- name: ensure that DHCP doesn't overwite DNS settings (CentOS/RHEL >= 8) - become: true - lineinfile: - path: /etc/NetworkManager/NetworkManager.conf - regexp: '^dns=' - insertafter: '^[main]' - line: 'dns=none' - when: - - ansible_os_family == 'RedHat' - - ansible_distribution_major_version is version(8, '>=') - -- name: cat out resolv.conf to see original DNS config - become: true - debug: - msg: "Content of resolv.conf before modifications: {{ lookup('file', '/etc/resolv.conf') }}" - -- name: remove any existing entries from the resolv.conf file - become: true - lineinfile: - path: /etc/resolv.conf - regexp: "^nameserver " - state: absent - -- name: disable unbound service - become: true - service: - name: unbound - state: stopped - ignore_errors: true - -- name: set search domain - become: true - lineinfile: - path: /etc/resolv.conf - regexp: '^search' - line: 'search {{ cloud_domain }}' - state: present - when: - - cloud_domain == ipa_domain - -- name: set IPA server as primary DNS provider - become: true - lineinfile: - path: /etc/resolv.conf - insertafter: '^search' - line: "nameserver {{ freeipa_internal_ip }}" - state: present - -- name: run undercloud ipa installer as non-root user - shell: > - ansible-playbook -vvv - --ssh-extra-args "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - -e ipaclient_hostname="{{ undercloud_hostname }}" - -e tripleo_ipa_client_install_packages=false - /usr/share/ansible/tripleo-playbooks/undercloud-ipa-install.yaml - | tee undercloud-ipa-install.log - environment: - IPA_DOMAIN: "{{ ipa_domain }}" - IPA_REALM: "{{ ipa_realm }}" - IPA_ADMIN_USER: "{{ ipa_user }}" - IPA_ADMIN_PASSWORD: "{{ ipa_password }}" - IPA_SERVER_HOSTNAME: "{{ ipa_nameserver }}" - UNDERCLOUD_FQDN: "{{ undercloud_hostname }}" - USER: zuul - CLOUD_DOMAIN: "{{ cloud_domain }}" - # yamllint disable-line rule:line-length - ANSIBLE_ROLES_PATH: "/usr/share/ansible/tripleo-playbooks/roles:/home/zuul/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/usr/share/ansible/tripleo-playbooks:{{ openstack_git_root }}/tripleo-ansible/tripleo_ansible/roles" - when: - - enable_tls | bool - -- name: remove all other nameservers from resolv.conf - become: true - lineinfile: - path: /etc/resolv.conf - regexp: '^nameserver 127.0.0.1' - state: absent - -- name: debug nodepool_provider - debug: - msg: '{{ job.nodepool_provider }}' - -- name: Set fact on nameserver to use as public - set_fact: - trunk_public_nameserver: "{{ job.public_name_server|default('8.8.8.8') }}" - -- name: Register A record resolved by public nameserver - trunk.rdoproject.org - shell: > - dig +short @{{ trunk_public_nameserver }} trunk.rdoproject.org - register: trunk_record_public - -- name: Return A record resolved by public nameserver - trunk.rdoproject.org - debug: - msg: "{{ trunk_record_public.stdout_lines[1] }}" - -- name: Register A record resolved by ipa nameserver - trunk.rdoproject.org - shell: > - dig +short @{{ ipa_nameserver }} trunk.rdoproject.org - register: trunk_record_ipa - -- name: Return host resolved by freeipa_address - debug: - msg: "{{ trunk_record_ipa.stdout_lines[1] }}" - when: trunk_record_ipa.stdout_lines|length > 0 - -- name: Register A record resolved by public nameserver - releases.openstack.org - shell: > - dig +short @{{ trunk_public_nameserver }} releases.openstack.org - register: releases_record_public - -- name: Return A record resolved by public nameserver - releases.openstack.org - debug: - msg: "{{ releases_record_public.stdout_lines[2] }}" - -- name: Register A record resolved by public nameserver - redhat.com - shell: > - dig +short @{{ trunk_public_nameserver }} redhat.com - register: redhat_record_public - -- name: Return A record resolved by public nameserver - redhat.com - debug: - msg: "{{ redhat_record_public.stdout_lines[0] }}" - -- name: Register A record resolved by public nameserver - opendev.org - shell: > - dig +short @{{ trunk_public_nameserver }} opendev.org - register: opendev_record_public - -- name: Return A record resolved by public nameserver - opendev.org - debug: - msg: "{{ opendev_record_public.stdout_lines[0] }}" - -- name: Register A record resolved by public nameserver - tarballs.opendev.org - shell: > - dig +short @{{ trunk_public_nameserver }} tarballs.opendev.org - register: tarballs_record_public - -- name: Return A record resolved by public nameserver - tarballs.opendev.org - debug: - msg: "{{ tarballs_record_public.stdout_lines[2] }}" - -- name: Register A record resolved by public nameserver - github.com - shell: > - dig +short @{{ trunk_public_nameserver }} github.com - register: github_record_public - -- name: Return A record resolved by public nameserver - github.com - debug: - msg: "{{ github_record_public.stdout_lines[0] }}" - -- name: Add entries to /etc/hosts for providers that don't resolve - become: true - lineinfile: - path: /etc/hosts - line: "{{ item }}" - state: present - with_items: - - '{{ redhat_record_public.stdout_lines[0] }} redhat.com' - - '{{ trunk_record_public.stdout_lines[1] }} trunk.rdoproject.org' - - '{{ releases_record_public.stdout_lines[2] }} releases.openstack.org' - - '{{ opendev_record_public.stdout_lines[0] }} opendev.org' - - '{{ tarballs_record_public.stdout_lines[2] }} tarballs.opendev.org' - - '{{ github_record_public.stdout_lines[0] }} github.com' - -- name: check if /etc/ci/mirror_info.sh exists - stat: - path: /etc/ci/mirror_info.sh - register: mirror_info_result - -- name: Return RDO proxy when /etc/ci/mirror_info.sh exists - when: mirror_info_result.stat.exists - block: - - name: get nodepool_mirror_host - become: true - shell: > - cat /etc/ci/mirror_info.sh | sed -n -e 's/export NODEPOOL_MIRROR_HOST=//p' - register: nodepool_mirror_host - - - name: Return nodepool_mirror_host - debug: - msg: "{{ nodepool_mirror_host.stdout }}" - - - name: Register A record resolved by public nameserver - mirror host - shell: > - dig +short @{{ trunk_public_nameserver }} {{ nodepool_mirror_host.stdout }} - register: mirror_host_record_public - - - name: Return A record resolved by public nameserver - mirror host - debug: - msg: "{{ mirror_host_record_public.stdout_lines[1] }}" - when: mirror_host_record_public.stdout_lines|length >=2 - - - name: Add entries to /etc/hosts for providers that don't resolve - become: true - lineinfile: - path: /etc/hosts - line: '{{ mirror_host_record_public.stdout_lines[1] }} {{ nodepool_mirror_host.stdout }}' - state: present - when: mirror_host_record_public.stdout_lines|length >=2 - -- name: Check that the DNS works - shell: > - dig +tries=5 +timeout=5 redhat.com - register: dig_ouput_com - ignore_errors: true - -- debug: - msg: "dig_ouput_com is {{ dig_ouput_com.stdout }}" - -- name: Check curl works with DNS - shell: > - curl -s -S https://trunk.rdoproject.org/centos8/component/tripleo/ | grep 'consistent' - register: curl_output - -- debug: - msg: "{{ curl_output.stdout }}" diff --git a/roles/modify-image/README.md b/roles/modify-image/README.md deleted file mode 100644 index 3bd7c03b0..000000000 --- a/roles/modify-image/README.md +++ /dev/null @@ -1,133 +0,0 @@ -modify-image -============ - -An Ansible role for modifying an image via the libguestfs tool, virt-customize. -The role requires an image and a script to run inside of that image via -virt-customize. It also has paramaters for how much memory and cpu to give -the virt-customize VM, and a list of artifacts to copy out of the VM after -running the script. The script will always produce a log of the same name as -the script with .log appended. This can be extracted via the -`modify_image_extract_list` variable. - -Requirements ------------- - -* [libguestfs](http://libguestfs.org/) - -Role Variables --------------- - -* `image_to_modify` -- the image that virt-customize will operate on -* `modify_script` -- the script that will be run inside the image -* `modify_image_upload_files` -- list of src/dest of files to upload to image - (files are uploaded before running the script) -* `modify_image_install_packages` -- list of packages to install in the image - (packages are installed before running the script) -* `modify_image_extract_list` -- list of artifacts to extract after the image - is modified -* `modify_image_working_dir` -- directory containing image and script. This is - also where extracted files and logs will end up. -* `modify_image_vc_ram` -- amount of RAM to give the virt-customize VM (in MB) -* `modify_image_vc_cpu` -- number of CPUs to give the virt-customize VM -* `modify_image_vc_verbose` -- whether to run virt-customize with verbose flag -* `modify_image_vc_trace` -- whether to run virt-customize with trace flag -* `modify_image_vc_root_password` -- password for the root account of the image - (useful for baremetal envs) - -Example Usage -------------- - -```yaml ---- -- name: | - Run a script inside an image via virt-customize without extracting anything - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_script: "{{ working_dir }}/undercloud_convert.sh" - roles: - - modify-image - -- name: Run a script inside an image and extract the log from the script - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_script: "{{ working_dir }}/undercloud_convert.sh" - modify_image_extract_list: - - /tmp/builder.log - roles: - - modify-image - -- name: Run a script inside an image that needs to have lots of resources - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_script: "{{ working_dir }}/undercloud_convert.sh" - modify_image_vc_cpu: 8 - modify_image_vc_ram: 16384 - roles: - - modify-image - -- name: Run a script inside an image with virt-customize in verbose mode - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_script: "{{ working_dir }}/undercloud_convert.sh" - modify_image_verbose: true - roles: - - modify-image - -- name: Upload files to image - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_image_upload_files: - - src: /tmp/file_to_upload.tar.gz - dest: /home/user/renamed_file.tar.gz - - src: /home/local_user/file - dest: /home/image_user/ - roles: - - modify-image - -- name: Upload files to image and run script - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/undercloud.qcow2" - modify_image_upload_files: - - src: /tmp/file_to_upload.tar.gz - dest: /home/user/renamed_file.tar.gz - - src: /home/local_user/file - dest: /tmp/ - modify_script: "{{ working_dir }}/undercloud_convert.sh" - roles: - - modify-image - -- name: Install packages in the image - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/{{ overcloud_image }}.qcow2" - modify_image_install_packages: - - 'package_to_be_installed_1' - - 'package_to_be_installed_2' - - 'package_to_be_installed_3' - include_role: - name: modify-image - -- name: Upload an RPM file and install it in the image - hosts: virthost - vars: - image_to_modify: "{{ working_dir }}/{{ overcloud_image }}.qcow2" - modify_image_upload_files: - - src: "/tmp/rpm_to_be_uploaded.rpm" - dest: /root/rpm_to_be_installed.rpm - modify_image_install_packages: - - '/root/rpm_to_be_installed.rpm' - include_role: - name: modify-image - -``` - -License -------- - -Apache diff --git a/roles/modify-image/defaults/main.yml b/roles/modify-image/defaults/main.yml deleted file mode 100644 index 8929a8ef6..000000000 --- a/roles/modify-image/defaults/main.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# defaults file for modify-image - -# These variable do not have a default because there is no sane default. The -# role will fail immediately if either is not specified. -# image_to_modify: -# modify_script: - -# Run a specific command -# modify_image_run_command: - -# Note: modify_image_run_command will run first then -# modify_image_upload_files will run. It is useful in case -# to make sure remote directories exists. -# The upload list of files -modify_image_upload_files: [] - -# The extract list defaults to empty list -modify_image_extract_list: [] - -# The package install list defaults to empty list -modify_image_install_packages: [] - -# By default we use the global working directory for modifying images -modify_image_working_dir: "{{ working_dir }}" - -# ram, cpu and root password are not set by default to take libguestfs defaults by default -# modify_image_vc_ram: -# modify_image_vc_cpu: -# modify_image_vc_root_password: -modify_image_vc_verbose: false -modify_image_vc_trace: false -libguestfs_mode: true -# TODO(sshnaidm): implement initramfs image modifying -initramfs_image: false diff --git a/roles/modify-image/meta/main.yml b/roles/modify-image/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/modify-image/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/modify-image/tasks/libguestfs.yml b/roles/modify-image/tasks/libguestfs.yml deleted file mode 100644 index 8806c4dee..000000000 --- a/roles/modify-image/tasks/libguestfs.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -- name: ensure libguestfs is installed - # noqa 403 - yum: name=libguestfs-tools-c state=latest - become: true - -- name: virt-customize args --> reset private var - set_fact: _vc_args="" - -- name: virt-customize args --> memory - set_fact: _vc_args="{{ _vc_args }} -m {{ modify_image_vc_ram }}" - when: modify_image_vc_ram is defined - -- name: virt-customize args --> cpu - set_fact: _vc_args="{{ _vc_args }} --smp {{ modify_image_vc_cpu }}" - when: modify_image_vc_cpu is defined - -- name: virt-customize args --> verbose output - set_fact: _vc_args="{{ _vc_args }} -v" - when: modify_image_vc_verbose|bool - -- name: virt-customize args --> trace/debug output - set_fact: _vc_args="{{ _vc_args }} -x" - when: modify_image_vc_trace|bool - -- name: virt-customize agrs --> run command - set_fact: _vc_args="{{ _vc_args }} --run-command {{ modify_image_run_command }}" - when: modify_image_run_command is defined - -- name: virt-customize args --> upload files - set_fact: _vc_args="{{ _vc_args }} --upload {{ item.src }}:{{ item.dest }}" - with_items: "{{ modify_image_upload_files }}" - -- name: virt-customize args --> install packages - set_fact: _vc_args="{{ _vc_args }} --install {{ modify_image_install_packages|join(",") }}" - when: modify_image_install_packages - -- name: virt-customize args --> modify script - set_fact: _vc_args="{{ _vc_args }} --run {{ modify_script }}" - when: modify_script is defined - -- name: virt-customize args --> root password - set_fact: _vc_args="{{ _vc_args }} --root-password password:{{ modify_image_vc_root_password }}" - when: modify_image_vc_root_password is defined - -- name: Run virt-customize on the provided image - shell: > - virt-customize {{ _vc_args }} - -a {{ image_to_modify }} - > {{ working_dir }}/{{ modify_script|default('modify_image')|replace('/','_') }}.log 2>&1 - environment: - LIBGUESTFS_BACKEND: direct - args: - chdir: "{{ modify_image_working_dir }}" - changed_when: true - -- name: Extract artifacts from the image - shell: > - virt-copy-out - -a {{ image_to_modify }} - {{ item }} - {{ modify_image_working_dir }} - environment: - LIBGUESTFS_BACKEND: direct - args: - chdir: "{{ modify_image_working_dir }}" - with_items: "{{ modify_image_extract_list }}" - changed_when: true diff --git a/roles/modify-image/tasks/main.yml b/roles/modify-image/tasks/main.yml deleted file mode 100644 index 007e5991f..000000000 --- a/roles/modify-image/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- - -- 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. - when: image_to_modify is not defined or (modify_script is not defined and modify_image_upload_files == []) - -- include: libguestfs.yml - when: libguestfs_mode|bool - -- include: manual.yml - when: not libguestfs_mode|bool diff --git a/roles/modify-image/tasks/manual.yml b/roles/modify-image/tasks/manual.yml deleted file mode 100644 index 8c7ffd0ac..000000000 --- a/roles/modify-image/tasks/manual.yml +++ /dev/null @@ -1,138 +0,0 @@ ---- -- name: Set abs path for image - command: echo "{{ image_to_modify }}" - register: image_to_modify_abs_path - changed_when: false - -- name: Create a temp dir for extracting images - command: mktemp -d - register: mktemp_command - changed_when: true - -- name: Set names for images and temp dir - set_fact: - mount_tempdir: "{{ mktemp_command.stdout }}" - -- name: Ensure qemu-img is installed - package: - name: qemu-img - state: present - become: true - -- when: not initramfs_image|bool - block: - - - name: Set names for images and temp dir - set_fact: - image_to_modify_qcow: "{{ image_to_modify_abs_path.stdout }}" - image_to_modify_raw: "{{ image_to_modify_abs_path.stdout|replace('qcow2', 'raw') }}" - - - name: Convert image - shell: > - set -eo pipefail; - qemu-img convert -f qcow2 -O raw {{ image_to_modify_qcow }} {{ image_to_modify_raw }}; - rm -rf "{{ image_to_modify_qcow }}"; - - - name: Install required packages used in modify-image role - become: true - package: - state: present - name: - - lvm2 - - - name: Mount image - shell: | - set -ex - if type tripleo-mount-image >/dev/null; then - tripleo-mount-image -a {{ image_to_modify_raw }} -m {{ mount_tempdir }} - else - # stable branches do not have tripleo-mount-image, and only use - # partition images - modprobe nbd - if qemu-img info --output json {{ image_to_modify_raw }} |grep '"format": "raw"' ; then - image_format='--format raw' - elif qemu-img info --output json {{ image_to_modify_raw }} |grep '"format": "qcow2"' ; then - image_format='--format qcow2' - else - image_format='' - fi - qemu-nbd $image_format --connect /dev/nbd0 {{ image_to_modify_raw }} - mount /dev/nbd0 {{ mount_tempdir }} - fi - become: true - register: mount_result - ignore_errors: true - - - name: Debug image mount - debug: - msg: - stdout: "{{ mount_result.stdout }}" - stderr: "{{ mount_result.stderr }}" - failed_when: mount_result.rc != 0 - -- name: Extract initramfs image - shell: set -o pipefail && gunzip -c {{ image_to_modify_abs_path.stdout }} | cpio -i - become: true - args: - chdir: "{{ mount_tempdir }}" - when: initramfs_image|bool - -- become: true - block: - - - name: Upload files to image - shell: > - cp {{ item.src }} {{ mount_tempdir }}/{{ item.dest }}; - with_items: "{{ modify_image_upload_files }}" - - - name: Check if /etc/resolv.conf exists - stat: - path: "{{ mount_tempdir }}/etc/resolv.conf" - register: resolv_stat_result - - - name: Create {{ mount_tempdir }}/etc/resolv.conf if it does not exist - file: - path: "{{ mount_tempdir }}/etc/resolv.conf" - state: touch - when: not resolv_stat_result.stat.exists - - - 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{_,}; - umount {{ mount_tempdir }}/dev/; - - - 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: > - 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 / - if type tripleo-unmount-image >/dev/null; then - tripleo-unmount-image -m {{ mount_tempdir }} - else - umount {{ mount_tempdir }} - qemu-nbd --disconnect /dev/nbd0 - fi - qemu-img convert -c -f raw -O qcow2 {{ image_to_modify_raw }} {{ image_to_modify_qcow }} - rm -rf "{{ image_to_modify_raw }}" - rm -rf "{{ mount_tempdir }}" - chown -R {{ undercloud_user }}: /home/{{ undercloud_user }}/ - when: not initramfs_image|bool diff --git a/roles/multinodes/README.md b/roles/multinodes/README.md deleted file mode 100644 index 0ee813b55..000000000 --- a/roles/multinodes/README.md +++ /dev/null @@ -1,69 +0,0 @@ -multinodes -========== - -Provision openstack cloud with subnodes for multinode jobs - -Requirements ------------- - -This Ansible role allows sets up a particular amount of subnodes for reproducing -CI jobs on them. - -Role Variables --------------- - -* `os_region`: OS region, by default is taken from environment variable OS_REGION_NAME -* `os_tenant`: OS tenant ID, by default is taken from environment variables OS_TENANT_ID -* `os_identity_api_version`: OS identity API version, by default is taken from environment variable OS_IDENTITY_API_VERSION -* `os_password`: OS password, by default is taken from environment variable OS_PASSWORD -* `os_auth_url`: OS auth URL, by default is taken from environment variable OS_AUTH_URL -* `os_username`: OS username, by default is taken from environment variable OS_USERNAME -* `os_tenant_name`: OS tenant name, by default is taken from environment variable OS_TENANT_NAME -* `os_endpoint_type`: OS endpoint type, by default is taken from environment variable OS_ENDPOINT_TYPE -* `prefix`: (default: '') prefix for stack and hosts names -* `remove_previous_stack:`: bool, (default: true) whether to remove previous stack with same name -* `stack_log`: log file for this role -* `key_name`: (default: multinode_admins) keypair name to inject into subnodes, if not present will be - created from "key_location" -* `private_key_location`: (default: ~/.ssh/id_rsa) users private key -* `key_location`: (default: ~/.ssh/id_rsa.pub) users public key, used for creating keypair -* `stack_name`: (default: multinode_stack) name of Heat stack to create -* `public_net_name:`: (default: 38.145.32.0/22) name of public network on the cloud -* `private_net_name`: (default: private_net) name of private network in stack -* `private_net_base`: (default: 192.168.54) base IP range for private network -* `private_net_cidr`: (default: 192.168.54.0/24) CIDR for private network -* `private_net_gateway`: (default: 192.168.54.1) gateway address for private network -* `private_net_pool_start`: (default: 192.168.54.5) DHCP pool start for private network -* `private_net_pool_end`: "(default: 192.168.54.150) DHCP pool end for private network -* `subnode_count`: (default: 2) how many nodes to create -* `subnode_flavor`: (default: m1.large) flavor for nodes -* `subnode_groups`: (default: subnodes) ansible host group names for subnodes -* `image_id`: (default: last image from the cloud) Image ID or name in the cloud, by default - it's image with property "latest" in public images in the cloud - -Dependencies ------------- - -No dependencies - -Example Playbook ----------------- - - --- - - name: Multinode - hosts: localhost - gather_facts: false - roles: - - role: multinodes - -For deleting stack it's possible to run playbook with "--tags delete". - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/multinodes/defaults/main.yml b/roles/multinodes/defaults/main.yml deleted file mode 100644 index 73acfb1a5..000000000 --- a/roles/multinodes/defaults/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -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) }}" -os_password: "{{ lookup('env', 'OS_PASSWORD') }}" -os_auth_url: "{{ lookup('env', 'OS_AUTH_URL')|default('https://phx2.cloud.rdoproject.org:13000/v2.0') }}" -os_username: "{{ lookup('env', 'OS_USERNAME') }}" -os_tenant_name: "{{ lookup('env', 'OS_TENANT_NAME') }}" -os_endpoint_type: "{{ lookup('env', 'OS_ENDPOINT_TYPE')|default('publicURL') }}" - -prefix: '' -remove_previous_stack: true -local_working_dir: "{{ lookup('env', 'HOME') }}/.quickstart" -stack_log: "{{ local_working_dir }}/{{ prefix }}provision_multinode_stack.log" -key_name: multinode_admins -private_key_location: "{{ lookup('env', 'HOME') }}/.ssh/id_rsa" -key_location: "{{ private_key_location }}.pub" -# image_id: - -stack_name: "{{ prefix }}multinode_stack" -public_net_name: 38.145.32.0/22 -private_net_name: "{{ prefix }}private_net" -private_net_base: 192.168.54 -private_net_cidr: "{{ private_net_base }}.0/24" -private_net_gateway: "{{ private_net_base }}.1" -private_net_pool_start: "{{ private_net_base }}.5" -private_net_pool_end: "{{ private_net_base }}.150" - -subnode_count: 2 -subnode_flavor: m1.large -subnode_groups: - - subnodes -nodepool_user: zuul -default_image_user: centos diff --git a/roles/multinodes/tasks/delete_stack.yml b/roles/multinodes/tasks/delete_stack.yml deleted file mode 100644 index 798a1bd63..000000000 --- a/roles/multinodes/tasks/delete_stack.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: Delete stack - # noqa: 306 - shell: > - echo "Executing 'openstack stack delete {{ stack_name }} --yes'" >> {{ stack_log }}; - openstack stack delete {{ stack_name }} --yes &>> {{ stack_log }} && { - export COUNTER=0; - while openstack stack show {{ stack_name }} &>> {{ stack_log }} ; do - if [ $COUNTER -lt 10 ]; then - sleep 30; - if openstack stack show {{ stack_name }} | grep FAILED ; then - echo "Failed deleting OVB stack" | tee -a {{ stack_log }}; - openstack stack show {{ stack_name }} &>> {{ stack_log }}; - openstack stack failures list --long {{ stack_name }} &>> {{ stack_log }} || echo 'Failed to list stack failures' >> {{ stack_log }}; - # NOTE(emilien) "openstack overcloud failures" was introduced in Rocky - openstack overcloud failures &>> {{ stack_log }} || echo 'Failed to list deployment failures' >> {{ stack_log }}; - exit 0; - fi; - COUNTER=$((COUNTER+1)); - fi; - done; } || echo "No stack {{ stack_name }} present" >> {{ stack_log }} - environment: - OS_USERNAME: "{{ os_username }}" - OS_PASSWORD: "{{ os_password }}" - OS_TENANT_NAME: "{{ os_tenant_name }}" - OS_AUTH_URL: "{{ os_auth_url }}" - args: - executable: /bin/bash - register: delete_stack - changed_when: true - -- name: Fail if stack was not deleted properly - fail: - msg: 'Deletion of stack {{ stack_name }} failed, log: {{ stack_log }}' - when: '"Failed deleting OVB stack" in delete_stack.stdout' diff --git a/roles/multinodes/tasks/main.yml b/roles/multinodes/tasks/main.yml deleted file mode 100644 index 83ed90138..000000000 --- a/roles/multinodes/tasks/main.yml +++ /dev/null @@ -1,211 +0,0 @@ ---- -- name: Fail if no auth is provided - fail: - msg: 'Please source credential rc file from your tenant on cloud' - when: not os_username or not os_password or not os_tenant_name - tags: - - delete - -- name: Check if openstack client is installed - shell: command -v openstack 2>/dev/null - register: openstack_client_installed - tags: - - delete - changed_when: false - -- name: Fail if no openstack client is installed - fail: - msg: 'Please install openstack client as it is required for running this role' - when: openstack_client_installed.rc != 0 - tags: - - delete - -- name: Ensure local working dir exists - file: - dest: "{{ local_working_dir }}" - state: directory - tags: - - delete - -- name: Clean log for this role - copy: - dest: "{{ stack_log }}" - content: '' - tags: - - delete - -- include: delete_stack.yml - when: remove_previous_stack|bool - tags: - - delete - -- name: Image to use - block: - - - name: find image - shell: openstack image list --long -f value -c ID --public --property latest=centos-7-latest | tail -1 - register: image_id_latest - changed_when: false - - - name: Set fact for image - set_fact: - image_id: "{{ image_id_latest.stdout }}" - - when: image_id is not defined - -- name: Add keypair - shell: > - set -o pipefail && - openstack keypair show {{ key_name }} && echo "{{ key_name }} already exists" || - openstack keypair create --public-key {{ key_location }} {{ key_name }} 2>&1 | tee -a {{ stack_log }} - environment: - OS_USERNAME: "{{ os_username }}" - OS_PASSWORD: "{{ os_password }}" - OS_TENANT_NAME: "{{ os_tenant_name }}" - OS_AUTH_URL: "{{ os_auth_url }}" - args: - executable: /bin/bash - changed_when: true - -- name: Create parent template - template: - src: stack.yaml - dest: "{{ local_working_dir }}/multinode_stack.yaml" - -- name: Create resources group template - template: - src: subnode.yaml - dest: "{{ local_working_dir }}/subnode.yaml" - -- name: Create parameters in environment file for templates - template: - src: params.yaml.j2 - dest: "{{ local_working_dir }}/params_multinode.yaml" - -- name: Create stack - # noqa: 306 - shell: > - echo "Executing 'openstack stack create {{ stack_name }} --template {{ local_working_dir }}/multinode_stack.yaml - -e {{ local_working_dir }}/params_multinode.yaml &>> {{ stack_log }}'" | tee -a {{ stack_log }}; - openstack stack create {{ stack_name }} --template {{ local_working_dir }}/multinode_stack.yaml - -e {{ local_working_dir }}/params_multinode.yaml &>> {{ stack_log }} || exit 1; - export COUNTER=0; - while ! openstack stack show {{ stack_name }} | grep CREATE_COMPLETE; do - if [ $COUNTER -lt 30 ]; then - sleep 10; - if openstack stack show {{ stack_name }} | grep FAILED ; then - echo "Failed to create multinode stack {{ stack_name }}" | tee -a {{ stack_log }}; - openstack stack show {{ stack_name }} >> {{ stack_log }} 2>&1; - openstack stack failures list --long {{ stack_name }} >> {{ stack_log }} 2>&1 || echo 'Failed to list stack failures' >> {{ stack_log }}; - exit 0; - fi; - COUNTER=$((COUNTER+1)); - fi; - done; - openstack stack show "{{ stack_name }}" >> {{ stack_log }}; - environment: - OS_USERNAME: "{{ os_username }}" - OS_PASSWORD: "{{ os_password }}" - OS_TENANT_NAME: "{{ os_tenant_name }}" - OS_AUTH_URL: "{{ os_auth_url }}" - args: - executable: /bin/bash - register: create_stack - changed_when: true - -- name: Fail if stack failed to create - fail: - msg: "Failed to create multinode stack {{ stack_name }}, check log: {{ stack_log }}" - when: '"Failed to create multinode stack" in create_stack.stdout' - -- name: Log - debug: - msg: "Log from stacks management is in {{ stack_log }}" - tags: - - delete - -- name: Get output from nodes - command: > - openstack stack output show {{ stack_name }} subnode_ip_pairs -c output_value -f value - register: subnode_ips - changed_when: true - -- name: Add hosts - add_host: - name: "subnode-{{ item.0 }}" - hostname: "{{ item.1.1 }}" - groups: "{{ subnode_groups| join(',') }}" - ansible_user: "{{ default_image_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: Wait for provisioned hosts to become reachable - command: - ssh -o BatchMode=yes -o "StrictHostKeyChecking=no" {{ default_image_user }}@{{ hostvars[item].ansible_host }} -i "{{ private_key_location }}" - register: result - until: result is success - retries: 100 - delay: 5 - with_items: - - "{{ groups['subnodes'] }}" - changed_when: false - -# In case of blank centos image we need to create CI user and update inventory -- when: hostvars['subnode-0'].ansible_user != "{{ nodepool_user }}" - block: - - - 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: 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 }}" - -- name: Dump hosts to file - template: - src: multinode_hosts.j2 - dest: '{{ local_working_dir }}/multinode_hosts' diff --git a/roles/multinodes/templates/multinode_hosts.j2 b/roles/multinodes/templates/multinode_hosts.j2 deleted file mode 100644 index 820cb2ef7..000000000 --- a/roles/multinodes/templates/multinode_hosts.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{% for h in groups['subnodes'] %} -{{ h }} ansible_host={{ hostvars[h].ansible_host }} ansible_user={{ hostvars[h].ansible_user }} ansible_private_key_file={{ hostvars[h].ansible_private_key_file }}{% if hostvars[h].get('subnode_private_ip') %} subnode_private_ip={{ hostvars[h].subnode_private_ip }}{% endif %}{% if hostvars[h].get('subnode_public_ip') %} subnode_public_ip={{ hostvars[h].subnode_public_ip }}{% endif %} - -{% endfor %} - -{% for group in groups %} -{% if group not in ['ungrouped', 'all'] %} -[{{ group }}] -{% for host in groups[group] %} -{{ host }} -{% endfor %} - -{% endif %} -{% endfor %} diff --git a/roles/multinodes/templates/params.yaml.j2 b/roles/multinodes/templates/params.yaml.j2 deleted file mode 100644 index 72979ae55..000000000 --- a/roles/multinodes/templates/params.yaml.j2 +++ /dev/null @@ -1,11 +0,0 @@ -parameters: - image: {{ image_id }} - public_net_name: {{ public_net_name }} - key_name: {{ key_name }} - private_net_name: {{ private_net_name }} - private_net_cidr: {{ private_net_cidr }} - private_net_gateway: {{ private_net_gateway }} - private_net_pool_start: {{ private_net_pool_start }} - private_net_pool_end: {{ private_net_pool_end }} - subnode_count: {{ subnode_count }} - subnode_flavor: {{ subnode_flavor }} diff --git a/roles/multinodes/templates/stack.yaml b/roles/multinodes/templates/stack.yaml deleted file mode 100644 index ff4f38732..000000000 --- a/roles/multinodes/templates/stack.yaml +++ /dev/null @@ -1,105 +0,0 @@ ---- -heat_template_version: newton - -description: > - This is for multinode -parameters: - key_name: - type: string - description: Name of keypair to assign to servers - image: - type: string - description: Name of image to use for servers - public_net_name: - type: string - description: > - ID or name of public network for which floating IP addresses will be allocated - private_net_name: - type: string - description: Name of private network to be created - private_net_cidr: - type: string - description: Private network address (CIDR notation) - private_net_gateway: - type: string - description: Private network gateway address - private_net_pool_start: - type: string - description: Start of private network IP address allocation pool - private_net_pool_end: - type: string - description: End of private network IP address allocation pool - subnode_flavor: - type: string - description: Flavor for subnode node - subnode_count: - type: string - description: How many subnodes - -resources: - - private_net: - type: OS::Neutron::Net - properties: - 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} - allocation_pools: - - 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} - - router_interface: - type: OS::Neutron::RouterInterface - properties: - router_id: {get_resource: router} - subnet_id: {get_resource: private_subnet} - - - server_security_group: - type: OS::Neutron::SecurityGroup - properties: - description: Add security group rules for server - name: subnode_security_group - rules: - - remote_ip_prefix: 0.0.0.0/0 - protocol: tcp - port_range_min: 22 - port_range_max: 22 - - remote_ip_prefix: 0.0.0.0/0 - protocol: icmp - - remote_ip_prefix: 0.0.0.0/0 - protocol: udp - port_range_min: 4789 - port_range_max: 4789 - - subnodes: - type: OS::Heat::ResourceGroup - depends_on: router_interface - properties: - 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} - 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} - -outputs: - subnode_ip_pairs: - value: {get_attr: [subnodes, subnode_ip_pair]} diff --git a/roles/multinodes/templates/subnode.yaml b/roles/multinodes/templates/subnode.yaml deleted file mode 100644 index 4017c44a7..000000000 --- a/roles/multinodes/templates/subnode.yaml +++ /dev/null @@ -1,58 +0,0 @@ ---- -heat_template_version: newton - -description: > - Subnode config -parameters: - - subnode_flavor: - type: string - description: Flavor for subnode - public_net_name: - type: string - description: > - ID or name of public network for which floating IP addresses will be allocated - key_name: - type: string - description: Name of keypair to assign to servers - image: - type: string - description: Name of image to use for servers - name: - type: string - description: Index for subnodes counting - private_net: - type: string - private_subnet: - type: string - server_security_group: - type: string - -resources: - - subnode_floating_ip: - type: OS::Neutron::FloatingIP - # depends_on: router_interface, subnode_port - properties: - floating_network: {get_param: public_net_name} - port_id: {get_attr: [subnode, addresses, {get_param: private_net}, 0, port]} - - subnode: - type: OS::Nova::Server - properties: - name: {get_param: name} - image: {get_param: image} - flavor: {get_param: subnode_flavor} - key_name: {get_param: key_name} - networks: - - network: {get_param: private_net} - - network: {get_param: private_net} - security_groups: - - {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] diff --git a/roles/nodepool-setup/defaults/main.yml b/roles/nodepool-setup/defaults/main.yml deleted file mode 100644 index ac51af937..000000000 --- a/roles/nodepool-setup/defaults/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -nodepool_cirros_url: http://download.cirros-cloud.net/0.5.2/cirros-0.5.2-x86_64-disk.img -nodepool_cirros_dest: /opt/cache/files/cirros-0.5.2-x86_64-disk.img -nodepool_cirros_checksum: md5:b874c39491a2377b8490f5f1e89761a4 -repos: - - https://opendev.org/openstack/tripleo-quickstart - - https://opendev.org/openstack/tripleo-quickstart-extras - - https://opendev.org/openstack/tripleo-upgrade - - https://opendev.org/x/browbeat - - https://opendev.org/openstack/tripleo-ha-utils - - https://opendev.org/openstack/tripleo-ci - - https://opendev.org/openstack/devstack - - https://opendev.org/openstack/devstack-gate - - https://opendev.org/openstack/openstack-ansible-os_tempest - - https://opendev.org/openstack/ansible-config_template - - https://opendev.org/openstack/ansible-role-python_venv_build - - https://opendev.org/openstack/ansible-collections-openstack -zuul_changes: "{{ lookup('env', 'ZUUL_CHANGES') }}" -subnode_swap_size: 8388608 # 8GB -update_subnodes: true -rdo_cloud_provider: true -packages_list: - - git - - unbound - - screen - - vim - - curl - - iptables-services diff --git a/roles/nodepool-setup/tasks/clone-ci-repos.yml b/roles/nodepool-setup/tasks/clone-ci-repos.yml deleted file mode 100644 index a3b443598..000000000 --- a/roles/nodepool-setup/tasks/clone-ci-repos.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -- name: Create /opt/stack directory - file: - path: /opt/stack - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - state: directory - become: true - -- name: Link /opt/stack/new to /opt/stack for backwards compat - file: - src: /opt/stack - dest: /opt/stack/new - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - state: link - become: true - -- name: Set up git credentials - shell: > - git config --global user.email "user@example.com"; - git config --global user.name "CI user" - changed_when: true - -- include_tasks: patch_repos.yml - with_items: "{{ repos }}" - loop_control: - loop_var: repo_item - -- name: Set oooq extras to install from local copy - copy: - dest: /opt/stack/tripleo-quickstart/quickstart-extras-requirements.txt - content: "git+file:///opt/stack/tripleo-quickstart-extras/#egg=tripleo-quickstart-extras\n" - -- name: Add additional repos to quickstart-extras-requirements.txt - lineinfile: - dest: /opt/stack/tripleo-quickstart/quickstart-extras-requirements.txt - line: "git+file:///opt/stack/{{ item }}/#egg={{ item }}" - with_items: - - "browbeat" - - "ansible-config_template" - - "ansible-role-python_venv_build" - - "openstack-ansible-os_tempest" - - "tripleo-ha-utils" - - "ansible-collections-openstack" - -- name: Create /opt/cache/files directory - file: - path: /opt/cache/files - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - state: directory - become: true - -- name: Download Cirros image - get_url: - url: "{{ nodepool_cirros_url }}" - dest: "{{ nodepool_cirros_dest }}" - checksum: "{{ nodepool_cirros_checksum }}" diff --git a/roles/nodepool-setup/tasks/etc-nodepool.yml b/roles/nodepool-setup/tasks/etc-nodepool.yml deleted file mode 100644 index 00c94aa81..000000000 --- a/roles/nodepool-setup/tasks/etc-nodepool.yml +++ /dev/null @@ -1,85 +0,0 @@ ---- -- name: Create /etc/nodepool directory - file: - path: /etc/nodepool - state: directory - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - mode: 0755 - -- name: Create /etc/nodepool/node_private - lineinfile: - create: true - state: present - name: /etc/nodepool/node_private - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - line: "{{ subnode_private_ip }}" - -- name: Create /etc/nodepool/primary_node_private - lineinfile: - create: true - state: present - name: /etc/nodepool/primary_node_private - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - line: "{{ hostvars['subnode-0'].subnode_private_ip }}" - -- name: Create /etc/nodepool/provider - copy: - content: | - NODEPOOL_PROVIDER={% if rdo_cloud_provider|bool %} - rdo-cloud-tripleo - {% else %} - fake-cloud - {% endif %} - NODEPOOL_CLOUD=fake-cloud - NODEPOOL_REGION=FAKE - NODEPOOL_AZ= - dest: /etc/nodepool/provider - -# Required for single node jobs -- name: Create empty /etc/nodepool/sub_nodes - copy: - dest: /etc/nodepool/sub_nodes - content: '' - -- name: Create /etc/nodepool/sub_nodes - lineinfile: - create: true - state: present - name: /etc/nodepool/sub_nodes - line: "{{ hostvars[item].subnode_public_ip }}" - with_inventory_hostnames: - - subnodes:!subnode-0 - -# Required for single node jobs -- name: Create empty /etc/nodepool/sub_nodes_private - copy: - dest: /etc/nodepool/sub_nodes_private - content: '' - -- name: Create /etc/nodepool/sub_nodes_private - lineinfile: - create: true - state: present - name: /etc/nodepool/sub_nodes_private - line: "{{ hostvars[item].subnode_private_ip }}" - with_inventory_hostnames: - - subnodes:!subnode-0 - -- name: Create /etc/nodepool/id_rsa - shell: > - ssh-keygen -N "" -f /etc/nodepool/id_rsa; - chmod 600 /etc/nodepool/id_rsa; - args: - creates: /etc/nodepool/id_rsa - -- name: Make sure /etc/nodepool/id_rsa is owned by zuul - file: - path: '/etc/nodepool/id_rsa{{ item }}' - owner: "{{ ansible_user }}" - group: "{{ ansible_user }}" - with_items: - - '' - - '.pub' diff --git a/roles/nodepool-setup/tasks/main.yml b/roles/nodepool-setup/tasks/main.yml deleted file mode 100644 index 979f0b5ee..000000000 --- a/roles/nodepool-setup/tasks/main.yml +++ /dev/null @@ -1,172 +0,0 @@ ---- -- include: etc-nodepool.yml - become: true - -- name: Create and enable swap on subnode - shell: > - dd if=/dev/zero of=/root/swapfile bs=1024 count={{ subnode_swap_size }}; - chmod 600 /root/swapfile; - mkswap /root/swapfile; - swapon /root/swapfile; - echo "/root/swapfile swap swap defaults 0 0" >> /etc/fstab; - become: true - changed_when: true - -- name: Create /etc/ci directory - file: - path: /etc/ci - state: directory - owner: "{{ ansible_user }}" - become: true - -# NOTE: (trown) this is just a place holder, but I am not so sure we -# need to create this file. -- name: Create /etc/ci/mirror_info.sh - template: - dest: /etc/ci/mirror_info.sh - src: mirror_info.sh.j2 - -- name: Check for /etc/yum/vars/contentdir - stat: - path: /etc/yum/vars/contentdir - register: yum_contentdir - -- when: not yum_contentdir.stat.exists and ansible_distribution|lower != 'fedora' - block: - - - name: Discover package architecture - command: rpm -q --qf "%{arch}" -f /etc/redhat-release - register: rpm_arch - changed_when: false - - - 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 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: Install repos (will be removed by toci_gatetest) - package: - name: "{{ item }}" - with_items: - - centos-release-openstack-rocky - - epel-release - become: true - when: ansible_distribution|lower != 'fedora' - -- name: Install packages - # noqa 403 - package: - name: "{{ packages_list }}" - state: latest - become: true - -- include: clone-ci-repos.yml - -- name: Set primary public key on all hosts - command: cat /etc/nodepool/id_rsa.pub - register: primary_key - when: inventory_hostname == "subnode-0" - changed_when: false - -- name: Add primary key - lineinfile: - dest: ~/.ssh/authorized_keys - state: present - line: "{{ hostvars['subnode-0'].primary_key.stdout }}" - -- name: Scan SSH keys from subnodes - shell: | - for key in {{ hostvars[item].subnode_public_ip }} {{ hostvars[item].subnode_private_ip }}; do - if ! grep -q $key /etc/ssh/ssh_known_hosts ; then - ssh-keyscan $key >> /etc/ssh/ssh_known_hosts - fi - done - with_inventory_hostnames: - - subnodes - become: true - changed_when: true - -- name: start unbound service - service: - name: unbound - state: started - enabled: true - become: true - -- name: start iptables service - service: - name: iptables - state: started - enabled: true - become: true - -- name: Add iptables rules for subnodes - iptables: - chain: INPUT - source: "{{ hostvars[item].subnode_private_ip }}" - jump: ACCEPT - action: insert - with_inventory_hostnames: - - subnodes - become: true - -- name: Save the iptables rules - shell: - iptables-save > /etc/sysconfig/iptables - become: true - changed_when: true - -- name: Set some env vars - lineinfile: - dest: /etc/environment - state: present - line: "{{ item }}" - with_items: - - "WORKSPACE=/tmp" - - "DEVSTACK_GATE_TIMEOUT=300" - - "REMAINING_TIME=180" # 3 hours for quickstart run - # In case of multinode - - "EXTRA_VARS=' --extra-vars vxlan_mtu=1400'" - become: true - -- when: update_subnodes|bool - block: - - - name: Update packages - # noqa 403 - package: - name: '*' - state: latest - 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 diff --git a/roles/nodepool-setup/tasks/patch_repos.yml b/roles/nodepool-setup/tasks/patch_repos.yml deleted file mode 100644 index a6c7af134..000000000 --- a/roles/nodepool-setup/tasks/patch_repos.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: Check if repo should be changed - set_fact: - proj: "{{ repo_item.replace('.git', '').split('/')[-2:]|join('/') }}:" - -- name: Clone usually if project has no changes to apply - git: - repo: "{{ repo_item }}" - dest: "/opt/stack/{{ repo_item.replace('.git', '').split('/')[-1] }}" - version: master - when: proj not in zuul_changes - -- name: Clone project and apply changes to it - when: proj in zuul_changes - block: - - - name: Get changes - set_fact: - zuul_changes_list: "{{ zuul_changes.split('^')|list }}" - - - name: Clone repo and apply change - shell: | - export dir={{ item.split(':')[0].split('/')[1] }} - export refs={{ item.split(':')[2] }} - if [[ ! -e $dir ]]; then - git clone {{ repo_item }} - cd $dir - git fetch {{ repo_item }} $refs && git checkout FETCH_HEAD - else - cd $dir - git fetch {{ repo_item }} $refs && git cherry-pick --allow-empty FETCH_HEAD - fi - git rebase {{ stable_release|default('master', true) }} - with_items: "{{ zuul_changes_list }}" - when: - - proj in item - - stable_release|default('master', true) in item - args: - chdir: /opt/stack diff --git a/roles/nodepool-setup/templates/mirror_info.sh.j2 b/roles/nodepool-setup/templates/mirror_info.sh.j2 deleted file mode 100644 index 0d239229c..000000000 --- a/roles/nodepool-setup/templates/mirror_info.sh.j2 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -xe - -# Ansible managed - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -export NODEPOOL_MIRROR_HOST=${NODEPOOL_MIRROR_HOST:-mirror.mtl01.inap.opendev.org} - -# This script generates a descriptor slug to use with AFS, composed of the -# operating system, its version, and the processor architecture. - -# Pull in the os release. -# ID is 'fedora', 'centos', 'ubuntu' -# VERSION_ID is '23', '7', '14.04' -# Nothing else is useful and/or reliable across distros -source /etc/os-release - -################################################################################ -# Generate an OS Release Name -OS_TYPE=$ID - -################################################################################ -# Generate a version string. -OS_VERSION=$VERSION_ID -if [ "$OS_TYPE" != "ubuntu" ]; then - OS_VERSION=$(echo $OS_VERSION | cut -d'.' -f1) -fi - -################################################################################ -# Get the processor architecture. -# x86_64, i386, armv7l, armv6l -OS_ARCH=$(uname -m) - -################################################################################ -# Build the name -AFS_SLUG="$OS_TYPE-$OS_VERSION-$OS_ARCH" -AFS_SLUG=$(echo "$AFS_SLUG" | tr '[:upper:]' '[:lower:]') - -export AFS_SLUG -export NODEPOOL_DEBIAN_MIRROR=${NODEPOOL_DEBIAN_MIRROR:-http://$NODEPOOL_MIRROR_HOST/debian} -export NODEPOOL_PYPI_MIRROR=${NODEPOOL_PYPI_MIRROR:-http://$NODEPOOL_MIRROR_HOST/pypi/simple} -export NODEPOOL_WHEEL_MIRROR=${NODEPOOL_WHEEL_MIRROR:-http://$NODEPOOL_MIRROR_HOST/wheel/$AFS_SLUG} -export NODEPOOL_UBUNTU_MIRROR=${NODEPOOL_UBUNTU_MIRROR:-http://$NODEPOOL_MIRROR_HOST/ubuntu} -export NODEPOOL_CENTOS_MIRROR=${NODEPOOL_CENTOS_MIRROR:-http://$NODEPOOL_MIRROR_HOST/centos} -export NODEPOOL_DEBIAN_OPENSTACK_MIRROR=${NODEPOOL_DEBIAN_OPENSTACK_MIRROR:-http://$NODEPOOL_MIRROR_HOST/debian-openstack} -export NODEPOOL_EPEL_MIRROR=${NODEPOOL_EPEL_MIRROR:-http://$NODEPOOL_MIRROR_HOST/epel} -export NODEPOOL_FEDORA_MIRROR=${NODEPOOL_FEDORA_MIRROR:-http://$NODEPOOL_MIRROR_HOST/fedora} -export NODEPOOL_OPENSUSE_MIRROR=${NODEPOOL_OPENSUSE_MIRROR:-http://$NODEPOOL_MIRROR_HOST/opensuse} -export NODEPOOL_CEPH_MIRROR=${NODEPOOL_CEPH_MIRROR:-http://$NODEPOOL_MIRROR_HOST/ceph-deb-hammer} -export NODEPOOL_UCA_MIRROR=${NODEPOOL_UCA_MIRROR:-http://$NODEPOOL_MIRROR_HOST/ubuntu-cloud-archive} -export NODEPOOL_MARIADB_MIRROR=${NODEPOOL_MARIADB_MIRROR:-http://$NODEPOOL_MIRROR_HOST/ubuntu-mariadb} -# Reverse proxy servers -export NODEPOOL_BUILDLOGS_CENTOS_PROXY=${NODEPOOL_BUILDLOGS_CENTOS_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/buildlogs.centos} -export NODEPOOL_CBS_CENTOS_PROXY=${NODEPOOL_CBS_CENTOS_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/cbs.centos} -export NODEPOOL_DOCKER_REGISTRY_PROXY=${NODEPOOL_DOCKER_REGISTRY_PROXY:-http://$NODEPOOL_MIRROR_HOST:8081/registry-1.docker/} -export NODEPOOL_RDO_PROXY=${NODEPOOL_RDO_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/rdo} -export NODEPOOL_RUGYGEMS_PROXY=${NODEPOOL_RUBYGEMS_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/rubygems/} -export NODEPOOL_NPM_REGISTRY_PROXY=${NODEPOOL_NPM_REGISTRY_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/registry.npmjs} -export NODEPOOL_TARBALLS_PROXY=${NODEPOOL_TARBALLS_PROXY:-http://$NODEPOOL_MIRROR_HOST:8080/tarballs} -export NODEPOOL_LXC_IMAGE_PROXY=${NODEPOOL_LXC_IMAGE_PROXY:-$NODEPOOL_MIRROR_HOST:8080/images.linuxcontainers} diff --git a/roles/octavia-amphora-download/README.md b/roles/octavia-amphora-download/README.md deleted file mode 100644 index 3d406b59b..000000000 --- a/roles/octavia-amphora-download/README.md +++ /dev/null @@ -1,43 +0,0 @@ -Octavia-amphora-download -======================== - -An Ansible role to download Octavia amphora images to be used in CI or scripted deployments. - -Requirements ------------- - -This playbook expects a supported version of Ansible and working Internet access. - -Role Variables: ---------------- - -- octavia_amphora_path -- full path for the downloaded amphora image. -- amphora\_url -- url of image to download. If not provided a default location based on branch is used. - -Dependenncies -------------- - -No dependencies - -Example Playbook ----------------- - -Download the amphora image for the stein branch to foo's home directory: - - - hosts: undercloud - vars: - release: "stein" - target_dir: "/home/foo" - roles: - - octavia-amphora-dowload - - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/octavia-amphora-download/meta/main.yml b/roles/octavia-amphora-download/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/octavia-amphora-download/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/octavia-amphora-download/tasks/main.yml b/roles/octavia-amphora-download/tasks/main.yml deleted file mode 100644 index 8d6fa1f1c..000000000 --- a/roles/octavia-amphora-download/tasks/main.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -- name: Set the download url if amphora_url provided - set_fact: - download_url: "{{ amphora_url }}" - when: - amphora_url is defined and ((amphora_url | length) > 0) - -- name: Set the download url to specified release branch if amphora_url not provided - set_fact: - download_url: "https://images.rdoproject.org/octavia/{{ release }}/amphora-x64-haproxy-centos.qcow2" - when: - download_url is not defined - -- name: check for target directory for amphora image - stat: - path: "{{ octavia_amphora_path | dirname }}" - register: amphora_path_stat_result - -# We check for an existing directory because we do not want to modify -# permissions on existing directories, potentially causing perm issues -# with other tasks/processes. -- name: If target path does not exist, create as readable to everyone. - file: - path: "{{ octavia_amphora_path | dirname }}" - state: directory - mode: 0755 - become: true - when: - - not amphora_path_stat_result.stat.exists|bool - -- name: Download the amphora - get_url: - url: "{{ download_url }}" - dest: "{{ octavia_amphora_path }}" - mode: 0644 - become: true diff --git a/roles/ovb-manage-stack/README.md b/roles/ovb-manage-stack/README.md deleted file mode 100644 index ccdf00cba..000000000 --- a/roles/ovb-manage-stack/README.md +++ /dev/null @@ -1,84 +0,0 @@ -Role Name -========= - -Ansible roles for managing a heat stack to deploy an OpenStack cloud using OpenStack Virtual Baremetal. - -Requirements ------------- - -These roles assume that the host cloud has already been patched as per -[Patching the Host Cloud](https://openstack-virtual-baremetal.readthedocs.io/en/latest/host-cloud/patches.html). - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](http://docs.openstack.org/developer/tripleo-docs/basic_deployment/basic_deployment_cli.html#deploy-the-overcloud) - -To interact with the Openstack Virtual Baremetal host cloud, credentials are needed: -- os_username: -- os_password: -- os_tenant_name: -- os_auth_url: # For example http://190.1.1.5:5000/v2.0 -- os_region_name: # Most probably RegionOne - -Parameters required to access the stack: -- stack_name: <'baremetal_{{ idnum }}'> -- name for OVB heat stack -- rc_file: -- file to reference the overcloud -- node_name: 'undercloud' -- existing_key_location: -- required to access the undercloud node -- ssh_extra_args: <'-F "{{ local_working_dir }}/ssh.config.ansible"'> -- undercloud_key: <"{{ local_working_dir }}/id_rsa_undercloud"> - -Parameters required for shade (See defaults/main.yml for default values): -- heat_template -- environment_list - -Parameters used the env.yaml file to create the OVB heat stack (See defaults/main.yml for default values): -- bmc_flavor -- bmc_image -- bmc_prefix -- baremetal_flavor -- baremetal_image -- baremetal_prefix -- key_name -- private_net -- node_count -- public_net -- provision_net -- undercloud_name -- undercloud_image -- undercloud_flavor -- external_net -- templates_dir -- ovb_dir -- network_isolation_type: -- other options are 'none' and 'public-bond' - -- registered_releases -- releases for which images should be available for the undercloud - -- baremetal_driver -- ironic driver to use for overcloud nodes, 'pxe_ipmitool' - for < Queens, 'ipmi' for >= Queens - -Dependencies ------------- - -This playbook depends on the shade library and https://github.com/openstack/openstack-virtual-baremetal. - -Example Playbook ----------------- - -Playbooks to create the strack prior to TripleO Quickstart deployments will require: - -- name: Create the OVB stack - hosts: localhost - roles: - - { role: ovb-manage-stack, ovb_manage_stack_mode: 'create' } - -License -------- - -Apache - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/ovb-manage-stack/defaults/main.yml b/roles/ovb-manage-stack/defaults/main.yml deleted file mode 100644 index c34ee5bd3..000000000 --- a/roles/ovb-manage-stack/defaults/main.yml +++ /dev/null @@ -1,102 +0,0 @@ ---- -release: master -ovb_repo_version: stable/1.0 - -tmp: - idnum: "{{ 100000 |random }}" - -os_username: admin -os_password: password -os_tenant_name: admin -os_auth_url: 'http://10.0.1.10:5000/v2.0' -os_region_name: 'regionOne' -cloud_name: rdocloud - -stack_name: 'baremetal_{{ idnum }}' -rc_file: /home/{{ ansible_user }}/overcloudrc -node_name: 'undercloud' -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' -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" -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 - rhos-12: rhel-7.4-server-x86_64-latest - rhos-13: rhel-7.4-server-x86_64-latest - -port_security: true - -baremetal_ports_template: - multiple-nics: baremetal-ports-all.yaml - multi-nic: baremetal-ports-all.yaml - public-bond: baremetal-ports-public-bond.yaml - -baremetal_port_security_template: - none: baremetal-ports-default-port-security.yaml - multiple-nics: baremetal-ports-all-port-security.yaml - multi-nic: baremetal-ports-all-port-security.yaml - public-bond: baremetal-ports-public-bond-port-security.yaml - -existing_key_location: '~/.ssh/id_rsa' -remove_image_from_host_cloud: false - -bmc_flavor: m1.medium -bmc_image: 'bmc-base' -bmc_prefix: 'bmc-{{ idnum }}' - -baremetal_flavor: m1.large -baremetal_image: 'ipxe-boot' -baremetal_prefix: 'baremetal-{{ idnum }}' - -key_name: 'key-{{ idnum }}' -private_net: 'private-{{ idnum }}' -node_count: 2 -public_net: 'public-{{ idnum }}' -provision_net: 'provision-{{ idnum }}' -provision_net_cidr: 192.0.2.0/24 - -# QuintupleO-specific params ignored by virtual-baremetal.yaml -undercloud_name: 'undercloud-{{ idnum }}' -undercloud_image: 'undercloud-{{ idnum }}.qcow2' -undercloud_flavor: m1.xlarge -external_net: '10.2.1.0/22' - -network_isolation_type: multiple-nics - -registered_releases: - - newton - - ocata - - pike - - master - - rhos-11 - - rhos-12 - - rhos-13 - -baremetal_driver: >- - {% if release not in ['newton', 'ocata', 'pike'] -%} - "ipmi" - {%- else -%} - "pxe_ipmitool" - {%- endif -%} - -# OVB environment clean up -cleanup_stacks_keypairs: false -cleanup_stacks_keypairs_script: cleanup-stacks-keypairs.sh.j2 -cleanup_stacks_keypairs_log: "{{ local_working_dir }}/cleanup_stacks_keypairs.log" diff --git a/roles/ovb-manage-stack/meta/main.yml b/roles/ovb-manage-stack/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/ovb-manage-stack/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/ovb-manage-stack/tasks/main.yml b/roles/ovb-manage-stack/tasks/main.yml deleted file mode 100644 index 02e2c5f24..000000000 --- a/roles/ovb-manage-stack/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Create OVB stack - include: ovb-create-stack.yml - when: ovb_manage_stack_mode == 'create' - -- name: Delete OVB stack - include: ovb-delete-stack.yml - when: ovb_manage_stack_mode == 'delete' diff --git a/roles/ovb-manage-stack/tasks/ovb-cleanup-stacks-keypairs.yml b/roles/ovb-manage-stack/tasks/ovb-cleanup-stacks-keypairs.yml deleted file mode 100644 index c67c024a3..000000000 --- a/roles/ovb-manage-stack/tasks/ovb-cleanup-stacks-keypairs.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Create OVB environment clean up script - template: - src: "{{ cleanup_stacks_keypairs_script }}" - dest: "{{ local_working_dir }}/cleanup-stacks-keypairs.sh" - mode: 0755 - -- name: Remove existing stacks and key pairs - shell: > - set -o pipefail && - {{ local_working_dir }}/cleanup-stacks-keypairs.sh 2>&1 {{ timestamper_cmd }} > - {{ cleanup_stacks_keypairs_log }} - args: - executable: /bin/bash - changed_when: true diff --git a/roles/ovb-manage-stack/tasks/ovb-create-stack.yml b/roles/ovb-manage-stack/tasks/ovb-create-stack.yml deleted file mode 100644 index ce94eeb47..000000000 --- a/roles/ovb-manage-stack/tasks/ovb-create-stack.yml +++ /dev/null @@ -1,210 +0,0 @@ ---- -- name: Deprecation message for network isolation types - debug: - msg: >- - Network isolation type 'multi-nic' is deprecated in R release, - please use 'multiple-nics'. - when: network_isolation_type == 'multi-nic' - -- name: Ensure local working dir exists - file: - path: "{{ local_working_dir }}" - -- name: Clone Openstack Virtual Baremetal repo if it does not exist - git: - repo: https://opendev.org/openstack/openstack-virtual-baremetal.git - dest: "{{ local_working_dir }}/openstack-virtual-baremetal" - version: "{{ ovb_repo_version }}" - -- include: ovb-cleanup-stacks-keypairs.yml - when: cleanup_stacks_keypairs|bool - -- name: generate idnum for all run-related entities - set_fact: - idnum: "{{ tmp.idnum }}" - -- name: set fact for undercloud image - set_fact: - latest_undercloud_image: "{{ latest_guest_image[osp_release | default(release)] }}" - -- name: copy key inserted in image to undercloud_key location - copy: - src: "{{ existing_key_location }}{{ item }}" - dest: "{{ local_working_dir }}/id_rsa_undercloud{{ item }}" - mode: 0600 - with_items: - - "" - - .pub - -- name: Copy deploy stack parameters template - template: - src: env.yaml.j2 - dest: "{{ local_working_dir }}/env-{{ idnum }}.yaml" - mode: 0755 - -- name: Add keypair - shell: > - export OS_USERNAME="{{ os_username }}"; - export OS_PASSWORD="{{ os_password }}"; - export OS_TENANT_NAME="{{ os_tenant_name }}"; - export OS_AUTH_URL="{{ os_auth_url }}"; - nova keypair-add --pub-key {{ existing_key_location }}.pub key-{{ idnum }} - ignore_errors: true - no_log: true - changed_when: true - -- name: copy clouds.yaml file - template: - src: clouds.yaml.j2 - dest: "{{ local_working_dir }}/clouds.yaml" - mode: 0755 - -- name: Deploy stack - shell: > - export OS_CLIENT_CONFIG_FILE="{{ local_working_dir }}/clouds.yaml"; - export OS_CLOUD="{{ cloud_name }}"; - {{ ovb_dir }}/bin/deploy.py --env {{ local_working_dir }}/env-{{ idnum }}.yaml --name {{ stack_name }} --quintupleo - args: - chdir: "{{ ovb_dir }}" - changed_when: true - -- name: Return stack state - # noqa: 306 - shell: > - export OS_USERNAME="{{ os_username }}"; - export OS_PASSWORD="{{ os_password }}"; - export OS_TENANT_NAME="{{ os_tenant_name }}"; - export OS_AUTH_URL="{{ os_auth_url }}"; - export STACK_LOG="{{ local_working_dir }}/ovb_create_stack.log"; - export COUNTER=0; - while ! openstack stack show {{ stack_name }} | grep CREATE_COMPLETE; do - if [ $COUNTER -lt 10 ]; then - sleep 30; - if openstack stack show {{ stack_name }} | grep FAILED ; then - echo "Failed OVB stack" > $STACK_LOG; - openstack stack show {{ stack_name }} >> $STACK_LOG 2>&1; - openstack stack failures list --long {{ stack_name }} >> $STACK_LOG 2>&1 || echo 'Failed to list stack failures' >> $STACK_LOG; - exit 0; - fi; - COUNTER=$((COUNTER+1)); - fi; - done; - openstack stack show "{{ stack_name }}" | grep "status" - register: stack_status - no_log: true - changed_when: false - -- name: Show stack status - debug: - var: stack_status.stdout_lines - -- block: - - name: Get full stack status info in case of failure - command: openstack stack show "{{ stack_name }}" - register: failed_stack - changed_when: false - - - name: Show stack status in case of failure - debug: var="failed_stack.stdout" - - - name: Fail if stack did not deploy successfully - fail: - msg: "Stack {{ stack_name }} did not deploy successfully. See the stack status message above." - when: stack_status.stdout.find("CREATE_COMPLETE") == -1 - -- name: Return floating ip outputs - shell: > - export OS_USERNAME="{{ os_username }}"; - export OS_PASSWORD="{{ os_password }}"; - export OS_TENANT_NAME="{{ os_tenant_name }}"; - export OS_AUTH_URL="{{ os_auth_url }}"; - openstack stack show {{ stack_name }} -f json -c outputs - register: stack_outputs - no_log: true - changed_when: false - -- name: Set fact for undercloud floating IP address - set_fact: - undercloud_ip: "{{ (stack_outputs.stdout|from_json).outputs[0].output_value }}" - cacheable: true - -- name: Add provisioned undercloud host - add_host: - name: undercloud - hostname: "{{ undercloud_ip }}" - groups: "{{ node_groups| join(',') }}" - ansible_host: "{{ undercloud_ip }}" - ansible_user: root - ansible_fqdn: undercloud - ansible_private_key_file: "{{ undercloud_key }}" - ansible_ssh_extra_args: "{{ ssh_extra_args }}" - undercloud_ip: "{{ undercloud_ip }}" - -- name: Wait for provisioned host to become reachable - command: | - ssh -o BatchMode=yes -o "StrictHostKeyChecking=no" root@{{ undercloud_ip }} -i "{{ undercloud_key }}" - register: result - until: result is success - retries: 300 - delay: 5 - changed_when: false - -- when: ovb_setup_user|default('false')|bool - block: - - - name: Setup user - user: - name: "{{ nodepool_user }}" - groups: wheel - append: true - become: true - delegate_to: undercloud - - - name: Setup keys - authorized_key: - user: "{{ nodepool_user }}" - state: present - key: "{{ lookup('file', '{{ undercloud_key }}.pub') }}" - become: true - become_user: "{{ nodepool_user }}" - delegate_to: undercloud - - - 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: undercloud - - - name: Add undercloud with non-root user - add_host: - name: subnode-0 - hostname: "{{ undercloud_ip }}" - groups: subnodes - ansible_user: "{{ nodepool_user }}" - ansible_host: "{{ undercloud_ip }}" - ansible_private_key_file: "{{ undercloud_key }}" - subnode_public_ip: "{{ undercloud_ip }}" - subnode_private_ip: 192.168.23.23 - -- name: Build nodes.json file to be used as instackenv.json - shell: > - chdir={{ local_working_dir }} - export OS_CLIENT_CONFIG_FILE="{{ local_working_dir }}/clouds.yaml"; - export OS_CLOUD="{{ cloud_name }}"; - {{ ovb_dir }}/bin/build-nodes-json --env {{ local_working_dir }}/env-{{ idnum }}.yaml --driver {{ baremetal_driver }} - register: nodes_json - changed_when: true - -- name: remove clouds.yaml file - file: - path: "{{ local_working_dir }}/clouds.yaml" - state: absent - -- name: Dump hosts to file - template: - src: ovb_hosts.j2 - dest: '{{ local_working_dir }}/ovb_hosts' - when: ovb_dump_hosts|default('false')|bool diff --git a/roles/ovb-manage-stack/tasks/ovb-delete-stack.yml b/roles/ovb-manage-stack/tasks/ovb-delete-stack.yml deleted file mode 100644 index db9b3ad32..000000000 --- a/roles/ovb-manage-stack/tasks/ovb-delete-stack.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: Clone Openstack Virtual Baremetal repo if it does not exist - git: - repo: https://opendev.org/openstack/openstack-virtual-baremetal.git - dest: "{{ local_working_dir }}/openstack-virtual-baremetal" - version: "{{ ovb_repo_version }}" - -- name: copy clouds.yaml file - template: - src: clouds.yaml.j2 - dest: "{{ local_working_dir }}/clouds.yaml" - mode: 0755 - -- name: Remove stack - openstack.cloud.stack: - name: "{{ stack_name }}" - cloud: "{{ cloud_name }}" - state: absent - environment: - OS_CLIENT_CONFIG_FILE: "{{ local_working_dir }}/clouds.yaml" - ignore_errors: true - -- name: Remove associated keypair - shell: > - export OS_USERNAME="{{ os_username }}"; - export OS_PASSWORD="{{ os_password }}"; - export OS_TENANT_NAME="{{ os_tenant_name }}"; - export OS_AUTH_URL="{{ os_auth_url }}"; - nova keypair-delete key-{{ idnum }} - ignore_errors: true - no_log: true - changed_when: true - -- name: remove clouds.yaml file - file: - path: "{{ local_working_dir }}/clouds.yaml" - state: absent diff --git a/roles/ovb-manage-stack/templates/cleanup-stacks-keypairs.sh.j2 b/roles/ovb-manage-stack/templates/cleanup-stacks-keypairs.sh.j2 deleted file mode 100644 index 40db1e6fc..000000000 --- a/roles/ovb-manage-stack/templates/cleanup-stacks-keypairs.sh.j2 +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs - -## -------------------------------------------------------------- -## Clean up the OVB environment by removing stacks and key pairs -## -------------------------------------------------------------- - -## ################################################## -## Find the existing stacks and keys pairs to delete -## ################################################## - -## * Return all stacks in COMPLETE or CREATE_FAILED state -## :: - -ALL_STACKS=$({{ local_working_dir }}/bin/openstack stack list | grep "COMPLETE\|CREATE_FAILED" | cut -d '|' -f 3) - -## * Delete stacks in COMPLETE or CREATE_FAILED state - one stack at a time -## :: - -for STACK in $ALL_STACKS; do - echo "Deleting Heat stack $STACK" - {{ local_working_dir }}/bin/openstack stack delete --yes $STACK - COUNTER=0 - while [[ $({{ local_working_dir }}/bin/openstack stack list) == *"$STACK"* ]]; do - if [[ $COUNTER -gt 6 ]]; then - echo "$STACK could not be deleted in time or is in FAILED state." - exit 1 - else - echo "Polling for stack $STACK to be deleted" - sleep 30 - COUNTER=$((COUNTER+1)) - fi - done - -## * Delete the key pair associated with the stack -## :: - - KEYPAIR=$(echo ${STACK/stack/key} | sed 's/oooq-//') - if [[ $({{ local_working_dir }}/bin/nova keypair-list) == *"$KEYPAIR"* ]]; then - echo "Deleting key pair $KEYPAIR" - {{ local_working_dir }}/bin/nova keypair-delete $KEYPAIR - fi -done - -### --stop_docs diff --git a/roles/ovb-manage-stack/templates/clouds.yaml.j2 b/roles/ovb-manage-stack/templates/clouds.yaml.j2 deleted file mode 100644 index 32d26a962..000000000 --- a/roles/ovb-manage-stack/templates/clouds.yaml.j2 +++ /dev/null @@ -1,8 +0,0 @@ -clouds: - {{ cloud_name }}: - auth: - username: {{ os_username }} - password: {{ os_password }} - project_name: {{ os_tenant_name }} - auth_url: {{ os_auth_url }} - region_name: {{ os_region_name }} diff --git a/roles/ovb-manage-stack/templates/env.yaml.j2 b/roles/ovb-manage-stack/templates/env.yaml.j2 deleted file mode 100644 index 5293c3e62..000000000 --- a/roles/ovb-manage-stack/templates/env.yaml.j2 +++ /dev/null @@ -1,89 +0,0 @@ -parameters: - os_user: {{ os_username }} - os_password: {{ os_password }} - os_tenant: {{ os_tenant_name }} - os_auth_url: {{ os_auth_url }} - - bmc_flavor: {{ bmc_flavor }} - bmc_image: 'bmc-base' - bmc_prefix: 'bmc-{{ idnum }}' - - baremetal_flavor: {{ baremetal_flavor }} - baremetal_image: 'ipxe-boot' - baremetal_prefix: 'baremetal-{{ idnum }}' - - key_name: 'key-{{ idnum }}' - private_net: 'private-{{ idnum }}' - node_count: {{ node_count }} - public_net: 'public-{{ idnum }}' - provision_net: 'provision-{{ idnum }}' - provision_net_cidr: {{ provision_net_cidr }} - - # QuintupleO-specific params ignored by virtual-baremetal.yaml - undercloud_name: 'undercloud-{{ idnum }}' - undercloud_image: '{{ latest_undercloud_image }}' - undercloud_flavor: {{ undercloud_flavor }} - external_net: '{{ external_net }}' - undercloud_user_data: | - #!/bin/sh - sed -i "s/no-port-forwarding.*sleep 10\" //" /root/.ssh/authorized_keys - -parameter_defaults: -## Uncomment and customize the following to use an existing floating ip -# undercloud_floating_ip_id: 'uuid of floating ip' -# undercloud_floating_ip: 'address of floating ip' - # Network Isolation parameters - overcloud_internal_net: 'overcloud_internal-{{ idnum }}' - overcloud_storage_net: 'overcloud_storage-{{ idnum }}' - overcloud_storage_mgmt_net: 'overcloud_storage_mgmt-{{ idnum }}' - overcloud_tenant_net: 'overcloud_tenant-{{ idnum }}' - dns_nameservers: '{{ custom_nameserver[0] }}' -{% if boot_from_volume|bool %} - baremetal_volume_size: '{{ baremetal_boot_from_volume_size }}' - undercloud_volume_size: '{{ undercloud_boot_from_volume_size }}' -{% endif %} - -resource_registry: -## Uncomment the following to use an existing floating ip -# OS::OVB::UndercloudFloating: templates/undercloud-floating-existing.yaml - -## Uncomment the following to use no floating ip -# OS::OVB::UndercloudFloating: templates/undercloud-floating-none.yaml - -## Uncomment the following to create a private network - OS::OVB::PrivateNetwork: {{ templates_dir }}/private-net-create.yaml - -## Uncomment to create all networks required for network-isolation. -## parameter_defaults should be used to override default parameter values -## in baremetal-networks-all.yaml -# OS::OVB::BaremetalNetworks: {{ templates_dir }}/baremetal-networks-all.yaml -# OS::OVB::BaremetalPorts: {{ templates_dir }}/baremetal-ports-all.yaml -{% if network_isolation_type in ['multi-nic', 'multiple-nics', 'public-bond'] and not port_security|bool %} - OS::OVB::BaremetalNetworks: {{ templates_dir }}/baremetal-networks-all.yaml - OS::OVB::BaremetalPorts: {{ templates_dir }}/{{ baremetal_ports_template[network_isolation_type] }} -{% endif %} -{% if network_isolation_type in ['multi-nic', 'multiple-nics', 'public-bond'] and port_security|bool %} - OS::OVB::BaremetalNetworks: {{ templates_dir }}/baremetal-networks-all.yaml -{% endif %} - -## Uncomment to use the neutron port-security extension to allow DHCP from -## the undercloud to overcloud nodes. There are *-port-security.yaml versions -## of all the standard port resource templates. The examples below are to use -## port-security with a minimal deployment (i.e. no network isolation). -# OS::OVB::BaremetalPorts: templates/baremetal-ports-default-port-security.yaml -# OS::OVB::BMCPort: templates/bmc-port-port-security.yaml -# OS::OVB::UndercloudPorts: templates/undercloud-ports-port-security.yaml -{% if network_isolation_type in ['none', 'multi-nic', 'multiple-nics', 'public-bond'] and port_security|bool %} - OS::OVB::BaremetalPorts: {{ templates_dir }}/{{ baremetal_port_security_template[network_isolation_type] }} - OS::OVB::BMCPort: {{ templates_dir }}/bmc-port-port-security.yaml - OS::OVB::UndercloudPorts: {{ templates_dir }}/undercloud-ports-port-security.yaml -{% endif %} - -## Uncomment to deploy a quintupleo environment without an undercloud. -# OS::OVB::UndercloudEnvironment: OS::Heat::None - -# Boot from volume options -{% if boot_from_volume|bool %} - OS::OVB::ServerPair: {{ templates_dir }}/virtual-baremetal-servers-volume.yaml - OS::OVB::UndercloudEnvironment: {{ templates_dir }}/undercloud-volume.yaml -{% endif %} diff --git a/roles/ovb-manage-stack/templates/ovb_hosts.j2 b/roles/ovb-manage-stack/templates/ovb_hosts.j2 deleted file mode 100644 index ca70ef930..000000000 --- a/roles/ovb-manage-stack/templates/ovb_hosts.j2 +++ /dev/null @@ -1,14 +0,0 @@ -{% for h in groups['all'] %} -{{ h }} ansible_host={{ hostvars[h].ansible_host }} {% if hostvars[h].get('ansible_user') %}ansible_user={{ hostvars[h].ansible_user }}{% endif %} {% if hostvars[h].get('ansible_private_key_file') %}ansible_private_key_file={{ hostvars[h].ansible_private_key_file }}{% endif %} {% if hostvars[h].get('subnode_public_ip') %} subnode_public_ip={{ hostvars[h].subnode_public_ip }}{% endif %}{% if hostvars[h].get('subnode_private_ip') %} subnode_private_ip={{ hostvars[h].subnode_private_ip }}{% endif %} - -{% endfor %} - -{% for group in groups %} -{% if group not in ['ungrouped', 'all'] %} -[{{ group }}] -{% for host in groups[group] %} -{{ host }} -{% endfor %} - -{% endif %} -{% endfor %} diff --git a/roles/overcloud-delete/defaults/main.yml b/roles/overcloud-delete/defaults/main.yml deleted file mode 100644 index 4ec487687..000000000 --- a/roles/overcloud-delete/defaults/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -stack_name: "overcloud" -# Script and log locations used during the delete process. -delete_log: "{{ working_dir }}/overcloud_delete.log" - -# 30 retries * 10 seconds delay = 5 minutes delete timeout -delete_check_retries: 60 -delete_check_delay: 10 -step_delete_overcloud: false diff --git a/roles/overcloud-delete/meta/main.yml b/roles/overcloud-delete/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-delete/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-delete/tasks/main.yml b/roles/overcloud-delete/tasks/main.yml deleted file mode 100644 index dd05865f5..000000000 --- a/roles/overcloud-delete/tasks/main.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- name: "Delete overcloud" - tags: - - overcloud-delete - block: - - name: "Get overcloud status" - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_status - vars: - tripleo_overcloud_status_rc_file: "{{ working_dir }}/stackrc" - tripleo_overcloud_status_plan: "{{ stack_name }}" - - - name: "Run overcloud delete" - when: - - step_delete_overcloud | bool - - tripleo_overcloud_status_result | int == 0 - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_delete - vars: - tripleo_overcloud_delete_debug: true - tripleo_overcloud_delete_name: "{{ stack_name }}" - tripleo_overcloud_delete_rc_file: "{{ working_dir }}/stackrc" - tripleo_overcloud_delete_log: "{{ delete_log }}" - tripleo_overcloud_delete_home_dir: "{{ working_dir }}" - - - name: "check for delete command to complete or fail" - when: - - step_delete_overcloud | bool - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_status - vars: - tripleo_overcloud_status_rc_file: "{{ working_dir }}/stackrc" - tripleo_overcloud_status_plan: "{{ stack_name }}" - - - name: "Display overcloud status output" - debug: - var: tripleo_overcloud_status_output - - - name: "Fail if overcloud is not deleted successfully" - when: - - tripleo_overcloud_status_output.find("No deployment was found") == -1 - fail: - msg: "Overcloud is not deleted" diff --git a/roles/overcloud-deploy/README.md b/roles/overcloud-deploy/README.md deleted file mode 100644 index c47f5b7ae..000000000 --- a/roles/overcloud-deploy/README.md +++ /dev/null @@ -1,76 +0,0 @@ -Role Name -========= - -ansible-role-tripleo-overcloud - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -* `overcloud_ipv6`: enables IPv6 deployment on the overcloud -* `enable_cinder_backup`: false/true - enables cinder-backup service. -* `deployed_server`: false/true - enables support for nodepool deployed server deployment (default: false) -* `overcloud_cloud_name`: Sets the FQDN for the overcloud's public VIP. -* `overcloud_cloud_name_internal`: Sets the FQDN for the overcloud's VIP for the internal network. -* `overcloud_cloud_name_storage`: Sets the FQDN for the overcloud's VIP for the storage network. -* `overcloud_cloud_name_storage_management`: Sets the FQDN for the overcloud's VIP for the storage management network. -* `overcloud_cloud_name_ctlplane`: Sets the FQDN for the overcloud's VIP for the ctlplane network. -* `overcloud_cloud_domain`: Sets the domain for the nodes' internal hostnames. -* `enable_swap`: Enables swap in the overcloud nodes. -* `swap_type`: Defines the approach to adding swap that will be used, the - available options are 'file' and 'partition'. Defaults to 'file'. -* `composable_services`: false/true - whether to use customized list of services -* `overcloud_services`: structure specifying services for roles. See - the overcloud-deploy role's defaults.yaml file for an example. -* `composable_roles`: false/true - whether to use custom `roles_data.yaml` -* `overcloud_roles`: contents of custom `roles_data.yaml` (as a YAML - structure, not a string). See `roles_data.yaml` in the - tripleo-heat-templates repository for example contents. -* `generate_overcloud_roles`: String specifying of roles to generate overcloud_roles.yaml - using the openstack overcloud roles generate command. - Note this takes precedence over the `overcloud_roles` variable. -* `tripleo_config_download_log`: Sets the TripleO config-download log file path. -* `ansible_steps_log`: Sets the TripleO Ansible steps log file path. -* `config_download_args`: Sets the arguments to load config-download - environment in THT. -* `deploy_steps_ansible_workflow`: false/true - whether to deploy the overcloud with - config-download Ansible steps from a Mistral workflow. -* `libvirt_args`: libvirt arguments used to deploy overcloud as the - --libvirt_type `virt_type`. -* `virt_type`: qemu|kvm default is qemu. kvm is only enabled when kvm-{intel|amd} - kernel module can be loaded. -* `topology_map`: undefined - a dictionary of roles with their scale (count) and flavor names. Example: topology_map: { 'Controller': { 'scale': 3, 'flavor': 'baremetal' } } -* `extra_tht_configs`: -- a list of files to copy to the undercloud and add as - extra config to the overcloud-deployment command. -* `undercloud_enable_novajoin`: <'true'> -- uses old novajoin service to register - overcloud nodes into IPA when 'enable_tls_everywhere' is enabled. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -Apache - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/overcloud-deploy/defaults/main.yml b/roles/overcloud-deploy/defaults/main.yml deleted file mode 100644 index af4195d42..000000000 --- a/roles/overcloud-deploy/defaults/main.yml +++ /dev/null @@ -1,186 +0,0 @@ ---- - -# Script and log locations used during the deploy process. -stack_name: "overcloud" -deploy_script: overcloud-deploy.sh.j2 -deploy_cell_script: overcloud-deploy-cell.sh.j2 -deploy_log: "{{ working_dir }}/{{ stack_name }}_deploy.log" -deploy_cell_log: "{{ working_dir }}/cell_deploy.log" -post_deploy_script: overcloud-deploy-post.sh.j2 -post_deploy_log: "{{ working_dir }}/{{ stack_name }}_deploy_post.log" -failed_deployments_log: "{{ working_dir }}/failed_deployments.log" -failed_deployment_list: "{{ working_dir }}/failed_deployment_list.log" -failed_cell_deployment_list: "{{ working_dir }}/failed_cell_deployment_list.log" -failed_cell_deployments_log: "{{ working_dir }}/failed_cell_deployments.log" -tripleo_config_download_log: "{{ working_dir }}/tripleo_config_download.log" -ansible_steps_log: "{{ working_dir }}/ansible_steps.log" -validate_script: overcloud-validate.sh.j2 - -# Deploy a specific scenario THT to the Overcloud -composable_scenario: "" - -# `floating_ip_cidr` controls the address range used in the network -# created for tempest tests. We use Ansible's [ipaddr][] filter to -# calculate addresses within this range so that you can provide a -# different value for `floating_ip_cidr` and in many cases not need to -# change any of the related variables. -# -# [ipaddr]: http://docs.ansible.com/ansible/playbooks_filters_ipaddr.html -floating_ip_cidr: "{{ undercloud_network_cidr }}" -floating_ip_start: "{{ floating_ip_cidr|nthhost(100) }}" -floating_ip_end: "{{ floating_ip_cidr|nthhost(120) }}" -external_network_gateway: "{{ floating_ip_cidr|nthhost(1) }}" - -# Minutes to wait before giving up on the deploy. -deploy_timeout: 90 - -# Disable cinder backup by default -enable_cinder_backup: false - -# Deployment variations -composable_args: "" -extra_args: "" -topology: "" -ssl_overcloud: false -libvirt_args: "--libvirt-type {{ virt_type|default('qemu') }}" -deploy_ha_ovn: false - -use_git_tht_repo: false -tht_branch: master -overcloud_release: "{{ release }}" - -timeout_args: "--timeout {{ deploy_timeout }}" - -set_overcloud_workers: true - -cloud_name_args: "" -hostnamemap_args: "" -network_args: "" -storage_args: "" -overcloud_cinder_lvm_loop_device_size: 20480 -network_isolation_args: "" -ntp_args: "" -pacemaker_args: "" -workers_args: "" -backup_args: "" -resource_registry_nic_configs_args: "" -use_resource_registry_nic_configs: false - -ssl_args: "" -tls_everywhere_args: "" -validation_args: "--validation-warnings-fatal" - -enable_swap: false -swap_type: "file" -swap_args: "" - -deployed_server_overcloud_roles: - - name: Controller - hosts: "$(sed -n 1,1p /etc/nodepool/sub_nodes_private)" - -deployed_server_prepare_script: deployed_server_prepare.sh.j2 -deployed_server_prepare_log: "{{ working_dir }}/deployed_server_prepare.txt" - -container_args: "" -scenario_args: "" -topology_args: "" -multinode_args: "" -fips_args: "" -ovn_args: "" -telemetry_args: "" -config_download_args: "" -ephemeral_heat_args: "" -selinux_args: "" - -deploy_args: >- - {{ libvirt_args }} - {{ timeout_args }} - {{ ntp_args }} - {{ cloud_name_args }} - {{ hostnamemap_args }} - {{ multinode_args }} - {{ fips_args }} - {{ ovn_args }} - {{ pacemaker_args }} - {{ container_args }} - {{ scenario_args }} - {{ network_args }} - {{ storage_args }} - {{ resource_registry_nic_configs_args }} - {{ workers_args }} - {{ backup_args }} - {{ ssl_args }} - {{ tls_everywhere_args }} - {{ telemetry_args }} - {{ extra_tht_config_args|default('') }} - {{ validation_args }} - {{ swap_args }} - {{ composable_args }} - {{ topology }} - {{ topology_args }} - {{ config_download_args }} - {{ ephemeral_heat_args }} - {{ selinux_args }} - {{ extra_args }} - -composable_roles: false -composable_services: false -deploy_multinode: false -enable_fips: false -ephemeral_heat: false - -step_deploy_overcloud: true -step_deploy_cell: true - -deploy_steps_ansible_workflow: false - -step_validate_overcloud: true -prepare_tempest: false - -# If `test_tempest` is `true`, run tempests tests, otherwise do not -# run them. -test_tempest: false -tempest_regex: smoke -tempest_workers: 2 - -# enable IPv6 on overcloud deployment -overcloud_ipv6: false - -# Wait for hypervisor in the deployment script -hypervisor_wait: true - -overcloud_services: - - name: 'ControllerServices:' - services: - - OS::TripleO::Services::Kernel - -ara_overcloud_db_path: "/var/lib/mistral/overcloud/ara_overcloud.sqlite" -override_ansiblecfg: true - -# Use to populate the resource registry for nic configs -resource_registry_args: - OS::TripleO::BlockStorage::Net::SoftwareConfig: nic-configs/cinder-storage.yaml - OS::TripleO::Compute::Net::SoftwareConfig: nic-configs/compute.yaml - OS::TripleO::Controller::Net::SoftwareConfig: nic-configs/controller.yaml - OS::TripleO::ObjectStorage::Net::SoftwareConfig: nic-configs/swift-storage.yaml - OS::TripleO::CephStorage::Net::SoftwareConfig: nic-configs/ceph-storage.yaml - -# This default is set in roles/extras-common/defaults/main.yml -# overcloud_container_cli - -# We disable selinux when running under CentOS. It's enabled for RHEL -overcloud_selinux_enabled: >- - {% if osp_release is defined -%} - enforcing - {%- else -%} - permissive - {%- endif -%} - -network_data_yaml: "{{ overcloud_templates_path }}/ci/network_data.yaml" -vip_data_yaml: "{{ overcloud_templates_path }}/ci/vip_data.yaml" - -# Use default network topology - InternalApi, StorageMgmt, Storage, tenant, -# External. In featureset064: we set this as false as we don't want to -# use the default cloud-names.yaml created from cloud-names.yaml.j2 and use -# the values we defined in ci tht templates for custom networks. -non_custom_network: true diff --git a/roles/overcloud-deploy/docs/contributing.md b/roles/overcloud-deploy/docs/contributing.md deleted file mode 100644 index cb06e9c2e..000000000 --- a/roles/overcloud-deploy/docs/contributing.md +++ /dev/null @@ -1,42 +0,0 @@ -# Contributing - -## Bug reports - - - -## Code - -If you *fix* a problem or implement a new feature, you may submit your -changes via Gerrit. The `ansible-roles-tripleo-overcloud` project uses a Gerrit -workflow similar to the [OpenStack Gerrit workflow][gerrit]. - -We're currently using , so you will need -to establish an account there first. - -Once your gerrithub account is ready, install the [git-review][] tool, -then from within a clone of the tripleo-quickstart repository run: - - git review -s - -After you have made your changes locally, commit them to a feature -branch, and then submit them for review by running: - - git review - -Your changes will be tested by our automated CI infrastructure, and will -also be reviewed by other developers. If you need to make changes (and -you probably will; it's not uncommon for patches to go through several -iterations before being accepted), make the changes on your feature -branch, and instead of creating a new commit, *amend the existing -commit*, making sure to retain the `Change-Id` line that was placed -there by `git-review`: - - git ci --amend - -After committing your changes, resubmit the review: - - git review - - -[gerrit]: https://docs.openstack.org/infra/manual/developers.html#development-workflow -[git-review]: https://docs.openstack.org/infra/manual/developers.html#installing-git-review diff --git a/roles/overcloud-deploy/files/hardware_environments/README b/roles/overcloud-deploy/files/hardware_environments/README deleted file mode 100644 index f45ea27a6..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/README +++ /dev/null @@ -1,9 +0,0 @@ -Adding a New Hardware Environment -================================= - -Each hardware environment must have: - - instackenv.json file describing your baremetal nodes - - vendor_specific_setup file containing commands required to set up the environment for deployment - - hw_settings.yml file containing values that will be used in undercloud.conf and deploy-overcloudrc files - -If there are no additional commands required to set up the environment, the vendor_specific_setup file is still required however it can be empty (as in the hp_dl320g8 environment). diff --git a/roles/overcloud-deploy/files/hardware_environments/common/plan-parameter-neutron-bridge.yaml b/roles/overcloud-deploy/files/hardware_environments/common/plan-parameter-neutron-bridge.yaml deleted file mode 100644 index 06d1ff133..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/common/plan-parameter-neutron-bridge.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -parameters: - Controller-1::NeutronExternalNetworkBridge: "''" diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/hw_settings.yml b/roles/overcloud-deploy/files/hardware_environments/virt/hw_settings.yml deleted file mode 100644 index d00a8527e..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/hw_settings.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -hw_env: - env_type: virt - libvirt_type: qemu - floating_ip_version: 4 - network_cidr: 192.168.0.0/24 - floating_ip_end: 172.16.23.50 - floating_ip_start: 172.16.23.40 - floating_ip_cidr: 172.16.23.0/24 - network_gateway: 172.16.23.251 - network_type: vlan - physical_network: datacentre - ExternalNetworkVlanID: 10 diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/hw_settings.yml b/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/hw_settings.yml deleted file mode 100644 index d00a8527e..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/hw_settings.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -hw_env: - env_type: virt - libvirt_type: qemu - floating_ip_version: 4 - network_cidr: 192.168.0.0/24 - floating_ip_end: 172.16.23.50 - floating_ip_start: 172.16.23.40 - floating_ip_cidr: 172.16.23.0/24 - network_gateway: 172.16.23.251 - network_type: vlan - physical_network: datacentre - ExternalNetworkVlanID: 10 diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/single_nic_vlans_ipv4.yml b/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/single_nic_vlans_ipv4.yml deleted file mode 100644 index 6ecebe949..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv4/single_nic_vlans_ipv4.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -# note the EC2MetadataIp: value should match the value in -# /home/stack/undercloud.conf for key local_ip -# # EC2MetadataIp: "local_ip" -# -# #ControlPlaneSubnetCidr: key name must match the keyname found in -# #/usr/share/openstack-tripleo-heat-templates/network/config/$type/node.yaml - -parameter_defaults: - InternalApiNetCidr: 172.16.20.0/24 - StorageNetCidr: 172.16.21.0/24 - TenantNetCidr: 172.16.22.0/24 - ExternalNetCidr: 172.16.23.0/24 - InternalApiAllocationPools: [{'start': '172.16.20.10', 'end': '172.16.20.100'}] - StorageAllocationPools: [{'start': '172.16.21.10', 'end': '172.16.21.100'}] - TenantAllocationPools: [{'start': '172.16.22.10', 'end': '172.16.22.100'}] - ExternalAllocationPools: [{'start': '172.16.23.110', 'end': '172.16.23.150'}] - ExternalInterfaceDefaultRoute: 172.16.23.1 - NeutronExternalNetworkBridge: "''" - ControlPlaneSubnetCidr: "24" - ControlPlaneDefaultRoute: 192.0.2.1 - EC2MetadataIp: 192.0.2.1 - DnsServers: ["192.168.23.1", "8.8.8.8"] diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/hw_settings.yml b/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/hw_settings.yml deleted file mode 100644 index 5124e8814..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/hw_settings.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -hw_env: - env_type: virt - libvirt_type: qemu - network_cidr: 192.168.0.0/24 - floating_ip_end: 172.16.23.50 - floating_ip_start: 172.16.23.40 - floating_ip_cidr: 172.16.23.0/24 - network_gateway: 172.16.23.251 - network_type: vlan - physical_network: datacentre - ExternalNetworkVlanID: 10 - dns_server: 192.168.122.1 diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/single_nic_vlans_ipv6.yml b/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/single_nic_vlans_ipv6.yml deleted file mode 100644 index fc2ff7307..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/network_configs/single_nic_vlans_ipv6/single_nic_vlans_ipv6.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -parameters: - ServiceNetMap: - NeutronTenantNetwork: tenant - CeilometerApiNetwork: internal_api - MongoDbNetwork: internal_api - CinderApiNetwork: internal_api - CinderIscsiNetwork: storage - GlanceApiNetwork: storage - GlanceRegistryNetwork: internal_api - KeystoneAdminApiNetwork: ctlplane # allows undercloud to config endpoints - KeystonePublicApiNetwork: internal_api - NeutronApiNetwork: internal_api - HeatApiNetwork: internal_api - NovaApiNetwork: internal_api - NovaMetadataNetwork: internal_api - NovaVncProxyNetwork: internal_api - SwiftMgmtNetwork: storage_mgmt - SwiftProxyNetwork: storage - HorizonNetwork: internal_api - MemcachedNetwork: internal_api - RabbitMqNetwork: internal_api - RedisNetwork: internal_api - MysqlNetwork: internal_api - CephClusterNetwork: storage_mgmt - CephPublicNetwork: storage - ControllerHostnameResolveNetwork: internal_api - ComputeHostnameResolveNetwork: internal_api - BlockStorageHostnameResolveNetwork: internal_api - ObjectStorageHostnameResolveNetwork: internal_api - CephStorageHostnameResolveNetwork: storage - -parameter_defaults: - DnsServers: ["192.168.122.1"] # Customize for your env - ControlPlaneSubnetCidr: "24" - EC2MetadataIp: 192.0.2.1 # Default for virt-env, customize if need be - ControlPlaneDefaultRoute: 192.0.2.1 # Default for virt-env, customize if need be - ExternalInterfaceDefaultRoute: 2001:db8:fd00:1000:dead:beef:cafe:f00 diff --git a/roles/overcloud-deploy/files/hardware_environments/virt/vendor_specific_setup b/roles/overcloud-deploy/files/hardware_environments/virt/vendor_specific_setup deleted file mode 100644 index f96870470..000000000 --- a/roles/overcloud-deploy/files/hardware_environments/virt/vendor_specific_setup +++ /dev/null @@ -1,3 +0,0 @@ -# Set up for virt_default - -echo "no vendor specific commands required" diff --git a/roles/overcloud-deploy/meta/main.yml b/roles/overcloud-deploy/meta/main.yml deleted file mode 100644 index 3af8158ad..000000000 --- a/roles/overcloud-deploy/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - tripleo - - extras-common diff --git a/roles/overcloud-deploy/tasks/create-scripts.yml b/roles/overcloud-deploy/tasks/create-scripts.yml deleted file mode 100644 index 066a42673..000000000 --- a/roles/overcloud-deploy/tasks/create-scripts.yml +++ /dev/null @@ -1,167 +0,0 @@ ---- -- name: Copy extra THT config files on the undercloud - copy: - src: "{{ item }}" - dest: "{{ working_dir }}" - with_items: "{{ extra_tht_configs|default([]) }}" - -- name: Add extra THT config file to the deploy command - set_fact: - extra_tht_config_args: >- - {{ extra_tht_config_args|default('') }} - {% if extra_tht_configs|default([])|length > 0 %} - -e {{ extra_tht_configs | default([]) | map('basename') | map('regex_replace', '(.+)', working_dir + "/\1") | join (' -e ') }} - {% endif %} - cacheable: true - -- name: Add custom rules needed in CI infra after switch to nftables. - when: release not in ['train', 'wallaby'] - block: - - name: Find the default network on the undercloud node - set_fact: - source_ci_ip_address: "{{ ansible_default_ipv4.address }}/{{ ansible_default_ipv4.netmask }}" - - - name: Convert to obtain the network address in CIDR notation format. - set_fact: - source_ci_network: "{{ source_ci_ip_address | ipaddr('network/prefix') }}" - - - name: Create a yaml file with custom CI rules for VXLAN support, open ssh to all - vars: - ips: "{{ ((hostvars | json_query('*.ansible_host') |list) + - ansible_facts['all_ipv4_addresses'] + - ansible_facts['all_ipv6_addresses'] + - [source_ci_network]) | unique | ipaddr }}" - copy: - dest: "{{ working_dir }}/ci_custom_firewall_rules.yaml" - content: | - parameter_defaults: - SshFirewallAllowAll: true - ExtraFirewallRules: - {% for ip in ips %} - '020 Allow VXLan from {{ ip }}': - proto: "udp" - dport: 4789 - source: "{{ ip }}" - state: [] - '021 Allow OTV for vxlan from {{ ip }}': - proto: 'udp' - dport: 8472 - source: "{{ ip }}" - state: [] - {% endfor %} - -# Generate a number of scripts from templates. These are scripts -# rather than additional ansible tasks so that they can be run -# manually from the undercloud host. -- name: Create overcloud deploy script - template: - src: "{{ deploy_script }}" - dest: "{{ working_dir }}/{{ stack_name }}-deploy.sh" - mode: 0755 - -- name: Create post-deploy script - template: - src: "{{ post_deploy_script }}" - dest: "{{ working_dir }}/{{ stack_name }}-deploy-post.sh" - mode: 0755 - -- name: Copy neutron l3 ha heat template - when: enable_pacemaker|bool and number_of_controllers|int < 3 - template: - src: "neutronl3ha.yaml.j2" - dest: "{{ working_dir }}/neutronl3ha.yaml" - -- name: Create config-download environment - when: (deploy_steps_ansible_workflow|bool) and (deploy_multinode|bool) - template: - src: "config-download.yaml.j2" - dest: "{{ working_dir }}/config-download.yaml" - -- name: Write composable roles file - when: composable_roles|bool and generate_overcloud_roles is not defined - template: - src: "overcloud_roles.yaml.j2" - dest: "{{ working_dir }}/overcloud_roles.yaml" - -- name: Copy composable services file - when: composable_services|bool - template: - src: "overcloud_services.yaml.j2" - dest: "{{ working_dir }}/overcloud_services.yaml" - -- name: Create overcloud topology configuration - template: - src: "overcloud-topology-config.yaml.j2" - dest: "{{ working_dir }}/overcloud-topology-config.yaml" - when: topology_map is defined - -- name: Create overcloud baremetal deploy yaml - block: - - name: Read instackenv.json file - command: cat "{{ working_dir }}/instackenv.json" - register: instackenv_json - - - name: Set the baremetal nodes into a json var - set_fact: - baremetal_instackenv: "{{ instackenv_json.stdout | from_json }}" - - - name: Create overcloud baremetal deploy yaml file - template: - src: "overcloud_baremetal_deploy.yaml.j2" - dest: "{{ working_dir }}/overcloud_baremetal_deploy.yaml" - when: baremetal_provision|bool and topology_map is defined - -- name: Cloud names heat environment - when: non_custom_network|bool - template: - src: "cloud-names.yaml.j2" - dest: "{{ working_dir }}/cloud-names.yaml" - -- name: Set OS::TripleO::Services::IpaClient for novajoin-less deployment - when: - - enable_tls_everywhere|bool and not undercloud_enable_novajoin|bool - template: - src: "tls-everywhere.yaml.j2" - dest: "{{ working_dir }}/tls-everywhere.yaml" - -- name: Create the hostname_map parameters yaml - when: - - groups['overcloud'] is defined - - groups['overcloud'][0] is defined - - overcloud_nodes is defined - - overcloud_nodes[0] is defined - - overcloud_nodes[0].hostnamemap_override is defined - template: - src: "hostnamemap.yaml.j2" - dest: "{{ working_dir }}/hostnamemap.yaml" - -- name: Copy nic-configs resource registry template - when: use_resource_registry_nic_configs|bool - template: - src: "resource-registry-nic-configs.yaml.j2" - dest: "{{ working_dir }}/resource-registry-nic-configs.yaml" - -- name: Create the overcloud network parameters yaml - when: - - overcloud_neutron_global_physnet_mtu is defined - template: - src: "overcloud_network_params.yaml.j2" - dest: "{{ working_dir }}/overcloud_network_params.yaml" - -- name: Create the overcloud storage parameters yaml - when: - - overcloud_cinder_lvm_loop_device_size is defined - template: - src: "overcloud_storage_params.yaml.j2" - dest: "{{ working_dir }}/overcloud_storage_params.yaml" - -- name: Create overriding ansible.cfg for overcloud deployment - when: override_ansiblecfg|bool - template: - src: "ansible.cfg.j2" - dest: "{{ working_dir }}/custom_ansible.cfg" - -- name: Create selinux configuration for overcloud - template: - src: "overcloud-selinux-config.yaml.j2" - dest: "{{ working_dir }}/overcloud-selinux-config.yaml" diff --git a/roles/overcloud-deploy/tasks/deploy-cell.yml b/roles/overcloud-deploy/tasks/deploy-cell.yml deleted file mode 100644 index 674bf21c5..000000000 --- a/roles/overcloud-deploy/tasks/deploy-cell.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Deploy the cell - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-deploy-cell.sh 2>&1 {{ timestamper_cmd }} > {{ deploy_cell_log }} - register: deploy_cell_script_result - ignore_errors: true - when: step_deploy_cell|bool - -- name: Export actual used deploy args for persistence to other plays - set_fact: - # deploy_args end with a newline, remove to make deploy_args_used easier to use - deploy_args_used: "{{ deploy_args | replace('\n', ' ') }}" - cacheable: true - -- name: Export actual used cell deploy args for persistence to other plays - set_fact: - # cell_deploy_args end with a newline, remove to make cell_deploy_args_used easier to use - cell_deploy_args_used: "{{ cell_deploy_args | replace('\n', ' ') }}" - cacheable: true diff --git a/roles/overcloud-deploy/tasks/deploy-overcloud.yml b/roles/overcloud-deploy/tasks/deploy-overcloud.yml deleted file mode 100644 index 502232834..000000000 --- a/roles/overcloud-deploy/tasks/deploy-overcloud.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -- name: "Check hypervisors available" - when: - - hypervisor_wait | bool - shell: >- - source {{ working_dir }}/stackrc && \ - openstack hypervisor stats show -c count -f value - register: osp_hypervisor_status - until: osp_hypervisor_status.stdout | int > 0 - retries: 100 - delay: 10 - -- name: "Provision overcloud network" - when: - - network_provision | bool - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_network_provision - vars: - tripleo_overcloud_network_provision_debug: true - tripleo_overcloud_network_provision_generate_scripts: true - tripleo_overcloud_network_provision_output_file: "{{ working_dir }}/overcloud-networks-deployed.yaml" - tripleo_overcloud_network_provision_deployment_file: "{{ network_data_yaml }}" - tripleo_overcloud_network_provision_rc_file: "{{ working_dir }}/stackrc" - -- name: "Run overcloud network vip provision" - when: - - network_provision | bool - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_network_vip_provision - vars: - tripleo_overcloud_network_vip_provision_debug: true - tripleo_overcloud_network_vip_provision_generate_scripts: true - tripleo_overcloud_network_vip_provision_output_file: "{{ working_dir }}/overcloud-vips-deployed.yaml" - tripleo_overcloud_network_vip_provision_deployment_file: "{{ vip_data_yaml }}" - tripleo_overcloud_network_vip_provision_rc_file: "{{ working_dir }}/stackrc" - tripleo_overcloud_network_vip_provision_stack: "{{ stack_name }}" - -- name: "Provision overcloud baremetal node" - when: - - baremetal_provision | bool - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_node_provision - vars: - tripleo_overcloud_node_provision_debug: true - tripleo_overcloud_node_provision_generate_scripts: true - tripleo_overcloud_node_provision_deployment_file: "{{ working_dir }}/overcloud_baremetal_deploy.yaml" - tripleo_overcloud_node_provision_output_file: "{{ working_dir }}/overcloud-baremetal-deployed.yaml" - tripleo_overcloud_node_provision_rc_file: "{{ working_dir }}/stackrc" - tripleo_overcloud_node_provision_stack: "{{ stack_name }}" - -- name: Deploy the overcloud - shell: > - set -o pipefail && - {{ working_dir }}/{{ stack_name }}-deploy.sh 2>&1 {{ timestamper_cmd }} > {{ deploy_log }} - register: deploy_script_result - ignore_errors: true - when: step_deploy_overcloud|bool - -- name: Export actual used deploy args for persistence to other plays - set_fact: - # deploy_args end with a newline, remove to make deploy_args_used easier to use - deploy_args_used: "{{ deploy_args | replace('\n', ' ') }}" - cacheable: true diff --git a/roles/overcloud-deploy/tasks/deployed-server.yml b/roles/overcloud-deploy/tasks/deployed-server.yml deleted file mode 100644 index c1bc9b916..000000000 --- a/roles/overcloud-deploy/tasks/deployed-server.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- - -- name: Create deployed_server_prepare script - template: - src: "{{ deployed_server_prepare_script }}" - dest: "{{ working_dir }}/deployed_server_prepare.sh" - mode: 0755 - -- name: Run the deployed-server_prepare script - shell: > - set -o pipefail && - {{ working_dir }}/deployed_server_prepare.sh 2>&1 {{ timestamper_cmd }} > - {{ deployed_server_prepare_log }} - async: 10800 - poll: 0 - environment: - OPT_WORKDIR: "{{ lookup('env', 'OPT_WORKDIR') }}" - http_proxy: "{{ lookup('env', 'http_proxy') }}" - no_proxy: "{{ lookup('env', 'no_proxy') }}" - TRIPLEO_ROOT: "{{ lookup('env','TRIPLEO_ROOT') }}" - SUBNODES_SSH_KEY: "/etc/nodepool/id_rsa" - changed_when: true diff --git a/roles/overcloud-deploy/tasks/main.yml b/roles/overcloud-deploy/tasks/main.yml deleted file mode 100644 index 33f00aedd..000000000 --- a/roles/overcloud-deploy/tasks/main.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- include: pre-deploy.yml - tags: - - overcloud-scripts - -- include: create-scripts.yml - tags: - - overcloud-scripts - -- include: deployed-server.yml - when: deployed_server|bool and not (deploy_steps_ansible_workflow|bool) - tags: - - overcloud-deploy - -- include: deploy-overcloud.yml - tags: - - overcloud-deploy - -- include: overcloud-status.yml - tags: - - overcloud-deploy - -- include: post-deploy.yml - tags: - - overcloud-post-deploy - when: overcloud_deploy_result is defined and overcloud_deploy_result == "passed" - -- block: - - include: pre-cell-deploy.yml - tags: - - overcloud-scripts-cell - - include: deploy-cell.yml - tags: - - overcloud-deploy-cell - when: - - additional_cell|bool - - overcloud_deploy_result is defined and overcloud_deploy_result == "passed" diff --git a/roles/overcloud-deploy/tasks/overcloud-status.yml b/roles/overcloud-deploy/tasks/overcloud-status.yml deleted file mode 100644 index 9fc78bd97..000000000 --- a/roles/overcloud-deploy/tasks/overcloud-status.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- - -# The purpose of writing the overcloud status out to a json file is to -# allow ansible to capture the status, and then execute required steps -# after the deployment fails e.g. inventory -# After the deployment fails and inventory is collected the playbook then -# checks the status via the json file and passes or fails at the appropriate -# time. -- name: write out overcloud status to a file on the localhost - shell: > - echo '{ "overcloud_deploy_result": "failed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - when: deploy_script_result.rc != 0 - -- name: write out overcloud status to a file on the localhost - shell: > - echo '{ "overcloud_deploy_result": "passed" }' > "{{ local_working_dir }}/overcloud_deployment_result.json" - delegate_to: localhost - when: deploy_script_result.rc == 0 - -- name: import deployment status from file - include_vars: "{{ local_working_dir }}/overcloud_deployment_result.json" - -- name: echo deployment_status - debug: var=overcloud_deploy_result diff --git a/roles/overcloud-deploy/tasks/post-deploy.yml b/roles/overcloud-deploy/tasks/post-deploy.yml deleted file mode 100644 index 6a4cd2dae..000000000 --- a/roles/overcloud-deploy/tasks/post-deploy.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -# This makes the overcloudrc file available locally. This file -# contains credentials for accessing OpenStack API services on the -# overcloud. -- name: Copy overcloudrc to ansible host - fetch: - flat: true - src: "{{ stack_name }}rc" - dest: "{{ local_working_dir }}/{{ stack_name }}rc" - -- name: Run post-deploy script - shell: > - set -o pipefail && - {{ working_dir }}/{{ stack_name }}-deploy-post.sh 2>&1 {{ timestamper_cmd }} > - {{ post_deploy_log }} - changed_when: true diff --git a/roles/overcloud-deploy/tasks/pre-cell-deploy.yml b/roles/overcloud-deploy/tasks/pre-cell-deploy.yml deleted file mode 100644 index 5a7f152cc..000000000 --- a/roles/overcloud-deploy/tasks/pre-cell-deploy.yml +++ /dev/null @@ -1,63 +0,0 @@ ---- -# Note.. the order of heat templates and args is very important. The last environment that sets a variable takes precedent. - - -- name: Extract the number of cell controllers to be deployed (from cell topology_map) - set_fact: - number_of_cell_controllers: |- - {% if cell_topology_map.CellController is defined -%} - {{ cell_topology_map.CellController.scale }} - {%- else -%} - 1 - {%- endif %} - when: - - cell_topology_map is defined - -- name: Extract the cell controller flavor from cell topology_map - set_fact: - cell_controller_flavor: |- - {% if cell_topology_map.CellController is defined and cell_topology_map.CellController.flavor is defined -%} - {{ cell_topology_map.CellController.flavor }} - {%- else -%} - baremetal - {%- endif %} - when: - - cell_topology_map is defined - -- name: Extract the number of cell computes to be deployed (from cell topology_map) - set_fact: - number_of_cell_computes: |- - {% if cell_topology_map.Compute is defined -%} - {{ cell_topology_map.Compute.scale }} - {%- else -%} - 0 - {%- endif %} - when: - - cell_topology_map is defined - -- name: set cell_deploy args fact - set_fact: - cell_deploy_args: >- - -r {{ working_dir }}/{{ cell_name }}/cell_roles_data.yaml - -e {{ working_dir }}/{{ cell_name }}/cell-input.yaml - -e {{ working_dir }}/{{ cell_name }}/cell.yaml - --stack {{ cell_name }} - -- name: Create cell data directory - file: - path: "{{ working_dir }}/{{ cell_name }}" - state: directory - mode: '0755' - -- name: Create cell parameter file - when: additional_cell|bool - template: - src: "cell.yaml.j2" - dest: "{{ working_dir }}/{{ cell_name }}/cell.yaml" - -- name: Create cell deploy script - when: additional_cell|bool - template: - src: "{{ deploy_cell_script }}" - dest: "{{ working_dir }}/overcloud-deploy-cell.sh" - mode: 0755 diff --git a/roles/overcloud-deploy/tasks/pre-deploy.yml b/roles/overcloud-deploy/tasks/pre-deploy.yml deleted file mode 100644 index 9cbdc2771..000000000 --- a/roles/overcloud-deploy/tasks/pre-deploy.yml +++ /dev/null @@ -1,341 +0,0 @@ ---- -# Note.. the order of heat templates and args is very important. The last environment that sets a variable takes precedent. - -- name: Deprecation message for network isolation types - debug: - msg: >- - Network isolation types 'multi-nic', 'bond_with_vlans', 'single_nic_vlans' - are deprecated in R release, please use 'multiple-nics', 'bond-with-vlans', - 'single-nic-vlans'. - when: network_isolation_type in ["single_nic_vlans", "bond_with_vlans", "multi-nic"] - -# NOTE: 'single_nic_vlans' is deprecated -- name: set network isolation args for single-nic-vlans IPv4 - set_fact: - network_isolation_args: >- - -e {{ overcloud_templates_path }}/environments/network-isolation.yaml - -e {{ overcloud_templates_path }}/environments/net-single-nic-with-vlans.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["single_nic_vlans", "single-nic-vlans"] - - not network_provision|bool - -- name: set network isolation args for bond-with-vlans IPv4 - set_fact: - network_isolation_args: >- - -e {{ overcloud_templates_path }}/environments/network-isolation.yaml - -e {{ overcloud_templates_path }}/environments/net-bond-with-vlans.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["bond_with_vlans", "bond-with-vlans"] - - not network_provision|bool - -# NOTE: 'multi-nic' is deprecated -- name: set network isolation args for multi-nic IPv4 - set_fact: - network_isolation_args: >- - -e {{ overcloud_templates_path }}/environments/network-isolation.yaml - -e {{ overcloud_templates_path }}/environments/net-multiple-nics.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["multi-nic", "multiple-nics"] - - not overcloud_ipv6|bool - - not network_provision|bool - -# NOTE: 'multi-nic' is deprecated -- name: set network isolation args for multi-nic IPv6 - set_fact: - network_isolation_args: >- - -e {{ overcloud_templates_path }}/environments/network-isolation-v6.yaml - -e {{ overcloud_templates_path }}/environments/net-multiple-nics-v6.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["multi-nic", "multiple-nics"] - - overcloud_ipv6|bool - - not network_provision|bool - -# Since there are no nic-configs for public-bond in the default -# tripleo-heat-templates directory, no public-bond specfic -# /environments/ file is listed. -# The network-environment.yaml file can point to path where the -# public-bond nic-configs are stored. -- name: set network isolation args for public-bond IPv4 - set_fact: - network_isolation_args: >- - -e {{ overcloud_templates_path }}/environments/network-isolation.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type == "public-bond" - - not overcloud_ipv6|bool - - not network_provision|bool - -- name: set network isolation args for multi-nic IPv4 (deployed networks) - set_fact: - network_isolation_args: >- - --networks-file {{ overcloud_templates_path }}/ci/network_data.yaml - -e {{ overcloud_templates_path }}/environments/network-isolation.yaml - -e {{ overcloud_templates_path }}/environments/net-multiple-nics.yaml - -e {{ working_dir }}/overcloud-networks-deployed.yaml - -e {{ working_dir }}/overcloud-vips-deployed.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["multi-nic", "multiple-nics"] - - not overcloud_ipv6|bool - - network_provision|bool - -- name: set network isolation args for multi-nic IPv6 (deployed networks) - set_fact: - network_isolation_args: >- - --networks-file {{ overcloud_templates_path }}/ci/network_data.yaml - -e {{ overcloud_templates_path }}/environments/network-isolation-v6.yaml - -e {{ overcloud_templates_path }}/environments/net-multiple-nics-v6.yaml - -e {{ working_dir }}/overcloud-networks-deployed.yaml - -e {{ working_dir }}/overcloud-vips-deployed.yaml - -e {{ working_dir }}/network-environment.yaml - when: - - network_isolation_type in ["multi-nic", "multiple-nics"] - - overcloud_ipv6|bool - - network_provision|bool - -- name: set network_args fact - set_fact: - network_args: >- - {{ network_isolation_args }} - when: - - network_isolation|bool - -- name: set ntp_args - set_fact: - ntp_args: >- - --ntp-server {{ ntp_server }} - when: - - ntp_server|default('') - -- name: use resource registry - set_fact: - resource_registry_nic_configs_args: >- - -e {{ working_dir }}/resource-registry-nic-configs.yaml - when: use_resource_registry_nic_configs|bool - -- name: extract the number of controllers to be deployed - set_fact: - number_of_controllers: "{{ deploy_args| regex_replace('^.*--control-scale +([0-9]+).*$', '\\1') | regex_replace('^[^ 0-9]+$', '1') }}" - when: topology_map is not defined - -- name: extract the number of controllers to be deployed (from topology_map) - set_fact: - number_of_controllers: |- - {% if topology_map.Controller is defined -%} - {{ topology_map.Controller.scale }} - {%- else -%} - 1 - {%- endif %} - when: - - topology_map is defined - -- name: Set cinder-backup - set_fact: - backup_args: >- - -e {{ overcloud_templates_path }}/environments/cinder-backup.yaml - when: enable_cinder_backup|bool - -- name: Set cloud-name variables - set_fact: - cloud_name_args: >- - -e {{ working_dir }}/cloud-names.yaml - when: non_custom_network|bool - -- name: Set the hostname_map config if defined - set_fact: - hostnamemap_args: >- - -e {{ working_dir }}/hostnamemap.yaml - when: - - groups['overcloud'] is defined - - groups['overcloud'][0] is defined - - overcloud_nodes is defined - - overcloud_nodes[0] is defined - - overcloud_nodes[0].hostnamemap_override is defined - -- name: set set overcloud SSL args - set_fact: - ssl_overcloud_args: >- - -e {{ working_dir }}/enable-tls.yaml - -e {{ overcloud_templates_path }}/environments/ssl/tls-endpoints-public-ip.yaml - when: - - ssl_overcloud|bool - -- name: set CA injection arg - set_fact: - ssl_ca_args: >- - -e {{ working_dir }}/inject-trust-anchor.yaml - when: ssl_overcloud|bool or undercloud_generate_service_certificate|bool - -- name: set ssl_args - set_fact: - ssl_args: >- - {{ ssl_overcloud_args|default('') }} - {{ ssl_ca_args }} - when: ssl_overcloud|bool or undercloud_generate_service_certificate|bool - -- name: set TLS everywhere fact with novajoin - set_fact: - tls_everywhere_args: >- - -e {{ overcloud_templates_path }}/environments/services/haproxy-public-tls-certmonger.yaml - -e {{ overcloud_templates_path }}/environments/ssl/enable-internal-tls.yaml - -e {{ overcloud_templates_path }}/environments/ssl/tls-everywhere-endpoints-dns.yaml - -e {{ overcloud_templates_path }}/environments/ssl/enable-memcached-tls.yaml - when: - - enable_tls_everywhere|bool and undercloud_enable_novajoin|bool - -- name: set TLS everywhere fact with tripleo-ipa - set_fact: - tls_everywhere_args: >- - -e {{ overcloud_templates_path }}/environments/services/haproxy-public-tls-certmonger.yaml - -e {{ overcloud_templates_path }}/environments/ssl/enable-internal-tls.yaml - -e {{ overcloud_templates_path }}/environments/ssl/tls-everywhere-endpoints-dns.yaml - -e {{ overcloud_templates_path }}/environments/ssl/enable-memcached-tls.yaml - -e {{ working_dir }}/tls-everywhere.yaml - when: - - enable_tls_everywhere|bool and not undercloud_enable_novajoin|bool - -- name: disable L3 HA - set_fact: - pacemaker_args: >- - {{ pacemaker_args }} - -e {{ working_dir }}/neutronl3ha.yaml - when: - - enable_pacemaker|bool - - number_of_controllers|int < 3 - -- name: set workers_args fact - set_fact: - workers_args: >- - -e {{ overcloud_templates_path }}/environments/low-memory-usage.yaml - when: - - set_overcloud_workers|bool - -- name: set container_args fact - set_fact: - container_args: >- - {% if enable_pacemaker|bool or osp_release is defined%} - -e {{ overcloud_templates_path }}/environments/docker-ha.yaml - {% endif %} - -e {{ working_dir }}/containers-prepare-parameter.yaml - -e {{ overcloud_templates_path }}/environments/{{ overcloud_container_cli }}.yaml - -- name: set composable roles args fact - set_fact: - composable_args: >- - --roles-file {{ working_dir }}/overcloud_roles.yaml - when: composable_roles|bool - -- name: Generate composable roles file - command: openstack overcloud roles generate --roles-path {{ overcloud_templates_path }}/roles -o {{ working_dir }}/overcloud_roles.yaml {{ generate_overcloud_roles }} - when: composable_roles|bool and generate_overcloud_roles is defined - -- name: set composable service args fact - set_fact: - composable_args: >- - {{ composable_args }} - -e {{ working_dir }}/overcloud_services.yaml - when: composable_services|bool - -- name: set overcloud topology args - set_fact: - topology_args: >- - -e {{ working_dir }}/overcloud-topology-config.yaml - when: topology_map is defined - -- name: set the multinode args - set_fact: - multinode_args: >- - {% if release in ['train'] %} - -e {{ overcloud_templates_path }}/environments/deployed-server-environment.yaml - {% endif %} - --overcloud-ssh-user {{ undercloud_user }} - {% if not undercloud_enable_nova|bool and release in ['train', 'wallaby'] %} - --deployed-server - {% endif %} - when: deploy_multinode|bool - -- name: set the fips args - set_fact: - fips_args: >- - -e {{ overcloud_templates_path }}/environments/fips.yaml - when: enable_fips|bool - -- name: set the baremetal provision args - set_fact: - hypervisor_wait: false - multinode_args: >- - {% if release in ['train'] %} - -e {{ overcloud_templates_path }}/environments/deployed-server-environment.yaml - {% endif %} - -e {{ working_dir }}/overcloud-baremetal-deployed.yaml - {% if release in ['train', 'wallaby'] %} - --deployed-server - {% endif %} - when: baremetal_provision|bool - -- name: set the OVN args - set_fact: - ovn_args: >- - -e {{ overcloud_templates_path }}/environments/services/neutron-ovn-ha.yaml - when: deploy_ha_ovn|bool - -- name: set the scenario args for composable roles - set_fact: - scenario_args: >- - -e {{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }} - when: not composable_scenario|trim == '' - -- name: set swap_args to enable swap file - set_fact: - swap_args: >- - -e {{ overcloud_templates_path }}/environments/enable-swap.yaml - when: enable_swap|bool and swap_type == 'file' - -- name: set swap_args to enable swap partition - set_fact: - swap_args: >- - -e {{ overcloud_templates_path }}/environments/enable-swap-partition.yaml - when: enable_swap|bool and swap_type == 'partition' - -- name: set network_args for mtu settings - set_fact: - network_args: >- - {{ network_args }} - -e {{ working_dir }}/overcloud_network_params.yaml - when: - - overcloud_neutron_global_physnet_mtu is defined - -- name: set storage_args for CinderLVMLoopDeviceSize settings - set_fact: - storage_args: >- - {{ storage_args }} - -e {{ working_dir }}/overcloud_storage_params.yaml - when: - - overcloud_cinder_lvm_loop_device_size is defined - -# 15 is "reserved time for logs=10" + 5 minutes for inventory role for OVB jobs -# Time must be synchronised on hosts -- name: Set overcloud deployment timeout in CI for OVB - set_fact: - deploy_timeout: "{{ ((ci_job_end_time|int - lookup('pipe','date +%s')|int)/60)|int -15 }}" - when: - - ci_job_end_time is defined - - '"ovb" in lookup("env", "TOCI_JOBTYPE")' - -# 5 is "reserved time for 5 minutes for inventory role for multinode jobs -# Time must be synchronised on hosts -- name: Set overcloud deployment timeout in CI for multinode - set_fact: - deploy_timeout: "{{ ((ci_job_end_time|int - lookup('pipe','date +%s')|int)/60)|int -5 }}" - when: - - ci_job_end_time is defined - - '"ovb" not in lookup("env", "TOCI_JOBTYPE")' - -- name: Set the selinux args - set_fact: - selinux_args: >- - -e {{ working_dir }}/overcloud-selinux-config.yaml diff --git a/roles/overcloud-deploy/templates/README.md b/roles/overcloud-deploy/templates/README.md deleted file mode 100644 index 832819350..000000000 --- a/roles/overcloud-deploy/templates/README.md +++ /dev/null @@ -1,45 +0,0 @@ -Overcloud ansible templates -=========================== - -overcloud_services jinja template ---------------------------------- - -The overcloud_services jinja template is taking a dictionary from the default -variable `overcloud_services`. -The dictionary is composed by: nodes and services. -Those value would build the heat environment file required for deploying -the overcloud with the specify services. - -Example: if you want to deploy only keystone, just override the -overcloud_services variable in a yaml file with: - -overcloud_services: - - name: 'ControllerServices:' - services: - - OS::TripleO::Services::Kernel - - OS::TripleO::Services::Keystone - - OS::TripleO::Services::RabbitMQ - - OS::TripleO::Services::MySQL - - OS::TripleO::Services::HAproxy - - OS::TripleO::Services::Keepalived - - OS::TripleO::Services::Ntp - - OS::TripleO::Services::Timezone - - OS::TripleO::Services::TripleoPackages - -Or with keystone and nova: - -overcloud_services: - - name: 'ControllerServices:' - services: - - OS::TripleO::Services::Kernel - - OS::TripleO::Services::Keystone - - OS::TripleO::Services::RabbitMQ - - OS::TripleO::Services::MySQL - - OS::TripleO::Services::HAproxy - - OS::TripleO::Services::Keepalived - - OS::TripleO::Services::Ntp - - OS::TripleO::Services::Timezone - - OS::TripleO::Services::TripleoPackages - - name: 'ComputeServices:' - services: - - OS::TripleO::Services::NovaCompute diff --git a/roles/overcloud-deploy/templates/ansible.cfg.j2 b/roles/overcloud-deploy/templates/ansible.cfg.j2 deleted file mode 100644 index ed88c2027..000000000 --- a/roles/overcloud-deploy/templates/ansible.cfg.j2 +++ /dev/null @@ -1,56 +0,0 @@ -{% set modules_path = [ - '/root/.ansible/plugins/modules', - '/usr/share/ansible/tripleo-plugins/modules', - '/usr/share/ansible/plugins/modules', - ] -%} -{% set lookups_path = [ - '/root/.ansible/plugins/lookup', - '/usr/share/ansible/tripleo-plugins/lookup', - '/usr/share/ansible/plugins/lookup', - ] -%} -{% set callbacks_path = [ - '/root/.ansible/plugins/callback', - '/usr/share/ansible/tripleo-plugins/callback', - '/usr/share/ansible/plugins/callback', - ] -%} -{% set action_plugins_path = [ - '/root/.ansible/plugins/action', - '/usr/share/ansible/tripleo-plugins/action', - '/usr/share/ansible/plugins/action', - ] -%} -{% set filter_plugins_path = [ - '/root/.ansible/plugins/filter', - '/usr/share/ansible/tripleo-plugins/filter', - '/usr/share/ansible/plugins/filter', - ] -%} -{% set roles_path = [ - '/root/.ansible/roles', - '/usr/share/ansible/tripleo-roles', - '/usr/share/ansible/roles', - '/etc/ansible/roles', - ] -%} -{% if ansible_python.version.major == 3 %} -{% set _ = action_plugins_path.append('/usr/local/lib/python3.6/site-packages/ara/plugins/actions') %} -{% else %} -{% set _ = action_plugins_path.append('/usr/lib/python2.7/site-packages/ara/plugins/actions') %} -{% endif %} -{% if ansible_python.version.major == 3 %} -{% else %} -{% set _ = callbacks_path.append('/usr/lib/python2.7/site-packages/ara/plugins/callbacks') %} -{% endif %} -[defaults] -roles_path={{ roles_path | join(':') }} -library={{ modules_path | join(':') }} -callback_plugins={{ callbacks_path | join(':') }} -action_plugins={{ action_plugins_path | join(':') }} -lookup_plugins={{ lookups_path | join(':') }} -filter_plugins={{ filter_plugins_path | join(':') }} - -[ara] -database=sqlite:///{{ ara_overcloud_db_path }} diff --git a/roles/overcloud-deploy/templates/cell.yaml.j2 b/roles/overcloud-deploy/templates/cell.yaml.j2 deleted file mode 100644 index 912166163..000000000 --- a/roles/overcloud-deploy/templates/cell.yaml.j2 +++ /dev/null @@ -1,30 +0,0 @@ -resource_registry: - # since the same networks are used in this example, the - # creation of the different networks is omitted - OS::TripleO::Network::External: OS::Heat::None - OS::TripleO::Network::InternalApi: OS::Heat::None - OS::TripleO::Network::Storage: OS::Heat::None - OS::TripleO::Network::StorageMgmt: OS::Heat::None - OS::TripleO::Network::Tenant: OS::Heat::None - OS::TripleO::Network::Management: OS::Heat::None - -parameter_defaults: - # new CELL Parameter to reflect that this is an additional CELL - NovaAdditionalCell: True - - # The DNS names for the VIPs for the cell - CloudName: {{cell_cloud_name|default('cell.localdomain')}} - CloudNameInternal: {{cell_cloud_name_internal|default('cell.internalapi.localdomain')}} - CloudNameStorage: {{cell_cloud_name_storage|default('cell.storage.localdomain')}} - CloudNameStorageManagement: {{cell_cloud_name_storage_management|default('cell.storagemgmt.localdomain')}} - CloudNameCtlplane: {{cell_cloud_name_ctlplane|default('cell.ctlplane.localdomain')}} - - # Flavors used for the cell controller - OvercloudCellControllerFlavor: {{ cell_controller_flavor|default('baremetal') }} - - # number of controllers/computes in the cell - CellControllerCount: {{ number_of_cell_controllers|default('1') }} - ComputeCount: {{ number_of_cell_computes|default('0') }} -{% if cell_public_vip is defined %} - PublicVirtualFixedIPs: [{'ip_address':'{{ cell_public_vip }}'}] -{% endif %} diff --git a/roles/overcloud-deploy/templates/cloud-names.yaml.j2 b/roles/overcloud-deploy/templates/cloud-names.yaml.j2 deleted file mode 100644 index f7f2e0e59..000000000 --- a/roles/overcloud-deploy/templates/cloud-names.yaml.j2 +++ /dev/null @@ -1,9 +0,0 @@ -# Defines the cloud names based on parameters given. - -parameter_defaults: - CloudName: {{overcloud_cloud_name|default('overcloud.localdomain')}} - CloudNameInternal: {{overcloud_cloud_name_internal|default('overcloud.internalapi.localdomain')}} - CloudNameStorage: {{overcloud_cloud_name_storage|default('overcloud.storage.localdomain')}} - CloudNameStorageManagement: {{overcloud_cloud_name_storage_management|default('overcloud.storagemgmt.localdomain')}} - CloudNameCtlplane: {{overcloud_cloud_name_ctlplane|default('overcloud.ctlplane.localdomain')}} - CloudDomain: {{overcloud_cloud_domain|default('localdomain')}} diff --git a/roles/overcloud-deploy/templates/config-download.yaml.j2 b/roles/overcloud-deploy/templates/config-download.yaml.j2 deleted file mode 100644 index 97834e2cc..000000000 --- a/roles/overcloud-deploy/templates/config-download.yaml.j2 +++ /dev/null @@ -1,53 +0,0 @@ -resource_registry: - OS::TripleO::DeployedServer::ControlPlanePort: /usr/share/openstack-tripleo-heat-templates/deployed-server/deployed-neutron-port.yaml - OS::TripleO::OVNMacAddressNetwork: OS::Heat::None - OS::TripleO::OVNMacAddressPort: OS::Heat::None - -parameter_defaults: -{% if release not in ['train'] %} - # Set VIP's for redis and OVN - RedisVirtualFixedIPs: - - ip_address: 192.168.24.101 - use_neutron: false - OVNDBsVirtualFixedIPs: - - ip_address: 192.168.24.102 - use_neutron: false -{% endif %} -# TODO: This is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2006409, Remove this -# once this bug is fixed. -{% if release not in ['train'] %} - NovaLibvirtNumPciePorts: 12 -{% endif %} -# Set machine type if default is not supported on current OS -# see https://bugzilla.redhat.com/show_bug.cgi?id=2110535 -{% if nova_hw_machine_type is defined and nova_hw_machine_type %} - NovaHWMachineType: {{ nova_hw_machine_type }} -{% endif %} - - DeployedServerPortMap: -{% for subnode in groups['overcloud'] %} - {{ hostvars[subnode]['ansible_hostname'] }}-ctlplane: - fixed_ips: - - ip_address: 192.168.24.{{ 3 + loop.index0 }} - subnets: - - cidr: 192.168.24.0/24 - network: - tags: - - 192.168.24.0/24 -{% endfor %} - - CtlplaneNetworkAttributes: - network: - dns_domain: localdomain - mtu: 1500 - name: ctlplane - tags: - - 192.168.24.0/24 - subnets: - ctlplane-subnet: - cidr: 192.168.24.0/24 - dns_nameservers: {{ overcloud_dns_servers | default(['127.0.0.1', '1.1.1.1']) }} - gateway_ip: 192.168.24.1 - host_routes: [] - ip_version: 4 - name: ctlplane-subnet diff --git a/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 b/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 deleted file mode 100644 index 65c00aa84..000000000 --- a/roles/overcloud-deploy/templates/deployed_server_prepare.sh.j2 +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -source {{ working_dir }}/stackrc - -export OVERCLOUD_ROLES="" -{% for role in deployed_server_overcloud_roles %} -OVERCLOUD_ROLES="$OVERCLOUD_ROLES {{ role.name }}" -export {{ role.name }}_hosts={{ role.hosts }} -{% endfor %} -export OVERCLOUD_HOSTS="{{ deployed_server_overcloud_roles|map(attribute='hosts')|join(' ') }}" - -{% set get_occ_config_script = overcloud_templates_path|default('/usr/share/openstack-tripleo-heat-templates') ~ '/deployed-server/scripts/get-occ-config.sh' %} - -{{ get_occ_config_script }} 2>&1 | sudo dd of=/var/log/deployed-server-os-collect-config.log - -/usr/share/openstack-tripleo-heat-templates/deployed-server/scripts/enable-ssh-admin.sh 2>&1 | sudo dd of=/var/log/deployed-server-enable-ssh-admin.log diff --git a/roles/overcloud-deploy/templates/hostnamemap.yaml.j2 b/roles/overcloud-deploy/templates/hostnamemap.yaml.j2 deleted file mode 100644 index 9215edcab..000000000 --- a/roles/overcloud-deploy/templates/hostnamemap.yaml.j2 +++ /dev/null @@ -1,7 +0,0 @@ -parameter_defaults: - HostnameMap: -{% for node in overcloud_nodes %} -{% if node.hostnamemap_override is defined %} - {{ node.default_name }}: {{ node.hostnamemap_override }} -{% endif %} -{% endfor %} diff --git a/roles/overcloud-deploy/templates/neutronl3ha.yaml.j2 b/roles/overcloud-deploy/templates/neutronl3ha.yaml.j2 deleted file mode 100644 index ec3969100..000000000 --- a/roles/overcloud-deploy/templates/neutronl3ha.yaml.j2 +++ /dev/null @@ -1,6 +0,0 @@ -# Note: we need to disable the L3 HA for Neutron if we want to use pacemaker -# and only 1 controller. -# This particular use case is used with the upgrade CI workflow - -parameter_defaults: - NeutronL3HA: false diff --git a/roles/overcloud-deploy/templates/overcloud-deploy-cell.sh.j2 b/roles/overcloud-deploy/templates/overcloud-deploy-cell.sh.j2 deleted file mode 100644 index 365e19470..000000000 --- a/roles/overcloud-deploy/templates/overcloud-deploy-cell.sh.j2 +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/bash - -set -ux - - -### --start_docs -## Deploying the cell -## ================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -### --start_docs - -# Create directory for cell related parameter files -mkdir -p {{ working_dir }}/{{ cell_name }} - -# export overcloud information needed as input for cell stack -openstack overcloud cell export {{ cell_name }} -o {{ working_dir }}/{{ cell_name }}/cell-input.yaml - -# create cell roles file with Compute and CellController role -openstack overcloud roles generate --roles-path \ - /usr/share/openstack-tripleo-heat-templates/roles \ - -o {{ working_dir }}/{{ cell_name }}/cell_roles_data.yaml Compute CellController - -## * Deploy the cell -## :: -openstack overcloud deploy --override-ansible-cfg {{ working_dir }}/custom_ansible.cfg \ - --templates {{overcloud_templates_path}} \ - {{ deploy_args | regex_replace("\n", " ") }} \ - {{ cell_deploy_args | regex_replace("\n", " ") }} \ - "$@" && status_code=0 || status_code=$? - -### --stop_docs - -if ! openstack stack list | grep -q {{ cell_name }}; then - echo "cell deployment not started. Check the deploy configurations" - exit 1 - - # We don't always get a useful error code from the openstack deploy command, - # so check `openstack stack list` for a CREATE_COMPLETE or an UPDATE_COMPLETE - # status. -elif ! openstack stack list | grep {{ cell_name }} | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then - # get the failures list - openstack stack failures list overcloud --long > {{ failed_cell_deployment_list }} || true - - # get any puppet related errors - for failed in $(openstack stack resource list \ - --nested-depth 5 {{ cell_name }} | grep FAILED | - grep 'StructuredDeployment ' | cut -d '|' -f3) - do - echo "openstack software deployment show output for deployment: $failed" >> {{ failed_cell_deployments_log }} - echo "######################################################" >> {{ failed_cell_deployments_log }} - openstack software deployment show $failed >> {{ failed_cell_deployments_log }} - echo "######################################################" >> {{ failed_cell_deployments_log }} - echo "puppet standard error for deployment: $failed" >> {{ failed_cell_deployments_log }} - echo "######################################################" >> {{ failed_cell_deployments_log }} - # the sed part removes color codes from the text - openstack software deployment show $failed -f json | - jq -r .output_values.deploy_stderr | - sed -r "s:\x1B\[[0-9;]*[mK]::g" >> {{ failed_cell_deployments_log }} - echo "######################################################" >> {{ failed_cell_deployments_log }} - # We need to exit with 1 because of the above || true - done - exit 1 -elif ! openstack overcloud status --stack {{ cell_name }}| grep -Eq 'DEPLOY_SUCCESS'; then - # NOTE(emilien) "openstack overcloud failures" was introduced in Rocky - openstack overcloud failures --stack {{ cell_name }}>> {{ failed_cell_deployment_list }} || true - exit 1 -fi - -# Create inventory files for overcloud and cell stack -mkdir -p {{ working_dir }}/inventories - -for i in $(openstack stack list -f value -c 'Stack Name'); do - /usr/bin/tripleo-ansible-inventory \ - --static-yaml-inventory inventories/${i}.yaml \ - --stack ${i} -done - -ANSIBLE_HOST_KEY_CHECKING=False \ -ANSIBLE_SSH_RETRIES=3 \ -ansible-playbook -i inventories \ - /usr/share/ansible/tripleo-playbooks/create-nova-cell-v2.yaml \ - -e tripleo_cellv2_cell_name={{ cell_name }} \ - -e tripleo_cellv2_containercli={{ overcloud_container_cli }} - -exit $status_code diff --git a/roles/overcloud-deploy/templates/overcloud-deploy-post.sh.j2 b/roles/overcloud-deploy/templates/overcloud-deploy-post.sh.j2 deleted file mode 100644 index 0b01c8288..000000000 --- a/roles/overcloud-deploy/templates/overcloud-deploy-post.sh.j2 +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -set -eux - -### --start_docs -## Post overcloud deployment steps -## =============================== - -## * Prepare Your Environment. -## :: - -## * Source in the undercloud credentials. -## :: - -. {{ working_dir }}/stackrc - -### --stop_docs diff --git a/roles/overcloud-deploy/templates/overcloud-deploy.sh.j2 b/roles/overcloud-deploy/templates/overcloud-deploy.sh.j2 deleted file mode 100644 index b6e22d5d5..000000000 --- a/roles/overcloud-deploy/templates/overcloud-deploy.sh.j2 +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - -set -ux - - -### --start_docs -## Deploying the overcloud -## ======================= - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Deploy the overcloud! -## :: -openstack overcloud deploy --stack {{ stack_name }} \ - --override-ansible-cfg {{ working_dir }}/custom_ansible.cfg \ - --templates {{overcloud_templates_path}} \ - {{ deploy_args | regex_replace("\n", " ") }} \ - "$@" && status_code=0 || status_code=$? - -### --stop_docs - -{% if not (ephemeral_heat|default(false)|bool) %} -# Check if the deployment has started. If not, exit gracefully. If yes, check for errors. -if ! openstack stack list | grep -q {{ stack_name }}; then - echo "overcloud deployment not started. Check the deploy configurations" - exit 1 - - # We don't always get a useful error code from the openstack deploy command, - # so check `openstack stack list` for a CREATE_COMPLETE or an UPDATE_COMPLETE - # status. -elif ! openstack stack list | grep -Eq '(CREATE|UPDATE)_COMPLETE'; then - # get the failures list - openstack stack failures list {{ stack_name }} --long > {{ failed_deployment_list }} || true - - # get any puppet related errors - for failed in $(openstack stack resource list \ - --nested-depth 5 {{ stack_name }} | grep FAILED | - grep 'StructuredDeployment ' | cut -d '|' -f3) - do - echo "openstack software deployment show output for deployment: $failed" >> {{ failed_deployments_log }} - echo "######################################################" >> {{ failed_deployments_log }} - openstack software deployment show $failed >> {{ failed_deployments_log }} - echo "######################################################" >> {{ failed_deployments_log }} - echo "puppet standard error for deployment: $failed" >> {{ failed_deployments_log }} - echo "######################################################" >> {{ failed_deployments_log }} - # the sed part removes color codes from the text - openstack software deployment show $failed -f json | - jq -r .output_values.deploy_stderr | - sed -r "s:\x1B\[[0-9;]*[mK]::g" >> {{ failed_deployments_log }} - echo "######################################################" >> {{ failed_deployments_log }} - # We need to exit with 1 because of the above || true - done - exit 1 -elif ! openstack overcloud status --plan {{ stack_name }} | grep -Eq 'DEPLOY_SUCCESS'; then - # NOTE(emilien) "openstack overcloud failures" was introduced in Rocky - openstack overcloud failures --plan {{ stack_name }} >> {{ failed_deployment_list }} || true -fi -{% endif %} -exit $status_code diff --git a/roles/overcloud-deploy/templates/overcloud-selinux-config.yaml.j2 b/roles/overcloud-deploy/templates/overcloud-selinux-config.yaml.j2 deleted file mode 100644 index 95b59f793..000000000 --- a/roles/overcloud-deploy/templates/overcloud-selinux-config.yaml.j2 +++ /dev/null @@ -1,2 +0,0 @@ -parameter_defaults: - SELinuxMode: '{{ overcloud_selinux_enabled }}' diff --git a/roles/overcloud-deploy/templates/overcloud-status.sh.j2 b/roles/overcloud-deploy/templates/overcloud-status.sh.j2 deleted file mode 100644 index 00a93d3b5..000000000 --- a/roles/overcloud-deploy/templates/overcloud-status.sh.j2 +++ /dev/null @@ -1,2 +0,0 @@ -source {{ working_dir }}/stackrc -openstack stack resource list -n5 overcloud | grep -v COMPLETE diff --git a/roles/overcloud-deploy/templates/overcloud-topology-config.yaml.j2 b/roles/overcloud-deploy/templates/overcloud-topology-config.yaml.j2 deleted file mode 100644 index 03effe589..000000000 --- a/roles/overcloud-deploy/templates/overcloud-topology-config.yaml.j2 +++ /dev/null @@ -1,9 +0,0 @@ -parameter_defaults: -{% for role in topology_map %} -{% if 'scale' in topology_map[role] %} - {{ role }}Count: {{ topology_map[role].scale }} -{% endif -%} -{% if 'flavor' in topology_map[role] %} - Overcloud{{ role }}Flavor: {{ topology_map[role].flavor }} -{% endif -%} -{% endfor %} diff --git a/roles/overcloud-deploy/templates/overcloud_baremetal_deploy.yaml.j2 b/roles/overcloud-deploy/templates/overcloud_baremetal_deploy.yaml.j2 deleted file mode 100644 index 155373c9b..000000000 --- a/roles/overcloud-deploy/templates/overcloud_baremetal_deploy.yaml.j2 +++ /dev/null @@ -1,58 +0,0 @@ -{% for role in topology_map %} -{% set role_count = topology_map[role].scale |default(0) %} -{% set role_profile = topology_map[role].flavor |default('') %} -{% set role_networks = topology_map[role].networks |default([]) %} -{% set network_config = topology_map[role].network_config |default('') %} -{% set growvols_args = topology_map[role].growvols_args |default('') %} -{% if role_count %} -- name: {{ role }} - count: {{ role_count }} -{% if 'Controller' in role %} -{# (jbadiapa) The to_json | from_json is due to the ansible issue at #} -{# https://github.com/ansible/ansible/issues/27299 #} -{% if ( baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:control')].name")| length > 0 ) %} - instances: -{% for instance in range (role_count): %} - - hostname: {{stack_name}}-{{role|lower}}-{{instance}} - name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:control')].name"))[instance] }} -{% endfor %} -{% endif %} -{% elif 'Compute' in role %} -{% if (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:compute')].name")| length > 0 ) %} - instances: -{% for instance in range (role_count): %} - - hostname: {{stack_name}}-{{role|lower}}-{{instance}} - name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:compute')].name"))[instance] }} -{% endfor %} -{% endif %} -{% elif 'Ceph' in role %} -{% if ( baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:ceph')].name")| length > 0 ) %} - instances: -{% for instance in range (role_count): %} - - hostname: {{stack_name}}-{{role|lower}}-{{instance}} - name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:ceph')].name"))[instance] }} -{% endfor %} -{% endif %} -{% endif %} -{% if role_profile or (network_config and network_provision|bool) or (role_networks and network_isolation and network_provision|bool) %} - defaults: -{% endif %} -{% if role_profile %} - profile: {{ role_profile }} -{% endif %} -{% if role_networks and network_isolation and network_provision|bool %} - networks: - {{ role_networks | to_nice_yaml(indent=2) | indent(6)}} -{% endif %} -{% if network_config and network_provision|bool %} - network_config: - {{ network_config | to_nice_yaml(indent=2) | indent(6)}} -{% endif %} -{% if growvols_args and release not in ['train'] %} - ansible_playbooks: - - playbook: /usr/share/ansible/tripleo-playbooks/cli-overcloud-node-growvols.yaml - extra_vars: - growvols_args: {{ growvols_args }} -{% endif %} -{% endif %} -{% endfor %} diff --git a/roles/overcloud-deploy/templates/overcloud_network_params.yaml.j2 b/roles/overcloud-deploy/templates/overcloud_network_params.yaml.j2 deleted file mode 100644 index 6701d2cda..000000000 --- a/roles/overcloud-deploy/templates/overcloud_network_params.yaml.j2 +++ /dev/null @@ -1,4 +0,0 @@ -# Defines overcloud network parameters based on parameters given. - -parameter_defaults: - NeutronGlobalPhysnetMtu: {{ overcloud_neutron_global_physnet_mtu }} diff --git a/roles/overcloud-deploy/templates/overcloud_roles.yaml.j2 b/roles/overcloud-deploy/templates/overcloud_roles.yaml.j2 deleted file mode 100644 index 739b339f6..000000000 --- a/roles/overcloud-deploy/templates/overcloud_roles.yaml.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ overcloud_roles | default('') | to_nice_yaml }} diff --git a/roles/overcloud-deploy/templates/overcloud_services.yaml.j2 b/roles/overcloud-deploy/templates/overcloud_services.yaml.j2 deleted file mode 100644 index 9e2c95dba..000000000 --- a/roles/overcloud-deploy/templates/overcloud_services.yaml.j2 +++ /dev/null @@ -1,7 +0,0 @@ -parameter_defaults: -{% for nodes in overcloud_services %} - {{ nodes.name }} - {% for node in nodes.services %} - - {{ node }} - {% endfor %} -{% endfor %} diff --git a/roles/overcloud-deploy/templates/overcloud_storage_params.yaml.j2 b/roles/overcloud-deploy/templates/overcloud_storage_params.yaml.j2 deleted file mode 100644 index 340eec6bd..000000000 --- a/roles/overcloud-deploy/templates/overcloud_storage_params.yaml.j2 +++ /dev/null @@ -1,4 +0,0 @@ -# Defines overcloud storage parameters based on parameters given. - -parameter_defaults: - CinderLVMLoopDeviceSize: {{ overcloud_cinder_lvm_loop_device_size }} diff --git a/roles/overcloud-deploy/templates/resource-registry-nic-configs.yaml.j2 b/roles/overcloud-deploy/templates/resource-registry-nic-configs.yaml.j2 deleted file mode 100644 index 3d7932f5e..000000000 --- a/roles/overcloud-deploy/templates/resource-registry-nic-configs.yaml.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{# -This takes advantage of the fact that valid JSON is also -valid YAML. The default to_nice_yaml filter doesn't quote strings, -which can cause unexpected implicit type conversion when the -resulting YAML is consumed, whereas with JSON all strings are quoted. -#} -{% set resource_registry = {'resource_registry': resource_registry_args} %} -{{ resource_registry|to_nice_json }} diff --git a/roles/overcloud-deploy/templates/tls-everywhere.yaml.j2 b/roles/overcloud-deploy/templates/tls-everywhere.yaml.j2 deleted file mode 100644 index effe80701..000000000 --- a/roles/overcloud-deploy/templates/tls-everywhere.yaml.j2 +++ /dev/null @@ -1,8 +0,0 @@ -# Override the IpaClient path to use tripleo-ipa instead of novajoin for IPA registration - -parameter_defaults: - IdMServer: {{freeipa_server_hostname}} - IdMDomain: {{overcloud_cloud_domain}} - -resource_registry: - OS::TripleO::Services::IpaClient: {{overcloud_templates_path}}/deployment/ipa/ipaservices-baremetal-ansible.yaml diff --git a/roles/overcloud-deploy/tests/inventory b/roles/overcloud-deploy/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/overcloud-deploy/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/overcloud-deploy/tests/test.yml b/roles/overcloud-deploy/tests/test.yml deleted file mode 100644 index a115b9986..000000000 --- a/roles/overcloud-deploy/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-overcloud diff --git a/roles/overcloud-network-discovery/defaults/main.yml b/roles/overcloud-network-discovery/defaults/main.yml deleted file mode 100644 index 8e55b7524..000000000 --- a/roles/overcloud-network-discovery/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -netstat_log: /tmp/netstat_audit.log -netstat_interval: 60 -netstat_dest_directory: /tmp -execute_netstat: false -kill_netstat: false diff --git a/roles/overcloud-network-discovery/meta/main.yml b/roles/overcloud-network-discovery/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-network-discovery/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-network-discovery/tasks/main.yml b/roles/overcloud-network-discovery/tasks/main.yml deleted file mode 100644 index 58c2ddb62..000000000 --- a/roles/overcloud-network-discovery/tasks/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -- include: netstat.yml diff --git a/roles/overcloud-network-discovery/tasks/netstat.yml b/roles/overcloud-network-discovery/tasks/netstat.yml deleted file mode 100644 index 17a1950eb..000000000 --- a/roles/overcloud-network-discovery/tasks/netstat.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- name: generate netstat script - template: - src: execute_netstat.sh.j2 - dest: "{{ netstat_dest_directory }}/execute_netstat.sh" - mode: 0755 - when: execute_netstat|default(false)|bool - -- name: execute the netstat script - become: true - shell: > - set -o pipefail && - {{ netstat_dest_directory }}/execute_netstat.sh & - changed_when: true - async: 0 - poll: 0 - when: execute_netstat|bool - -- name: kill netstat - become: true - command: killall -9 netstat - ignore_errors: true - when: kill_netstat|default(false)|bool - -- name: copy log file to /var/log/ - become: true - command: "cp {{ netstat_log }} /var/log/" - ignore_errors: true - when: kill_netstat|default(false)|bool diff --git a/roles/overcloud-network-discovery/templates/execute_netstat.sh.j2 b/roles/overcloud-network-discovery/templates/execute_netstat.sh.j2 deleted file mode 100644 index 21c70ea8a..000000000 --- a/roles/overcloud-network-discovery/templates/execute_netstat.sh.j2 +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -# run netstat periodically to gather data for port audits -/usr/bin/netstat -lnp -c {{ netstat_interval }} &> {{ netstat_log }} diff --git a/roles/overcloud-prep-config/README.md b/roles/overcloud-prep-config/README.md deleted file mode 100644 index 273c8743a..000000000 --- a/roles/overcloud-prep-config/README.md +++ /dev/null @@ -1,95 +0,0 @@ -ansible-role-tripleo-overcloud-prep-config -========================================== - -An Ansible role to copy configuration files to the undercloud prior to -overcloud deployment. - -Requirements ------------- - -This playbook expects that the undercloud has been installed and setup using -one of the roles relevant to baremetal overcloud deployments. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your -[initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html). - -- `working_dir`: <'/home/{{ undercloud_user }}'> -- defined in roles/extras-common -- `baremetal_instackenv`: <"{{ working_dir }}/instackenv.json"> -- location of - instackenv.json to copy over -- `baremetal_network_environment`: <"{{ working_dir }}/network-isolation.yml"> - -- location of network-environment file to copy over -- `undercloud_type`: -- can be overwritten with values like - 'baremetal' or 'ovb' -- `network_isolation_type`: single-nic-vlans, multiple-nics, bond-with-vlans, public-bond - - type of network isolation to use (default: single-nic-vlans) [1] - deprecated types - single_nic_vlans, bond_with_vlans, multi-nic -- `download_overcloud_templates_rpm`: if set to true, allow the user to - download a tripleo-heat-templates rpm package from a url defined by the - variable `tht_rpm_url` -- `overcloud_templates_path`: <'/usr/share/openstack-tripleo-heat-templates'> -- - defined in roles/extras-common -- `overcloud_prep_post_hook_script`: if set to a non-empty string, it should be the content - of a bash script that will be run at the end of the overcloud preparation configuration step. - This should only be use in rare case. - -[1] Names are derived from the `tripleo-heat-templates configuration `_ - -Role Network Variables ----------------------- -- `overcloud_dns_servers`: -- a list of nameservers to be used for the - overcloud nodes. These will result in the 'DnsServers' parameter in heat, and - will be added to the `network_environment_args` (see below). Defaults to - [ '{{ external_network_cidr|nthhost(1) }}' ] - -The following variables are nested under network_environment_args. The values -are calculated at run time using ansible jinja filters. This are, in turn, -persisted to a heat environment file that is used in for the overcloud -deployment. - -**Note:** See additional documentation at http://docs.ansible.com/ansible/playbooks_filters_ipaddr.html and -the ansible code base ansible/plugins/filter/ipaddr.py - -``` -network_environment_args: - ExternalNetCidr: "{{ undercloud_external_network_cidr }}" - ExternalAllocationPools: > - [{'start': '{{ undercloud_external_network_cidr|nthhost(4) }}', - 'end': '{{ undercloud_external_network_cidr|nthhost(250) }}'}] - NeutronExternalNetworkBridge: "" - ControlPlaneSubnetCidr: "{{ undercloud_network_cidr|ipaddr('prefix') }}" - ControlPlaneDefaultRoute: "{{ undercloud_network_cidr|nthhost(1) }}" - EC2MetadataIp: "{{ undercloud_network_cidr|nthhost(1) }}" - DnsServers: "{{ overcloud_dns_servers }}" - -``` - -Dependencies ------------- - -This playbook does not deploy the overcloud. After this playbook runs, call -https://github.com/redhat-openstack/ansible-role-tripleo-overcloud. - -Example Playbook ----------------- - -Sample playbook to call the role - -```yaml -- name: Copy configuration files - hosts: undercloud - roles: - - ansible-role-tripleo-overcloud-prep-config -``` - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/overcloud-prep-config/defaults/main.yml b/roles/overcloud-prep-config/defaults/main.yml deleted file mode 100644 index 6d377b6a7..000000000 --- a/roles/overcloud-prep-config/defaults/main.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- - -network_isolation: true -network_isolation_type: single-nic-vlans # multiple-nics, bond-with-vlans, public-bond -network_environment_file: network-environment.yaml.j2 - -external_network_cidr: 192.168.23.0/24 -undercloud_external_network_cidr: >- - {%- if overcloud_ipv6|bool %}2001:db8:fd00:1000::/64{% else %}10.0.0.1/24{% endif -%} -overcloud_dns_servers: ['{{ external_network_cidr|nthhost(1) }}'] - -overcloud_public_vip: "{{ undercloud_external_network_cidr|nthhost(5) }}" -ssl_overcloud: false - -network_environment_args: - ExternalNetCidr: "{{ undercloud_external_network_cidr }}" - ExternalInterfaceDefaultRoute: "{{ undercloud_external_network_cidr|nthhost(1) }}" - ExternalAllocationPools: > - [{'start': '{{ undercloud_external_network_cidr|nthhost(4) }}', - 'end': '{{ undercloud_external_network_cidr|nthhost(250) }}'}] - NeutronExternalNetworkBridge: "" - ControlPlaneSubnetCidr: "{{ undercloud_network_cidr|ipaddr('prefix') }}" - ControlPlaneDefaultRoute: "{{ undercloud_network_cidr|nthhost(1) }}" - EC2MetadataIp: "{{ undercloud_network_cidr|nthhost(1) }}" - DnsServers: "{{ overcloud_dns_servers }}" - -public_virtual_fixed_ips: - PublicVirtualFixedIPs: > - [{'ip_address':'{{ overcloud_public_vip }}'}] - -undercloud_type: virtual -baremetal_instackenv: "{{ working_dir }}/instackenv.json" -baremetal_network_environment: "{{ working_dir }}/network-isolation.yml" - -overcloud_custom_tht_script: custom-tht-script.sh.j2 -overcloud_custom_tht_log: overcloud_custom_tht_script.log - -bond_with_vlans_copy_nic_configs_script: bond-with-vlans-copy-nic-configs.sh.j2 -bond_with_vlans_nic_configs_log: bond_with_vlans_nic_configs_script_log - -tht_rpm_url: https://trunk.rdoproject.org/centos7-{{ release }}/current/ - -overcloud_prep_post_hook_script: "" - -# The `network_data_details` var when defined can be used to copy custom network_data.yaml in -# zuul/stack user home directory. By default for ci use case we utilize tht ci/network_data.yaml:- -# https://github.com/openstack/tripleo-heat-templates/blob/master/ci/network_data.yaml -# In baremetal environment we have to create our own custom network_data.yaml as per -# network layout, details on how to create this file can be found at:- -# https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/network_v2.html#pre-provision-networks -# network_data_details: -# - name: External -# name_lower: external -# vip: true -# mtu: 1500 -# subnets: -# external_subnet: -# ip_subnet: 10.0.0.0/24 -# allocation_pools: -# - start: 10.0.0.4 -# end: 10.0.0.250 -# gateway_ip: 10.0.0.1 -# vlan: 10 - -# The `network_vip_details` var when defined can be use to create custom vip_data.yaml in zuul -# zuul/stack home directory. By default for ci use case we utilize tht ci/vip_data.yaml:- -# https://github.com/openstack/tripleo-heat-templates/blob/master/ci/vip_data.yaml -# In baremetal environment we have to create our own custom vip_data.yaml as per -# network layout, details on how to create this file can be found at:- -# https://docs.openstack.org/project-deploy-guide/tripleo-docs/latest/deployment/network_v2.html#pre-provision-network-virtual-ips -# network_vip_details: -# - network: ctlplane -# dns_name: overcloud -# - network: external -# dns_name: overcloud -# - network: internal_api -# dns_name: overcloud -# - network: storage -# dns_name: overcloud -# - network: storage_mgmt -# dns_name: overcloud diff --git a/roles/overcloud-prep-config/meta/main.yml b/roles/overcloud-prep-config/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-prep-config/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-prep-config/tasks/main.yml b/roles/overcloud-prep-config/tasks/main.yml deleted file mode 100644 index 52534fe03..000000000 --- a/roles/overcloud-prep-config/tasks/main.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -- name: Deprecation message for network isolation types - debug: - msg: >- - Network isolation type 'bond_with_vlans' is deprecated in R release, - please use 'bond-with-vlans'. - when: network_isolation_type is defined and network_isolation_type == "bond_with_vlans" - -- name: Add PublicVirtualFixedIPs Argument to network environment file - set_fact: - network_environment_args: >- - {{ network_environment_args | combine(public_virtual_fixed_ips) }} - when: ssl_overcloud|bool and undercloud_type != "baremetal" - tags: - - overcloud-scripts - -- name: Create network environment file for network isolation - template: - src: "{{ network_environment_file }}" - dest: "{{ working_dir }}/network-environment.yaml" - mode: 0644 - when: network_isolation|bool and undercloud_type != "baremetal" or deployed_server|bool - tags: - - overcloud-scripts - -- when: - - release not in ['train'] - - job.environment_type is defined and job.environment_type == 'baremetal' - block: - - name: Create network_data.yaml according to baremetal environment - become: true - copy: - content: "{{ network_data_details }}" - dest: "{{ working_dir }}/network_data.yaml" - when: - - network_data_details is defined - - name: Create vip_data.yaml according to baremetal environment - become: true - copy: - content: "{{ network_vip_details }}" - dest: "{{ working_dir }}/vip_data.yaml" - when: - - network_vip_details is defined - -- when: undercloud_type == "baremetal" - block: - - - name: "Push baremetal instackenv.json" - copy: - src: "{{ baremetal_instackenv }}" - dest: "{{ working_dir }}/instackenv.json" - - - name: "Push network-environment.yaml" - copy: - src: "{{ baremetal_network_environment }}" - dest: "{{ working_dir }}/network-environment.yaml" - -# NOTE: 'bond_with_vlans' is deprecated -- when: network_isolation_type is defined and network_isolation_type in ["bond-with-vlans", "bond_with_vlans"] - block: - - - name: Create bond-with-vlans nic-configs script - template: - src: "{{ bond_with_vlans_copy_nic_configs_script }}" - dest: "{{ working_dir }}/bond-with-vlans-copy-nic-configs.sh" - mode: 0755 - - - name: Modify the nic-configs file to use Linux bonds - shell: > - set -o pipefail && - {{ working_dir }}/bond-with-vlans-copy-nic-configs.sh 2>&1 {{ timestamper_cmd }} > - {{ bond_with_vlans_nic_configs_log }} - -- name: "Push baremetal nic-configs directory (if defined)" - copy: - src: "{{ baremetal_nic_configs }}" - dest: "{{ working_dir }}" - when: baremetal_nic_configs is defined - -- name: Prepare custom t-h-t for overcloud deployment - include_role: - name: tht-prep-config - vars: - custom_tht_log: "{{ overcloud_custom_tht_log }}" - custom_tht_script: "{{ overcloud_custom_tht_script }}" - tht_templates_repo: "{{ overcloud_templates_repo|default('') }}" - tht_templates_refspec: "{{ overcloud_templates_refspec|default('') }}" - tht_templates_branch: "{{ overcloud_templates_branch|default('') }}" - tht_templates_path: "{{ overcloud_templates_path }}" - download_templates_rpm: "{{ download_overcloud_templates_rpm|default('') }}" - prep_post_hook_script: "{{ overcloud_prep_post_hook_script|default('') }}" - when: - - overcloud_templates_refspec is defined or overcloud_templates_branch is defined - - overcloud_templates_repo is defined diff --git a/roles/overcloud-prep-config/templates/bond-with-vlans-copy-nic-configs.sh.j2 b/roles/overcloud-prep-config/templates/bond-with-vlans-copy-nic-configs.sh.j2 deleted file mode 100644 index 916c689ec..000000000 --- a/roles/overcloud-prep-config/templates/bond-with-vlans-copy-nic-configs.sh.j2 +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# Script to modify nic-configs for bond-with-vlans deployments - -set -eux - -### --start_docs - -## LACP bonding using Linux bonds for bond-with-vlans deployments -## ============================================================== - -## * Copy the yaml file from the standard template files directory -## :: - -ORIGIN_TEMPLATES_DIR={{ overcloud_templates_path }}/network/config/bond-with-vlans -CUSTOM_TEMPLATES_DIR={{ overcloud_templates_path }}/network/config/custom-bond-with-vlans -sudo mkdir -p $CUSTOM_TEMPLATES_DIR -sudo cp $ORIGIN_TEMPLATES_DIR/*.yaml $CUSTOM_TEMPLATES_DIR/ - -## * Modify the yaml files to use Linux bonds -## :: - -sudo grep -rl 'type: ovs_bond' $CUSTOM_TEMPLATES_DIR/ | xargs sudo sed -i 's/type: ovs_bond/type: linux_bond/g' -sudo grep -rl 'ovs_options' $CUSTOM_TEMPLATES_DIR/ | xargs sudo sed -i 's/ovs_options/bonding_options/g' - -### --stop_docs diff --git a/roles/overcloud-prep-config/templates/network-environment.yaml.j2 b/roles/overcloud-prep-config/templates/network-environment.yaml.j2 deleted file mode 100644 index f0c5cba2e..000000000 --- a/roles/overcloud-prep-config/templates/network-environment.yaml.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{# -This takes advantage of the fact that valid JSON is also -valid YAML. The default to_nice_yaml filter doesn't quote strings, -which can cause unexpected implicit type conversion when the -resulting YAML is consumed, whereas with JSON all strings are quoted. -#} -{% set parameter_defaults = {'parameter_defaults': network_environment_args} %} -{{ parameter_defaults|to_nice_json }} diff --git a/roles/overcloud-prep-containers/README.md b/roles/overcloud-prep-containers/README.md deleted file mode 100644 index babe3b990..000000000 --- a/roles/overcloud-prep-containers/README.md +++ /dev/null @@ -1,139 +0,0 @@ -overcloud-prep-containers -========= - -This role that prepares an environment for a containerized compute is under active development along -with active development of the containerized computer feature itself. - -This role walks through the developer setup for a tripleo deployment with a containerized compute. -The developer documentation can be found here: https://etherpad.openstack.org/p/tripleo-containers-work - -The instructions below use the master branch from delorean that has been vetted by CI, and then updates -any tripleo rpm to the latest version available from delorean. It should be the same content as what -currently runs in tripleo-ci - -This also git checks out https://opendev.org/openstack/tripleo-heat-templates -with refspec: refs/changes/59/330659/43 , this can be updated in config/general_config/containers_minimal.yml - - -Requirements ------------- - -https://github.com/openstack/tripleo-quickstart/blob/master/README.rst - - -overcloud-prep-containers variables --------------- - -* working_dir: /home/stack -* overcloud_prep_containers_script: overcloud-prep-containers.sh.j2 -* overcloud_prep_containers_log: overcloud_prep_containers.log -* undercloud_network_cidr: 192.168.24.0/24 -* prepare_service_env_args: -e {{ overcloud_templates_path }}/environments/docker.yaml -* delete_docker_cache: -- whether to stop Docker, wipe all the Docker data, and restart -* update_containers: -- whether to run container-check to update containers -* container_process_count: <8> -- number of concurrent processes to run when updating containers -* use_overcloud_mixed_upgrade: - when true, we use overcloud release tag and build_id for - container images in mixed upgrade context. -* prep_container_upgrade_run: - in mixed version upgrade offer a flag to have container - deployed during upgrade. - -overcloud-prep-config variables -------------------------------- - -* overcloud_templates_path: /home/stack/tripleo-heat-templates -* overcloud_templates_repo: https://opendev.org/openstack/tripleo-heat-templates -* overcloud_templates_branch: master - - -tripleo-quickstart variables ----------------------------- - -* see config/general_config/containers_minimal.yml - - - -Dependencies ------------- - -These dependencies are accounted for in the unmerged tripleo-quickstart review https://review.opendev.org/#/c/393348/ - -* Depends-On: https://review.opendev.org/#/c/393348/ -* Depends-On: https://review.gerrithub.io/#/c/300328/ - -How to Execute: ---------------- -Review https://github.com/openstack/tripleo-quickstart/blob/master/README.rst:: - - mkdir quickstart_containers - export WORKSPACE=$PWD/quickstart_containers - cd $WORKSPACE - git clone https://github.com/openstack/tripleo-quickstart.git - git clone https://github.com/openstack/tripleo-quickstart-extras.git - - # Update quickstart to use the right review - pushd tripleo-quickstart - git remote add gerrit https://review.opendev.org/openstack/tripleo-quickstart - git fetch --all - git review -d I676b429cab920516a151b124fca2e26dd5c5e87b - popd - - # Update quickstart-extras to use the right review - pushd tripleo-quickstart-extras - git remote add gerrit https://review.opendev.org/openstack/tripleo-quickstart-extras - git fetch --all - git-review -d Id91cfae8aff8652222a4e9adab0635be6c0f8f64 - git-review -x Ie1ca08de17ff0fddd9c9cbd124ae65735ea4b6bc - popd - - mkdir /var/tmp/containers - export WD=/var/tmp/containers - export VIRTHOST= - - pushd tripleo-quickstart - sed -i "s|git+https://opendev.org/openstack|file://$WORKSPACE|g" quickstart-extras-requirements.txt - - ./quickstart.sh --no-clone --working-dir $WD --teardown all --requirements quickstart-extras-requirements.txt --playbook quickstart-extras.yml --config $PWD/config/general_config/containers_minimal.yml --tags all --release master-tripleo-ci $VIRTHOST - -How to Execute with Additional gerrit reviews ---------------------------------------------- - -This will install a local delorean instance and build the reviews into the undercloud/overcloud -Example change https://review.opendev.org/#/c/396460/ - -STEPS:: - - export GERRIT_HOST=review.opendev.org - export GERRIT_BRANCH=master - export GERRIT_CHANGE_ID=396460 - export GERRIT_PATCHSET_REVISION=3ea99ef27f60157699c13acb64f88d2cd03d237b - - # Note.. FOR RHEL VIRTHOST's - * ensure mock is installed on the virthost *, for rhel it comes from epel.. then remove the epel repo - - # Build the yum repo in /home/stack of the $VIRTHOST - ./quickstart.sh \ - --no-clone \ - --working-dir $WD \ - --teardown all \ - --requirements quickstart-extras-requirements.txt \ - --playbook dlrn-gate.yml \ - --config $PWD/config/general_config/containers_minimal.yml \ - --extra-vars compressed_gating_repo="/home/stack/gating_repo.tar.gz" \ - --tags all \ - --release master-tripleo-ci \ - $VIRTHOST - - # Consume the local delorean repo in addition to the normal deployment - ./quickstart.sh \ - --no-clone \ - --working-dir $WD \ - --teardown none \ - --retain-inventory \ - --requirements quickstart-extras-requirements.txt \ - --playbook quickstart-extras.yml \ - --config $PWD/config/general_config/containers_minimal.yml \ - --extra-vars compressed_gating_repo="/home/stack/gating_repo.tar.gz" \ - --skip-tags provision \ - --tags all \ - --release master-tripleo-ci \ - $VIRTHOST diff --git a/roles/overcloud-prep-containers/defaults/main.yml b/roles/overcloud-prep-containers/defaults/main.yml deleted file mode 100644 index ac7c7d9f7..000000000 --- a/roles/overcloud-prep-containers/defaults/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -tripleo_common_dir: /usr/share/openstack-tripleo-common -overcloud_prep_containers_template: overcloud-prep-containers.sh.j2 -overcloud_prep_containers_script: "overcloud-prep-containers.sh" -overcloud_prep_containers_log: "overcloud_prep_containers.log" -prepare_service_env_args: -e {{ overcloud_templates_path }}/environments/docker.yaml -update_containers: false -container_process_count: 8 -use_overcloud_mixed_upgrade: false -prep_container_upgrade_run: false -gating_repo_name: gating-repo -container_prep_additional_repos: "" -update_containers_repo: >- - {% if compressed_gating_repo is defined %}{{ gating_repo_name }},{% endif %}delorean-current - {%- if container_prep_additional_repos -%},{{ container_prep_additional_repos }}{%- endif -%} -local_registry_ip: 127.0.0.1 -local_registry_port: 5001 diff --git a/roles/overcloud-prep-containers/meta/main.yml b/roles/overcloud-prep-containers/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/overcloud-prep-containers/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/overcloud-prep-containers/tasks/create-scripts.yml b/roles/overcloud-prep-containers/tasks/create-scripts.yml deleted file mode 100644 index 2a2b3c411..000000000 --- a/roles/overcloud-prep-containers/tasks/create-scripts.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -# Create the scripts that will be used to setup the overcloud images - -- name: set the service environments for container image prepare - set_fact: - prepare_service_env_args: >- - -e {{ overcloud_templates_path }}/environments/docker.yaml - -e {{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }} - when: not composable_scenario|trim == '' - -- name: Create overcloud prep-containers script - template: - src: "{{ overcloud_prep_containers_template }}" - dest: "{{ working_dir }}/{{ overcloud_prep_containers_script }}" - mode: 0755 diff --git a/roles/overcloud-prep-containers/tasks/main.yml b/roles/overcloud-prep-containers/tasks/main.yml deleted file mode 100644 index eb34bb226..000000000 --- a/roles/overcloud-prep-containers/tasks/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -# tasks file for ansible-role-tripleo-overcloud-prep-containers -- name: gather facts needed by role - setup: - gather_subset: "!min,user_dir,python" - when: > - ansible_user_dir is not defined or - ansible_python is not defined - -- name: set python_cmd - set_fact: - python_cmd: "python{{ ansible_python.version.major }}" - cacheable: true - when: python_cmd is not defined diff --git a/roles/overcloud-prep-containers/tasks/overcloud-prep-containers.yml b/roles/overcloud-prep-containers/tasks/overcloud-prep-containers.yml deleted file mode 100644 index 6b9a35654..000000000 --- a/roles/overcloud-prep-containers/tasks/overcloud-prep-containers.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- when: update_containers|bool - block: - - - name: Update pip - # noqa 403 - pip: - name: pip - state: latest - extra_args: --upgrade - become: true - - - name: Pip install container-check - # noqa 403 - pip: - name: container-check - state: latest - extra_args: --upgrade - become: true - -- name: Prepare for the containerized deployment - shell: > - set -o pipefail && - {{ working_dir }}/{{ overcloud_prep_containers_script }} 2>&1 {{ timestamper_cmd }} > - {{ overcloud_prep_containers_log }} diff --git a/roles/overcloud-prep-containers/templates/overcloud-prep-containers.sh.j2 b/roles/overcloud-prep-containers/templates/overcloud-prep-containers.sh.j2 deleted file mode 100644 index 80f212c5e..000000000 --- a/roles/overcloud-prep-containers/templates/overcloud-prep-containers.sh.j2 +++ /dev/null @@ -1,281 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare the undercloud for deploying the containerized compute node -## =================================================================== - -## .. note:: In progress documentation is available at https://etherpad.openstack.org/p/tripleo-containers-work -## :: - -## Prepare Your Environment -## ------------------------ - -## * Add an additional insecure registry if needed -## :: -{% if additional_insecure_registry|bool %} -{% if job.registry_ip_address_branch is defined %} -if egrep -q "^INSECURE_REGISTRY=.*{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}.*" /etc/sysconfig/docker; then - echo "/etc/sysconfig/docker contains the correct settings" -else - echo "updating /etc/sysconfig/docker for internal registry" - sudo sed -i \ - -e "s/^INSECURE_REGISTRY=\"\(.*\)\"/INSECURE_REGISTRY=\"\1 --insecure-registry {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}\"/g" \ - /etc/sysconfig/docker - sudo systemctl restart docker -fi -{% else %} -if egrep -q "^INSECURE_REGISTRY=.*{{docker_registry_host}}.*" /etc/sysconfig/docker; then - echo "/etc/sysconfig/docker contains the correct settings" -else - echo "updating /etc/sysconfig/docker for internal registry" - sudo sed -i -e "s/^INSECURE_REGISTRY=\"\(.*\)\"/INSECURE_REGISTRY=\"\1 --insecure-registry {{ docker_registry_host }}\"/g" /etc/sysconfig/docker - sudo systemctl restart docker -fi -{% endif %} -{% endif %} - -PREPARE_ARGS=${PREPARE_ARGS:-"{{ prepare_service_env_args }}"} - -## * Configure the {{ working_dir }}/containers-default-parameters.yaml, and -## populate the docker registry. This is done automatically. -## :: - -{% if not mixed_upgrade|default(false)|bool %} -openstack tripleo container image prepare --verbose \ - --output-env-file {{ working_dir }}/containers-default-parameters.yaml \ - ${PREPARE_ARGS} \ - -e {{ working_dir }}/containers-prepare-parameter.yaml - -{% else %} - -openstack overcloud container image prepare \ - --output-images-file {{ working_dir }}/overcloud_containers.yaml \ - --output-env-file {{ working_dir }}/containers-default-parameters.yaml \ - ${PREPARE_ARGS} \ -{% if job.consumer_job | default(false) | bool %} - --namespace "{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" \ -{% else %} - --namespace "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}" \ -{% endif %} - --tag {{ container_build_id }} \ -{% if docker_prep_prefix is defined %} - --prefix "{{ docker_prep_prefix }}" \ -{% endif %} -{% if docker_prep_suffix is defined %} - --suffix "{{ docker_prep_suffix }}" \ -{% endif %} -{% if docker_ceph_namespace is defined %} - --set "ceph_namespace={{ docker_ceph_namespace }}" \ -{% endif %} -{% if docker_ceph_image is defined %} - --set "ceph_image={{ docker_ceph_image }}" \ -{% endif %} -{% if docker_ceph_tag is defined %} - --set "ceph_tag={{ docker_ceph_tag }}" \ -{% endif %} -{% if custom_ceph_alertmanager_image is defined %} - --set "ceph_alertmanager_image={{ custom_ceph_alertmanager_image }}" \ -{% endif %} -{% if custom_ceph_alertmanager_namespace is defined %} - --set "ceph_alertmanager_namespace={{ custom_ceph_alertmanager_namespace }}" \ -{% endif %} -{% if custom_ceph_alertmanager_tag is defined %} - --set "ceph_alertmanager_tag={{ custom_ceph_alertmanager_tag }}" \ -{% endif %} -{% if custom_ceph_grafana_image is defined %} - --set "ceph_grafana_image={{ custom_ceph_grafana_image }}" \ -{% endif %} -{% if custom_ceph_grafana_namespace is defined %} - --set "ceph_grafana_namespace={{ custom_ceph_grafana_namespace }}" \ -{% endif %} -{% if custom_ceph_grafana_tag is defined %} - --set "ceph_grafana_tag={{ custom_ceph_grafana_tag }}" \ -{% endif %} -{% if custom_ceph_node_exporter_image is defined %} - --set "ceph_node_exporter_image={{ custom_ceph_node_exporter_image }}" \ -{% endif %} -{% if custom_ceph_node_exporter_namespace is defined %} - --set "ceph_node_exporter_namespace={{ custom_ceph_node_exporter_namespace }}" \ -{% endif %} -{% if custom_ceph_node_exporter_tag is defined %} - --set "ceph_node_exporter_tag={{ custom_ceph_node_exporter_tag }}" \ -{% endif %} -{% if custom_ceph_prometheus_image is defined %} - --set "ceph_prometheus_image={{ custom_ceph_prometheus_image }}" \ -{% endif %} -{% if custom_ceph_prometheus_namespace is defined %} - --set "ceph_prometheus_namespace={{ custom_ceph_prometheus_namespace }}" \ -{% endif %} -{% if custom_ceph_prometheus_tag is defined %} - --set "ceph_prometheus_tag={{ custom_ceph_prometheus_tag }}" \ -{% endif %} -{% if docker_openshift_namespace is defined %} - --set openshift_namespace={{ docker_openshift_namespace }} \ -{% endif %} -{% if docker_openshift_tag is defined %} - --set openshift_tag={{ docker_openshift_tag }} \ -{% endif %} -{% if docker_openshift_prefix is defined %} - --set openshift_prefix={{ docker_openshift_prefix }} \ -{% endif %} -{% if docker_openshift_cockpit_namespace is defined %} - --set openshift_cockpit_namespace={{ docker_openshift_cockpit_namespace }} \ -{% endif %} -{% if docker_openshift_cockpit_image is defined %} - --set openshift_cockpit_image={{ docker_openshift_cockpit_image }} \ -{% endif %} -{% if docker_openshift_cockpit_tag is defined %} - --set openshift_cockpit_tag={{ docker_openshift_cockpit_tag }} \ -{% endif %} -{% if docker_openshift_etcd_namespace is defined %} - --set openshift_etcd_namespace={{ docker_openshift_etcd_namespace }} \ -{% endif %} -{% if docker_openshift_etcd_image is defined %} - --set openshift_etcd_image={{ docker_openshift_etcd_image }} \ -{% endif %} -{% if docker_openshift_etcd_tag is defined %} - --set openshift_etcd_tag={{ docker_openshift_etcd_tag }} \ -{% endif %} -{% if docker_openshift_gluster_namespace is defined %} - --set openshift_gluster_namespace={{ docker_openshift_gluster_namespace }} \ -{% endif %} -{% if docker_openshift_gluster_image is defined %} - --set openshift_gluster_image={{ docker_openshift_gluster_image }} \ -{% endif %} -{% if docker_openshift_gluster_block_image is defined %} - --set openshift_gluster_block_image={{ docker_openshift_gluster_block_image }} \ -{% endif %} -{% if docker_openshift_gluster_tag is defined %} - --set openshift_gluster_tag={{ docker_openshift_gluster_tag }} \ -{% endif %} -{% if docker_openshift_heketi_namespace is defined %} - --set openshift_heketi_namespace={{ docker_openshift_heketi_namespace }} \ -{% endif %} -{% if docker_openshift_heketi_image is defined %} - --set openshift_heketi_image={{ docker_openshift_heketi_image }} \ -{% endif %} -{% if docker_openshift_heketi_tag is defined %} - --set openshift_heketi_tag={{ docker_openshift_heketi_tag }} \ -{% endif %} -{% if docker_openshift_cluster_monitoring_namespace is defined %} - --set openshift_cluster_monitoring_namespace={{ docker_openshift_cluster_monitoring_namespace }} \ -{% endif %} -{% if docker_openshift_cluster_monitoring_image is defined %} - --set openshift_cluster_monitoring_image={{ docker_openshift_cluster_monitoring_image }} \ -{% endif %} -{% if docker_openshift_cluster_monitoring_tag is defined %} - --set openshift_cluster_monitoring_tag={{ docker_openshift_cluster_monitoring_tag }} \ -{% endif %} -{% if docker_openshift_configmap_reload_namespace is defined %} - --set openshift_configmap_reload_namespace={{ docker_openshift_configmap_reload_namespace }} \ -{% endif %} -{% if docker_openshift_configmap_reload_image is defined %} - --set openshift_configmap_reload_image={{ docker_openshift_configmap_reload_image }} \ -{% endif %} -{% if docker_openshift_configmap_reload_tag is defined %} - --set openshift_configmap_reload_tag={{ docker_openshift_configmap_reload_tag }} \ -{% endif %} -{% if docker_openshift_prometheus_operator_namespace is defined %} - --set openshift_prometheus_operator_namespace={{ docker_openshift_prometheus_operator_namespace }} \ -{% endif %} -{% if docker_openshift_prometheus_operator_image is defined %} - --set openshift_prometheus_operator_image={{ docker_openshift_prometheus_operator_image }} \ -{% endif %} -{% if docker_openshift_prometheus_operator_tag is defined %} - --set openshift_prometheus_operator_tag={{ docker_openshift_prometheus_operator_tag }} \ -{% endif %} -{% if docker_openshift_prometheus_config_reload_namespace is defined %} - --set openshift_prometheus_config_reload_namespace={{ docker_openshift_prometheus_config_reload_namespace }} \ -{% endif %} -{% if docker_openshift_prometheus_config_reload_image is defined %} - --set openshift_prometheus_config_reload_image={{ docker_openshift_prometheus_config_reload_image }} \ -{% endif %} -{% if docker_openshift_prometheus_config_reload_tag is defined %} - --set openshift_prometheus_config_reload_tag={{ docker_openshift_prometheus_config_reload_tag }} \ -{% endif %} -{% if docker_openshift_prometheus_tag is defined %} - --set openshift_prometheus_tag={{ docker_openshift_prometheus_tag }} \ -{% endif %} -{% if docker_openshift_prometheus_alertmanager_tag is defined %} - --set openshift_prometheus_alertmanager_tag={{ docker_openshift_prometheus_alertmanager_tag }} \ -{% endif %} -{% if docker_openshift_prometheus_node_exporter_tag is defined %} - --set openshift_prometheus_node_exporter_tag={{ docker_openshift_prometheus_node_exporter_tag }} \ -{% endif %} -{% if docker_openshift_oauth_proxy_tag is defined %} - --set openshift_oauth_proxy_tag={{ docker_openshift_oauth_proxy_tag }} \ -{% endif %} -{% if docker_openshift_kube_rbac_proxy_namespace is defined %} - --set openshift_kube_rbac_proxy_namespace={{ docker_openshift_kube_rbac_proxy_namespace }} \ -{% endif %} -{% if docker_openshift_kube_rbac_proxy_image is defined %} - --set openshift_kube_rbac_proxy_image={{ docker_openshift_kube_rbac_proxy_image }} \ -{% endif %} -{% if docker_openshift_kube_rbac_proxy_tag is defined %} - --set openshift_kube_rbac_proxy_tag={{ docker_openshift_kube_rbac_proxy_tag }} \ -{% endif %} -{% if docker_openshift_kube_state_metrics_namespace is defined %} - --set openshift_kube_state_metrics_namespace={{ docker_openshift_kube_state_metrics_namespace }} \ -{% endif %} -{% if docker_openshift_kube_state_metrics_image is defined %} - --set openshift_kube_state_metrics_image={{ docker_openshift_kube_state_metrics_image }} \ -{% endif %} -{% if docker_openshift_kube_state_metrics_tag is defined %} - --set openshift_kube_state_metrics_tag={{ docker_openshift_kube_state_metrics_tag }} \ -{% endif %} -{% if docker_openshift_grafana_namespace is defined %} - --set openshift_grafana_namespace={{ docker_openshift_grafana_namespace }} \ -{% endif %} -{% if docker_openshift_grafana_tag is defined %} - --set openshift_grafana_tag={{ docker_openshift_grafana_tag }} \ -{% endif %} - --push-destination {{ local_docker_registry_host }}:8787 - -openstack overcloud container image upload --debug --config-file {{ working_dir }}/overcloud_containers.yaml - -{% if update_containers|bool and not use_overcloud_mixed_upgrade|default(false)|bool %} -# See https://github.com/imain/container-check for script and documentation - -## * update the containers with yum updates from OpenStack repos. ( delorean-current, dependent patches built by DLRN ) -## :: - -packages_for_update="$(repoquery --disablerepo='*' --enablerepo={{ update_containers_repo }} --qf %{NAME} -a 2>{{ working_dir }}/repoquery.err.log | sort -u | xargs)" - -if [[ -n "$packages_for_update" ]]; then - openstack overcloud container image prepare \ - --output-images-file {{ working_dir }}/containers_update.yaml \ - ${PREPARE_ARGS} \ - --exclude ceph \ - --exclude openshift \ - --exclude kubernetes \ - --namespace {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} \ - {% if docker_prep_prefix is defined %} - --prefix "{{ docker_prep_prefix }}" \ - {% endif %} - {% if docker_prep_suffix is defined %} - --suffix "{{ docker_prep_suffix }}" \ - {% endif %} - --tag {{ container_build_id }} - - container-check -u \ - -c {{ working_dir }}/containers_update.yaml \ - -p {{ container_process_count }} \ - -k $packages_for_update -fi - -{% endif %} -{% endif %} - -echo "=============================" -echo "Containers default parameters:" -cat {{ working_dir }}/containers-default-parameters.yaml -echo "=============================" - -## * Get the journal logs for docker -## :: - -sudo journalctl -u docker > docker_journalctl.log - -### --stop_docs diff --git a/roles/overcloud-prep-flavors/README.md b/roles/overcloud-prep-flavors/README.md deleted file mode 100644 index 3a0abfd7f..000000000 --- a/roles/overcloud-prep-flavors/README.md +++ /dev/null @@ -1,45 +0,0 @@ -Role Name -========= - -An Ansible role to copy configuration files to the undercloud prior to deployment. - -Requirements ------------- - -This playbook expects that the undercloud has been installed and setup using one of the roles relevant to baremetal overcloud deployments. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html). - -- working_dir: <'/home/stack'> -- working directory for the role. Assumes stackrc file is present at this location -- baremetal_instackenv: <"{{ working_dir }}/instackenv.json"> -- location of instackenv.json to copy over -- baremetal_network_environment: <"{{ working_dir }}/network-isolation.yml"> -- location of network-environment file to copy over -- undercloud_type: -- can be overwritten with values like 'baremetal' or 'ovb' - -Dependencies ------------- - -This playbook does not deploy the overcloud. After this playbook runs, call https://github.com/redhat-openstack/ansible-role-tripleo-overcloud. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Copy configuration files - hosts: virthost - gather_facts: false - roles: - - ansible-role-tripleo-overcloud-prep-config - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/overcloud-prep-flavors/defaults/main.yml b/roles/overcloud-prep-flavors/defaults/main.yml deleted file mode 100644 index 32bb6a769..000000000 --- a/roles/overcloud-prep-flavors/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -overcloud_prep_flavors_script: overcloud-prep-flavors.sh.j2 -overcloud_prep_flavors_log: "{{ working_dir }}/overcloud_prep_flavors.log" diff --git a/roles/overcloud-prep-flavors/meta/main.yml b/roles/overcloud-prep-flavors/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-prep-flavors/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-prep-flavors/tasks/create-scripts.yml b/roles/overcloud-prep-flavors/tasks/create-scripts.yml deleted file mode 100644 index 7246e6edc..000000000 --- a/roles/overcloud-prep-flavors/tasks/create-scripts.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -# Creat the scripts that will be used to setup flavors for the overcloud - -- name: Create overcloud-prep-flavors script - template: - src: "{{ overcloud_prep_flavors_script }}" - dest: "{{ working_dir }}/overcloud-prep-flavors.sh" - mode: 0755 - when: undercloud_enable_nova|bool diff --git a/roles/overcloud-prep-flavors/tasks/main.yml b/roles/overcloud-prep-flavors/tasks/main.yml deleted file mode 100644 index 0d5c690a0..000000000 --- a/roles/overcloud-prep-flavors/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- include: create-scripts.yml - tags: - - undercloud-scripts - -- include: overcloud-prep-flavors.yml - tags: - - undercloud-post-install diff --git a/roles/overcloud-prep-flavors/tasks/overcloud-prep-flavors.yml b/roles/overcloud-prep-flavors/tasks/overcloud-prep-flavors.yml deleted file mode 100644 index df9b9eb9c..000000000 --- a/roles/overcloud-prep-flavors/tasks/overcloud-prep-flavors.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Prepare the scripts for overcloud flavors - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-prep-flavors.sh 2>&1 {{ timestamper_cmd }} > - {{ overcloud_prep_flavors_log }} - changed_when: true - when: undercloud_enable_nova|bool diff --git a/roles/overcloud-prep-flavors/templates/overcloud-prep-flavors.sh.j2 b/roles/overcloud-prep-flavors/templates/overcloud-prep-flavors.sh.j2 deleted file mode 100644 index bbe7bc806..000000000 --- a/roles/overcloud-prep-flavors/templates/overcloud-prep-flavors.sh.j2 +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare flavors for deploying the overcloud -## =========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## Create flavors required for deployment -## -------------------------------------- - -{% for name, flavor in (flavors|default({})).items() if name != 'undercloud' %} - -## * Ensure oooq_{{ name }} flavor does not exist before attempting to create a new one. - -## :: - -nova flavor-delete oooq_{{ name }} > /dev/null 2>&1 || true - -## .. note: We subtract one from the total disk size here to resolve problems -## encountered in CI in which the available disk space on the virtual -## nodes was slightly less than what we requested. - -## :: - -openstack flavor create --id auto \ - --ram {{ flavor.memory }} \ - --disk $(( {{ flavor.disk }} - 1)) \ - --vcpus {{ flavor.vcpu }} \ - oooq_{{ name }} -openstack flavor set \ - --property "cpu_arch"="x86_64" \ - --property "capabilities:boot_option"="local" \ - --property "capabilities:profile"="{{ name }}" oooq_{{ name }} \ - --property "resources:CUSTOM_BAREMETAL"="1" \ - --property "resources:DISK_GB"="0" \ - --property "resources:MEMORY_MB"="0" \ - --property "resources:VCPU"="0" -{% for propname,propval in (flavor.properties|default({})).items() %} -openstack flavor set --property "{{ propname }}={{ propval }}" oooq_{{ name }} -{% endfor %} - -{% endfor %} - -### --stop_docs diff --git a/roles/overcloud-prep-images/README.md b/roles/overcloud-prep-images/README.md deleted file mode 100644 index be35e7d9a..000000000 --- a/roles/overcloud-prep-images/README.md +++ /dev/null @@ -1,61 +0,0 @@ -Role Name -========= - -An Ansible role to copy configuration files to the undercloud prior to deployment. - -Requirements ------------- - -This playbook expects that the undercloud has been installed and setup using one of the roles relevant to baremetal overcloud deployments. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html). - -- working_dir: <'/home/stack'> -- working directory for the role. Assumes stackrc file is present at this location -- baremetal_instackenv: <"{{ working_dir }}/instackenv.json"> -- location of instackenv.json to copy over -- baremetal_network_environment: <"{{ working_dir }}/network-isolation.yml"> -- location of network-environment file to copy over -- undercloud_type: -- can be overwritten with values like 'baremetal' or 'ovb' -- step_root_device_size: -- add disk size hints if needed for the environment under test -- disk_root_device_size: <1843> -- size hint for selecting the correct disk during introspection -- step_root_device_hints: false -- add root device hints if needed for the environment under test -- root_device_hints: [] -- list of the root device hints to be associated with nodes. Needs to have this format:: - - - root_device_hints: - - ip: <> - key: <> - value: <> - - Where key needs to be one of the valid Ironic root device hints, and value is the exact value that needs to be filtered. - For reference on all the possible root device hints see ``http://docs.openstack.org/project-install-guide/baremetal/draft/advanced.html#specifying-the-disk-for-deployment-root-device-hints``. - Please note that in order to match root device hints with the associated nodes on `instackenv.json`, - the node `pm_address` will be used as a key. - At the moment only equal operator is supported, is not possible to use other operators or logical combinations. -- step_introspect_with_retry: -- a more robust version of the step_introspect option - -Dependencies ------------- - -This playbook does not deploy the overcloud. After this playbook runs, call https://github.com/redhat-openstack/ansible-role-tripleo-overcloud. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Copy configuration files - hosts: virthost - gather_facts: false - roles: - - ansible-role-tripleo-overcloud-prep-config - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/overcloud-prep-images/defaults/main.yml b/roles/overcloud-prep-images/defaults/main.yml deleted file mode 100644 index f6af28ede..000000000 --- a/roles/overcloud-prep-images/defaults/main.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- - -overcloud_prep_images_script: overcloud-prep-images.sh.j2 -overcloud_prep_images_log: "{{ working_dir }}/overcloud_prep_images.log" -overcloud_introspect_script: overcloud-introspect.sh.j2 -overcloud_introspect_script_log: "{{ working_dir }}/overcloud_introspect.log" -download_overcloud_image_script: download-overcloud-image.sh.j2 -download_overcloud_image_log: "{{ working_dir }}/download_overcloud_image.log" -overcloud_image_upload_script: overcloud-image-upload.sh.j2 -overcloud_image_upload_log: "{{ working_dir }}/overcloud_image_upload.log" -overcloud_glance_image_upload_script: overcloud-glance-image-upload.sh.j2 -overcloud_glance_image_upload_log: "{{ working_dir }}/overcloud_glance_image_upload.log" -overcloud_list_flavors_log: "{{ working_dir }}/overcloud_list_flavors.log" -overcloud_list_flavors_script: overcloud-list-flavors.sh.j2 -overcloud_import_nodes_script: overcloud-import-nodes.sh.j2 -overcloud_import_nodes_log: "{{ working_dir }}/overcloud_import_nodes.log" -root_device_size_script: root-device-size.sh.j2 -root_device_size_log: "{{ working_dir }}/root_device_size.log" -root_device_hints_script: root-device-hints.sh.j2 -root_device_hints_log: "{{ working_dir }}/root_device_hints.log" -inject_ara_script: inject-ara.sh.j2 -inject_ara_log: "{{ working_dir }}/inject_ara.log" - -step_overcloud_image: true -step_glance_upload: false -step_register: true -step_introspect: false -step_introspect_debug: false -step_introspect_debug_tcpdump_log: "{{ working_dir }}/overcloud_prep_images_introspection_debug.pcap.log" -step_introspect_debug_tcpdump_ports: - - 67 - - 68 - - 69 - - 623 -step_introspect_with_retry: false -step_install_undercloud: true -step_root_device_size: false -disk_root_device_size: 1843 -step_root_device_hints: false -root_device_hints: [] - -download_overcloud_image: false diff --git a/roles/overcloud-prep-images/meta/main.yml b/roles/overcloud-prep-images/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-prep-images/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-prep-images/tasks/create-scripts.yml b/roles/overcloud-prep-images/tasks/create-scripts.yml deleted file mode 100644 index 770550ff6..000000000 --- a/roles/overcloud-prep-images/tasks/create-scripts.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -# Create the scripts that will be used to setup the overcloud images - -- name: Create overcloud prep-images script - template: - src: "{{ overcloud_prep_images_script }}" - dest: "{{ working_dir }}/overcloud-prep-images.sh" - mode: 0755 - -- name: Create download overcloud image script - template: - src: "{{ download_overcloud_image_script }}" - dest: "{{ working_dir }}/download-overcloud-image.sh" - mode: 0755 - when: download_overcloud_image|bool - -- name: Create overcloud upload image script - template: - src: "{{ overcloud_image_upload_script }}" - dest: "{{ working_dir }}/overcloud-image-upload.sh" - mode: 0755 - when: step_overcloud_image|bool - -- name: Create glance overcloud upload image script - template: - src: "{{ overcloud_glance_image_upload_script }}" - dest: "{{ working_dir }}/overcloud-glance-image-upload.sh" - mode: 0755 - when: step_glance_upload|bool - -- name: Create list overcloud nova flavors script - template: - src: "{{ overcloud_list_flavors_script }}" - dest: "{{ working_dir }}/overcloud-list-flavors.sh" - mode: 0755 - when: undercloud_enable_nova|bool - -- name: Create overcloud import nodes script - template: - src: "{{ overcloud_import_nodes_script }}" - dest: "{{ working_dir }}/overcloud-import-nodes.sh" - mode: 0755 - when: step_register|bool - -- name: Create root device size script - template: - src: "{{ root_device_size_script }}" - dest: "{{ working_dir }}/root-device-size.sh" - mode: 0755 - when: step_root_device_size|bool - -- name: Create root device hints script - template: - src: "{{ root_device_hints_script }}" - dest: "{{ working_dir }}/root-device-hints.sh" - mode: 0755 - when: step_root_device_hints|bool - -- name: Create overcloud introspection script - template: - src: "{{ overcloud_introspect_script }}" - dest: "{{ working_dir }}/overcloud-introspect.sh" - mode: 0755 - when: step_introspect|bool - -- name: Create ARA to mistral executor injection script - template: - src: "{{ inject_ara_script }}" - dest: "{{ working_dir }}/inject-ara.sh" - mode: 0755 - when: - - undercloud_enable_mistral|bool diff --git a/roles/overcloud-prep-images/tasks/main.yml b/roles/overcloud-prep-images/tasks/main.yml deleted file mode 100644 index eb865c4be..000000000 --- a/roles/overcloud-prep-images/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- include: create-scripts.yml - tags: - - undercloud-scripts - -- include: overcloud-prep-images.yml - tags: - - undercloud-post-install diff --git a/roles/overcloud-prep-images/tasks/overcloud-prep-images.yml b/roles/overcloud-prep-images/tasks/overcloud-prep-images.yml deleted file mode 100644 index 72370fe48..000000000 --- a/roles/overcloud-prep-images/tasks/overcloud-prep-images.yml +++ /dev/null @@ -1,131 +0,0 @@ ---- -- name: Download overcloud image - shell: > - set -o pipefail && - {{ working_dir }}/download-overcloud-image.sh 2>&1 {{ timestamper_cmd }} > - {{ download_overcloud_image_log }} - changed_when: true - when: download_overcloud_image|bool - -- name: Upload Overcloud Images - when: step_overcloud_image|bool - block: - - name: Run overcloud image upload via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_image_upload - vars: - tripleo_os_cloud: undercloud - tripleo_overcloud_image_upload_debug: true - tripleo_overcloud_image_upload_generate_scripts: true - tripleo_overcloud_image_upload_http_boot: '/var/lib/ironic/httpboot' - tripleo_overcloud_image_upload_whole_disk: "{{ whole_disk_images | default(false) | bool }}" - tripleo_overcloud_image_upload_local: "{{ not undercloud_enable_nova | default(false) |bool }}" - tripleo_overcloud_image_upload_log: "{{ overcloud_image_upload_log }}" - tripleo_overcloud_image_upload_log_combine: true - -- name: Upload overcloud images with Glance for multinode - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-glance-image-upload.sh 2>&1 {{ timestamper_cmd }} > - {{ overcloud_glance_image_upload_log }} - changed_when: true - when: step_glance_upload|bool - -- name: List overcloud flavors for Nova deployment - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-list-flavors.sh 2>&1 {{ timestamper_cmd }} > - {{ overcloud_list_flavors_log }} - changed_when: true - when: undercloud_enable_nova|bool - -- name: Run import nodes - when: - - step_register|bool - block: - - name: Run import nodes via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_node_import - vars: - tripleo_overcloud_node_import_debug: true - tripleo_os_cloud: undercloud - tripleo_overcloud_node_import_provide: "{{ not step_introspect|bool and not step_introspect_with_retry|bool }}" - tripleo_overcloud_node_import_log: "{{ overcloud_import_nodes_log }}" - tripleo_overcloud_node_import_environment_file: instackenv.json - - - name: Wait until nodes will be manageable - shell: >- - set -o pipefail && - openstack --os-cloud undercloud baremetal node list -f value -c "Provisioning State" | grep -v -e manageable -e available - register: result - until: result.stdout == '' - failed_when: result.rc == 0 - retries: 10 - delay: 30 - changed_when: false - when: step_introspect|bool - -- name: Set root device size - shell: > - set -o pipefail && - {{ working_dir }}/root-device-size.sh 2>&1 {{ timestamper_cmd }} > - {{ root_device_size_log }} - changed_when: true - when: step_root_device_size|bool - -- name: Set root device hints - shell: > - set -o pipefail && - {{ working_dir }}/root-device-hints.sh 2>&1 {{ timestamper_cmd }} > - {{ root_device_hints_log }} - changed_when: true - when: step_root_device_hints|bool - -- name: Run tcpdump during introspection in background - become: true - shell: > - {{ ansible_pkg_mgr }} -y install tcpdump; - tcpdump -U -i any port {{ step_introspect_debug_tcpdump_ports | join(' or port ') }} - -w {{ step_introspect_debug_tcpdump_log }} > /dev/null & - args: - executable: /bin/bash - async: 1 - poll: 0 - changed_when: false - when: - - step_introspect|bool - - step_introspect_debug|bool - -- name: Run Introspection - when: step_introspect|bool - block: - - name: Run Introspection on overcloud nodes via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_overcloud_node_introspect - vars: - tripleo_os_cloud: undercloud - tripleo_overcloud_node_introspect_debug: true - tripleo_overcloud_node_introspect_all_manageable: true - tripleo_overcloud_node_introspect_provide: true - tripleo_overcloud_node_introspect_log: "{{ overcloud_introspect_script_log }}" - -- name: Stop tcpdump after introspection - become: true - command: pkill tcpdump - changed_when: false - failed_when: false - -- name: Inject ARA into mistral executor container image - shell: > - set -o pipefail && - {{ working_dir }}/inject-ara.sh 2>&1 {{ timestamper_cmd }} > - {{ inject_ara_log }} - changed_when: true - when: - - undercloud_enable_mistral|bool diff --git a/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 b/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 deleted file mode 100644 index 60e280c68..000000000 --- a/roles/overcloud-prep-images/templates/download-overcloud-image.sh.j2 +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs - -## * Download specific Overcloud images -## :: - -if [ -f {{ overcloud_image }}.qcow2 ]; then - sudo rm -rf {{ overcloud_image }}.* -fi -curl -L -O "{{ overcloud_image_url }}" - -{% if not whole_disk_images|bool %} -tar xvfp {{ overcloud_image }}.tar -{% endif %} - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/inject-ara.sh.j2 b/roles/overcloud-prep-images/templates/inject-ara.sh.j2 deleted file mode 100644 index 996ddd03f..000000000 --- a/roles/overcloud-prep-images/templates/inject-ara.sh.j2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -container_cli="{{ undercloud_container_cli | default('podman') }}" -cont=$(sudo $container_cli ps | grep executor | awk {'print $1'}) -sudo $container_cli exec --user root $cont bash -c "easy_install pip==20.3.4 && pip install 'ara==1.0.0' || pip3 install 'ara==1.0.0'" -# check it -sudo $container_cli exec --user root $cont find /usr -type d -name ara - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-glance-image-upload.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-glance-image-upload.sh.j2 deleted file mode 100644 index bf56575da..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-glance-image-upload.sh.j2 +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Create and upload image to glance, this step is specific to nodepool based deployments. -## :: - -rpm -q qemu-img || sudo {{ ansible_pkg_mgr }} install -y qemu-img -qemu-img create -f qcow2 {{ overcloud_image }}.qcow2 1G - -glance image-create --container-format bare \ - --disk-format qcow2 \ - --name {{ overcloud_image }} \ - --file {{ overcloud_image }}.qcow2 - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-image-upload.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-image-upload.sh.j2 deleted file mode 100644 index 2a4109211..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-image-upload.sh.j2 +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -{% if undercloud_enable_nova|bool %} -## * Upload images to glance. -## :: -{% else %} -## * Copy images to /var/lib/ironic/images. -## :: -{% endif %} - -openstack overcloud image upload - --http-boot=/var/lib/ironic/httpboot -{%- if whole_disk_images|bool %} - --whole-disk -{%- endif %} -{%- if not undercloud_enable_nova|bool %} - --local -{%- endif %} - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-import-nodes.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-import-nodes.sh.j2 deleted file mode 100644 index 496ded25e..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-import-nodes.sh.j2 +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Register nodes with Ironic. -## :: - -{% if step_introspect|bool or step_introspect_with_retry|bool %} -openstack overcloud node import instackenv.json -{% else %} -openstack overcloud node import instackenv.json --provide -{% endif %} - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-introspect.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-introspect.sh.j2 deleted file mode 100644 index 8b08c42c4..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-introspect.sh.j2 +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash - -set -eux -### --start_docs - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Introspect hardware attributes of nodes. -## :: -openstack overcloud node introspect --all-manageable -openstack overcloud node provide --all-manageable - -{% if step_introspect_with_retry|bool %} - -## * Introspect all manageable nodes with a caller provided timeout. -## then move all nodes that power off after a successful introspection -## back to available so we don't introspect them again. This is useful -## for large deployments (think 10+ nodes) where bulk introspection -## can be troublesome. It's also useful in environments where connection -## problems may spuriously fail a deployment. Related-Bug: #1651127 -## :: -introspect() -{ - for node in `openstack baremetal node list -f json | jq -r '.[]| select(.["Provisioning State"] == "manageable")| .["UUID"]'`; do - openstack baremetal introspection start $node - sleep 30s - done - - manageable_count=1 - on_count=0 - while [ $on_count -eq 0 ] && [ $manageable_count -gt 0 ]; do - manageable_count=$(openstack baremetal node list -f json | jq -r '.[]| select(.["Provisioning State"] == "manageable")| .["UUID"]' | wc -l) - on_count=$(openstack baremetal node list -f json|jq -r '.[]| select(.["Power State"] == "power on")| .["UUID"]' | wc -l) - sleep 30 - done - - set +e - timeout $1 bash -c -- 'source {{ working_dir }}/stackrc; \ - on_count=$(openstack baremetal node list -f json|jq -r ".[]| select(.[\"Power State\"] == \"power on\")| .[\"UUID\"]" | wc -l) ; \ - while [ $on_count -gt 0 ]; do \ - sleep 30s; \ - on_count=$(openstack baremetal node list -f json|jq -r ".[]| select(.[\"Power State\"] == \"power on\")| .[\"UUID\"]" | wc -l) ; \ - done' - set -e - - for node in `openstack baremetal node list -f json | jq -r '.[]| select(.["Power State"] == "power off")| select(.["Provisioning State"] == "manageable")|.["UUID"]'`; do - openstack baremetal node provide $node - done -} - -## * Introspect hardware attributes of nodes in a robust manner -## retrying up to three times on any given node. This should -## only be used in cases where deployment using bulk introspection -## has reliability issues. -## :: - -for node in `openstack baremetal node list -f json | jq -r '.[]| select(.["Provisioning State"] == "available")| .["UUID"]'`; do - openstack baremetal node manage $node -done - -introspect 15m -introspect 30m -introspect 60m - -{% endif %} - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-list-flavors.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-list-flavors.sh.j2 deleted file mode 100644 index 245a23412..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-list-flavors.sh.j2 +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * List out all the available OpenStack flavors. -## :: - -for i in `openstack flavor list -c Name -f value`; do - echo $i; openstack flavor show $i; -done || true - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 deleted file mode 100644 index cb8b1621b..000000000 --- a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -eux -### --start_docs - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -{% if download_overcloud_image|bool %} -{% include 'download-overcloud-image.sh.j2' %} -{% endif %} -{% if step_overcloud_image|bool %} -{% include 'overcloud-image-upload.sh.j2' %} -{% endif %} -{% if step_glance_upload|bool %} -{% include 'overcloud-glance-image-upload.sh.j2' %} -{% endif %} -{% if undercloud_enable_nova|bool %} -{% include 'overcloud-list-flavors.sh.j2' %} -{% endif %} -{% if step_register|bool %} -{% include 'overcloud-import-nodes.sh.j2' %} -{% endif %} -{% if step_root_device_size|bool %} -{% include 'root-device-size.sh.j2' %} -{% endif %} -{% if step_root_device_hints|bool %} -{% include 'root-device-hints.sh.j2' %} -{% endif %} -{% if step_introspect|bool %} -{% include 'overcloud-introspect.sh.j2' %} -{% endif %} -{% if undercloud_enable_mistral|bool %} -{% include 'inject-ara.sh.j2' %} -{% endif %} diff --git a/roles/overcloud-prep-images/templates/root-device-hints.sh.j2 b/roles/overcloud-prep-images/templates/root-device-hints.sh.j2 deleted file mode 100644 index 98a5a3701..000000000 --- a/roles/overcloud-prep-images/templates/root-device-hints.sh.j2 +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Get nodes UUID -## :: - -export ironic_nodes="$( openstack baremetal node list | awk '/power/ {print $2}' )" - -for ironic_node in $ironic_nodes; do - # extract IP from ironic node details - ip_address=$(openstack baremetal node show -f value -c driver_info $ironic_node | sed -n "s/.*ipmi_address': u'\([0-9\.]*\)'.*/\1/p") - - # get information for the matching template - {% for node in root_device_hints %} - NODE_IP="{{ node['ip'] }}" - if [ "$NODE_IP" == "$ip_address" ]; then - # set property - openstack baremetal node set --property root_device='{"{{ node['key'] }}": "{{ node['value'] }}"}' $ironic_node - fi - {% endfor %} -done - -### --stop_docs diff --git a/roles/overcloud-prep-images/templates/root-device-size.sh.j2 b/roles/overcloud-prep-images/templates/root-device-size.sh.j2 deleted file mode 100644 index cba74f80a..000000000 --- a/roles/overcloud-prep-images/templates/root-device-size.sh.j2 +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare images for deploying the overcloud -## ========================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -## * Get nodes UUID -## :: - -export items="$( openstack baremetal node list | awk '/power/ {print $2}' )" - -## * Find disk size from instackenv.json -## :: - -export DISK_SIZE="$( jq '.["nodes"][]["disk"] | tonumber' instackenv.json )" - -## * Update nodes with disk size hint -## :: - -count=0 -ARRAY_DISK_SIZE=($(echo $DISK_SIZE)) -ROOT_DEVICE_SIZE={{ disk_root_device_size }} -for item in $items; do - if [ $ROOT_DEVICE_SIZE -ge ${ARRAY_DISK_SIZE[$count]} ]; then - declare i ADS - ADS=${ARRAY_DISK_SIZE[$count]} - openstack baremetal node set --property root_device='{"size": '$ADS'}' $item - fi - count=$((count+1)) -done - -### --stop_docs diff --git a/roles/overcloud-prep-network/README.md b/roles/overcloud-prep-network/README.md deleted file mode 100644 index 7867e5aa4..000000000 --- a/roles/overcloud-prep-network/README.md +++ /dev/null @@ -1,91 +0,0 @@ -Role Name -========= - -An Ansible role to copy configuration files to the undercloud prior to -deployment. - -Requirements ------------- - -This playbook expects that the undercloud has been installed and setup using -one of the roles relevant to baremetal overcloud deployments. - -Role Variables --------------- - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html). - -- working_dir: <'/home/stack'> -- working directory for the role. Assumes -stackrc file is present at this location -- baremetal_instackenv: <"{{ working_dir }}/instackenv.json"> -- location of -instackenv.json to copy over -- baremetal_network_environment: <"{{ working_dir }}/network-isolation.yml"> --- location of network-environment file to copy over -- undercloud_type: -- can be overwritten with values like 'baremetal' - or 'ovb' -- undercloud_networks: by default an external network is defined by - tripleo-quickstart, as follows: - - undercloud_networks: - external: - address: "{{ undercloud_external_network_cidr|nthhost(1) }}" - netmask: "{{ undercloud_external_network_cidr|ipaddr('netmask') }}" - address6: "{{ undercloud_external_network_cidr6|nthhost(1) }}" - device_type: ovs - type: OVSIntPort - ovs_bridge: br-ctlplane - ovs_options: '"tag=10"' - tag: 10 - - But it is possible to override this, when specific vlan options are needed: - - undercloud_networks: - external: - address: 172.20.0.254 - netmask: 255.255.255.0 - device_type: ovs - type: OVSIntPort - ovs_bridge: br-ctlplane - ovs_options: '"tag=1005"' - tag: 1005 - - Or when the external network on the undercloud is and ethernet device instead -of a bridge: - - undercloud_networks: - external: - address: 172.20.0.254 - netmask: 255.255.255.0 - device_type: ethernet - device_name: eth2 - - What makes the difference in this case is the *device_type* set to *ethernet* -instead of *ovs* and the *device_name* which must be the name of the ethernet -device on the undercloud. - -Dependencies ------------- - -This playbook does not deploy the overcloud. After this playbook runs, call -https://github.com/redhat-openstack/ansible-role-tripleo-overcloud. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Copy configuration files - hosts: virthost - gather_facts: false - roles: - - ansible-role-tripleo-overcloud-prep-config - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/overcloud-prep-network/defaults/main.yml b/roles/overcloud-prep-network/defaults/main.yml deleted file mode 100644 index 442ec4c93..000000000 --- a/roles/overcloud-prep-network/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- - -external_interface: eth2 -overcloud_prep_network_script: overcloud-prep-network.sh.j2 -overcloud_prep_network_log: "{{ working_dir }}/overcloud_prep_network.log" diff --git a/roles/overcloud-prep-network/meta/main.yml b/roles/overcloud-prep-network/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-prep-network/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-prep-network/tasks/create-scripts.yml b/roles/overcloud-prep-network/tasks/create-scripts.yml deleted file mode 100644 index b2e0eff60..000000000 --- a/roles/overcloud-prep-network/tasks/create-scripts.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Creat the overcloud-prep-network scripts that will be used to setup the undercloud for network isolation - -- name: Create overcloud-prep-network script - template: - src: "{{ overcloud_prep_network_script }}" - dest: "{{ working_dir }}/overcloud-prep-network.sh" - mode: 0755 diff --git a/roles/overcloud-prep-network/tasks/main.yml b/roles/overcloud-prep-network/tasks/main.yml deleted file mode 100644 index 7f0092bd2..000000000 --- a/roles/overcloud-prep-network/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- include: create-scripts.yml - tags: - - undercloud-scripts - -- include: overcloud-prep-network.yml - tags: - - undercloud-post-install diff --git a/roles/overcloud-prep-network/tasks/overcloud-prep-network.yml b/roles/overcloud-prep-network/tasks/overcloud-prep-network.yml deleted file mode 100644 index 781bda9f9..000000000 --- a/roles/overcloud-prep-network/tasks/overcloud-prep-network.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Prepare the network-isolation required networks on the undercloud - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-prep-network.sh 2>&1 {{ timestamper_cmd }} > - {{ overcloud_prep_network_log }} - changed_when: true diff --git a/roles/overcloud-prep-network/templates/overcloud-prep-network.sh.j2 b/roles/overcloud-prep-network/templates/overcloud-prep-network.sh.j2 deleted file mode 100644 index ae2da6666..000000000 --- a/roles/overcloud-prep-network/templates/overcloud-prep-network.sh.j2 +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Prepare network for deploying the overcloud -## ================================================== - -## Prepare Your Environment -## ------------------------ - -## * Source in the undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -{% if overcloud_nodes is defined and overcloud_nodes and not overcloud_ipv6|bool %} -FENCING_RULE="-m udp -p udp -m multiport --dports {% for node in overcloud_nodes %}{{ node.virtualbmc_port }}{% if not loop.last %},{% endif %}{% endfor %} -m state --state NEW" -COMMENT="fencing_access_from_overcloud" -if ! sudo iptables -nvL INPUT | grep "$COMMENT"; then - sudo iptables -I INPUT 1 $FENCING_RULE -m comment --comment "$COMMENT" -j ACCEPT - sudo sh -c 'iptables-save > /etc/sysconfig/iptables' -fi -{% endif %} - -{% if network_isolation|bool and network_isolation_type in ['single-nic-vlans', 'single_nic_vlans', 'bond-with-vlans', 'bond_with_vlans', 'multiple-nics-vlans'] %} - -{% if network_isolation_type in ['single_nic_vlans', 'bond_with_vlans'] %} -# NOTE: 'bond_with_vlans' and 'single_nic_vlans' are deprecated -echo "Network isolation types 'bond_with_vlans' and 'single_nic_vlans' are deprecated" -echo "Please use 'single-nic-vlans' and 'bond-with-vlans'" -{% endif %} -{% for name, network in (undercloud_networks|default({})).items() if name == 'external' %} - -{% if not overcloud_ipv6|bool and network.device_type is defined and network.device_type == 'ovs' %} -sudo bash -c 'cat < /etc/sysconfig/network-scripts/ifcfg-vlan{{ network.tag }} -ONBOOT=yes -BOOTPROTO=static -IPADDR={{ network.address }} -NETMASK={{ network.netmask }} -{% if network_isolation_type == 'multiple-nics-vlans' %} -DEVICE={{ external_interface }}.{{ network.tag }} -VLAN=yes -{% else %} -DEVICE=vlan{{ network.tag }} -DEVICETYPE={{ network.device_type }} -TYPE={{ network.type }} -OVS_BRIDGE={{ network.ovs_bridge }} -OVS_OPTIONS={{ network.ovs_options }} -{% endif %} -EOF' - -sudo ifup ifcfg-vlan{{ network.tag }} - -{% elif network.device_type is defined and network.device_type == 'ethernet' %} - -sudo bash -c 'cat < /etc/sysconfig/network-scripts/ifcfg-{{ network.device_name }} -DEVICE={{ network.device_name }} -ONBOOT=yes -TYPE=Ethernet -BOOTPROTO=static -IPADDR={{ network.address }} -NETMASK={{ network.netmask }} -EOF' - -{% if overcloud_ipv6|bool %} - -sudo bash -c 'cat <> /etc/sysconfig/network-scripts/ifcfg-{{ network.device_name }} -IPV6ADDR={{ network.address6 }} -IPV6INIT=yes -EOF' - -{%endif%} - -sudo ifup ifcfg-{{ network.device_name }} - -{%endif%} - - -{% endfor %} - -{% endif %} - -### --stop_docs diff --git a/roles/overcloud-scale/README.md b/roles/overcloud-scale/README.md deleted file mode 100644 index 0d1e8abbc..000000000 --- a/roles/overcloud-scale/README.md +++ /dev/null @@ -1,90 +0,0 @@ -Role Name -========= - -An Ansible role for scaling and deleting nodes from an overcloud. - -Requirements ------------- - -This role assumes it will be executed against a host on which an under/overcloud have already been deployed. - -**Note:** The validate-simple role must be accessible. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -**Note:** Make sure to include all environment file and options from your [initial Overcloud creation](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/7/html/Director_Installation_and_Usage/sect-Scaling_the_Overcloud.html#sect-Adding_Compute_or_Ceph_Storage_Nodes). This includes the same scale parameters for non-Compute nodes. - -- artosn_scale_nodes: -- boolean value that will scale nodes if true -- artosn_delete_original_node: -- boolean value that will delete the original node of type that was scaled - - -Dependencies ------------- - -1. [ansible-role-tripleo-overcloud-validate](https://github.com/redhat-openstack/ansible-role-tripleo-overcloud-validate) - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Scale overcloud nodes - hosts: undercloud - roles: - - ansible-role-tripleo-overcloud-scale-nodes - - 2. Sample config file to scale from one compute node to two compute nodes on the overcloud - - control_memory: 6144 - compute_memory: 6144 - - undercloud_memory: 8192 - undercloud_vcpu: 2 - - overcloud_nodes: - - name: control_0 - flavor: control - - - name: compute_0 - flavor: compute - - - name: compute_1 - flavor: compute - - - name: compute_2 - flavor: compute - - tempest: false - pingtest: true - deploy_timeout: 60 - - # General deployment info - libvirt_args: "--libvirt-type qemu" - timeout_args: "--timeout {{ deploy_timeout }}" - # Pulled this out so we can hand these configs to the openstack overcloud node delete command - scale_extra_configs: "-e /usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml -e /usr/share/openstack-tripleo-heat-templates/environments/net-single-nic-with-vlans.yaml -e ~/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 - - # Scale deployment arguments - scale_args: >- - {{ libvirt_args }} - {{ timeout_args }} - {{ scale_extra_args }} - -License -------- - -Apache - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/overcloud-scale/defaults/main.yml b/roles/overcloud-scale/defaults/main.yml deleted file mode 100644 index 5a0adcd2d..000000000 --- a/roles/overcloud-scale/defaults/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -artosn_scale_nodes: true -artosn_delete_original_node: false diff --git a/roles/overcloud-scale/meta/main.yml b/roles/overcloud-scale/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-scale/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-scale/tasks/delete-original-node.yml b/roles/overcloud-scale/tasks/delete-original-node.yml deleted file mode 100644 index 374e33ad5..000000000 --- a/roles/overcloud-scale/tasks/delete-original-node.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- - -# Delete the scaled node -- name: Check the overcloud heat stack-list state - shell: > - source {{ working_dir }}/stackrc; - heat stack-list - register: heat_stack_list_result - changed_when: false - -- name: Verify the overcloud is in a complete state - fail: msg='Overcloud heat stack is not in a complete state' - when: heat_stack_list_result.stdout.find('COMPLETE') == -1 - -- name: Register uuid of original {{ node_to_scale }} node - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}' - register: node_id_to_delete - changed_when: false - -- name: Register the Name of the original {{ node_to_scale }} node - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}' - register: node_name_to_delete - changed_when: false - -- name: Display node name to be deleted - debug: msg={{ node_name_to_delete.stdout }} - -- name: Copy delete node script to undercloud - template: - src: delete-node.j2 - dest: "{{ working_dir }}/delete-node.sh" - mode: 0755 - -- name: Delete node by id - shell: > - cat {{ working_dir }}/delete-node.sh; - set -o pipefail && - {{ working_dir }}/delete-node.sh 2>&1 {{ timestamper_cmd }} > - delete_node_scale_console.log; - changed_when: true - -# Verify the delete was successful -- name: Poll heat stack-list to determine when node delete is complete - shell: > - source {{ working_dir }}/stackrc; - heat stack-list - register: heat_stack_list_result - until: heat_stack_list_result.stdout.find("COMPLETE") != -1 - retries: 20 - delay: 90 - changed_when: false - -- name: Determine the post scale node count - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l - register: post_scale_node_count - changed_when: false - -- name: Remove deleted hosts from the host file - shell: > - sed -i '/{{ node_name_to_delete.stdout }}/d' {{ local_working_dir }}/hosts - delegate_to: localhost - changed_when: true - -- name: Check that post delete node count is correct - fail: - msg: "Overcloud nova list does not show expected number of {{ node_to_scale }} services" - when: post_scale_node_count.stdout|int != (initial_scale_value | int) diff --git a/roles/overcloud-scale/tasks/main.yml b/roles/overcloud-scale/tasks/main.yml deleted file mode 100644 index 3d8a3169c..000000000 --- a/roles/overcloud-scale/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# tasks file for ansible-role-tripleo-overcloud-scale-nodes - -- include: pre-scale.yml - when: artosn_scale_nodes|bool - tags: - - pre-overcloud-scale-nodes - -- include: scale-nodes.yml - when: artosn_scale_nodes|bool - tags: - - overcloud-scale-nodes - -# Optionally delete the original node of type scaled -- include: delete-original-node.yml - when: artosn_delete_original_node|bool - tags: - - post-overcloud-scale-nodes-delete diff --git a/roles/overcloud-scale/tasks/pre-scale.yml b/roles/overcloud-scale/tasks/pre-scale.yml deleted file mode 100644 index b54bc5ee0..000000000 --- a/roles/overcloud-scale/tasks/pre-scale.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- - -# Prepare deployment args -- name: Enable pacemaker - set_fact: - pacemaker_args: >- - -e {{ overcloud_templates_path }}/environments/puppet-pacemaker.yaml - when: enable_pacemaker|bool - -- name: extract the number of controllers to be deployed - set_fact: - number_of_controllers: "{{ scale_args| regex_replace('^.*--control-scale +([0-9]+).*$', '\\1') | regex_replace('^[^ 0-9]+$', '1') }}" - -- name: disable L3 HA - set_fact: - pacemaker_args: >- - {{ pacemaker_args }} - -e $HOME/neutronl3ha.yaml - when: enable_pacemaker|bool and number_of_controllers|int < 3 - -# Prep for scaling overcloud -- name: Determine initial number of node(s) that will be scaled - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l - register: initial_node_count - changed_when: false - -- name: Register uuid of original {{ node_to_scale }} node - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $1}' - register: node_id_to_delete - changed_when: false - -- name: Register the Name of the original {{ node_to_scale }} node - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep -m 1 {{ node_to_scale }} | sed -e 's/|//g' | awk '{print $2}' - register: node_name_to_delete - changed_when: false - -- name: Register pre-scale nova list - shell: | - source {{ working_dir }}/stackrc - nova list - register: pre_scale_nova_list - changed_when: false - -- name: Display pre-scale nova list - debug: msg={{ pre_scale_nova_list.stdout_lines }} - when: pre_scale_nova_list is defined - -- name: Copy scale deployment template to undercloud - template: - src: scale-deployment.j2 - dest: "{{ working_dir }}/scale-deployment.sh" - mode: 0755 - -- name: Copy neutron l3 ha heat template - when: enable_pacemaker|bool and number_of_controllers|int < 3 - template: - src: neutronl3ha.yaml.j2 - dest: "{{ working_dir }}/neutronl3ha.yaml" - mode: 0755 diff --git a/roles/overcloud-scale/tasks/scale-nodes.yml b/roles/overcloud-scale/tasks/scale-nodes.yml deleted file mode 100644 index fb289d2cc..000000000 --- a/roles/overcloud-scale/tasks/scale-nodes.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- - -# Do the scale -- name: Call scale deployment script - shell: > - source {{ working_dir }}/stackrc; - set -o pipefail && - {{ working_dir }}/scale-deployment.sh 2>&1 {{ timestamper_cmd }} > - overcloud_deployment_scale_console.log; - changed_when: true - -- name: Poll heat stack-list to determine when node scale is complete - shell: > - source {{ working_dir }}/stackrc; - heat stack-list - register: heat_stack_list_result - until: heat_stack_list_result.stdout.find("COMPLETE") != -1 - retries: 20 - delay: 90 - changed_when: false - -- name: Register post-scale nova list - shell: > - source {{ working_dir }}/stackrc; - nova list - register: post_scale_nova_list - changed_when: false - -- name: Display post-scale nova list - debug: - msg: "{{ post_scale_nova_list.stdout_lines }}" - when: post_scale_nova_list is defined - -# Verify the scale -- name: Determine the post scale node count - shell: | - set -eo pipefail - source {{ working_dir }}/stackrc - nova list | grep {{ node_to_scale }} | cut -f2- -d':' | wc -l - register: post_scale_node_count - changed_when: false - -- name: Check that post scale node count is correct - fail: - msg: "Overcloud nova list does not show expected number of {{ node_to_scale }} services" - when: post_scale_node_count.stdout|int != (final_scale_value|int) diff --git a/roles/overcloud-scale/templates/delete-node.j2 b/roles/overcloud-scale/templates/delete-node.j2 deleted file mode 100644 index 5a338a05b..000000000 --- a/roles/overcloud-scale/templates/delete-node.j2 +++ /dev/null @@ -1,18 +0,0 @@ -#! /bin/bash - -### --start_docs - -## Delete the original {{ node_to_scale }} node -## ============================================ - -## * Source in the undercloud credentials -## :: - -source ./stackrc - -## * Delete the {{ node_to_scale }} node from the original deployment -## :: - -openstack overcloud node delete --debug --stack overcloud --templates {{ overcloud_templates_path }} {{ scale_extra_configs }} {{ node_id_to_delete.stdout }} - -### ---stop_docs diff --git a/roles/overcloud-scale/templates/neutronl3ha.yaml.j2 b/roles/overcloud-scale/templates/neutronl3ha.yaml.j2 deleted file mode 100644 index ec3969100..000000000 --- a/roles/overcloud-scale/templates/neutronl3ha.yaml.j2 +++ /dev/null @@ -1,6 +0,0 @@ -# Note: we need to disable the L3 HA for Neutron if we want to use pacemaker -# and only 1 controller. -# This particular use case is used with the upgrade CI workflow - -parameter_defaults: - NeutronL3HA: false diff --git a/roles/overcloud-scale/templates/scale-deployment.j2 b/roles/overcloud-scale/templates/scale-deployment.j2 deleted file mode 100644 index b16f7bb4e..000000000 --- a/roles/overcloud-scale/templates/scale-deployment.j2 +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs - -## Scale the overcloud -## =================== - -## * Source in undercloud credentials. -## :: - -source {{ working_dir }}/stackrc - -### --stop_docs - -# Wait until there are hypervisors available. -while true; do - count=$(openstack hypervisor stats show -c count -f value) - if [ $count -gt 0 ]; then - break - fi -done - -deploy_status=0 - -### --start_docs - -## * Scale the overcloud -## :: - -openstack overcloud deploy --templates {{ overcloud_templates_path }} {{ scale_args }} \ - ${DEPLOY_ENV_YAML:+-e $DEPLOY_ENV_YAML} || deploy_status=1 - -### --stop_docs - -# We don't always get a useful error code from the openstack deploy command, -# so check `heat stack-list` for a CREATE_FAILED status. -if heat stack-list | grep -q 'CREATE_FAILED'; then - deploy_status=1 - - for failed in $(heat resource-list \ - --nested-depth 5 overcloud | grep FAILED | - grep 'StructuredDeployment ' | cut -d '|' -f3) - do heat deployment-show $failed > failed_deployment_$failed.log - done -fi - -exit $deploy_status diff --git a/roles/overcloud-ssl/README.md b/roles/overcloud-ssl/README.md deleted file mode 100644 index b2dc28626..000000000 --- a/roles/overcloud-ssl/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -Apache 2.0 - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/overcloud-ssl/defaults/main.yml b/roles/overcloud-ssl/defaults/main.yml deleted file mode 100644 index 3f91faa6b..000000000 --- a/roles/overcloud-ssl/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -ssl_overcloud: false - -overcloud_public_vip: "{{ undercloud_external_network_cidr|nthhost(5) }}" -overcloud_ssl_cert_log: "{{ working_dir }}/overcloud_create_ssl_cert.log" -overcloud_ssl_cert_script: overcloud-create-ssl-cert.sh.j2 diff --git a/roles/overcloud-ssl/library/tls_tht.py b/roles/overcloud-ssl/library/tls_tht.py deleted file mode 100644 index 860ac9a8a..000000000 --- a/roles/overcloud-ssl/library/tls_tht.py +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/python -# coding: utf-8 -*- -# -# (c) 2016, Adriano Petrich -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import yaml -from ansible.module_utils.basic import * - - -DOCUMENTATION = ''' ---- -module: tls_tht -version_added: "1.9" -short_description: Generate the tht templates for enabled ssl -description: - - Generate the tht templates for enabled ssl -options: - source_dir: - description: - - directory to copy the templates from - required: false - default: "/usr/share/openstack-tripleo-heat-templates/" - dest_dir: - description: - - were to copy the files to - required: false - default: "" - cert_filename: - description: - - the cert pem filename - required: false - default: cert.pem - cert_ca_filename: - description: - - the key pem filename - required: false - default: key.pem - key_filename: - description: - - the CA cert pem filename - required: false - default: cert.pem - tht_release: - description: - - the tht release name - required: false - default: master - - -''' - -EXAMPLES = ''' -# Generate the tht templates for enabled ssl -- tls_tht: -''' - - -def _open_yaml(filename): - with open(filename, "r") as stream: - tmp_dict = yaml.safe_load(stream) - return tmp_dict - - -def create_enable_file(certpem, keypem, source_dir, dest_dir, tht_release): - # environments/ssl/* is preferred starting with pike - output_dict = _open_yaml("{}environments/ssl/enable-tls.yaml".format(source_dir)) - - output_dict["parameter_defaults"]["SSLCertificate"] = certpem - output_dict["parameter_defaults"]["SSLKey"] = keypem - - with open("{}enable-tls.yaml".format(dest_dir), "w") as stream: - yaml.safe_dump(output_dict, stream, default_style='|') - - -def create_anchor_file(cert_ca_pem, source_dir, dest_dir, enable_tls_overcloud, tht_release): - - output_dict = _open_yaml( - "{}environments/ssl/inject-trust-anchor.yaml".format(source_dir) - ) - - if enable_tls_overcloud: - ca_map = {"overcloud-ca": {"content": cert_ca_pem}} - else: - ca_map = {} - # Optionally include the undercloud's local CA certificate - try: - undercloud_ca = "/etc/pki/ca-trust/source/anchors/cm-local-ca.pem" - with open(undercloud_ca, 'r') as undercloud_ca_file: - undercloud_ca_content = undercloud_ca_file.read() - ca_map.update({"undercloud-ca": {"content": undercloud_ca_content}}) - except IOError: - pass - output_dict["parameter_defaults"]["CAMap"] = ca_map - del output_dict["resource_registry"] - - with open("{}inject-trust-anchor.yaml".format(dest_dir), "w") as stream: - yaml.safe_dump(output_dict, stream, default_style='|') - - -def main(): - module = AnsibleModule( - argument_spec=dict( - enable_tls_overcloud=dict(type="bool", default=False, required=False), - source_dir=dict(default="/usr/share/openstack-tripleo-heat-templates/", - required=False), - dest_dir=dict(default="", required=False), - cert_filename=dict(default="cert.pem", required=False), - cert_ca_filename=dict(default="cert.pem", required=False), - key_filename=dict(default="key.pem", required=False), - tht_release=dict(default="master", required=False), - ) - ) - - if module.params["enable_tls_overcloud"]: - with open(module.params["cert_filename"], "r") as stream: - certpem = stream.read() - - with open(module.params["key_filename"], "r") as stream: - keypem = stream.read() - with open(module.params["cert_ca_filename"], "r") as stream: - cert_ca_pem = stream.read() - - create_enable_file(certpem, keypem, - module.params["source_dir"], - module.params["dest_dir"], - module.params["tht_release"]) - else: - cert_ca_pem = None - - create_anchor_file(cert_ca_pem, - module.params["source_dir"], - module.params["dest_dir"], - module.params["enable_tls_overcloud"], - module.params["tht_release"]) - module.exit_json(changed=True) - - -if __name__ == '__main__': - main() diff --git a/roles/overcloud-ssl/meta/main.yml b/roles/overcloud-ssl/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/overcloud-ssl/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/overcloud-ssl/tasks/main.yml b/roles/overcloud-ssl/tasks/main.yml deleted file mode 100644 index f688b2c5f..000000000 --- a/roles/overcloud-ssl/tasks/main.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -# tasks file for ansible-role-tripleo-ssl -- when: ssl_overcloud|bool - block: - - name: Ensure rpm requirements for ssl and heat template are installed - become: true - # noqa 403 - package: - name: - - openssl - - openstack-tripleo-heat-templates - state: latest - - - name: Create overcloud-create-ssl-cert.sh - template: - src: "{{ overcloud_ssl_cert_script }}" - dest: "{{ working_dir }}/overcloud-create-ssl-cert.sh" - mode: 0755 - - - name: Generate SSL certificates - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-create-ssl-cert.sh 2>&1 {{ timestamper_cmd }} > - {{ overcloud_ssl_cert_log }} - -- name: fetch template from single remote host - tls_tht: - enable_tls_overcloud: "{{ ssl_overcloud }}" - source_dir: "/usr/share/openstack-tripleo-heat-templates/" - dest_dir: "{{ working_dir }}/" - cert_filename: "{{ working_dir }}/server-cert.pem" - cert_ca_filename: "{{ working_dir }}/overcloud-cacert.pem" - key_filename: "{{ working_dir }}/server-key.pem" - tht_release: '{{ release }}' - when: ssl_overcloud|bool or undercloud_generate_service_certificate|bool diff --git a/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 b/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 deleted file mode 100755 index cbbf5a400..000000000 --- a/roles/overcloud-ssl/templates/overcloud-create-ssl-cert.sh.j2 +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Generating the overcloud SSL Certificates -## ========================================= - -## * Generate a private key -## :: - -openssl genrsa 2048 > {{ working_dir }}/overcloud-ca-privkey.pem 2> /dev/null - -## * Generate a self-signed CA certificate -## :: - -openssl req -new -x509 -key {{ working_dir }}/overcloud-ca-privkey.pem \ - -out {{ working_dir }}/overcloud-cacert.pem -days 365 \ - -subj "/C=US/ST=NC/L=Raleigh/O=Red Hat/OU=OOOQ/CN=overcloud" - -## * Add the self-signed CA certificate to the undercloud's trusted certificate -## store. -## :: - -sudo cp {{ working_dir }}/overcloud-cacert.pem /etc/pki/ca-trust/source/anchors/ -sudo update-ca-trust extract - -## * Generate the leaf certificate request and key that will be used for the -## public VIP -## :: - -{% set _vip = overcloud_public_vip %} - -openssl req -newkey rsa:2048 -days 365 \ - -nodes -keyout {{ working_dir }}/server-key.pem \ - -out {{ working_dir }}/server-req.pem \ - -subj "/C=US/ST=NC/L=Raleigh/O=Red Hat/OU=OOOQ/CN={{_vip}}" \ - -reqexts subjectAltName \ - -config <(printf "[subjectAltName]\nsubjectAltName=IP:{{_vip}}\n[req]req_extensions = v3_req\ndistinguished_name=req_distinguished_name\n[req_distinguished_name]") - -## * Process the server RSA key -## :: - -openssl rsa -in {{ working_dir }}/server-key.pem \ - -out {{ working_dir }}/server-key.pem - -## * Sign the leaf certificate with the CA certificate and generate -## the certificate -## :: - -openssl x509 -req -in {{ working_dir }}/server-req.pem -days 365 \ - -CA {{ working_dir }}/overcloud-cacert.pem \ - -CAkey {{ working_dir }}/overcloud-ca-privkey.pem \ - -set_serial 01 -out {{ working_dir }}/server-cert.pem \ - -extensions subjectAltName \ - -extfile <(printf "[subjectAltName]\nsubjectAltName=IP:{{_vip}}\n[req]req_extensions = v3_req\ndistinguished_name=req_distinguished_name\n[req_distinguished_name]") - -## --stop_docs diff --git a/roles/overcloud-ssl/tests/inventory b/roles/overcloud-ssl/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/overcloud-ssl/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/overcloud-ssl/tests/test.yml b/roles/overcloud-ssl/tests/test.yml deleted file mode 100644 index c9ac8cec4..000000000 --- a/roles/overcloud-ssl/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-ssl diff --git a/roles/repoclosure/README.md b/roles/repoclosure/README.md deleted file mode 100644 index 8e19f9f52..000000000 --- a/roles/repoclosure/README.md +++ /dev/null @@ -1,61 +0,0 @@ -repoclosure -================ - -This role will execute repoclosure against the enabled repos on a system. -It runs repoclosure per repo to better determine what needs to be fixed in the -yum repo. - -You can exclude certain repos w/ the *repoclosure_exclude_repos* variable. -You can exclude certain packages via excludepkgs w/ *repoclosure_exclude_pkgs* - -Requirements ------------- - -Available yum repos - -Role Variables --------------- - -repoclosure_script_source: the jina template used -repoclosure_script: out of jinja2 template -repoclosure_log: the log file -repoclosure_exclude_repos: a list of repos that are not worthy of repoclosure. -repoclosure_include_repos: - - "--enablerepo delorean-*" - - "--enablerepo quickstart-*" - - "--enablerepo advanced-virt*" - - "--enablerepo centos-rabbitmq*" - - "--enablerepo centos-opstools" - - "--enablerepo centos-nfv-ovs" -repoclosure_exclude_pkgs: - - "*-test*" - - "*.src" - - "*-devel" - - "*-debug" - - "*-docs" - - -Dependencies ------------- - -This role has no dependencies. -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Set up CentOS undercloud node to run TripleO Quickstart - hosts: undercloud - gather_facts: false - roles: - - repoclosure - -License -------- - -Apache-2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/repoclosure/defaults/main.yml b/roles/repoclosure/defaults/main.yml deleted file mode 100644 index 6b15e14be..000000000 --- a/roles/repoclosure/defaults/main.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -repo_setup_dir: "{{ working_dir }}" -repoclosure_script_source: repoclosure.sh.j2 -repoclosure_script: repoclosure.sh -repoclosure_log: repoclosure.log -repoclosure_include_repos: - - "--enablerepo delorean-*" - - "--enablerepo quickstart-*" - - "--enablerepo advanced-virt*" - - "--enablerepo centos-rabbitmq*" - - "--enablerepo centos-opstools" - - "--enablerepo centos-nfv-ovs" -repoclosure_exclude_pkgs: - - "*-test*" - - "*.src" - - "*-devel" - - "*-debug" - - "*-docs" - # the following packages are probably package bugs - - python3-oslotest - - python3-mox3 - - python3-stackviz - - python3-tobiko - - openstack-tempest-all - - python3-sahara-tempest - - python3-tempest - - openstack-tempest - - python3-tempestconf - - ksc - - awscli - - ansible-tripleo-powerflex - - "ceph*" - - "ceph-*" - - gperftools - - rbd-mirror -# repos that are enabled but not required to check -repoclosure_exclude_repos: - - advanced-virtualization - - centos-opstools - - quickstart-centos-base - - quickstart-centos-opstools - - centos-rabbitmq-38 - - delorean-master-testing - - quickstart-centos-appstreams - - quickstart-centos-ceph-octopus - - quickstart-centos-powertools - - centos-nfv-ovs - - delorean-master-build-deps - - delorean-current diff --git a/roles/repoclosure/meta/main.yml b/roles/repoclosure/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/repoclosure/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/repoclosure/tasks/main.yml b/roles/repoclosure/tasks/main.yml deleted file mode 100644 index 7b755985a..000000000 --- a/roles/repoclosure/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# execute and log repoclosure -- name: execute repoclosure - include: repoclosure.yml - when: job.repoclosure is defined or repoclosure is defined diff --git a/roles/repoclosure/tasks/repoclosure.yml b/roles/repoclosure/tasks/repoclosure.yml deleted file mode 100644 index 0fdd2cf1a..000000000 --- a/roles/repoclosure/tasks/repoclosure.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -# The following two tasks turn a standalone -# deployment into a single purpose job -# setup repos and test for repoclosure. - -# execute and log repoclosure -# stops execution when failed: if zuul.repoclosure -# or repoclosure is defined -# if this passes continue -- name: register enabled yum repos - shell: dnf -q repolist | awk '{print $1}' - register: yum_repos - changed_when: true - -- name: debug register yum_repos - debug: - var: yum_repos.stdout_lines - -- name: Create repoclosure script - template: - src: "{{ repoclosure_script_source }}" - dest: "{{ repo_setup_dir }}/{{ repoclosure_script }}" - mode: 0755 - changed_when: true - -- name: Execute repoclosure to ensure rpms are installable - shell: > - set -o pipefail && - {{ repo_setup_dir }}/{{ repoclosure_script }} 2>&1 {{ timestamper_cmd }} - | tee -a {{ repo_setup_dir }}/{{ repoclosure_log }} - become: true - no_log: result.rc == 0 - changed_when: result.rc == 0 diff --git a/roles/repoclosure/templates/repoclosure.sh.j2 b/roles/repoclosure/templates/repoclosure.sh.j2 deleted file mode 100644 index 0c0c9c2f8..000000000 --- a/roles/repoclosure/templates/repoclosure.sh.j2 +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -set -x -set -o pipefail - -### --start_docs -## Execute repoclosure w/ options -## ============================== - -## * run repoclosure -## :: - -EXIT_CODE=0 - -{% for repo_name in yum_repos.stdout_lines %} - -echo "*********************** repo: {{ repo_name }} *****************" -{% if repo_name in repoclosure_exclude_repos %} - - echo "skipping, {{ repo_name }} is in var repoclosure_exclude_repos" - -{% else %} - - dnf repoclosure --newest --check {{ repo_name }} --disablerepo '*' \ - {{ repoclosure_include_repos|join(' ') }} \ - --excludepkgs {{ repoclosure_exclude_pkgs|join(',') }} \ - --disablerepo 'delorean-current' - if [ "$?" -ne 0 ]; then - EXIT_CODE=1 - fi - -{% endif %} -{% endfor %} - -exit $EXIT_CODE -### --stop_docs diff --git a/roles/set-libvirt-type/README.md b/roles/set-libvirt-type/README.md deleted file mode 100644 index 64d58684c..000000000 --- a/roles/set-libvirt-type/README.md +++ /dev/null @@ -1,45 +0,0 @@ -set-libvirt-type -================ - -Set Libvirt type for overcloud deploy. -This Ansible role allows provisioning overcloud with nested kvm or qemu full -virtualization mode based on cpu and OS capabilities. - -Requirements ------------- - -No requirements. - -Role Variables --------------- - -No variables. - -Dependencies ------------- - -No dependencies. - -Example Playbook ----------------- - -Including an example of how to use this role - - --- - - name: Set Libvirt type - hosts: overcloud - roles: - - set-libvirt-type - tags: - - overcloud-deploy - - -License -------- - -Apache 2.0 - -Author Information ------------------- - -OpenStack diff --git a/roles/set-libvirt-type/tasks/main.yml b/roles/set-libvirt-type/tasks/main.yml deleted file mode 100644 index 191b7e762..000000000 --- a/roles/set-libvirt-type/tasks/main.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -- name: Collect hardware facts if necessary - setup: - gather_subset: "!all,!min,hardware" - when: ansible_processor is not defined - -- name: Check cpu vendor - set_fact: - cpu_vendor: "{{ item }}" - when: ansible_processor[1]|lower is search(item) - with_items: - - intel - - amd - -- name: Check virt extensions on cpu flags - # noqa 306 - shell: egrep 'vmx|svm' /proc/cpuinfo - register: cpuflags - failed_when: false - no_log: true - when: cpu_vendor is defined - -- name: Set qemu as virt type - set_fact: - virt_type: qemu - when: cpu_vendor is not defined or cpuflags.stdout == "" - -- name: Set kvm as virt type - set_fact: - virt_type: kvm - when: cpu_vendor is defined and cpuflags.stdout != "" - -- name: Print virtualization type - debug: - var: virt_type diff --git a/roles/snapshot-libvirt/README.md b/roles/snapshot-libvirt/README.md deleted file mode 100644 index 42f3e90f7..000000000 --- a/roles/snapshot-libvirt/README.md +++ /dev/null @@ -1,72 +0,0 @@ -snapshot-libvirt -================ - -An Ansible role for snapshotting a libvirt environment using -external snapshots with backing files. - -The role will shutdown all of the VMs specified in the -overcloud_nodes list, then proceed with either creating or -restoring a previous snapshot depending on the settings for -snapshot_create and snapshot_restore. The default is to -do nothing since both of these operations are potentially -destructive. - -When run with snapshot_create=true, the role will check if -there is already a backing file. If one exists, it will -commit all new changes to that backing file. If there is -not already a backing file, the role will create one, and -make an empty snapshot pointing to it. - -When run with snapshot_restore=true, the role will delete -the current snapshot and create an empty snapshot pointing -to the backing file. - -Limitations ------------ - -- This role does not currently support any "management" of snapshots, - i.e. there is only one maintained. -- The role uses qemu-img directly to create the snapshots, this means - the snapshots will not show up with commands like `virsh-snapshot` -- The role does not currently implement any method to remove the backing - files. This means when starting over from scratch, these *.bak files - will need to be manually deleted (if reusing the same libvirt_volume_path). - -Example Usage -------------- - -```yaml ---- -- name: Create a snapshot (or update a snapshot) - hosts: virthost - gather_facts: true - vars: - - snapshot_create: true - - libvirt_volume_path: /opt/vm_images - - libvirt_uri: qemu:///system - - overcloud_nodes: - - name: subnode-0 - - name: subnode-1 - roles: - - snapshot-libvirt - become: true - -- name: Restore a snapshot - hosts: virthost - gather_facts: true - vars: - - snapshot_restore: true - - libvirt_volume_path: /opt/vm_images - - libvirt_uri: qemu:///system - - overcloud_nodes: - - name: subnode-0 - - name: subnode-1 - roles: - - snapshot-libvirt - become: true -``` - -License -------- - -Apache diff --git a/roles/snapshot-libvirt/defaults/main.yml b/roles/snapshot-libvirt/defaults/main.yml deleted file mode 100644 index a36ca349e..000000000 --- a/roles/snapshot-libvirt/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# By default the role does nothing since both operations -# are potentially destructive. -snapshot_create: false -snapshot_restore: false diff --git a/roles/snapshot-libvirt/tasks/main.yml b/roles/snapshot-libvirt/tasks/main.yml deleted file mode 100644 index ffb9ca2d7..000000000 --- a/roles/snapshot-libvirt/tasks/main.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- - -- name: Shut down vms - virt: - name: "{{ item.name }}" - command: shutdown - state: shutdown - uri: "{{ libvirt_uri }}" - with_items: "{{ overcloud_nodes }}" - -- name: Evaluate overcloud VM libvirt names - set_fact: - libvirt_oc_names: >- - {%- set names=[] -%} - {%- for n in overcloud_nodes -%} - {%- if names.append(hostvars[n['name']]['inventory_hostname']) -%}{%- endif -%} - {%- endfor -%} - {{ names | join('|') }} - -- name: Wait for vms to shutdown - async: 300 - poll: 0 - shell: | - set -eo pipefail - while true - do virsh list | grep -E '{{ libvirt_oc_names }}' > /dev/null || break - done - register: vms_shutdown - changed_when: false - -- name: Check that vms are shutdown - async_status: - jid: "{{ vms_shutdown.ansible_job_id }}" - register: job_result - until: job_result.finished - retries: 30 - -- name: Commit any changes if a snapshot already exists - shell: | - qemu-img commit {{ libvirt_volume_path }}/{{ item.name }}.qcow2 - args: - removes: "{{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak" - with_items: "{{ overcloud_nodes }}" - when: snapshot_create|bool - changed_when: true - -- name: Create snapshot - shell: | - mv {{ libvirt_volume_path }}/{{ item.name }}.qcow2 {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak - qemu-img create -F qcow2 -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2 - args: - creates: "{{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak" - with_items: "{{ overcloud_nodes }}" - when: snapshot_create|bool - changed_when: true - -- name: Restore previous snapshot - shell: | - rm {{ libvirt_volume_path }}/{{ item.name }}.qcow2 - qemu-img create -F qcow2 -f qcow2 -b {{ libvirt_volume_path }}/{{ item.name }}.qcow2.bak {{ libvirt_volume_path }}/{{ item.name }}.qcow2 - with_items: "{{ overcloud_nodes }}" - when: snapshot_restore|bool - changed_when: true - -- name: Start vms - virt: - name: "{{ item.name }}" - command: start - autostart: true - state: running - uri: "{{ libvirt_uri }}" - with_items: "{{ overcloud_nodes }}" - -- name: "Wait for the vms to start" - wait_for: - host: "{{ hostvars[item.name]['ansible_host'] }}" - port: 22 - state: started - with_items: "{{ overcloud_nodes }}" diff --git a/roles/standalone-upgrade/README.md b/roles/standalone-upgrade/README.md deleted file mode 100644 index 9c34d5bb8..000000000 --- a/roles/standalone-upgrade/README.md +++ /dev/null @@ -1,40 +0,0 @@ -Standalone Upgrade -=================== - -An Ansible role to upgrade the Standalone ( all-in-one ) deployment of TripleO - -Requirements ------------- - -An existing standalone deployment. - -Role Variables --------------- - -- standalone_config: <'standalone_config.yaml.j2'> -- jinja template of the upgrade configuration -- standalone_network: <'192.168.24'> -- First three octets of the network used -- standalone_network_prefix: <'24'> -- The subnet size for the standalone deployment network -- standalone_ip: <'192.168.24.1'> -- The IP address of the standalone upgrade -- standalone_interface: <'br-ex'> -- The interface for the standalone upgrade -- standalone_neutron_bridge_mapping: <'datacentre:br-ctlplane'> -- The mapping for neutron network bridges -- standalone_neutron_physical_bridge: <'br-ctlplane'> -- Neutron physical bridge - -- standalone_container_prep_options: <''> -- additional parameters for the container prep command -- standalone_container_prep_script: <'standalone-container-prep.sh.j2'> -- The script name use to perform container prep actions -- standalone_container_prep_log: <'standalone_container_prep_upgrade.log'> -- The log of the container prepa actions during upgrade - -- standalone_upgrade_script: <'standalone.sh.j2'> -- The script name use to upgrade the standalone server -- standalone_upgrade_log: <'standalone_deploy.log'> -- The log of the upgrade - -- standalone_role: <'Standalone.yaml'> -- The TripleO Heat Template role definition of the deployment - -- standalone_libvirt_type: <'kvm'> -- The type of libvirt to run on the standalone (qemu|kvm) - -- standalone_selinux_mode: <'permissive'> -- The selinux mode to use. - -- standalone_custom_env_files: <'[]'> -- list of additional environment files to be added to the deployment command (do not include the -e) -- standalone_hostname: <'standalone.localdomain'> -- FQDN for system under deployment. -Dependencies ------------- - -The dependencies documented for TripleO Quickstart and TripleO diff --git a/roles/standalone-upgrade/defaults/main.yml b/roles/standalone-upgrade/defaults/main.yml deleted file mode 100644 index 62f3b93f2..000000000 --- a/roles/standalone-upgrade/defaults/main.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -standalone_config: standalone_config.yaml.j2 -standalone_network: 192.168.24 -standalone_network_prefix: 24 -standalone_ip: 192.168.24.1 -standalone_ha_control_virtual_ip: 192.168.24.3 -standalone_interface: br-ex -standalone_neutron_bridge_mappings: "datacentre:br-ctlplane" -standalone_neutron_physical_bridge: br-ctlplane - -# container prep script -standalone_container_prep_options: '' -standalone_container_prep_script: standalone-container-prep.sh.j2 -standalone_container_prep_log: standalone_container_prep_upgrade.log - -# Upgrade script -standalone_upgrade_script: standalone.sh.j2 -standalone_upgrade_log: standalone_upgrade.log - -# deployment role -standalone_role: Standalone.yaml - -standalone_selinux_mode: permissive - -standalone_libvirt_type: kvm - -standalone_container_cli: docker - -standalone_custom_env_files: [] -standalone_hostname: standalone.localdomain diff --git a/roles/standalone-upgrade/meta/main.yml b/roles/standalone-upgrade/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/standalone-upgrade/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/standalone-upgrade/tasks/main.yml b/roles/standalone-upgrade/tasks/main.yml deleted file mode 100644 index 1cbbd1b70..000000000 --- a/roles/standalone-upgrade/tasks/main.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -# tasks file for all_in_one upgrade -- name: gather facts used by role - setup: - gather_subset: "!min,pkg_mgr" - when: ansible_pkg_mgr is not defined - -# standalone params -- name: Create the standalone params for upgrade - template: - src: "{{ standalone_config }}" - dest: "{{ working_dir }}/standalone_parameters_upgrade.yaml" - mode: 0755 - -- name: Create container parameters script for upgrade - template: - src: "{{ standalone_container_prep_script }}" - dest: "{{ working_dir }}/standalone-container-prep-upgrade.sh" - mode: "0755" - -- name: Run container prepare for upgrade - shell: > - set -o pipefail && - {{ working_dir }}/standalone-container-prep-upgrade.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_container_prep_log }} - changed_when: true - -- name: Check whether control plane defaults to HA - set_fact: - standalone_upgrade_ha_control_plane: "{{ release not in ['train'] }}" - -- name: Create the upgrade command for standalone - template: - src: "{{ standalone_upgrade_script }}" - dest: "{{ working_dir }}/standalone-upgrade.sh" - mode: 0755 - vars: - standalone_upgrade_control_virtual_ip: >- - {% if standalone_control_virtual_ip is not defined and standalone_upgrade_ha_control_plane|default(false)|bool -%} - {{ standalone_ha_control_virtual_ip|default() }} - {%- else -%} - {{ standalone_control_virtual_ip|default() }} - {%- endif -%} - -# TODO: (rlandy) remove workaround for LP bug #1953326 -# For now pcs-0.10.11-1 is the last known good version -# All releases are affected by this issue at this moment -- name: Downgrade pcs version - block: - - name: Downgrade pcs - shell: | - dnf downgrade pcs-0.10.11-1.el8 -y; - rpm -qa | grep pcs - become: true - register: downgrade_result - - - name: Return current pcs version - debug: - msg: "{{ downgrade_result.stdout }}" - - - name: Ensure the version is not upgraded again - become: true - lineinfile: - path: /etc/dnf/dnf.conf - state: present - line: 'exclude=pcs' - -- name: Upgrade the standalone - shell: > - set -o pipefail && - {{ working_dir }}/standalone-upgrade.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_upgrade_log }} - changed_when: true diff --git a/roles/standalone-upgrade/templates/standalone-container-prep.sh.j2 b/roles/standalone-upgrade/templates/standalone-container-prep.sh.j2 deleted file mode 100644 index dd39200fa..000000000 --- a/roles/standalone-upgrade/templates/standalone-container-prep.sh.j2 +++ /dev/null @@ -1,20 +0,0 @@ -# Update tripleo packages before using tripleo commands -sudo {{ ansible_pkg_mgr }} update -y \ - python*-tripleoclient \ - openstack-tripleo-common \ - tripleo-ansible \ - openstack-tripleo-heat-templates -# generate the default container prepare statement -openstack tripleo container image prepare default \ - --output-env-file {{ working_dir }}/containers-prepare-parameters-upgrade.yaml {{ standalone_container_prep_options }} - -{% if docker_registry_namespace != '' and docker_registry_host != '' %} -# Make CI specific namespce change to the container parameters -sed -Ei 's/^([\t ]+)namespace: [a-z./]*/\1namespace: {{ docker_registry_host }}\/{{ docker_registry_namespace }}/' \ - "{{ working_dir }}/containers-prepare-parameters-upgrade.yaml" -{% endif %} -{% if dlrn_hash_tag != '' %} -# Make CI specific tag change to the container params -sed -Ei 's/^([\t ]+)tag: [a-z-]+/\1tag: {{ container_build_id }}/' \ - "{{ working_dir }}/containers-prepare-parameters-upgrade.yaml" -{% endif %} diff --git a/roles/standalone-upgrade/templates/standalone.sh.j2 b/roles/standalone-upgrade/templates/standalone.sh.j2 deleted file mode 100644 index c0ad3c080..000000000 --- a/roles/standalone-upgrade/templates/standalone.sh.j2 +++ /dev/null @@ -1,22 +0,0 @@ -PROMPT_ANSWER="" -if openstack tripleo upgrade --help | grep -qe "--yes"; then - PROMPT_ANSWER="--yes" -fi - -sudo openstack tripleo upgrade $PROMPT_ANSWER \ - --templates \ - --local-ip={{ standalone_ip }}/{{ standalone_network_prefix }} \ -{% if standalone_upgrade_control_virtual_ip %} - --control-virtual-ip={{ standalone_upgrade_control_virtual_ip }} \ -{% endif %} - -e {{ overcloud_templates_path }}/environments/standalone/standalone-tripleo.yaml \ - -r {{ overcloud_templates_path }}/roles/{{ standalone_role }} \ - -e "{{ working_dir }}/containers-prepare-parameters-upgrade.yaml" \ - -e "{{ working_dir }}/standalone_parameters_upgrade.yaml" \ -{% if standalone_custom_env_files %} - -e {{ standalone_custom_env_files | join(' -e ') }} \ -{% endif %} -{% if release in ['train'] %} - --standalone \ -{% endif %} - --output-dir {{ working_dir }}/tripleo-deploy diff --git a/roles/standalone-upgrade/templates/standalone_config.yaml.j2 b/roles/standalone-upgrade/templates/standalone_config.yaml.j2 deleted file mode 100644 index 053e9fcef..000000000 --- a/roles/standalone-upgrade/templates/standalone_config.yaml.j2 +++ /dev/null @@ -1,54 +0,0 @@ -{% if ffu_standalone_upgrade is defined and ffu_standalone_upgrade|bool %} -resource_registry: - OS::TripleO::Services::NovaLibvirt: /usr/share/openstack-tripleo-heat-templates/deployment/deprecated/nova/nova-libvirt-container-puppet.yaml - -{% endif %} -parameter_defaults: - CertmongerCA: local - CloudName: {{ standalone_ip }} - ContainerCli: {{ standalone_container_cli }} - ContainerImagePrepareDebug: true - ControlPlaneStaticRoutes: [] - Debug: true - DeploymentUser: {{ undercloud_user }} - DnsServers: {{ undercloud_undercloud_nameservers }} - DockerInsecureRegistryAddress: - - {{ local_docker_registry_host }}:8787 -{% if build_container_images|default(false)|bool %} - - {{ local_registry_ip }}:{{ local_registry_port }} -{% endif %} -{% if job.consumer_job | default(false) | bool %} - - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }} -{% else %} - - quay.io -{% endif %} -{% if undercloud_docker_registry_mirror is defined and undercloud_docker_registry_mirror %} - DockerRegistryMirror: {{undercloud_docker_registry_mirror}} -{% endif %} - MasqueradeNetworks: - {{ standalone_network }}.0/{{ standalone_network_prefix }}: - - {{ standalone_network }}.0/{{ standalone_network_prefix }} - NeutronPublicInterface: {{ standalone_interface }} -{% if standalone_neutron_bridge_mappings is defined and standalone_neutron_bridge_mappings %} - NeutronBridgeMappings: {{ standalone_neutron_bridge_mappings }} -{% endif %} -{% if standalone_neutron_physical_bridge is defined and standalone_neutron_physical_bridge %} - NeutronPhysicalBridge: {{ standalone_neutron_physical_bridge }} -{% endif %} - StandaloneCtlplaneLocalSubnet: ctlplane-subnet - StandaloneCtlplaneSubnets: - ctlplane-subnet: - DhcpRangeEnd: {{ standalone_network }}.40 - DhcpRangeStart: {{ standalone_network }}.20 - NetworkCidr: {{ standalone_network }}.0/{{ standalone_network_prefix }} - NetworkGateway: {{ standalone_ip }} - StandaloneEnableRoutedNetworks: false - StandaloneHomeDir: {{ working_dir }} - InterfaceLocalMtu: 1500 - NovaComputeLibvirtType: {{ standalone_libvirt_type }} - SELinuxMode: {{ standalone_selinux_mode }} -{% if ffu_standalone_upgrade is defined and ffu_standalone_upgrade|bool %} - NovaHWMachineType: 'x86_64=pc-i440fx-rhel7.6.0,aarch64=virt-rhel7.6.0,ppc64=pseries-rhel7.6.0,ppc64le=pseries-rhel7.6.0' - ExtraConfig: - nova::workarounds::disable_compute_service_check_for_ffu: true -{% endif %} diff --git a/roles/standalone/README.md b/roles/standalone/README.md deleted file mode 100644 index 256f45d4c..000000000 --- a/roles/standalone/README.md +++ /dev/null @@ -1,48 +0,0 @@ -Standalone -=================== - -An Ansible role to deploy the Standalone ( all-in-one ) deployment of TripleO - -Requirements ------------- - -This role expects the requirements for deploying a TripleO undercloud to be met. -For example python-tripleoclient is installed and hardware requirements met. - -Role Variables --------------- - -- standalone_config: <'standalone_config.yaml.j2'> -- jinja template of the deployment configuration -- standalone_network: <'192.168.24'> -- First three octets of the network used -- standalone_network_prefix: <'24'> -- The subnet size for the standalone deployment network -- standalone_ip: <'192.168.24.1'> -- The IP address of the standalone deployment -- standalone_interface: <'br-ex'> -- The interface for the standalone deployment -- standalone_neutron_bridge_mapping: <'datacentre:br-ctlplane'> -- The mapping for neutron network bridges -- standalone_neutron_physical_bridge: <'br-ctlplane'> -- Neutron physical bridge - -- standalone_hostname: <'standalone.localdomain'> -- FQDN to use for the system being deployed. Must be a fully qualified hostname with the domain. - -- standalone_container_prep_options: <''> -- additional parameters for the container prep command -- standalone_container_prep_script: <'standalone-container-prep.sh.j2'> -- The script name use to perform container prep actions -- standalone_container_prep_log: <'standalone_container_prep.log'> -- The log of the container prepa ctions -- standalone_container_prep_updates: <'true'> -- Adds needed parameters to containers-prepare-parameters.yaml so that new container images and packages will be retrieved - -- standalone_deploy_log: <'standalone_deploy.log'> -- The log of the deployment -- standalone_ansible_lint_log: <'standalone_ansible_lint.log'> -- The ansible lint output - -- standalone_role: <'Standalone.yaml'> -- The TripleO Heat Template role definition of the deployment - -- standalone_libvirt_type: <'kvm'> -- The type of libvirt to run on the standalone (qemu|kvm) - -- standalone_selinux_mode: <'permissive'> -- The selinux mode to use. - -- standalone_ansible_lint: <'false'> -- Perform ansible lint on the generated ansible playbooks - -- standalone_custom_env_files: <'[]'> -- list of additional environment files to be added to the deployment command (do not include the -e) - -- standalone_tripleo_deploy_debug_arg: -- makes tripleoclient invoked with --debug, that results in calling ansible -vv commands as well. - -Dependencies ------------- - -The dependencies documented for TripleO Quickstart and TripleO diff --git a/roles/standalone/defaults/main.yml b/roles/standalone/defaults/main.yml deleted file mode 100644 index 75d06c844..000000000 --- a/roles/standalone/defaults/main.yml +++ /dev/null @@ -1,58 +0,0 @@ ---- -standalone_config: standalone_config.yaml.j2 -standalone_network: 192.168.24 -standalone_network_prefix: 24 -standalone_ip: 192.168.24.1 -standalone_ha_control_virtual_ip: 192.168.24.3 -standalone_interface: br-ex -standalone_neutron_bridge_mappings: "datacentre:br-ctlplane" -standalone_neutron_physical_bridge: br-ctlplane -standalone_hostname: standalone.localdomain - -# container prep script -standalone_container_prep_options: '' -standalone_container_prep_script: standalone-container-prep.sh.j2 -standalone_container_prep_log: standalone_container_prep.log - -# Don't do container prep if we are not at n release at upgrades -standalone_container_prep_updates: >- - {{ standalone_upgrade | default(false) | bool | ternary(false, true) }} - -# Set the repo to update from -gating_repo_name: gating-repo -container_prep_additional_repos: "" -standalone_container_prep_update_repo: >- - {% if compressed_gating_repo is defined %}{{ gating_repo_name }},{% endif %}delorean-current - {%- if container_prep_additional_repos -%},{{ container_prep_additional_repos }}{%- endif -%} - -# deploy script -standalone_deploy_log: standalone_deploy.log -standalone_ansible_lint_log: standalone_ansible_lint.log - -# deployment role -standalone_role: Standalone.yaml - -# Extra action on the deployment -standalone_ansible_lint: false - -standalone_selinux_mode: permissive - -standalone_libvirt_type: kvm - -standalone_container_cli: docker - -standalone_custom_env_files: [] - -standalone_container_ceph_updates: "{{ job.standalone_container_ceph_updates|default(false)|bool }}" - -standalone_tripleo_deploy_debug_arg: false - -local_registry_ip: 127.0.0.1 -local_registry_port: 5001 - -# containers related params -custom_ceph_parameters: "{{ job.custom_ceph_parameters|default(false)|bool }}" -custom_ceph_alertmanager_namespace: quay.io/prometheus -custom_ceph_grafana_namespace: quay.io/app-sre -custom_ceph_node_exporter_namespace: quay.io/prometheus -custom_ceph_prometheus_namespace: quay.io/prometheus diff --git a/roles/standalone/meta/main.yml b/roles/standalone/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/standalone/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/standalone/tasks/ceph-install.yml b/roles/standalone/tasks/ceph-install.yml deleted file mode 100644 index 7a1a80b0e..000000000 --- a/roles/standalone/tasks/ceph-install.yml +++ /dev/null @@ -1,144 +0,0 @@ ---- -- block: - - name: Set facts for Ceph - set_fact: - stack: standalone - mon_ip: "{{ rfc1918c ~ subnet | string ~ '.1' }}" - ceph_network: "{{ rfc1918c ~ subnet | string ~ '.0/' ~ cidr | string }}" - network_data: "{{ working_dir }}/network_data.yaml" - deployed_network: "{{ working_dir }}/deployed_network.yaml" - osd_spec: "{{ working_dir }}/osd_spec.yaml" - initial_ceph_conf: "{{ working_dir }}/initial_ceph.conf" - ceph_spec: "{{ working_dir }}/ceph_spec.yaml" - containers_prep: "{{ working_dir }}/containers-prepare-parameters.yaml" - deployed_ceph: "{{ working_dir }}/deployed_ceph.yaml" - ntpserver: "0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org" - ntp_heat_env_file: "{{ working_dir }}/ntp-parameters.yaml" - - name: Configure Storage Network - include_tasks: storage-network.yml - vars: - interface: ceph-dummy0 - dummy_ip_cidr: "{{ mon_ip ~ '/' ~ cidr | string }}" - dummy_vip: "{{ rfc1918c ~ subnet | string ~ '.2' }}" - start: "{{ rfc1918c ~ subnet | string ~ '.4' }}" - end: "{{ rfc1918c ~ subnet | string ~ '.250' }}" - vars: - rfc1918c: '192.168.' - subnet: 42 - cidr: 24 - -- name: Update registries.conf to trust docker_registry_host with Ceph container - become: true - block: - - name: Remove v1 entries from registries.conf - ini_file: - path: /etc/containers/registries.conf - create: false - backup: false - section: "registries.{{ item }}" - state: absent - loop: ['search', 'insecure', 'block'] - - name: Add docker_registry_host location to registries.conf - ini_file: - path: /etc/containers/registries.conf - create: false - backup: false - section: '[registry]' - option: location - value: "'{{ docker_registry_host }}'" - - name: Set docker_registry_host as insecure in registries.conf - ini_file: - path: /etc/containers/registries.conf - create: false - backup: false - section: '[registry]' - option: insecure - value: 'true' - -- name: Create OSD spec file - copy: - dest: "{{ osd_spec }}" - content: | - data_devices: - paths: - - /dev/ceph_vg/ceph_lv_data - -- name: Create initial ceph.conf file - copy: - dest: "{{ initial_ceph_conf }}" - content: | - [global] - osd pool default size = 1 - [mon] - mon_warn_on_pool_no_redundancy = false - [mgr] - mgr/cephadm/log_to_cluster_level = debug - -- name: Create Ceph Spec file via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_ceph_spec - vars: - tripleo_ceph_spec_standalone: true - tripleo_ceph_spec_overwrite: true - tripleo_ceph_spec_mon_ip: "{{ mon_ip }}" - tripleo_ceph_spec_stack: "{{ stack }}" - tripleo_ceph_spec_file: "{{ ceph_spec }}" - tripleo_ceph_spec_osd_spec: "{{ osd_spec }}" - tripleo_ceph_spec_debug: true - tripleo_ceph_spec_generate_scripts: true - -- name: Create ceph-admin user via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_ceph_user - vars: - tripleo_ceph_user_spec: "{{ ceph_spec }}" - tripleo_ceph_user_enable: true - tripleo_ceph_user_stack: "{{ stack }}" - tripleo_ceph_user_standalone: true - tripleo_ceph_user_debug: true - tripleo_ceph_user_generate_scripts: true - -- name: Confirm ceph-admin user can SSH to mon_ip before deploying Ceph - shell: "ssh -i {{ ssh_key }} {{ ssh_opt }} ceph-admin@{{ mon_ip }} 'echo good'" - register: result - until: result.stdout.find("good") != -1 - retries: 12 - delay: 10 - vars: - ssh_key: /home/zuul/.ssh/ceph-admin-id_rsa - ssh_opt: "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" - - -- name: Deploy Ceph via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_ceph_deploy - vars: - tripleo_ceph_deploy_standalone: true - tripleo_ceph_deploy_single_host_defaults: true - tripleo_ceph_deploy_skip_user_create: true - tripleo_ceph_deploy_skip_hosts_config: true - tripleo_ceph_deploy_skip_container_registry_config: true - tripleo_ceph_deploy_skip_ntp: false - tripleo_ceph_deploy_mon_ip: "{{ mon_ip }}" - tripleo_ceph_deploy_spec: "{{ ceph_spec }}" - tripleo_ceph_deploy_stack: "{{ stack }}" - tripleo_ceph_deploy_config: "{{ initial_ceph_conf }}" - tripleo_ceph_deploy_output: "{{ deployed_ceph }}" - tripleo_ceph_deploy_container_image_prepare: "{{ containers_prep }}" - tripleo_ceph_deploy_cephadm_extra_args: "--log-to-file --skip-mon-network" - tripleo_ceph_deploy_force: true - tripleo_ceph_deploy_become: true - tripleo_ceph_deploy_overwrite: true - tripleo_ceph_deploy_debug: true - tripleo_ceph_deploy_generate_scripts: true - tripleo_ceph_deploy_network_data: "{{ network_data }}" - tripleo_ceph_deploy_cluster_network_name: storage - tripleo_ceph_deploy_container_namespace: "{{ (standalone_container_ceph_updates|bool) | ternary(docker_ceph_namespace, 'quay.rdoproject.org/tripleo' + release + 'centos9') }}" - tripleo_ceph_deploy_ntp_server: "{{ ntpserver }}" - tripleo_ceph_deploy_with_ntp: "{{ release in ['wallaby'] }}" diff --git a/roles/standalone/tasks/containers.yml b/roles/standalone/tasks/containers.yml deleted file mode 100644 index 0ef4549c7..000000000 --- a/roles/standalone/tasks/containers.yml +++ /dev/null @@ -1,286 +0,0 @@ ---- -- name: Run dstat on the standalone prior to standalone tasks - include_role: - name: validate-perf - -- name: Gather ansible distribution - setup: - gather_subset: "!min,distribution" - when: ansible_distribution is not defined - -- name: Cache tempest network cidr - set_fact: - tempest_cidr: "{{ undercloud_network_cidr }}" - when: use_os_tempest is defined - -# tasks file for all_in_one - -- name: Set hostname - hostname: - name: "{{ standalone_hostname }}" - become: true - when: not enable_tls|default(false)|bool - -- name: set virtual-control-ip for TLS deployments - set_fact: - standalone_control_virtual_ip: "{{ undercloud_network_cidr|nthhost(210) }}" - cacheable: true - when: enable_tls|default(false)|bool - -- name: Add DNS and NTP server settings for TLS deployments - become: true - blockinfile: - path: "{{ overcloud_templates_path }}/ci/environments/standalone-ipa.yaml" - insertafter: " HAProxyExternalNetwork: ctlplane" - block: | - # Custom IPA params - DnsServers: ["{{ subnode_1_ip }}"] - when: enable_tls|default(false)|bool - -# standalone params -- name: Create the standalone params - template: - src: "{{ standalone_config }}" - dest: "{{ working_dir }}/standalone_parameters.yaml" - mode: 0755 - -- name: Remove settings that will be added with TLS - lineinfile: - path: "{{ working_dir }}/standalone_parameters.yaml" - regexp: "{{ item }}" - state: absent - backup: true - with_items: - - ' CloudName: 192.168.24.1' - - ' CertmongerCA: local' - - ' DnsServers: (.*)' - when: enable_tls|default(false)|bool - -- name: Build and push containers into a local registry - when: - - build_container_images|default(false)|bool - include_role: - name: container-build - vars: - container_registry_namespace: "{{ docker_registry_namespace }}" - container_tag: "{{ container_build_id }}" - -- name: Run container prepare legacy - when: - - release in ['train'] - block: - - - name: Create container parameters script - template: - src: "{{ standalone_container_prep_script }}" - dest: "{{ working_dir }}/standalone-container-prep.sh" - mode: "0755" - - - name: Run container prepare - shell: > - set -o pipefail && - {{ working_dir }}/standalone-container-prep.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/{{ standalone_container_prep_log }} - changed_when: true - -- name: Run container prepare via tripleo-operator-ansible - when: - - release not in ['train'] - collections: - - tripleo.operator - include_role: - name: tripleo_container_image_prepare_default - vars: - tripleo_container_image_prepare_default_debug: true - tripleo_container_image_prepare_default_output_env_file: "{{ working_dir }}/containers-prepare-parameters.yaml" - -# update the registry to rdo or docker.io -- name: update registry if needed in container-prepare-parameters.yaml - when: - - docker_registry_host != '' and docker_registry_namespace != '' - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " namespace: (.*)" - replace: " namespace: {{ docker_registry_host }}/{{ docker_registry_namespace }}" - backup: true - -# update the container tag to match dlrn hash -- name: update container tag if needed in container-prepare-parameters.yaml - when: - - container_build_id != '' - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " tag: (.*)" - replace: " tag: {{ container_build_id }}" - backup: true - -# in extra-common/defaults -# docker_prep_prefix: "{{ ansible_distribution | lower }}-binary-" -- name: update container name_prefix for the appropriate distro - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " name_prefix: (.*)" - replace: " name_prefix: {{ docker_prep_prefix }}" - backup: true - -# ceph parameters -- name: update container ceph parameters - when: - - standalone_container_ceph_updates|bool or job.consumer_job|default(false)|bool - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " {{ item.original }}: (.*)" - replace: " {{ item.replace }}" - backup: true - with_items: - - {original: "ceph_namespace", replace: "ceph_namespace: {{ docker_ceph_namespace }}"} - - {original: "ceph_image", replace: "ceph_image: {{ docker_ceph_image }}"} - - {original: "ceph_tag", replace: "ceph_tag: {{ docker_ceph_tag }}"} - -- name: update container custom ceph parameters, if required - when: - - custom_ceph_parameters|bool - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " {{ item.original }}: (.*)" - replace: " {{ item.replace }}" - backup: true - with_items: - - {original: "ceph_alertmanager_image", replace: "ceph_alertmanager_image: {{ custom_ceph_alertmanager_image }}"} - - {original: "ceph_alertmanager_namespace", replace: "ceph_alertmanager_namespace: {{ custom_ceph_alertmanager_namespace }}"} - - {original: "ceph_alertmanager_tag", replace: "ceph_alertmanager_tag: {{ custom_ceph_alertmanager_tag }}"} - - {original: "ceph_grafana_image", replace: "ceph_grafana_image: {{ custom_ceph_grafana_image }}"} - - {original: "ceph_grafana_namespace", replace: "ceph_grafana_namespace: {{ custom_ceph_grafana_namespace }}"} - - {original: "ceph_grafana_tag", replace: "ceph_grafana_tag: {{ custom_ceph_grafana_tag }}"} - - {original: "ceph_node_exporter_image", replace: "ceph_node_exporter_image: {{ custom_ceph_node_exporter_image }}"} - - {original: "ceph_node_exporter_namespace", replace: "ceph_node_exporter_namespace: {{ custom_ceph_node_exporter_namespace }}"} - - {original: "ceph_node_exporter_tag", replace: "ceph_node_exporter_tag: {{ custom_ceph_node_exporter_tag }}"} - - {original: "ceph_prometheus_image", replace: "ceph_prometheus_image: {{ custom_ceph_prometheus_image }}"} - - {original: "ceph_prometheus_namespace", replace: "ceph_prometheus_namespace: {{ custom_ceph_prometheus_namespace }}"} - - {original: "ceph_prometheus_tag", replace: "ceph_prometheus_tag: {{ custom_ceph_prometheus_tag }}"} - -# By using non_tripleo_containers.yml playbook in provider job, ceph related containers -# will be pulled from quay.io and pushed to local registry in content provider job. -# in order to consume it during deployment in consumer job, ceph containers namespaces -# needs to be updated in consumer job pointing to content provider job registry -# to pull respective containers. -# docker_ceph_namespace will point to local registry in consumer job, is setted in -# extra-common role. -- name: update container custom ceph parameters for consumer job - when: - - job.consumer_job|default(false)|bool - - not custom_ceph_parameters|bool - replace: - path: "{{ working_dir }}/containers-prepare-parameters.yaml" - regexp: " {{ item.original }}: (.*)" - replace: " {{ item.replace }}" - backup: true - with_items: - - {original: "ceph_alertmanager_namespace", replace: "ceph_alertmanager_namespace: {{ docker_ceph_namespace }}"} - - {original: "ceph_grafana_namespace", replace: "ceph_grafana_namespace: {{ docker_ceph_namespace }}"} - - {original: "ceph_node_exporter_namespace", replace: "ceph_node_exporter_namespace: {{ docker_ceph_namespace }}"} - - {original: "ceph_prometheus_namespace", replace: "ceph_prometheus_namespace: {{ docker_ceph_namespace }}"} - -- name: Set repos defined in the job to update - when: - - job.add_repos is defined - - job.add_repos != [] - - standalone_container_prep_updates - - not job.consumer_job | default(false) | bool - block: - - name: Create string of repos to update - set_fact: - add_repo_update_list: >- - {% if job.add_repos[item|int].update_container|default(false) -%} - {{ job.add_repos[item|int].reponame }} - {% endif -%} - with_sequence: start=0 end="{{ (job.add_repos|length -1)|int }}" - register: add_repo_update_list_result - - - debug: - var: add_repo_update_list - - - name: Add repos to update_repo - set_fact: - add_repos_update: "{{ add_repo_update_list_result.results | map(attribute='ansible_facts.add_repo_update_list') | list }}" - cacheable: true - when: add_repo_update_list_result|length > 0 - - - debug: - var: add_repos_update - - - name: Create string from list - set_fact: - add_repos_update: - "{% if standalone_container_prep_update_repo|length >0 %},{% endif %}{{ add_repos_update | join(',') }}" - when: add_repos_update|length > 0 - -- name: Load the container params file data - slurp: - src: "{{ working_dir }}/containers-prepare-parameters.yaml" - register: containers_prepare_parameters - -- name: Parse container params - set_fact: - containers_prepare_parameters_yaml: "{{ containers_prepare_parameters['content'] | b64decode | from_yaml }}" - -# update params for container update -- name: Add updates to container-prepare-parameters.yaml - when: - - standalone_container_prep_updates - - not build_container_images|default(false)|bool - - not job.consumer_job | default(false) | bool - block: - - name: Generate modified containers file - set_fact: - containers_prepare_parameters_yaml: |- - {% set imageParams = [] %} - {% for item in containers_prepare_parameters_yaml['parameter_defaults']['ContainerImagePrepare'] %} - {% set _ = item.__setitem__("push_destination", local_docker_registry_host ~ ":8787") %} - {% set _ = item.__setitem__("modify_role", "tripleo-modify-image") %} - {% set _ = item.__setitem__("modify_append_tag", update_containers_append_tag) %} - {% set _ = item.__setitem__("modify_only_with_source", ["kolla", "tripleo"]) %} - {% set _ = item.__setitem__( - "modify_vars", - { - "tasks_from": "yum_update.yml", - "yum_repos_dir_path": "/etc/yum.repos.d", - "update_repo": standalone_container_prep_update_repo ~ add_repos_update | default('') - } - ) - %} - {% set _ = item.pop("tag_from_label", "") %} - {% set _ = imageParams.append(item) %} - {% endfor %} - {% set defaults = {"ContainerImagePrepare": imageParams} %} - {{ {"parameter_defaults": defaults} }} - -- name: Update rhel_containers value - when: - - ansible_distribution == 'RedHat' - set_fact: - containers_prepare_parameters_yaml: |- - {% set imageParams = [] %} - {% for item in (containers_prepare_parameters_yaml | from_yaml)['parameter_defaults']['ContainerImagePrepare'] %} - {% if "set" in item %} - {% set _ = item['set'].__setitem__("rhel_containers", true) %} - {% endif %} - {% set _ = imageParams.append(item) %} - {% endfor %} - {% set defaults = {"ContainerImagePrepare": imageParams} %} - {{ {"parameter_defaults": defaults} }} - -- name: Write containers-prepare-parameters.yaml - copy: - content: "{{ containers_prepare_parameters_yaml | to_nice_yaml }}" - dest: "{{ working_dir }}/containers-prepare-parameters.yaml" - -- name: Modify the insecure registry value when using podman - when: - - standalone_container_prep_updates - - ansible_distribution == 'RedHat' - - ansible_distribution_major_version|int >= 8 - replace: - path: "{{ working_dir }}/standalone_parameters.yaml" - regexp: " - 192.168.24.1:8787" - replace: " - 192.168.24.1" - backup: true diff --git a/roles/standalone/tasks/main.yml b/roles/standalone/tasks/main.yml deleted file mode 100644 index d5591aa18..000000000 --- a/roles/standalone/tasks/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- include_tasks: containers.yml -- include_tasks: ceph-install.yml - when: - - job.standalone_ceph | default(false) - - release not in ['train'] -- include_tasks: standalone-install.yml diff --git a/roles/standalone/tasks/standalone-install.yml b/roles/standalone/tasks/standalone-install.yml deleted file mode 100644 index d986c4d5b..000000000 --- a/roles/standalone/tasks/standalone-install.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -- name: Check whether control plane defaults to HA - set_fact: - tripleo_deploy_ha_control_plane: "{{ release not in ['train'] }}" - -- name: Run standalone via tripleo-operator-ansible - collections: - - tripleo.operator - include_role: - name: tripleo_deploy - vars: - tripleo_deploy_debug: true - tripleo_deploy_reproducer_command: "{{ release not in ['wallaby', 'train'] }}" - tripleo_deploy_debug_arg: "{{ standalone_tripleo_deploy_debug_arg }}" - tripleo_deploy_local_ip: "{{ standalone_ip }}/{{ standalone_network_prefix }}" - tripleo_deploy_control_virtual_ip: >- - {% if standalone_control_virtual_ip is not defined and tripleo_deploy_ha_control_plane|default(false)|bool -%} - {{ standalone_ha_control_virtual_ip|default() }} - {%- else -%} - {{ standalone_control_virtual_ip|default() }} - {%- endif -%} - tripleo_deploy_roles_file: "{{ overcloud_templates_path }}/roles/{{ standalone_role }}" - tripleo_deploy_output_dir: "{{ working_dir }}/tripleo-deploy" - tripleo_deploy_networks_file: "{{ network_data|default() }}" - tripleo_deploy_environment_files: |- - {% set env_files = [overcloud_templates_path + '/environments/standalone/standalone-tripleo.yaml', - working_dir + '/containers-prepare-parameters.yaml', - working_dir + '/standalone_parameters.yaml']%} - {% if standalone_custom_env_files %} - {% set env_files = env_files + standalone_custom_env_files %} - {% endif %} - {% if deployed_ceph is defined %} - {% set env_files = env_files + [deployed_ceph] %} - {% endif %} - {% if deployed_network is defined %} - {% set env_files = env_files + [overcloud_templates_path + '/environments/deployed-network-environment.yaml'] %} - {% set env_files = env_files + [deployed_network] %} - {% endif %} - {{ env_files }} - # NOTE(mwhahaha): option no longer required as of V. - tripleo_deploy_standalone: "{{ release in ['train'] }}" - -- when: standalone_ansible_lint|default(false)|bool - vars: - quickstart_venv: "{{ lookup('env','OPT_WORKDIR') }}" - block: - - name: Install ansible-lint - # noqa 403 - pip: - name: ansible-lint - state: latest - virtualenv: "{{ quickstart_venv }}" - - - name: List playbooks - shell: "find $(ls -rtd {{ working_dir }}/undercloud-ansible-* | tail -1)/ -name '*playbook*.yaml'" - register: playbooks - - # We ignore (for now) the lint (rc==2), only catch syntax error - # (rc==1). - - name: Lint playbooks - shell: > - source {{ quickstart_venv }}/bin/activate; - exec 1>>{{ working_dir }}/{{ standalone_ansible_lint_log }}; - exec 2>&1; - echo LINTING {{ item }}; - ansible-lint -v {{ item }}; - rc=$?; - echo DONE rc=$rc; - exit $rc - register: lint_result - environment: - ANSIBLE_LIBRARY: | - /usr/share/ansible-modules/:{{ lookup('env', 'ANSIBLE_LIBRARY') }} - with_items: "{{ playbooks.stdout_lines }}" - failed_when: lint_result.rc == 1 diff --git a/roles/standalone/tasks/storage-network.yml b/roles/standalone/tasks/storage-network.yml deleted file mode 100644 index 3819e585e..000000000 --- a/roles/standalone/tasks/storage-network.yml +++ /dev/null @@ -1,104 +0,0 @@ ---- -- name: Look for dummy interface - become: true - command: ip link show "{{ interface }}" - register: ip_link_show - ignore_errors: true - -- name: Create dummy interface - become: true - command: ip link add "{{ interface }}" type dummy - when: - - ip_link_show.stdout_lines == [] - -- name: Assign IP to dummy interface - become: true - command: ip addr add "{{ dummy_ip_cidr }}" dev "{{ interface }}" - when: - - ip_link_show.stdout_lines == [] - -- name: Assign VIP to dummy interface - become: true - command: ip addr add "{{ dummy_vip }}/32" dev "{{ interface }}" - when: - - ip_link_show.stdout_lines == [] - -- name: Bring up dummy interface - become: true - command: ip link set "{{ interface }}" up - when: - - ip_link_show.stdout_lines == [] - -- name: Create network_data file - copy: - dest: "{{ network_data }}" - content: | - - name: Storage - mtu: 1350 - vip: true - name_lower: storage - dns_domain: storage.mydomain.tld. - service_net_map_replace: storage - subnets: - storage_subnet: - ip_subnet: '{{ ceph_network }}' - allocation_pools: [{'start': '{{ start }}', 'end': '{{ end }}'}] - -- name: Create deployed_network environment file (with VIPs) - copy: - dest: "{{ deployed_network }}" - content: | - resource_registry: - OS::TripleO::Network::Ports::ControlPlaneVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/deployed_vip_ctlplane.yaml - OS::TripleO::Network::Ports::StorageVipPort: network/ports/deployed_vip_storage.yaml - OS::TripleO::Network: /usr/share/openstack-tripleo-heat-templates/network/deployed_networks.yaml - parameter_defaults: - NodePortMap: - standalone: - ctlplane: - ip_address: {{ standalone_ip | default('192.168.24.1') }} - ip_subnet: {{ standalone_ip | default('192.168.24.1') }}/{{ standalone_network_prefix | default('24') }} - ip_address_uri: {{ standalone_ip | default('192.168.24.1') }} - storage: - ip_address: {{ mon_ip }} - ip_subnet: {{ dummy_ip_cidr }} - ip_address_uri: {{ mon_ip }} - ControlPlaneVipData: - fixed_ips: - - ip_address: {{ standalone_ha_control_virtual_ip | default('192.168.24.3') }} - name: control_virtual_ip - network: - tags: - - {{ standalone_network | default('192.168.24') ~ '.0/' ~ standalone_network_prefix | default('24') | string }} - subnets: - - ip_version: 4 - VipPortMap: - storage: - ip_address: {{ dummy_vip }} - ip_address_uri: {{ dummy_vip }} - ip_subnet: {{ dummy_vip ~ '/' ~ cidr | string }} - DeployedNetworkEnvironment: - net_attributes_map: - storage: - network: - dns_domain: storage.mydomain.tld. - mtu: 1350 - name: storage - tags: - - tripleo_network_name=Storage - - tripleo_net_idx=0 - - tripleo_service_net_map_replace=storage - - tripleo_vip=true - subnets: - storage_subnet: - cidr: {{ ceph_network }} - dns_nameservers: [] - gateway_ip: null - host_routes: [] - ip_version: 4 - name: storage_subnet - net_cidr_map: - storage: - - {{ ceph_network }} - net_ip_version_map: - storage: 4 diff --git a/roles/standalone/templates/standalone-container-prep.sh.j2 b/roles/standalone/templates/standalone-container-prep.sh.j2 deleted file mode 100644 index 92702f67c..000000000 --- a/roles/standalone/templates/standalone-container-prep.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -# generate the default container prepare statement -openstack tripleo container image prepare default \ - --output-env-file {{ working_dir }}/containers-prepare-parameters.yaml {{ standalone_container_prep_options }} diff --git a/roles/standalone/templates/standalone.sh.j2 b/roles/standalone/templates/standalone.sh.j2 deleted file mode 100644 index 8b750222a..000000000 --- a/roles/standalone/templates/standalone.sh.j2 +++ /dev/null @@ -1,12 +0,0 @@ -sudo openstack tripleo deploy {%- if standalone_tripleo_deploy_debug_arg | bool -%}--debug{%-endif -%} \ - --templates \ - --local-ip={{ standalone_ip }}/{{ standalone_network_prefix }} \ - -e {{ overcloud_templates_path }}/environments/standalone/standalone-tripleo.yaml \ - -r {{ overcloud_templates_path }}/roles/{{ standalone_role }} \ - -e "{{ working_dir }}/containers-prepare-parameters.yaml" \ - -e "{{ working_dir }}/standalone_parameters.yaml" \ -{% if standalone_custom_env_files %} - -e {{ standalone_custom_env_files | join(' -e ') }} \ -{% endif %} - --output-dir {{ working_dir }} \ - --standalone diff --git a/roles/standalone/templates/standalone_config.yaml.j2 b/roles/standalone/templates/standalone_config.yaml.j2 deleted file mode 100644 index d796b2b6e..000000000 --- a/roles/standalone/templates/standalone_config.yaml.j2 +++ /dev/null @@ -1,82 +0,0 @@ -# TODO: This is workaround for downstream osp17 and osp17.1 job, -# TripleO now defaults to libvirt's "modular daemons" but this -# required libvirt > 7.4, this is a temporary workaround to move -# back to monolithic modular libvirt daemon till RHOS17.1 on RHEL8 releases. -# Details in https://bugzilla.redhat.com/show_bug.cgi?id=2021536 -{% if ansible_distribution in ["RedHat"] and osp_release|default('') in ['rhos-17','rhos-17.1'] and ansible_distribution_major_version|int < 9 %} -resource_registry: - OS::TripleO::Services::NovaLibvirt: /usr/share/openstack-tripleo-heat-templates/deployment/deprecated/nova/nova-libvirt-container-puppet.yaml -{% endif %} -{% set source_ci_ip_address = ansible_default_ipv4.address + "/" + ansible_default_ipv4.netmask %} -{% set source_ci_network = source_ci_ip_address | ipaddr('network/prefix') %} -{% set ssh_client = (lookup("ansible.builtin.env", "SSH_CLIENT", default='')|split(' '))[0] %} -{% set console_access = (ssh_client == '') | ternary(source_ci_network, ssh_client) %} -parameter_defaults: - StandaloneParameters: - ExtraFirewallRules: - '022 Allow CI console stream from CI network {{ console_access }}': - proto: 'tcp' - dport: 19885 - source: "{{ console_access }}" - state: [] - CertmongerCA: local - CloudName: {{ standalone_ip }} - ContainerCli: {{ standalone_container_cli }} - ContainerImagePrepareDebug: true - ControlPlaneStaticRoutes: [] - Debug: true - ConfigDebug: {{ standalone_tripleo_deploy_debug_arg }} - DockerPuppetDebug: {{ standalone_tripleo_deploy_debug_arg }} - DeploymentUser: {{ undercloud_user }} - DnsServers: {{ undercloud_undercloud_nameservers | to_json }} - DockerInsecureRegistryAddress: - - {{ local_docker_registry_host }}:8787 -{% if build_container_images|default(false)|bool %} - - {{ local_registry_ip }}:{{ local_registry_port }} -{% endif %} -{% if job.consumer_job | default(false) | bool %} - - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }} -{% else %} - - quay.io -{% endif %} -{% if undercloud_docker_registry_mirror is defined and undercloud_docker_registry_mirror %} - DockerRegistryMirror: {{undercloud_docker_registry_mirror}} -{% endif %} - LocalContainerRegistry: {{ local_docker_registry_host }} - MasqueradeNetworks: - {{ standalone_network }}.0/{{ standalone_network_prefix }}: - - {{ standalone_network }}.0/{{ standalone_network_prefix }} -# Set machine type if default is not supported on current OS -# see https://bugzilla.redhat.com/show_bug.cgi?id=2110535 -{% if nova_hw_machine_type is defined and nova_hw_machine_type %} - NovaHWMachineType: {{ nova_hw_machine_type }} -{% endif %} - NeutronPublicInterface: {{ standalone_interface }} -{% if standalone_neutron_bridge_mappings is defined and standalone_neutron_bridge_mappings %} - NeutronBridgeMappings: {{ standalone_neutron_bridge_mappings }} -{% endif %} -{% if standalone_neutron_physical_bridge is defined and standalone_neutron_physical_bridge %} - NeutronPhysicalBridge: {{ standalone_neutron_physical_bridge }} -{% endif %} -# TODO: This is workaround for https://bugzilla.redhat.com/show_bug.cgi?id=2006409, Remove this -# once this bug is fixed. - NovaLibvirtNumPciePorts: 12 - StandaloneCtlplaneLocalSubnet: ctlplane-subnet - StandaloneCtlplaneSubnets: - ctlplane-subnet: - DhcpRangeEnd: {{ standalone_network }}.40 - DhcpRangeStart: {{ standalone_network }}.20 - NetworkCidr: {{ standalone_network }}.0/{{ standalone_network_prefix }} - NetworkGateway: {{ standalone_ip }} - StandaloneEnableRoutedNetworks: false - StandaloneHomeDir: {{ working_dir }} - InterfaceLocalMtu: 1500 - NovaComputeLibvirtType: {{ standalone_libvirt_type }} - SELinuxMode: {{ standalone_selinux_mode }} - NeutronDnsDomain: 'openstackgate.local' -{% if job is defined and job.standalone_ntp_servers is defined %} - NtpServer: {{ job.standalone_ntp_servers }} -{% endif %} -{% if cinder_lvm_loop_device_size is defined %} - CinderLVMLoopDeviceSize: {{ cinder_lvm_loop_device_size }} -{% endif %} diff --git a/roles/tht-prep-config/README.md b/roles/tht-prep-config/README.md deleted file mode 100644 index b87425e83..000000000 --- a/roles/tht-prep-config/README.md +++ /dev/null @@ -1,70 +0,0 @@ -ansible-role-tripleo-tht-prep-config -========================================== - -An Ansible "meta" role (do not use it on its own, its for imports only) to -prepare TripleO Heat Templates for TripleO deployments with Heat and Ansible. - -Requirements ------------- - -No requirements. The role should only be used via include/import_roles with -tasks_from. - -Role Variables --------------- - -- `working_dir`: -- the working dir to contain the cloned and checked-out t-h-t. Defined - in roles/extras-common -- `download_templates_rpm`: if set to true, allow the user to - download a tripleo-heat-templates rpm package from a url defined by the - variable `tht_rpm_url` -- `tht_templates_path`: -- the destination path inside of the working dir to clone - and checkout t-h-t from the given ``tht_templates_repo/_branch/_refspec``. -- `prep_post_hook_script`: if set to a non-empty string, it should be the content - of a bash script that will be run at the end of the t-h-t preparation configuration step. - This should only be use in rare case. -- `composable_scenario`: -- controls specific steps for the composable deployments. -- `upgrade_composable_scenario`: -- controls specific steps for the composable updates/upgrades. - -Dependencies ------------- - -None - -Example Playbook ----------------- - -Here is an example tasks snippet for a playbook (omitted the remaining parts): - -```yaml - vars: - my_custom_tht_script: clone_tht_script.j2.sh - my_custom_tht_log: clone_tht_script.log - tasks: - - name: Prepare custom t-h-t for my super deployment - include_role: - name: tht-prep-config - vars: - custom_tht_log: "{{ my_custom_tht_log }}" - custom_tht_script: "{{ my_custom_tht_script }}" - tht_templates_repo: "{{ my_templates_repo|default('') }}" - tht_templates_refspec: "{{ my_templates_refspec|default('') }}" - tht_templates_branch: "{{ my_templates_branch|default('') }}" - tht_templates_path: "{{ my_templates_path }}" - download_templates_rpm: "{{ download_my_templates_rpm|default('') }}" - prep_post_hook_script: "{{ my_prep_post_hook_script|default('') }}" -``` - -This puts into the current directory `clone-tht-script.sh` j2 rendered from -`clone_tht_script.j2.sh` (it should be placed under `tht-prep-config/templates`), -then executes the script and logs results into `clone_tht_script.log`. - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI and Tripleo Deployment Framework teams diff --git a/roles/tht-prep-config/defaults/main.yaml b/roles/tht-prep-config/defaults/main.yaml deleted file mode 100644 index b702ba23b..000000000 --- a/roles/tht-prep-config/defaults/main.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -custom_tht_log: custom-tht-script.log -custom_tht_script: custom-tht-script.sh.j2 -tht_templates_repo: "" -tht_templates_refspec: "" -tht_templates_branch: "" -tht_templates_path: "" -download_templates_rpm: "" -prep_post_hook_script: "" diff --git a/roles/tht-prep-config/meta/main.yml b/roles/tht-prep-config/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/tht-prep-config/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/tht-prep-config/tasks/main.yaml b/roles/tht-prep-config/tasks/main.yaml deleted file mode 100644 index 8116be5d7..000000000 --- a/roles/tht-prep-config/tasks/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- name: Evaluate the custom tht script name - set_fact: - script_name: "{{ custom_tht_log|replace('_', '-')|replace('.log', '.sh') }}" - -- name: Create custom tht script - template: - src: "{{ custom_tht_script }}" - dest: "{{ working_dir }}/{{ script_name }}" - mode: 0755 - -- name: Checkout custom tht heat templates from src - shell: > - set -o pipefail && - {{ working_dir }}/{{ script_name }} 2>&1 {{ timestamper_cmd }} > - {{ custom_tht_log }} - become: true - changed_when: true diff --git a/roles/tht-prep-config/templates/custom-tht-script.sh.j2 b/roles/tht-prep-config/templates/custom-tht-script.sh.j2 deleted file mode 100644 index 5f4179c18..000000000 --- a/roles/tht-prep-config/templates/custom-tht-script.sh.j2 +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## -------------------------------------------------- -## Checkout custom tripleo heat templates -## -------------------------------------------------- - -## ######################## -## Prepare Your Environment -## ######################## - -{% if tht_templates_repo|trim and tht_templates_path not in ['', '/'] %} -## * Clone the t-h-t templates if needed. -## :: - -rm -rf {{ tht_templates_path }} -chmod 755 $HOME -git clone --depth 1 {% if tht_templates_branch|trim %}-b {{ tht_templates_branch }} \ - --single-branch{% endif %} {{ tht_templates_repo }} {{ tht_templates_path }} - -{% if tht_templates_refspec|trim %} -## * Checkout an open t-h-t review if specified -## (this will stomp on the tht_templates_branch, so only one should be used). -## :: - -pushd {{ tht_templates_path }} -git fetch {{ tht_templates_repo }} {{ tht_templates_refspec }} && git checkout FETCH_HEAD -popd -{% endif %} - -{% if not composable_scenario|trim == '' %} -## * If desired composable scenario isn't present in the checked-out -## code, but is present in RPM, copy the scenario from RPM location. -## :: -if [ ! -e "{{ tht_templates_path }}/ci/environments/{{ composable_scenario }}" \ - -a -e "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ composable_scenario }}" ]; then - cp "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ composable_scenario }}" \ - "{{ tht_templates_path }}/ci/environments/{{ composable_scenario }}" -fi -{% endif %} -{% if not upgrade_composable_scenario|trim == '' %} -if [ ! -e "{{ tht_templates_path }}/ci/environments/{{ upgrade_composable_scenario }}" \ - -a -e "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ upgrade_composable_scenario }}" ]; then - cp "/usr/share/openstack-tripleo-heat-templates/ci/environments/{{ upgrade_composable_scenario }}" \ - "{{ tht_templates_path }}/ci/environments/{{ upgrade_composable_scenario }}" -fi -{% endif %} - -{% endif %} - -{% if download_templates_rpm and tht_templates_path|trim %} -## * Download the t-h-t package. -## :: -rm -rf {{ tht_templates_path }} -mkdir -p {{ working_dir }}/{{ tht_templates_path }}/downloaded-tht-rpm -pushd {{ working_dir }}/{{ tht_templates_path }}/downloaded-tht-rpm - -tht_rpm_name=$(curl {{ tht_rpm_url }} | grep "openstack-tripleo-heat-templates" | grep "noarch.rpm" | grep -v "tripleo-heat-templates-compat" | sed "s/^.*>openstack-tripleo-heat-templates/openstack-tripleo-heat-templates/" | cut -d "<" -f1) -curl -o {{ working_dir }}/{{ tht_templates_path }}/downloaded-tht-rpm/$tht_rpm_name {{ tht_rpm_url }}/$tht_rpm_name - -## * Unpack tht sources -## :: - -rpm2cpio $(ls -1 *.rpm | grep $tht_rpm_name) | cpio -ivdm -cp -R usr/share/openstack-tripleo-heat-templates {{ tht_templates_path }} -popd -{% endif %} - -{{ prep_post_hook_script }} - -### --stop_docs diff --git a/roles/undercloud-deploy/README.md b/roles/undercloud-deploy/README.md deleted file mode 100644 index 9f2f98724..000000000 --- a/roles/undercloud-deploy/README.md +++ /dev/null @@ -1,150 +0,0 @@ -undercloud-deploy -========================================== - -An Ansible role to execute the deployment of the tripleo undercloud - -Requirements ------------- - -This requires a running host to deploy the undercloud. - -Role Variables --------------- - -- `undercloud_templates_path`: <'/usr/share/openstack-tripleo-heat-templates'> -- -a path to git clone and check-out t-h-t templates from the corresponding repo/branch/ref paths. -- `undercloud_config_file`: <'undercloud.conf.j2'> -- the name of the jinja template -used as the base for the undercloud.conf -- `undercloud_install_log`: <'{{ working_dir }}/undercloud_install.log'> -- the full path -to the undercloud install log file. -- `undercloud_hieradata_override_file`: <'hieradata-overrides-classic-undercloud.yaml.j2'> -- the name of -jinja template used to override the undercloud's install hieradata. DEPRECATED. Use instead: -- `hieradata_override_file_t_h_t_undercloud`: -- -the source template for hieradata overrides for heat driven containerized undercloud deployments. -- `undercloud_ironic_ipxe_port`: <'3816'> -- port to use for httpd ipxe server -for ironic deploy -- `enable_vbmc`: <'true'> use a virtual bmc instead of pxe ssh -- `step_introspect`: <'false'> -- boolean value to enable/disable ironic introspection -- `step_install_undercloud`: <'true'> -- turn on/off the undercloud deployment -- `libvirt_uri`: <'qemu:///session'> -- the URI used by libvirt, by default tripleo-quickstart uses -user sessions to provide greater flexixiblity to our users. ** additional documentation ** is at -https://docs.openstack.org/tripleo-quickstart/latest/accessing-libvirt.html -- `undercloud_conf_extra`: <''> -- extra options to be added to ~/undercloud.conf -- `undercloud_extra_args`: <''> -- extra options for undercloud deploy command. -- `undercloud_enable_monitoring`: <'false'> -- sets up the 'enable_monitoring' - option in undercloud.conf. -- `undercloud_enable_telemetry`: <'true'> -- sets up the 'enable_telemetry' - option in undercloud.conf. -- `undercloud_enable_tempest`: <'true'> -- sets up the 'enable_tempest' option - in undercloud.conf. -- `undercloud_enable_validations`: <'true'> -- sets up the 'enable_validations' - option in undercloud.conf. -- `undercloud_enable_novajoin`: <'true'> -- sets up the 'enable_novajoin' - value from undercloud.conf when 'enable_tls_everywhere' is enabled. -- `novajoin_connect_timeout`: <5> Sets vendordata_dynamic_connect_timeout when novajoin is enabled -- `novajoin_read_timeout:` <20> Sets vendordata_dynamic_read_timeout when novajoin is enabled -- `prepare_ipa`: If set to true, it will install novajoin or tripleo-ipa in the - undercloud, and run a script that will create the required privileges/permissions - in FreeIPA, as well as the undercloud host entry. This requires - 'enable_tls_everywhere' to be set to true, and the following variables to be - properly defined: 'freeipa_admin_password', 'freeipa_server_hostname', - 'overcloud_cloud_domain', 'undercloud_undercloud_hostname'. If you plan to do - this yourself, you can set this variable to false. Defaults to true. -- `freeipa_admin_password`: The password for the admin principal for FreeIPA. - This will be used to run the script to prepare FreeIPA for novajoin. -- `freeipa_server_hostname`: The hostname for the FreeIPA server. - This will be used to run the script to prepare FreeIPA for novajoin. -- `overcloud_cloud_domain`: The domain configured for use by the overcloud - nodes. If TLS everywhere is enabled, this will also be the domain used by - FreeIPA. This sets up the 'overcloud_domain_name' configuration option in - undercloud.conf . Note: This also affects `CloudDomain` in the - `cloud-names.yaml` template used by the `overcloud-deploy` role. -- `undercloud_cloud_domain`: The domain configured for use by containerized - undercloud via the tripleo client's `--local-domain` option. It is unset by default. -- `local_docker_registry_host`: <`docker_registry_host`> -- registry host/port - for containerized undercloud services. Defaults to the value provided for overcloud. - You may want to diverge it, if building locally, or fetching from remote registries - not fitting the overcloud deployment needs. -- `undercloud_container_images_file`: <""> -- - The environment file with default parameters for containers to use with - undercloud install CLI. This should only be used to override image prepare - generating this during the undercloud install. -- `undercloud_custom_env_files`: -- - A space-separate string for custom t-h-t env files for `undercloud.conf` used with heat installer. -- `undercloud_undercloud_output_dir`: -- allows customize output directory for state, like - downloaded ansible configs and processed heat templates for heat installer -- `undercloud_undercloud_cleanup`: -- controls tear down of the processed heat templates -- `undercloud_upgrade_cleanup`: -- controls post upgrade cleanup after we containerize the undercloud. -- `update_containers`: -- whether to update containers from the local registry. -- `undercloud_enable_tempest`: -- The tempest container will be available on the undercloud. -- `undercloud_roles_data`: -- A custom t-h-t roles file. Consumed from ``undercloud_templates_path`` - or an alternative location as well. -- `undercloud_selinux_enabled`: <'true'> -- Enabled for RHEL by default, Disabled for CentOS by default -- `undercloud_enable_paunch`: -- Enable or disable Paunch to manage containers. Undefined by default. -- `undercloud_container_cli`: <'podman'> -- Container CLI to use for the Undercloud deployment. Default to 'podman'. -- `undercloud_parameter_defaults_args`: -- Complement 'parameter_defaults' for the undercloud. - -Role Network Variables ----------------------- -- `undercloud_network_cidr`: <'192.168.24.0/24'> -- the network cidr for the undercloud, note this -also currently the default cidr used in other CI environments for tripleo. -- `undercloud_network_gateway`: -- Sets up the -`undercloud_network_gateway` parameter from undercloud.conf. -- `undercloud_local_ip`: -- Sets up the `local_ip` -parameter from an inventory. Must be belonging to the `undercloud_network_cidr`. It is used -by overcloud nodes to access the undercloud node via a routable -[ctlplane network]((https://docs.openstack.org/developer/tripleo-docs/advanced_deployment/network_isolation). -Note that the undercloud.conf takes the default value based on the `undercloud_network_cidr` -instead. -- `undercloud_undercloud_public_host`: -- Sets -up the 'undercloud_public_host' parameter from undercloud.conf. It is also used by overcloud -nodes to access the undercloud node via a VIP/hostname that resolves to a routable IP address. -- `undercloud_undercloud_admin_host`: -- Sets -up the 'undercloud_admin_host' from undercloud.conf. -- `undercloud_dhcp_start`: -- Sets -up the 'undercloud_dhcp_start' from undercloud.conf. -- `undercloud_dhcp_end`: -- Sets -up the 'undercloud_dhcp_end' from undercloud.conf. -- `undercloud_undercloud_nameservers`: <['8.8.8.8']> -- Sets up the 'undercloud_undercloud_nameservers' -from undercloud.conf. May be a string or a sequence. Only the last item goes for -the undercloud deploy command. -- `undercloud_undercloud_hostname`: Sets up the 'undercloud_hostname' value from undercloud.conf. -- `undercloud_heat_public_endpoints`: <'false'> -- when the ctlplane network is not routable -from overcloud nodes, for example pre-provisioned -[deployed servers](https://docs.openstack.org/developer/tripleo-docs/advanced_deployment/deployed_server.html#undercloud), -the ``undercloud deploy --local_ip`` (and `local_ip` in the undercloud.conf) -may not be used. Enable this variable instead. Doing so changes the heat endpoint -type from the default internal to public and changes the signaling method to use -TempURLs from OpenStack Object Storage (swift). -- `undercloud_resource_registry_args`: Complements 'resource_registry' for undercloud - heat templates. Defaults to nothing. -- `undercloud_network_environment_args`: Complements Undercloud networking - setup with the default parameters for heat templates (parameter_defaults). -- `undercloud_net_config_override`: -- a j2 template for os-net-config - used to override network configuration, which is normally defined via - 'OS::TripleO::Undercloud::Net::SoftwareConfig'. Accepts instack tags like LOCAL_IP et al. - When it is defined, the ``undercloud_resource_registry_args`` value will be discarded. - -Undercloud deployment methods ------------------------------ - -The undercloud uses ``openstack undercloud install`` command, -`{{working_dir}}/undercloud.conf` config and the file coming from the -``hieradata_override_file_t_h_t_undercloud`` variable to set the hieradata -overrides that will be used for the containerized undercloud deploy. - - -Example Playbook ----------------- - -Sample playbook to call the role - -```yaml -# Deploy the undercloud -- name: Install undercloud - hosts: undercloud - gather_facts: false - roles: - - undercloud-deploy -``` -`` diff --git a/roles/undercloud-deploy/defaults/main.yml b/roles/undercloud-deploy/defaults/main.yml deleted file mode 100644 index b239f1d5c..000000000 --- a/roles/undercloud-deploy/defaults/main.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- - -undercloud_config_file: undercloud.conf.j2 -undercloud_post_install_script: undercloud-install-post.sh.j2 -undercloud_install_log: "{{ working_dir }}/undercloud_install.log" - -# defines extra args for the undercloud deploy command -undercloud_extra_args: "" - -hieradata_override_file_t_h_t_undercloud: hieradata-overrides-t-h-t-undercloud.yaml.j2 - -step_introspect: false -step_install_undercloud: true - -# Which libvirt session should we use? Using `qemu://session` does -# not require privileged access (but does require the setup performed by the -# `environment/setup` role). -libvirt_uri: qemu:///session - -# port to use for httpd ipxe server for ironic deploy -undercloud_ironic_ipxe_port: 3816 - -undercloud_conf_extra: "" - -prepare_ipa: true - -# location which the novajoin-ipa-setup will store the FreeIPA token -freeipa_otp_key: /tmp/ipa-otp.txt - -# determines vendordata_dynamic_connect|read_timeout when novajoin is enabled -novajoin_connect_timeout: 5 -novajoin_read_timeout: 20 - -libvirt_default_network_address: 192.168.122.1 - -# only to be used in libvirt deployments, see environment config for details -nameserver_from_virthost: false -virthost_nameservers: [] - -undercloud_enable_heat: "{{ not ephemeral_heat|default(false) }}" -undercloud_enable_ironic: true -undercloud_enable_ironic_inspector: true -undercloud_enable_monitoring: false -undercloud_enable_telemetry: false -undercloud_enable_tempest: false -undercloud_enable_validations: true -undercloud_ipxe_deploy: true -undercloud_enable_swift_encryption: false - -undercloud_undercloud_debug: true -undercloud_undercloud_timezone: 'UTC' - -# Path to tripleo-heat-templates to be cloned from given repo/branch/refscpec -undercloud_templates_path: /usr/share/openstack-tripleo-heat-templates - -# Use to populate the resource registry for nic configs and networking setup -undercloud_resource_registry_args: {} -undercloud_network_environment_args: {} - -ctlplane_masquerade: false - -update_containers: false -gating_repo_name: gating-repo -container_prep_additional_repos: "" -update_containers_repo: >- - {% if compressed_gating_repo is defined %}{{ gating_repo_name }},{% endif %}delorean-current - {%- if container_prep_additional_repos -%},{{ container_prep_additional_repos }}{%- endif -%} - -undercloud_enable_routed_networks: false - -default_undercloud_roles_data_path: "{{ undercloud_templates_path }}/roles_data_undercloud.yaml" - -# We disable selinux when running under CentOS. It's enabled for RHEL -undercloud_selinux_enabled: >- - {% if osp_release is defined -%} - true - {%- else -%} - false - {%- endif -%} - -undercloud_container_cli: podman - -# Define a custom t-h-t installation for UC -undercloud_custom_tht_script: custom-tht-script.sh.j2 -undercloud_custom_tht_log: undercloud_custom_tht_script.log - -# FIXME(bogdando) adapt these for real UC upgrade/deploy cases. -# As the tht prep config templates converged with the overcloud upgrade/deploy cases, -# these are yet meaningless for undercloud installations so the defaults -# are set only to disable the controlled code blocks. -undercloud_composable_scenario: "" -undercloud_upgrade_composable_scenario: "" -undercloud_prep_post_hook_script: "" -undercloud_tht_rpm_url: "" -download_undercloud_templates_rpm: false - -local_registry_ip: 127.0.0.1 -local_registry_port: 5001 diff --git a/roles/undercloud-deploy/meta/main.yml b/roles/undercloud-deploy/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/undercloud-deploy/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/undercloud-deploy/tasks/create-scripts.yml b/roles/undercloud-deploy/tasks/create-scripts.yml deleted file mode 100644 index 4ce1d34c5..000000000 --- a/roles/undercloud-deploy/tasks/create-scripts.yml +++ /dev/null @@ -1,188 +0,0 @@ ---- -# Creat the scripts that will be used to deploy the undercloud -# environment. -- name: Check the dns information provided by the virthost - shell: > - awk 'match($0, /nameserver\s+(([0-9]{1,3}.?){4})/,address){ print address[1] }' /etc/resolv.conf - delegate_to: virthost - register: virthost_nameservers_output - when: nameserver_from_virthost|bool - -- name: set name server facts - set_fact: - virthost_nameservers: "{{ virthost_nameservers_output.stdout_lines }}" - when: nameserver_from_virthost|bool - -- name: Add custom rules needed in CI infra after switch to nftables. - when: release not in ['train', 'wallaby'] - block: - - name: Find the default network on the undercloud node - set_fact: - source_ci_ip_address: "{{ ansible_default_ipv4.address }}/{{ ansible_default_ipv4.netmask }}" - - - name: Convert to obtain the network address in CIDR notation format. - set_fact: - source_ci_network: "{{ source_ci_ip_address | ipaddr('network/prefix') }}" - - - name: Set undercloud firewall rule as plain text first - vars: - ips: "{{ ((hostvars | json_query('*.ansible_host') |list) + - ansible_facts['all_ipv4_addresses'] + - ansible_facts['all_ipv6_addresses'] + - [source_ci_network]) | unique | ipaddr }}" - set_fact: - uc_firewall_rules: | - '022 Allow CI console stream from CI network {{ source_ci_network }}': - proto: 'tcp' - dport: 19885 - source: "{{ source_ci_network }}" - state: [] - {% for ip in ips %} - '020 Allow VXLan from {{ ip }}': - proto: "udp" - dport: 4789 - source: "{{ ip }}" - state: [] - '021 Allow OTV for vxlan from {{ ip }}': - proto: 'udp' - dport: 8472 - source: "{{ ip }}" - state: [] - {% endfor %} - - name: Set undercloud_network_environment_args to add custom CI rules for VXLAN, console Streaming and ssh accesses - set_fact: - undercloud_network_environment_args: - ExtraFirewallRules: "{{ uc_firewall_rules | from_yaml }}" - SshFirewallAllowAll: true - -- when: undercloud_hieradata_override_file is defined - block: - - name: deprecation message - vars: - deprecation_warning_msg: | - WARNING: The variable undercloud_hieradata_override_file - is deprecated for removal since Pike. - Reason: Both the undercloud and overcloud can use - hieradata overrides and we must distinguish between the two. - The variable will be removed in the "R" release. - Please revise your code to use the new variable, - and file name. - - debug: - msg: "{{ deprecation_warning_msg.split('\n') }}" - - - name: Create the deprecated undercloud hieradata overrides - template: - src: "{{ undercloud_hieradata_override_file }}" - dest: "./hieradata-overrides-classic-undercloud.yaml" - mode: 0600 - -- name: Create t-h-t driven undercloud hieradata overrides - block: - - name: Generate undercloud hieradata overrides file from template - template: - src: "{{ hieradata_override_file_t_h_t_undercloud }}" - dest: "./hieradata-overrides-t-h-t-undercloud.yaml" - mode: 0600 - - - name: Set fact for undercloud hieradata overrides file - set_fact: - undercloud_hieradata_override: "./hieradata-overrides-t-h-t-undercloud.yaml" - -- name: Create undercloud configuration - template: - src: "{{ undercloud_config_file }}" - dest: "./undercloud.conf" - mode: 0600 - -- name: Prepare undercloud custom t-h-t branch/refspec - include_role: - name: tht-prep-config - vars: - custom_tht_log: "{{ undercloud_custom_tht_log }}" - custom_tht_script: "{{ undercloud_custom_tht_script }}" - tht_templates_repo: "{{ undercloud_templates_repo|default('') }}" - tht_templates_refspec: "{{ undercloud_templates_refspec|default('') }}" - tht_templates_branch: "{{ undercloud_templates_branch|default('') }}" - tht_templates_path: "{{ undercloud_templates_path }}" - composable_scenario: "{{ undercloud_composable_scenario }}" - upgrade_composable_scenario: "{{ undercloud_upgrade_composable_scenario }}" - prep_post_hook_script: "{{ undercloud_prep_post_hook_script }}" - download_templates_rpm: "{{ download_undercloud_templates_rpm }}" - tht_rpm_url: "{{ undercloud_tht_rpm_url }}" - when: - - undercloud_templates_branch is defined or undercloud_templates_refspec is defined - - undercloud_templates_repo is defined - - undercloud_templates_path is defined - -- name: Create the undercloud parameter defaults file. - template: - src: undercloud-parameter-defaults.yaml.j2 - dest: "{{ working_dir }}/undercloud-parameter-defaults.yaml" - mode: 0600 - -- name: Set update_containers_repo if delorean-current is not present - stat: - path: "/etc/yum.repos.d/delorean-current.repo" - register: delorean_current_stat - -- name: Remove delorean-current from repo updates - set_fact: - update_containers_repo: >- - {% if compressed_gating_repo is defined %}{{ gating_repo_name }}{% endif %} - {%- if compressed_gating_repo is defined and container_prep_additional_repos -%},{%- endif -%} - {%- if container_prep_additional_repos -%}{{ container_prep_additional_repos }}{%- endif -%} - when: not delorean_current_stat.stat.exists - -- name: Set repos defined in the job for container update - when: - - job.add_repos is defined - - job.add_repos != [] - block: - - name: Create string of repos to update - set_fact: - add_repo_update_list: >- - {% if job.add_repos[item|int].update_container|default(false) -%} - {{ job.add_repos[item|int].reponame }} - {% endif -%} - with_sequence: start=0 end="{{ (job.add_repos|length -1)|int }}" - register: add_repo_update_list_result - - - debug: - var: add_repo_update_list - - - name: Add repos to update_repo - set_fact: - add_repos_update: "{{ add_repo_update_list_result.results | map(attribute='ansible_facts.add_repo_update_list') | list }}" - cacheable: true - when: add_repo_update_list_result|length > 0 - - - debug: - var: add_repos_update - - - name: Create string from list - set_fact: - add_repos_update: - "{% if update_containers_repo|length >0 %},{% endif %}{{ add_repos_update | join(',') }}" - when: add_repos_update|length > 0 - - - name: Create string from list - set_fact: - update_containers_repo: "{{ update_containers_repo }}{{ add_repos_update }}" - when: add_repos_update|length > 0 - -- name: Create containers-prepare-parameter.yaml - when: registry_distro_lower is not defined - block: - - name: Write containers-prepare-parameter.yaml - template: - src: containers-prepare-parameter.yaml.j2 - dest: "{{ working_dir }}/containers-prepare-parameter.yaml" - -- name: Create containers-prepare-parameter.yaml - when: registry_distro_lower is defined - block: - - name: Write containers-prepare-parameter.yaml - template: - src: containers-prepare-parameter-mixed-os.yaml.j2 - dest: "{{ working_dir }}/containers-prepare-parameter.yaml" diff --git a/roles/undercloud-deploy/tasks/gather-outputs.yml b/roles/undercloud-deploy/tasks/gather-outputs.yml deleted file mode 100644 index 14f8e418b..000000000 --- a/roles/undercloud-deploy/tasks/gather-outputs.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# gather the output post-undercloud installation and register variables with -# their contents -- name: Collect undercloud outputs - slurp: - src: "{{ lookup('first_found', output_paths, errors='ignore') }}" - register: tmp_undercloud_outputs - vars: - output_paths: - - "{{ working_dir }}/tripleo-deploy/undercloud/tripleo-undercloud-outputs.yaml" - - "{{ working_dir }}/tripleo-undercloud-outputs.yaml" - -- name: Collect undercloud passwords - slurp: - src: "{{ lookup('first_found', password_paths, errors='ignore') }}" - register: tmp_undercloud_passwords - vars: - password_paths: - - "{{ working_dir }}/tripleo-deploy/undercloud/tripleo-undercloud-passwords.yaml" - - "{{ working_dir }}/tripleo-undercloud-passwords.yaml" - -- name: Setting undercloud outputs and password facts - set_fact: - undercloud_outputs: "{{ tmp_undercloud_outputs['content'] | b64decode }}" - undercloud_passwords: "{{ tmp_undercloud_passwords['content'] | b64decode }}" diff --git a/roles/undercloud-deploy/tasks/ipa_prep.yml b/roles/undercloud-deploy/tasks/ipa_prep.yml deleted file mode 100644 index ccd48450a..000000000 --- a/roles/undercloud-deploy/tasks/ipa_prep.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- - -- name: Validate FreeIPA Admin password was passed - fail: msg="freeipa_admin_password is not passed and or blank" - when: - - deploy_supplemental_node|bool and not hostvars['supplemental'].freeipa_admin_password|default('') - - not freeipa_admin_password|default('') - -- name: Validate FreeIPA Server hostname was passed - fail: msg="freeipa_server_hostname is not passed and or blank" - when: freeipa_server_hostname is not defined or ( freeipa_server_hostname is defined and freeipa_server_hostname == "" ) - -- name: Validate a domain for the cloud was given - fail: msg="overcloud_cloud_domain is not passed and or blank" - when: overcloud_cloud_domain is not defined or ( overcloud_cloud_domain is defined and overcloud_cloud_domain == "" ) - -- name: Validate a undercloud hostname was given - fail: msg="undercloud_undercloud_hostname is not passed and or blank" - when: undercloud_undercloud_hostname is not defined or ( undercloud_undercloud_hostname is defined and undercloud_undercloud_hostname == "" ) - -- name: Install tripleo-ipa preparation script - template: - src: ipa_prep.sh.j2 - dest: "{{ working_dir }}/ipa_prep.sh" - mode: 0755 - -- name: Run the tripleo-ipa preparation script - shell: > - set -o pipefail && - {{ working_dir }}/ipa_prep.sh 2>&1 {{ timestamper_cmd }} > - {{ working_dir }}/ipa_prep.sh.log - changed_when: true - -- name: Copy the otp key to the undercloud - copy: - src: "{{ freeipa_otp_key }}" - dest: "{{ freeipa_otp_key }}" - -- name: Register OTP output - command: cat {{ freeipa_otp_key }} - register: ipa_otp_register - changed_when: false - -- name: Set OTP Fact for undercloud enrollment - set_fact: - undercloud_ipa_otp: "{{ ipa_otp_register.stdout }}" - when: ipa_otp_register.rc == 0 diff --git a/roles/undercloud-deploy/tasks/main.yml b/roles/undercloud-deploy/tasks/main.yml deleted file mode 100644 index a4efc74f0..000000000 --- a/roles/undercloud-deploy/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,distribution" - when: ansible_distribution is not defined - -- include: novajoin_prep.yml - when: enable_tls_everywhere|bool and prepare_ipa|bool and undercloud_enable_novajoin|bool - tags: - - undercloud-install - -- include: ipa_prep.yml - when: enable_tls_everywhere|bool and prepare_ipa|bool and not undercloud_enable_novajoin|bool - tags: - - undercloud-install - -# NOTE(aschultz): this creates all the magical config related items, will -# want to extract the script part from configs -- include: create-scripts.yml - tags: - - undercloud-scripts - -- name: Run install via tripleo-operator-ansible - when: - - step_install_undercloud|bool - tags: - - undercloud-install - block: - - name: Run dstat on the undercloud prior to undercloud install - include_role: - name: validate-perf - - - name: Build and push containers into a local registry - when: - - build_container_images|default(false)|bool - include_role: - name: container-build - vars: - container_registry_namespace: "{{ docker_registry_namespace }}" - container_tag: "{{ container_build_id }}" - - - name: Install undercloud - collections: - - tripleo.operator - include_role: - name: tripleo_undercloud_install - vars: - tripleo_undercloud_install_debug: "{{ undercloud_undercloud_debug }}" - -- include: post-install.yml - tags: - - undercloud-post-install diff --git a/roles/undercloud-deploy/tasks/novajoin_prep.yml b/roles/undercloud-deploy/tasks/novajoin_prep.yml deleted file mode 100644 index 330c51b58..000000000 --- a/roles/undercloud-deploy/tasks/novajoin_prep.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- - -- name: Validate FreeIPA Admin password was passed - fail: msg="freeipa_admin_password is not passed and or blank" - when: - - deploy_supplemental_node|bool and not hostvars['supplemental'].freeipa_admin_password|default('') - - not freeipa_admin_password|default('') - -- name: Validate FreeIPA Server hostname was passed - fail: msg="freeipa_server_hostname is not passed and or blank" - when: freeipa_server_hostname is not defined or ( freeipa_server_hostname is defined and freeipa_server_hostname == "" ) - -- name: Validate a domain for the cloud was given - fail: msg="overcloud_cloud_domain is not passed and or blank" - when: overcloud_cloud_domain is not defined or ( overcloud_cloud_domain is defined and overcloud_cloud_domain == "" ) - -- name: Validate a undercloud hostname was given - fail: msg="undercloud_undercloud_hostname is not passed and or blank" - when: undercloud_undercloud_hostname is not defined or ( undercloud_undercloud_hostname is defined and undercloud_undercloud_hostname == "" ) - -- name: Install novajoin package installation script - template: - src: install_novajoin.sh.j2 - dest: "{{ working_dir }}/install_novajoin.sh" - mode: 0755 - -- name: Run the novajoin installation script - shell: > - set -o pipefail && - {{ working_dir }}/install_novajoin.sh 2>&1 {{ timestamper_cmd }} > - {{ working_dir }}/install_novajoin.sh.log - changed_when: true - -- name: Install novajoin preparation script - template: - src: novajoin_prep.sh.j2 - dest: "{{ working_dir }}/novajoin_prep.sh" - mode: 0755 - -- name: Run the novajoin preparation script - shell: > - set -o pipefail && - {{ working_dir }}/novajoin_prep.sh 2>&1 {{ timestamper_cmd }} > - {{ working_dir }}/novajoin_prep.sh.log - changed_when: true - -- name: Register OTP output - command: cat {{ freeipa_otp_key }} - register: ipa_otp_register - changed_when: false - -- name: Set OTP Fact for undercloud enrollment - set_fact: - undercloud_ipa_otp: "{{ ipa_otp_register.stdout }}" - when: ipa_otp_register.rc == 0 diff --git a/roles/undercloud-deploy/tasks/post-install.yml b/roles/undercloud-deploy/tasks/post-install.yml deleted file mode 100644 index 6d0fc6ac1..000000000 --- a/roles/undercloud-deploy/tasks/post-install.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Copy stackrc created at the UC user $HOME to the working dir - tags: - - undercloud-post-install - copy: - src: /home/{{ undercloud_user }}/stackrc - dest: "{{ working_dir }}/stackrc" - owner: "{{ undercloud_user }}" - remote_src: true - mode: 0640 - become: true diff --git a/roles/undercloud-deploy/templates/containers-prepare-parameter-mixed-os.yaml.j2 b/roles/undercloud-deploy/templates/containers-prepare-parameter-mixed-os.yaml.j2 deleted file mode 100644 index 4bcfbcb4e..000000000 --- a/roles/undercloud-deploy/templates/containers-prepare-parameter-mixed-os.yaml.j2 +++ /dev/null @@ -1,225 +0,0 @@ -parameter_defaults: - DockerInsecureRegistryAddress: - - {{ local_docker_registry_host }}:8787 -{% if build_container_images|default(false)|bool %} - - {{ local_registry_ip }}:{{ local_registry_port }} -{% endif %} -{% if job.consumer_job | default(false) | bool %} -{% if registry_distro_lower is defined and registry_distro_lower | default('') | length > 0 %} - - {{ job.registry_ip_address_distro[registry_distro_lower] }}:{{ local_registry_port }} -{% endif %} -{% if registry_distro is defined and registry_distro | default('') | length > 0 %} - - {{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }} -{% else %} - - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }} -{% endif %} -{% else %} - - quay.io -{% endif %} -{% if undercloud_docker_registry_mirror is defined and undercloud_docker_registry_mirror %} - DockerRegistryMirror: {{ undercloud_docker_registry_mirror }} -{% endif %} - ContainerImagePrepare: - - push_destination: "{{ local_docker_registry_host }}:8787" -{% if update_containers|bool - and not use_overcloud_mixed_upgrade|default(false)|bool - and not job.consumer_job | default(false) | bool - and not build_container_images|default(false)|bool %} - modify_role: tripleo-modify-image - modify_append_tag: "{{ update_containers_append_tag }}" - modify_only_with_source: - - kolla - - tripleo - modify_vars: - tasks_from: yum_update.yml - yum_repos_dir_path: /etc/yum.repos.d - yum_cache: /var/tmp/tripleo-container-image-prepare-cache - update_repo: "{{ update_containers_repo }}" - container_build_tool: buildah -{% endif %} - set: - tag: "{{ container_build_id }}" -{% if job.consumer_job | default(false) | bool %} -{% if registry_distro is defined and registry_distro | default('') | length > 0 %} - namespace: "{{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" -{% else %} - namespace: "{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" -{% endif %} -{% else %} - namespace: "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}" -{% endif %} - name_prefix: "{{ docker_prep_prefix }}" - name_suffix: "{{ docker_prep_suffix }}" - rhel_containers: "{{ rhel_containers }}" - ceph_namespace: "{{ docker_ceph_namespace }}" - ceph_image: "{{ docker_ceph_image }}" - ceph_tag: "{{ docker_ceph_tag }}" -{% if custom_ceph_alertmanager_image is defined %} - ceph_alertmanager_image: "{{ custom_ceph_alertmanager_image }}" -{% endif %} -{% if custom_ceph_alertmanager_namespace is defined %} - ceph_alertmanager_namespace: "{{ custom_ceph_alertmanager_namespace }}" -{% endif %} -{% if custom_ceph_alertmanager_tag is defined %} - ceph_alertmanager_tag: "{{ custom_ceph_alertmanager_tag }}" -{% endif %} -{% if custom_ceph_grafana_image is defined %} - ceph_grafana_image: "{{ custom_ceph_grafana_image }}" -{% endif %} -{% if custom_ceph_grafana_namespace is defined %} - ceph_grafana_namespace: "{{ custom_ceph_grafana_namespace }}" -{% endif %} -{% if custom_ceph_grafana_tag is defined %} - ceph_grafana_tag: "{{ custom_ceph_grafana_tag }}" -{% endif %} -{% if custom_ceph_node_exporter_image is defined %} - ceph_node_exporter_image: "{{ custom_ceph_node_exporter_image }}" -{% endif %} -{% if custom_ceph_node_exporter_namespace is defined %} - ceph_node_exporter_namespace: "{{ custom_ceph_node_exporter_namespace }}" -{% endif %} -{% if custom_ceph_node_exporter_tag is defined %} - ceph_node_exporter_tag: "{{ custom_ceph_node_exporter_tag }}" -{% endif %} -{% if custom_ceph_prometheus_image is defined %} - ceph_prometheus_image: "{{ custom_ceph_prometheus_image }}" -{% endif %} -{% if custom_ceph_prometheus_namespace is defined %} - ceph_prometheus_namespace: "{{ custom_ceph_prometheus_namespace }}" -{% endif %} -{% if custom_ceph_prometheus_tag is defined %} - ceph_prometheus_tag: "{{ custom_ceph_prometheus_tag }}" -{% endif %} -{% if docker_openshift_namespace is defined %} - openshift_namespace: "{{ docker_openshift_namespace }}" -{% endif %} -{% if docker_openshift_tag is defined %} - openshift_tag: "{{ docker_openshift_tag }}" -{% endif %} -{% if docker_openshift_prefix is defined %} - openshift_prefix: "{{ docker_openshift_prefix }}" -{% endif %} -{% if docker_openshift_cockpit_namespace is defined %} - openshift_cockpit_namespace: "{{ docker_openshift_cockpit_namespace }}" -{% endif %} -{% if docker_openshift_cockpit_image is defined %} - openshift_cockpit_image: "{{ docker_openshift_cockpit_image }}" -{% endif %} -{% if docker_openshift_cockpit_tag is defined %} - openshift_cockpit_tag: "{{ docker_openshift_cockpit_tag }}" -{% endif %} -{% if docker_openshift_etcd_namespace is defined %} - openshift_etcd_namespace: "{{ docker_openshift_etcd_namespace }}" -{% endif %} -{% if docker_openshift_etcd_image is defined %} - openshift_etcd_image: "{{ docker_openshift_etcd_image }}" -{% endif %} -{% if docker_openshift_etcd_tag is defined %} - openshift_etcd_tag: "{{ docker_openshift_etcd_tag }}" -{% endif %} -{% if docker_openshift_gluster_namespace is defined %} - openshift_gluster_namespace: "{{ docker_openshift_gluster_namespace }}" -{% endif %} -{% if docker_openshift_gluster_image is defined %} - openshift_gluster_image: "{{ docker_openshift_gluster_image }}" -{% endif %} -{% if docker_openshift_gluster_block_image is defined %} - openshift_gluster_block_image: "{{ docker_openshift_gluster_block_image }}" -{% endif %} -{% if docker_openshift_gluster_tag is defined %} - openshift_gluster_tag: "{{ docker_openshift_gluster_tag }}" -{% endif %} -{% if docker_openshift_heketi_namespace is defined %} - openshift_heketi_namespace: "{{ docker_openshift_heketi_namespace }}" -{% endif %} -{% if docker_openshift_heketi_image is defined %} - openshift_heketi_image: "{{ docker_openshift_heketi_image }}" -{% endif %} -{% if docker_openshift_heketi_tag is defined %} - openshift_heketi_tag: "{{ docker_openshift_heketi_tag }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_namespace is defined %} - openshift_cluster_monitoring_namespace: "{{ docker_openshift_cluster_monitoring_namespace }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_image is defined %} - openshift_cluster_monitoring_image: "{{ docker_openshift_cluster_monitoring_image }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_tag is defined %} - openshift_cluster_monitoring_tag: "{{ docker_openshift_cluster_monitoring_tag }}" -{% endif %} -{% if docker_openshift_configmap_reload_namespace is defined %} - openshift_configmap_reload_namespace: "{{ docker_openshift_configmap_reload_namespace }}" -{% endif %} -{% if docker_openshift_configmap_reload_image is defined %} - openshift_configmap_reload_image: "{{ docker_openshift_configmap_reload_image }}" -{% endif %} -{% if docker_openshift_configmap_reload_tag is defined %} - openshift_configmap_reload_tag: "{{ docker_openshift_configmap_reload_tag }}" -{% endif %} -{% if docker_openshift_prometheus_operator_namespace is defined %} - openshift_prometheus_operator_namespace: "{{ docker_openshift_prometheus_operator_namespace }}" -{% endif %} -{% if docker_openshift_prometheus_operator_image is defined %} - openshift_prometheus_operator_image: "{{ docker_openshift_prometheus_operator_image }}" -{% endif %} -{% if docker_openshift_prometheus_operator_tag is defined %} - openshift_prometheus_operator_tag: "{{ docker_openshift_prometheus_operator_tag }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_namespace is defined %} - openshift_prometheus_config_reload_namespace: "{{ docker_openshift_prometheus_config_reload_namespace }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_image is defined %} - openshift_prometheus_config_reload_image: "{{ docker_openshift_prometheus_config_reload_image }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_tag is defined %} - openshift_prometheus_config_reload_tag: "{{ docker_openshift_prometheus_config_reload_tag }}" -{% endif %} -{% if docker_openshift_prometheus_tag is defined %} - openshift_prometheus_tag: "{{ docker_openshift_prometheus_tag }}" -{% endif %} -{% if docker_openshift_prometheus_alertmanager_tag is defined %} - openshift_prometheus_alertmanager_tag: "{{ docker_openshift_prometheus_alertmanager_tag }}" -{% endif %} -{% if docker_openshift_prometheus_node_exporter_tag is defined %} - openshift_prometheus_node_exporter_tag: "{{ docker_openshift_prometheus_node_exporter_tag }}" -{% endif %} -{% if docker_openshift_oauth_proxy_tag is defined %} - openshift_oauth_proxy_tag: "{{ docker_openshift_oauth_proxy_tag }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_namespace is defined %} - openshift_kube_rbac_proxy_namespace: "{{ docker_openshift_kube_rbac_proxy_namespace }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_image is defined %} - openshift_kube_rbac_proxy_image: "{{ docker_openshift_kube_rbac_proxy_image }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_tag is defined %} - openshift_kube_rbac_proxy_tag: "{{ docker_openshift_kube_rbac_proxy_tag }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_namespace is defined %} - openshift_kube_state_metrics_namespace: "{{ docker_openshift_kube_state_metrics_namespace }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_image is defined %} - openshift_kube_state_metrics_image: "{{ docker_openshift_kube_state_metrics_image }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_tag is defined %} - openshift_kube_state_metrics_tag: "{{ docker_openshift_kube_state_metrics_tag }}" -{% endif %} -{% if docker_openshift_grafana_namespace is defined %} - openshift_grafana_namespace: "{{ docker_openshift_grafana_namespace }}" -{% endif %} -{% if docker_openshift_grafana_tag is defined %} - openshift_grafana_tag: "{{ docker_openshift_grafana_tag }}" -{% endif %} - ComputeContainerImagePrepare: - - push_destination: "{{ local_docker_registry_host }}:8787" - set: - tag: "{{ mixed_os_dlrn_hash_8 }}" -{% if job.consumer_job | default(false) | bool %} - namespace: "{{ mixed_os_registry_host_8 }}:{{ local_registry_port }}/{{ mixed_os_docker_registry_namespace_8 }}" -{% else %} - namespace: "{{ mixed_os_registry_host_8 }}/{{ mixed_os_docker_registry_namespace_8 }}" -{% endif %} - name_prefix: "{{ docker_prep_prefix }}" - name_suffix: "{{ docker_prep_suffix }}" - rhel_containers: "{{ rhel_containers }}" - ceph_images: false diff --git a/roles/undercloud-deploy/templates/containers-prepare-parameter.yaml.j2 b/roles/undercloud-deploy/templates/containers-prepare-parameter.yaml.j2 deleted file mode 100644 index c6936234a..000000000 --- a/roles/undercloud-deploy/templates/containers-prepare-parameter.yaml.j2 +++ /dev/null @@ -1,209 +0,0 @@ -parameter_defaults: - DockerInsecureRegistryAddress: - - {{ local_docker_registry_host }}:8787 -{% if build_container_images|default(false)|bool %} - - {{ local_registry_ip }}:{{ local_registry_port }} -{% endif %} -{% if job.consumer_job | default(false) | bool %} -{% if registry_distro is defined and registry_distro | default('') | length > 0 %} - - {{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }} -{% else %} - - {{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }} -{% endif %} -{% else %} - - quay.io -{% endif %} -{% if undercloud_docker_registry_mirror is defined and undercloud_docker_registry_mirror %} - DockerRegistryMirror: {{ undercloud_docker_registry_mirror }} -{% endif %} - ContainerImagePrepare: - - push_destination: "{{ local_docker_registry_host }}:8787" -{% if update_containers|bool - and not use_overcloud_mixed_upgrade|default(false)|bool - and not job.consumer_job | default(false) | bool - and not build_container_images|default(false)|bool %} - modify_role: tripleo-modify-image - modify_append_tag: "{{ update_containers_append_tag }}" - modify_only_with_source: - - kolla - - tripleo - modify_vars: - tasks_from: yum_update.yml - yum_repos_dir_path: /etc/yum.repos.d - yum_cache: /var/tmp/tripleo-container-image-prepare-cache - update_repo: "{{ update_containers_repo }}" - container_build_tool: buildah -{% endif %} - set: - tag: "{{ container_build_id }}" -{% if job.consumer_job | default(false) | bool %} -{% if registry_distro is defined and registry_distro | default('') | length > 0 %} - namespace: "{{ job.registry_ip_address_distro[registry_distro] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" -{% else %} - namespace: "{{ job.registry_ip_address_branch[release] }}:{{ local_registry_port }}/{{ docker_registry_namespace_used }}" -{% endif %} -{% else %} - namespace: "{{ docker_registry_host }}/{{ docker_registry_namespace_used }}" -{% endif %} - name_prefix: "{{ docker_prep_prefix }}" - name_suffix: "{{ docker_prep_suffix }}" - rhel_containers: "{{ rhel_containers }}" - ceph_namespace: "{{ docker_ceph_namespace }}" - ceph_image: "{{ docker_ceph_image }}" - ceph_tag: "{{ docker_ceph_tag }}" -{% if custom_ceph_alertmanager_image is defined %} - ceph_alertmanager_image: "{{ custom_ceph_alertmanager_image }}" -{% endif %} -{% if custom_ceph_alertmanager_namespace is defined %} - ceph_alertmanager_namespace: "{{ custom_ceph_alertmanager_namespace }}" -{% endif %} -{% if custom_ceph_alertmanager_tag is defined %} - ceph_alertmanager_tag: "{{ custom_ceph_alertmanager_tag }}" -{% endif %} -{% if custom_ceph_grafana_image is defined %} - ceph_grafana_image: "{{ custom_ceph_grafana_image }}" -{% endif %} -{% if custom_ceph_grafana_namespace is defined %} - ceph_grafana_namespace: "{{ custom_ceph_grafana_namespace }}" -{% endif %} -{% if custom_ceph_grafana_tag is defined %} - ceph_grafana_tag: "{{ custom_ceph_grafana_tag }}" -{% endif %} -{% if custom_ceph_node_exporter_image is defined %} - ceph_node_exporter_image: "{{ custom_ceph_node_exporter_image }}" -{% endif %} -{% if custom_ceph_node_exporter_namespace is defined %} - ceph_node_exporter_namespace: "{{ custom_ceph_node_exporter_namespace }}" -{% endif %} -{% if custom_ceph_node_exporter_tag is defined %} - ceph_node_exporter_tag: "{{ custom_ceph_node_exporter_tag }}" -{% endif %} -{% if custom_ceph_prometheus_image is defined %} - ceph_prometheus_image: "{{ custom_ceph_prometheus_image }}" -{% endif %} -{% if custom_ceph_prometheus_namespace is defined %} - ceph_prometheus_namespace: "{{ custom_ceph_prometheus_namespace }}" -{% endif %} -{% if custom_ceph_prometheus_tag is defined %} - ceph_prometheus_tag: "{{ custom_ceph_prometheus_tag }}" -{% endif %} -{% if docker_openshift_namespace is defined %} - openshift_namespace: "{{ docker_openshift_namespace }}" -{% endif %} -{% if docker_openshift_tag is defined %} - openshift_tag: "{{ docker_openshift_tag }}" -{% endif %} -{% if docker_openshift_prefix is defined %} - openshift_prefix: "{{ docker_openshift_prefix }}" -{% endif %} -{% if docker_openshift_cockpit_namespace is defined %} - openshift_cockpit_namespace: "{{ docker_openshift_cockpit_namespace }}" -{% endif %} -{% if docker_openshift_cockpit_image is defined %} - openshift_cockpit_image: "{{ docker_openshift_cockpit_image }}" -{% endif %} -{% if docker_openshift_cockpit_tag is defined %} - openshift_cockpit_tag: "{{ docker_openshift_cockpit_tag }}" -{% endif %} -{% if docker_openshift_etcd_namespace is defined %} - openshift_etcd_namespace: "{{ docker_openshift_etcd_namespace }}" -{% endif %} -{% if docker_openshift_etcd_image is defined %} - openshift_etcd_image: "{{ docker_openshift_etcd_image }}" -{% endif %} -{% if docker_openshift_etcd_tag is defined %} - openshift_etcd_tag: "{{ docker_openshift_etcd_tag }}" -{% endif %} -{% if docker_openshift_gluster_namespace is defined %} - openshift_gluster_namespace: "{{ docker_openshift_gluster_namespace }}" -{% endif %} -{% if docker_openshift_gluster_image is defined %} - openshift_gluster_image: "{{ docker_openshift_gluster_image }}" -{% endif %} -{% if docker_openshift_gluster_block_image is defined %} - openshift_gluster_block_image: "{{ docker_openshift_gluster_block_image }}" -{% endif %} -{% if docker_openshift_gluster_tag is defined %} - openshift_gluster_tag: "{{ docker_openshift_gluster_tag }}" -{% endif %} -{% if docker_openshift_heketi_namespace is defined %} - openshift_heketi_namespace: "{{ docker_openshift_heketi_namespace }}" -{% endif %} -{% if docker_openshift_heketi_image is defined %} - openshift_heketi_image: "{{ docker_openshift_heketi_image }}" -{% endif %} -{% if docker_openshift_heketi_tag is defined %} - openshift_heketi_tag: "{{ docker_openshift_heketi_tag }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_namespace is defined %} - openshift_cluster_monitoring_namespace: "{{ docker_openshift_cluster_monitoring_namespace }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_image is defined %} - openshift_cluster_monitoring_image: "{{ docker_openshift_cluster_monitoring_image }}" -{% endif %} -{% if docker_openshift_cluster_monitoring_tag is defined %} - openshift_cluster_monitoring_tag: "{{ docker_openshift_cluster_monitoring_tag }}" -{% endif %} -{% if docker_openshift_configmap_reload_namespace is defined %} - openshift_configmap_reload_namespace: "{{ docker_openshift_configmap_reload_namespace }}" -{% endif %} -{% if docker_openshift_configmap_reload_image is defined %} - openshift_configmap_reload_image: "{{ docker_openshift_configmap_reload_image }}" -{% endif %} -{% if docker_openshift_configmap_reload_tag is defined %} - openshift_configmap_reload_tag: "{{ docker_openshift_configmap_reload_tag }}" -{% endif %} -{% if docker_openshift_prometheus_operator_namespace is defined %} - openshift_prometheus_operator_namespace: "{{ docker_openshift_prometheus_operator_namespace }}" -{% endif %} -{% if docker_openshift_prometheus_operator_image is defined %} - openshift_prometheus_operator_image: "{{ docker_openshift_prometheus_operator_image }}" -{% endif %} -{% if docker_openshift_prometheus_operator_tag is defined %} - openshift_prometheus_operator_tag: "{{ docker_openshift_prometheus_operator_tag }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_namespace is defined %} - openshift_prometheus_config_reload_namespace: "{{ docker_openshift_prometheus_config_reload_namespace }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_image is defined %} - openshift_prometheus_config_reload_image: "{{ docker_openshift_prometheus_config_reload_image }}" -{% endif %} -{% if docker_openshift_prometheus_config_reload_tag is defined %} - openshift_prometheus_config_reload_tag: "{{ docker_openshift_prometheus_config_reload_tag }}" -{% endif %} -{% if docker_openshift_prometheus_tag is defined %} - openshift_prometheus_tag: "{{ docker_openshift_prometheus_tag }}" -{% endif %} -{% if docker_openshift_prometheus_alertmanager_tag is defined %} - openshift_prometheus_alertmanager_tag: "{{ docker_openshift_prometheus_alertmanager_tag }}" -{% endif %} -{% if docker_openshift_prometheus_node_exporter_tag is defined %} - openshift_prometheus_node_exporter_tag: "{{ docker_openshift_prometheus_node_exporter_tag }}" -{% endif %} -{% if docker_openshift_oauth_proxy_tag is defined %} - openshift_oauth_proxy_tag: "{{ docker_openshift_oauth_proxy_tag }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_namespace is defined %} - openshift_kube_rbac_proxy_namespace: "{{ docker_openshift_kube_rbac_proxy_namespace }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_image is defined %} - openshift_kube_rbac_proxy_image: "{{ docker_openshift_kube_rbac_proxy_image }}" -{% endif %} -{% if docker_openshift_kube_rbac_proxy_tag is defined %} - openshift_kube_rbac_proxy_tag: "{{ docker_openshift_kube_rbac_proxy_tag }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_namespace is defined %} - openshift_kube_state_metrics_namespace: "{{ docker_openshift_kube_state_metrics_namespace }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_image is defined %} - openshift_kube_state_metrics_image: "{{ docker_openshift_kube_state_metrics_image }}" -{% endif %} -{% if docker_openshift_kube_state_metrics_tag is defined %} - openshift_kube_state_metrics_tag: "{{ docker_openshift_kube_state_metrics_tag }}" -{% endif %} -{% if docker_openshift_grafana_namespace is defined %} - openshift_grafana_namespace: "{{ docker_openshift_grafana_namespace }}" -{% endif %} -{% if docker_openshift_grafana_tag is defined %} - openshift_grafana_tag: "{{ docker_openshift_grafana_tag }}" -{% endif %} diff --git a/roles/undercloud-deploy/templates/hieradata-overrides-t-h-t-undercloud.yaml.j2 b/roles/undercloud-deploy/templates/hieradata-overrides-t-h-t-undercloud.yaml.j2 deleted file mode 100644 index 7a73d9c47..000000000 --- a/roles/undercloud-deploy/templates/hieradata-overrides-t-h-t-undercloud.yaml.j2 +++ /dev/null @@ -1,96 +0,0 @@ -parameter_defaults: - UndercloudExtraConfig: - ironic::disk_utils::image_convert_memory_limit: 2048 - ironic::conductor::heartbeat_interval: 20 - ironic::conductor::heartbeat_timeout: 120 - - # Ironic defaults to using `qemu:///system`. When running libvirtd - # unprivileged we need to use `qemu:///session`. This allows us to pass - # the value of libvirt_uri into /etc/ironic/ironic.conf. - ironic::drivers::ssh::libvirt_uri: '{{libvirt_uri}}' - - # The following are configurations for the different workers for the undercloud - # services. - {% if undercloud_workers is defined -%} - undercloud_workers: {{undercloud_workers}} - {%- endif %} - - {% if undercloud_glance_workers is defined -%} - glance::api::workers: {{undercloud_glance_workers}} - glance::registry::workers: {{undercloud_glance_workers}} - {% elif undercloud_workers is defined -%} - glance::api::workers: "%{hiera('undercloud_workers')}" - glance::registry::workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_heat_workers is defined -%} - heat::api::workers: {{undercloud_heat_workers}} - heat::api_cfn::workers: {{undercloud_heat_workers}} - heat::engine::num_engine_workers: {{undercloud_heat_workers}} - {% elif undercloud_workers is defined -%} - heat::api::workers: "%{hiera('undercloud_workers')}" - heat::api_cfn::workers: "%{hiera('undercloud_workers')}" - heat::engine::num_engine_workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_ironic_workers is defined -%} - ironic::api::workers: {{undercloud_ironic_workers}} - ironic::wsgi::apache::workers: {{undercloud_ironic_workers}} - {% elif undercloud_workers is defined -%} - ironic::api::workers: "%{hiera('undercloud_workers')}" - ironic::wsgi::apache::workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_keystone_workers is defined -%} - keystone::wsgi::apache::workers: {{undercloud_keystone_workers}} - {% elif undercloud_workers is defined -%} - keystone::wsgi::apache::workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_neutron_workers is defined -%} - neutron::agents::metadata::metadata_workers: {{undercloud_neutron_workers}} - neutron::server::api_workers: {{undercloud_neutron_workers}} - {% elif undercloud_workers is defined -%} - neutron::agents::metadata::metadata_workers: "%{hiera('undercloud_workers')}" - neutron::server::api_workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_nova_workers is defined -%} - nova::api::metadata_workers: {{undercloud_nova_workers}} - nova::api::osapi_compute_workers: {{undercloud_nova_workers}} - nova::conductor::workers: {{undercloud_nova_workers}} - nova::scheduler::workers: {{undercloud_nova_workers}} - {% elif undercloud_workers is defined -%} - nova::api::metadata_workers: "%{hiera('undercloud_workers')}" - nova::api::osapi_compute_workers: "%{hiera('undercloud_workers')}" - nova::conductor::workers: "%{hiera('undercloud_workers')}" - nova::scheduler::workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_nova_max_concurrent_builds is defined -%} - nova::compute::ironic::max_concurrent_builds: {{undercloud_nova_max_concurrent_builds}} - {%- endif %} - - {% if undercloud_nova_rpc_response_timeout is defined -%} - nova::rpc_response_timeout: {{undercloud_nova_rpc_response_timeout}} - {%- endif %} - - {% if undercloud_ironic_rpc_response_timeout is defined -%} - ironic::rpc_response_timeout: {{undercloud_ironic_rpc_response_timeout}} - {%- endif %} - - {% if undercloud_ironic_power_state_change_timeout is defined -%} - ironic::conductor::power_state_change_timeout: {{undercloud_ironic_power_state_change_timeout}} - {%- endif %} - - - {% if undercloud_swift_workers is defined -%} - swift::proxy::workers: {{undercloud_swift_workers}} - {% elif undercloud_workers is defined -%} - swift::proxy::workers: "%{hiera('undercloud_workers')}" - {%- endif %} - - {% if undercloud_heat_convergence is defined -%} - # The following is configuration for heat convergence feature: - heat::engine::convergence_engine: {{undercloud_heat_convergence}} - {%- endif %} diff --git a/roles/undercloud-deploy/templates/install_novajoin.sh.j2 b/roles/undercloud-deploy/templates/install_novajoin.sh.j2 deleted file mode 100644 index 71eb5b220..000000000 --- a/roles/undercloud-deploy/templates/install_novajoin.sh.j2 +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -### --start_docs - -## Install the required packages for novajoin/TLS-everywhere -## ========================================================= - -## * Install python-novajoin -## :: -{% if ansible_python['version']['major'] is version("3", "==") -%} -NOVAJOIN_PACKAGE=python3-novajoin -{% else %} -NOVAJOIN_PACKAGE=python-novajoin -{% endif %} - -sudo {{ ansible_pkg_mgr }} install -y $NOVAJOIN_PACKAGE - -### --stop_docs diff --git a/roles/undercloud-deploy/templates/ipa_prep.sh.j2 b/roles/undercloud-deploy/templates/ipa_prep.sh.j2 deleted file mode 100644 index 6b7f2d32b..000000000 --- a/roles/undercloud-deploy/templates/ipa_prep.sh.j2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -set -eux - -### --start_docs - -## Set up the necessary permissions/privileges in novajoin -## ======================================================= - - -## * Ensure that the undercloud is using the FreeIPA server -## as its DNS server -## * Make sure that the undercloud_undercloud_hostname resolves -## (undercloud.openstacklocal is originally set in prepare-slave.yml) -## * Set the hostname to undercloud_undercloud_hostname -## * Make sure the /etc/novajoin directory is created, so that the keytab can -## be saved there (ipa-getkeytab doesn't create that directory) - -## .. Note:: You may not use sudo and use output redirection '>':: - -sudo /bin/su -c "echo -e 'search {{ overcloud_cloud_domain }}\nnameserver {{ undercloud_undercloud_nameservers[-1] }}' > /etc/resolv.conf" -sudo sed -i "s/undercloud.openstacklocal/{{ undercloud_undercloud_hostname }} undercloud.openstacklocal/" /etc/hosts -sudo hostnamectl set-hostname {{ undercloud_undercloud_hostname }} - -sudo install -d -m 755 --context=system_u:object_r:etc_t:s0 /etc/novajoin -### --stop_docs diff --git a/roles/undercloud-deploy/templates/novajoin_prep.sh.j2 b/roles/undercloud-deploy/templates/novajoin_prep.sh.j2 deleted file mode 100644 index acc1f169e..000000000 --- a/roles/undercloud-deploy/templates/novajoin_prep.sh.j2 +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash -set -eux - -### --start_docs - -## Set up the necessary permissions/privileges in novajoin -## ======================================================= - - -## * Ensure that the undercloud is using the FreeIPA server -## as its DNS server - -## .. Note:: You may not use sudo and use output redirection '>':: - -sudo /bin/su -c "echo 'nameserver {{ undercloud_undercloud_nameservers[-1] }}' > /etc/resolv.conf" - -## * Set up FreeIPA permissions and privileges and get the OTP. -## :: - -sudo /usr/libexec/novajoin-ipa-setup \ - --principal admin \ -{% if deploy_supplemental_node|bool %} - --password {{ hostvars['supplemental'].freeipa_admin_password }} \ -{% else %} - --password {{ freeipa_admin_password }} \ -{% endif %} - --server {{ freeipa_server_hostname }} \ - --realm $(echo {{ overcloud_cloud_domain }} | awk '{print toupper($0)}') \ - --domain {{ overcloud_cloud_domain }} \ - --hostname {{ undercloud_undercloud_hostname }} \ - --otp-file {{ freeipa_otp_key }} \ - --precreate - -### --stop_docs diff --git a/roles/undercloud-deploy/templates/undercloud-parameter-defaults.yaml.j2 b/roles/undercloud-deploy/templates/undercloud-parameter-defaults.yaml.j2 deleted file mode 100644 index f64ec2efd..000000000 --- a/roles/undercloud-deploy/templates/undercloud-parameter-defaults.yaml.j2 +++ /dev/null @@ -1,31 +0,0 @@ -{# -This takes advantage of the fact that valid JSON is also -valid YAML. The default to_nice_yaml filter doesn't quote strings, -which can cause unexpected implicit type conversion when the -resulting YAML is consumed, whereas with JSON all strings are quoted. -#} -{% set undercloud_parameter_defaults = {} %} -{% set _ = undercloud_parameter_defaults.update({'parameter_defaults': {}}) %} -{% set _ = undercloud_parameter_defaults.update({'resource_registry': {}}) %} -{% if undercloud_parameter_defaults_args is defined and undercloud_parameter_defaults_args %} -{% set _ = undercloud_parameter_defaults['parameter_defaults'].update(undercloud_parameter_defaults_args if undercloud_parameter_defaults_args is mapping else undercloud_parameter_defaults_args | from_yaml) %} -{% endif %} -{% if undercloud_network_environment_args is defined and undercloud_network_environment_args %} -{% set _ = undercloud_parameter_defaults['parameter_defaults'].update(undercloud_network_environment_args) %} -{% endif %} -{% if undercloud_resource_registry_args is defined and undercloud_resource_registry_args %} -{% set _ = undercloud_parameter_defaults['resource_registry'].update(undercloud_resource_registry_args) %} -{% endif %} -{% if ctlplane_masquerade|default(false) %} -{% if overcloud_ipv6|bool %} -{% set masquerade_nets = {undercloud_network_cidr: [undercloud_network_cidr], undercloud_external_network_cidr_ipv4: [undercloud_external_network_cidr_ipv4]} %} -{% else %} -{% set masquerade_nets = {undercloud_network_cidr: [undercloud_network_cidr], undercloud_external_network_cidr: [undercloud_external_network_cidr]} %} -{% endif %} -{% set _ = undercloud_parameter_defaults['parameter_defaults'].update({'MasqueradeNetworks': masquerade_nets }) %} -{% endif %} -{# TODO(cjeanner) remove this block once nftables is default #} -{% if undercloud_firewall_engine is defined %} -{% set _ = undercloud_parameter_defaults['parameter_defaults'].update({'FirewallEngine': undercloud_firewall_engine}) %} -{% endif %} -{{ undercloud_parameter_defaults | to_nice_json }} diff --git a/roles/undercloud-deploy/templates/undercloud.conf.j2 b/roles/undercloud-deploy/templates/undercloud.conf.j2 deleted file mode 100644 index ff5e358fc..000000000 --- a/roles/undercloud-deploy/templates/undercloud.conf.j2 +++ /dev/null @@ -1,415 +0,0 @@ -[DEFAULT] - -# -# From instack-undercloud -# - -# Local file path to the necessary images. The path should be a -# directory readable by the current user that contains the full set of -# images. (string value) -{% if undercloud_image_path is defined %} -image_path = {{undercloud_image_path}} -{% else %} -#image_path = . -{% endif %} - -# Fully qualified hostname (including domain) to set on the -# Undercloud. If left unset, the current hostname will be used, but -# the user is responsible for configuring all system hostname settings -# appropriately. If set, the undercloud install will configure all -# system hostname settings. (string value) -{% if undercloud_undercloud_hostname is defined %} -undercloud_hostname = {{undercloud_undercloud_hostname}} -{% else %} -#undercloud_hostname = -{% endif %} - -# IP information for the interface on the Undercloud that will be -# handling the PXE boots and DHCP for Overcloud instances. The IP -# portion of the value will be assigned to the network interface -# defined by local_interface, with the netmask defined by the prefix -# portion of the value. (string value) -local_ip = {{undercloud_local_ip|default( - '%s/%s' % (undercloud_network_cidr|nthhost(1), - undercloud_network_cidr.split('/').1))}} - -# MTU, set neutron on the undercloud to match mtu of the nics -# (string value) -{% if undercloud_local_mtu is defined %} -local_mtu = {{ undercloud_local_mtu }} -{% endif %} - -# Virtual IP or DNS address to use for the public endpoints of -# Undercloud services. Only used with SSL. (string value) -# Deprecated group/name - [DEFAULT]/undercloud_public_vip -#undercloud_public_host = 192.168.24.2 -undercloud_public_host = {{undercloud_undercloud_public_host|default( - undercloud_network_cidr|nthhost(2))}} - -# Virtual IP or DNS address to use for the admin endpoints of -# Undercloud services. Only used with SSL. (string value) -# Deprecated group/name - [DEFAULT]/undercloud_admin_vip -#undercloud_admin_host = 192.168.24.3 -undercloud_admin_host = {{undercloud_undercloud_admin_host|default( - undercloud_network_cidr|nthhost(3))}} - -# Nameserver for the Undercloud node. -# (string value) -{% if virthost_nameservers is string %} -undercloud_nameservers = {{ virthost_nameservers }} -{% elif virthost_nameservers is sequence and virthost_nameservers|length > 0 %} -undercloud_nameservers = {{ virthost_nameservers|join(',') }} -{% elif undercloud_undercloud_nameservers is string %} -undercloud_nameservers = {{ undercloud_undercloud_nameservers }} -{% elif undercloud_undercloud_nameservers is sequence %} -undercloud_nameservers = {{ undercloud_undercloud_nameservers|join(',') }} -{% else %} -# undercloud_nameservers = -{% endif %} - -# List of ntp servers to use. (list value) -{% if undercloud_undercloud_ntp_servers is string %} -undercloud_ntp_servers = {{ undercloud_undercloud_ntp_servers }} -{% elif undercloud_undercloud_ntp_servers is sequence %} -undercloud_ntp_servers = {{ undercloud_undercloud_ntp_servers|join(',') }} -{% else %} -#undercloud_ntp_servers = -{% endif %} - -# Timezone for the Undercloud node. (string value) -{% if undercloud_undercloud_timezone is string %} -undercloud_timezone = {{ undercloud_undercloud_timezone }} -{% else %} -# undercloud_timezone = -{% endif %} - -# DNS domain name to use when deploying the overcloud. The overcloud -# parameter "CloudDomain" must be set to a matching value. (string -# value) -#overcloud_domain_name = localdomain -{% if overcloud_cloud_domain is defined %} -overcloud_domain_name = {{overcloud_cloud_domain}} -{% endif %} - -# Certificate file to use for OpenStack service SSL connections. -# Setting this enables SSL for the OpenStack API endpoints, leaving it -# unset disables SSL. (string value) -#undercloud_service_certificate = - -# When set to True, an SSL certificate will be generated as part of -# the undercloud install and this certificate will be used in place of -# the value for undercloud_service_certificate. The resulting -# certificate will be written to -# /etc/pki/tls/certs/undercloud-[undercloud_public_vip].pem. This -# certificate is signed by CA selected by the -# "certificate_generation_ca" option. (boolean value) -#generate_service_certificate = true -{% if undercloud_generate_service_certificate is defined %} -generate_service_certificate = {{undercloud_generate_service_certificate}} -{% endif %} - -# The certmonger nickname of the CA from which the certificate will be -# requested. This is used only if the generate_service_certificate -# option is set. Note that if the "local" CA is selected the -# certmonger's local CA certificate will be extracted to /etc/pki/ca- -# trust/source/anchors/cm-local-ca.pem and subsequently added to the -# trust chain. (string value) -#certificate_generation_ca = local -{% if undercloud_certificate_generation_ca is defined %} -certificate_generation_ca = {{undercloud_certificate_generation_ca}} -{% endif %} - -# Network interface on the Undercloud that will be handling the PXE -# boots and DHCP for Overcloud instances. (string value) -{% if undercloud_local_interface is defined %} -local_interface = {{undercloud_local_interface}} -{% else %} -#local_interface = eth1 -{% endif %} - -# Path to hieradata override file. If set, the file will be copied -# under /etc/puppet/hieradata and set as the first file in the hiera -# hierarchy. This can be used to to custom configure services beyond -# what undercloud.conf provides (string value) -hieradata_override = {{ undercloud_hieradata_override }} - -# Network interface on which inspection dnsmasq will listen. If in -# doubt, use the default value. (string value) -# Deprecated group/name - [DEFAULT]/discovery_interface -{% if undercloud_inspection_interface is defined %} -inspection_interface = {{undercloud_inspection_interface}} -{% else %} -#inspection_interface = br-ctlplane -{% endif %} - -# Whether to enable extra hardware collection during the inspection -# process. -{% if undercloud_inspection_extras is defined %} -inspection_extras = {{undercloud_inspection_extras}} -{% endif %} - -# Whether to run benchmarks when inspecting nodes. (boolean value) -# Deprecated group/name - [DEFAULT]/discovery_runbench -{% if undercloud_inspection_runbench is defined %} -inspection_runbench = {{undercloud_inspection_runbench}} -{% else %} -#inspection_runbench = false -{% endif %} - -# Whether to enable the debug log level for Undercloud OpenStack -# services. (boolean value) -undercloud_debug = {{undercloud_undercloud_debug}} - -# Container CLI used for deployment; -# Can be docker or podman. (string value) -container_cli = {{undercloud_container_cli}} - -# Enable or disable SELinux during the deployment. (boolean value) -{% if undercloud_selinux_enabled is defined %} -undercloud_enable_selinux = {{undercloud_selinux_enabled}} -{% else %} -# undercloud_enable_selinux = true -{% endif %} - -# Enable or disable Paunch to manage containers. (boolean value) -{% if undercloud_enable_paunch is defined %} -undercloud_enable_paunch = {{undercloud_enable_paunch}} -{% else %} -# undercloud_enable_paunch = true -{% endif %} - -# Whether to install Tempest in the Undercloud. (boolean value) -enable_tempest = {{undercloud_enable_tempest}} - -# Whether to install Telemetry services (ceilometer, aodh) in the -# Undercloud. (boolean value) -enable_telemetry = {{undercloud_enable_telemetry}} - -# Whether to install requirements to run the TripleO validations. -# (boolean value) -enable_validations = {{undercloud_enable_validations}} - -# Whether to install Mistral in the Undercloud. (boolean value) -enable_mistral = {{undercloud_enable_mistral}} - -# Whether to install Ironic in the Undercloud. (boolean value) -enable_ironic = {{undercloud_enable_ironic}} - -# Whether to install Ironic-inspector in the Undercloud. (boolean value) -enable_ironic_inspector = {{undercloud_enable_ironic_inspector}} - -# Whether to install Zaqar in the Undercloud. (boolean value) -enable_zaqar = {{undercloud_enable_zaqar}} - -# Whether to enable Swift encryption at-rest or not. (boolean value) -enable_swift_encryption = {{undercloud_enable_swift_encryption}} - -# Whether to enable Nova in the Undercloud. (boolean value) -enable_nova = {{ undercloud_enable_nova }} - -# Whether to enable Heat in the Undercloud. (boolean value) -enable_heat = {{ undercloud_enable_heat }} - -# FIXME(mandre) turn this into ansible variable -heat_native=true - -# Whether to use iPXE for deploy by default. (boolean value) -ipxe_deploy = {{undercloud_ipxe_deploy}} - -# Whether to install Monitoring services in the Undercloud. (boolean -# value) -enable_monitoring = {{undercloud_enable_monitoring}} - -# Whether to install novajoin metadata service in the Undercloud. -{% if undercloud_enable_novajoin|bool and enable_tls_everywhere|bool %} -enable_novajoin = true -{% else %} -enable_novajoin = false -{% endif %} - -# One Time Password to register Undercloud node with IPA server. -# Required when enable_novajoin = true. -{% if undercloud_ipa_otp is defined %} -ipa_otp = {{ undercloud_ipa_otp }} -{% else %} -# ipa_otp = -{% endif %} - -# IPv6 address configuration mode for the undercloud provisioning -# network. (string value) -# Possible values: -# dhcpv6-stateless - Address configuration using RA and optional -# information using DHCPv6. -# dhcpv6-stateful - Address configuration and optional information -# using DHCPv6. -{% if undercloud_ipv6_address_mode is defined %} -ipv6_address_mode = {{ undercloud_ipv6_address_mode }} -{% else %} -# ipv6_address_mode = dhcpv6-stateless -{% endif %} - -# Ironic network interface implementation to use by default. (string -# value) -# Possible values: -# flat - Use one flat provider network. -# neutron - Ironic interacts with Neutron to enable other network -# types and advanced networking features. -{% if undercloud_ironic_default_network_interface is defined %} -ironic_default_network_interface = {{ undercloud_ironic_default_network_interface }} -{% else %} -#ironic_default_network_interface = flat -{% endif %} - -# Enabled ironic network interface implementations. Each hardware type -# must have at least one valid implementation enabled. (list value) -{% if undercloud_ironic_enabled_network_interfaces is defined %} -ironic_enabled_network_interfaces = {{ undercloud_ironic_enabled_network_interfaces }} -{% else %} -#ironic_enabled_network_interfaces = flat -{% endif %} - -{% if undercloud_docker_registry_mirror is defined and undercloud_docker_registry_mirror %} -docker_registry_mirror = {{undercloud_docker_registry_mirror}} -{% else %} -# docker_registry_mirror = -{% endif %} - -{% if undercloud_docker_insecure_registries is defined and undercloud_docker_insecure_registries %} -docker_insecure_registries= {{undercloud_docker_insecure_registries}} -{% else %} -#docker_insecure_registries= -{% endif %} - -# additional env files for undercloud, used with containers - -{% if undercloud_container_images_file is defined%} -container_images_file = {{ undercloud_container_images_file }} -{% else %} -container_images_file = {{ working_dir }}/containers-prepare-parameter.yaml -{% endif %} - -{% if build_container_images|default(false)|bool %} -container_insecure_registries = {{ local_registry_ip }}:{{ local_registry_port }} -{% else %} -#container_insecure_registries = -{% endif %} - -{% if undercloud_custom_env_files is defined %} -custom_env_files = {{ undercloud_custom_env_files.split()|join(',') }} -{% else %} -#custom_env_files = -{% endif %} - -{% if undercloud_net_config_override is defined %} -net_config_override = {{ undercloud_net_config_override }} -{% else %} -#net_config_override = -{% endif %} - -# Output directory for state, like downloaded ansible configs and -# processed heat templates for heat installer -{% if undercloud_undercloud_output_dir is defined %} -output_dir = {{undercloud_undercloud_output_dir}} -{% else %} -#output_dir = $HOME/.undercloud-heat-installer -{% endif %} - -# Clean up mode for the temp files for heat installer on exit -{% if undercloud_undercloud_cleanup is defined %} -cleanup = {{undercloud_undercloud_cleanup}} -{% else %} -#cleanup = True -{% endif %} - -# Whether to clean undercloud rpms after an upgrade -# to a containerized undercloud. -{% if undercloud_upgrade_cleanup is defined %} -upgrade_cleanup = {{undercloud_upgrade_cleanup}} -{% else %} -#upgrade_cleanup = False -{% endif %} - -# Heat templates directory -templates = {{ undercloud_templates_path }} - -# Extra config elements. -{% if undercloud_conf_extra != "" %} -{{ undercloud_conf_extra }} -{% endif %} - -# Enable support for routed ctlplane networks -{% if undercloud_enable_routed_networks|default(false)|bool %} -enable_routed_networks = {{undercloud_enable_routed_networks}} -{% endif %} - -{% if undercloud_roles_data is defined %} -roles_file = {{undercloud_roles_data}} -{% endif %} - -# Whether to clean overcloud nodes (wipe the hard drive) between -# deployments and after the introspection. -{% if undercloud_clean_nodes is defined %} -clean_nodes = {{undercloud_clean_nodes}} -{% endif %} - -# List of routed network subnets for provisioning and introspection. -# Comma separated list of names/tags. For each network a section/group -# needs to be added to the configuration file with these parameters -# set: cidr, dhcp_start, dhcp_end, inspection_iprange, gateway and -# masquerade_network. Note: The section/group must be placed before or -# after any other section. (See the example section [ctlplane-subnet] -# in the sample configuration file.) (list value) -subnets = ctlplane-subnet - -# Name of the local subnet, where the PXE boot and DHCP interfaces for -# overcloud instances is located. The IP address of the -# local_ip/local_interface should reside in this subnet. (string -# value) -local_subnet = ctlplane-subnet - -[ctlplane-subnet] - -# Network CIDR for the Neutron-managed subnet for Overcloud instances. -# (string value) -# Deprecated group/name - [DEFAULT]/network_cidr -cidr = {{undercloud_network_cidr}} - -# Start of DHCP allocation range for PXE and DHCP of Overcloud -# instances on this network. (string value) -# Deprecated group/name - [DEFAULT]/dhcp_start -dhcp_start = {{undercloud_dhcp_start|default( - undercloud_network_cidr|nthhost(5))}} - -# End of DHCP allocation range for PXE and DHCP of Overcloud instances -# on this network. (string value) -# Deprecated group/name - [DEFAULT]/dhcp_end -dhcp_end = {{undercloud_dhcp_end|default( - undercloud_network_cidr|nthhost(30))}} - -# DNS nameservers for the Neutron-managed subnet for the Overcloud -# instances on this network. If no nameservers are defined for the -# subnet, the nameservers defined for undercloud_nameservers will be -# used. (list value) -{% if undercloud_ctlplane_dns_nameservers is defined %} -dns_nameservers = {{ undercloud_ctlplane_dns_nameservers }} -{% else %} -#dns_nameservers = -{% endif %} - -# Network gateway for the Neutron-managed network for Overcloud -# instances on this network. (string value) -# Deprecated group/name - [DEFAULT]/network_gateway -gateway = {{undercloud_network_gateway|default( - undercloud_network_cidr|nthhost(1))}} - -# Temporary IP range that will be given to nodes on this network -# during the inspection process. Should not overlap with the range -# defined by dhcp_start and dhcp_end, but should be in the same ip -# subnet. (string value) -# Deprecated group/name - [DEFAULT]/inspection_iprange -inspection_iprange = {{undercloud_inspection_iprange|default( - '%s,%s' % (undercloud_network_cidr|nthhost(100), - undercloud_network_cidr|nthhost(120)))}} - -# The network will be masqueraded for external access. (boolean value) -masquerade={{ ctlplane_masquerade|default(false) }} diff --git a/roles/undercloud-minion-deploy/README.md b/roles/undercloud-minion-deploy/README.md deleted file mode 100644 index 4a5ab8bc0..000000000 --- a/roles/undercloud-minion-deploy/README.md +++ /dev/null @@ -1,90 +0,0 @@ -undercloud-minion-deploy -========================================== - -An Ansible role to execute the deployment of the tripleo undercloud minion - -Requirements ------------- - -This requiest an existing undercloud deployed somewhere and another host -to deploy the minion on. - -Role Variables --------------- - -- `minion_templates_path`: <'/usr/share/openstack-tripleo-heat-templates'> -- -a path to git clone and check-out t-h-t templates from the corresponding repo/branch/ref paths. -- `minion_config_file`: <'minion.conf.j2'> -- the name of the jinja template -used as the base for the minion.conf -- `minion_install_script`: <'minion-install.j2'> -- the name of the jinja template -used as the base for the minion-install bash script and dev envs hacking. Note, the -defaults imply the 'openstack minion install' command will be invoked. See the minion -deployment methods section below for the alternative modes. -- `minion_install_log`: <'{{ working_dir }}/minion_install.log'> -- the full path -to the minion install log file. -- `minion_hieradata_override`: -- the name of a file containing overrides (hieradata or parameter defaults) -- `step_install_minion`: <'true'> -- turn on/off the minion deployment -- `minion_conf_extra`: <''> -- extra options to be added to ~/minion.conf -- `minion_extra_args`: <''> -- extra options for minion deploy command. -- `minion_install_cmd`: <'openstack minion install'> -- command used to install the minion -- `minion_install_cli_options`: <''> -- extra options for minion install command. -- `minion_enable_heat_engine`: <'true'> -- sets up the 'enable_heat_engine' option - in minion.conf. -- `minion_enable_ironic_conductor`: <'false'> -- sets up the 'enable_ironic_conductor' - option in minion.conf. -- `minion_cloud_domain`: The domain configured for use by containerized - minion via the tripleo client's `--local-domain` option. It is unset by default. -- `local_docker_registry_host`: <`docker_registry_host`> -- registry host/port - for containerized minion services. Defaults to the value provided for overcloud. - You may want to diverge it, if building locally, or fetching from remote registries - not fitting the overcloud deployment needs. -- `minion_container_images_file`: <""> -- - The environment file with default parameters for containers to use with - minion install CLI. This should only be used to override image prepare - generating this during the minion install. -- `minion_custom_env_files`: -- - A space-separate string for custom t-h-t env files for `minion.conf` used with heat installer. -- `minion_minion_output_dir`: -- allows customize output directory for state, like - downloaded ansible configs and processed heat templates for heat installer -- `minion_minion_cleanup`: -- controls tear down of the processed heat templates -- `minion_upgrade_cleanup`: -- controls post upgrade cleanup after we containerize the minion. -- `update_containers`: -- whether to update containers from the local registry. -- `minion_roles_data`: -- A custom t-h-t roles file. Consumed from ``minion_templates_path`` - or an alternative location as well. -- `minion_selinux_enabled`: <'true'> -- Enabled for RHEL by default, Disabled for CentOS by default -- `minion_container_cli`: <'podman'> -- Container CLI to use for the Undercloud deployment. Default to 'podman'. - -Role Network Variables ----------------------- -- `minion_local_ip`: -- Sets up the `local_ip` -parameter from an inventory. Must be belonging to the `minion_network_cidr`. It is used -by overcloud nodes to access the minion node via a routable -[ctlplane network]((https://docs.openstack.org/developer/tripleo-docs/advanced_deployment/network_isolation). -Note that the minion.conf takes the default value based on the `minion_network_cidr` -instead. -- `minion_minion_nameservers`: <['8.8.8.8']> -- Sets up the 'minion_minion_nameservers' -from minion.conf. May be a string or a sequence. Only the last item goes for -the minion deploy command. -- `minion_minion_hostname`: Sets up the 'minion_hostname' value from minion.conf. -- `minion_resource_registry_args`: Complements 'resource_registry' for minion - heat templates. Defaults to nothing. -- `minion_network_environment_args`: Complements Undercloud networking - setup with the default parameters for heat templates (parameter_defaults). -- `minion_net_config_override`: -- a j2 template for os-net-config - used to override network configuration, which is normally defined via - 'OS::TripleO::Undercloud::Net::SoftwareConfig'. Accepts instack tags like LOCAL_IP et al. - When it is defined, the ``minion_resource_registry_args`` value will be discarded. - -Example Playbook ----------------- - -Sample playbook to call the role - -```yaml -# Deploy the minion -- name: Install minion - hosts: minion - gather_facts: false - roles: - - minion-deploy -``` diff --git a/roles/undercloud-minion-deploy/defaults/main.yml b/roles/undercloud-minion-deploy/defaults/main.yml deleted file mode 100644 index 8ce855cc7..000000000 --- a/roles/undercloud-minion-deploy/defaults/main.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- - -minion_config_file: minion.conf.j2 -minion_install_cmd: openstack undercloud minion install -minion_install_cli_options: "" -minion_post_install_script: minion-install-post.sh.j2 -minion_install_log: "{{ working_dir }}/minion_install.log" -minion_minion_hostname: minion.localdomain - -minion_install_script: minion-install.sh.j2 - -# defines extra args for the minion deploy command -minion_extra_args: "" - -# only to be used in libvirt deployments, see environment config for details -nameserver_from_virthost: false -virthost_nameservers: [] - -step_install_minion: true - -minion_conf_extra: "" - -minion_enable_heat_engine: true -minion_enable_ironic_conductor: true - -minion_minion_debug: true - -# Path to tripleo-heat-templates to be cloned from given repo/branch/refscpec -minion_templates_path: /usr/share/openstack-tripleo-heat-templates - -minion_container_insecure_registries: - - 192.168.24.1 - -# Use to populate the resource registry for nic configs and networking setup -minion_resource_registry_args: {} -minion_network_environment_args: {} - -update_containers: false -gating_repo_name: gating-repo -container_prep_additional_repos: "" -update_containers_repo: >- - {% if compressed_gating_repo is defined %}{{ gating_repo_name }},{% endif %}delorean-current - {%- if container_prep_additional_repos -%},{{ container_prep_additional_repos }}{%- endif -%} - -default_minion_roles_data_path: "{{ minion_templates_path }}/roles_data_minion.yaml" - -# We disable selinux when running under CentOS. It's enabled for RHEL -minion_selinux_enabled: >- - {% if ansible_distribution == 'CentOS' -%} - false - {%- else -%} - true - {%- endif -%} - -minion_container_cli: >- - podman -minion_healthcheck_disabled: false - -# Define a custom t-h-t installation for UC -minion_custom_tht_script: custom-tht-script.sh.j2 -minion_custom_tht_log: minion_custom_tht_script.log - -# FIXME(bogdando) adapt these for real UC upgrade/deploy cases. -# As the tht prep config templates converged with the overcloud upgrade/deploy cases, -# these are yet meaningless for minion installations so the defaults -# are set only to disable the controlled code blocks. -minion_composable_scenario: "" -minion_upgrade_composable_scenario: "" -minion_prep_post_hook_script: "" -minion_tht_rpm_url: "" -download_minion_templates_rpm: false diff --git a/roles/undercloud-minion-deploy/meta/main.yml b/roles/undercloud-minion-deploy/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/undercloud-minion-deploy/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/undercloud-minion-deploy/tasks/create-scripts.yml b/roles/undercloud-minion-deploy/tasks/create-scripts.yml deleted file mode 100644 index 22405bd80..000000000 --- a/roles/undercloud-minion-deploy/tasks/create-scripts.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -# Creat the scripts that will be used to deploy the undercloud minion -# environment. -- name: Check the dns information provided by the virthost - shell: > - awk 'match($0, /nameserver\s+(([0-9]{1,3}.?){4})/,address){ print address[1] }' /etc/resolv.conf - delegate_to: virthost - register: virthost_nameservers_output - when: nameserver_from_virthost|bool - -- name: set name server facts - set_fact: - virthost_nameservers: "{{ virthost_nameservers_output.stdout_lines }}" - when: nameserver_from_virthost|bool - -- name: Create minion configuration - template: - src: "{{ minion_config_file }}" - dest: "./minion.conf" - mode: 0600 - -- name: Create minion install script - template: - src: "{{ minion_install_script }}" - dest: "{{ working_dir }}/minion-install.sh" - mode: 0755 - -- name: Prepare undercloud custom t-h-t branch/refspec - include_role: - name: tht-prep-config - vars: - custom_tht_log: "{{ undercloud_custom_tht_log }}" - custom_tht_script: "{{ undercloud_custom_tht_script }}" - tht_templates_repo: "{{ undercloud_templates_repo|default('') }}" - tht_templates_refspec: "{{ undercloud_templates_refspec|default('') }}" - tht_templates_branch: "{{ undercloud_templates_branch|default('') }}" - tht_templates_path: "{{ undercloud_templates_path }}" - composable_scenario: "{{ undercloud_composable_scenario }}" - upgrade_composable_scenario: "{{ undercloud_upgrade_composable_scenario }}" - prep_post_hook_script: "{{ undercloud_prep_post_hook_script }}" - download_templates_rpm: "{{ download_undercloud_templates_rpm }}" - tht_rpm_url: "{{ undercloud_tht_rpm_url }}" - when: - - undercloud_templates_branch is defined or undercloud_templates_refspec is defined - - undercloud_templates_repo is defined - - undercloud_templates_path is defined - -- name: Create the minion parameter defaults file. - template: - src: minion-parameter-defaults.yaml.j2 - dest: "{{ working_dir }}/minion-parameter-defaults.yaml" - mode: 0600 - -- name: Write containers-prepare-parameter.yaml - template: - src: containers-prepare-parameter.yaml.j2 - dest: "{{ working_dir }}/containers-prepare-parameter.yaml" diff --git a/roles/undercloud-minion-deploy/tasks/install-minion.yml b/roles/undercloud-minion-deploy/tasks/install-minion.yml deleted file mode 100644 index fe0e6d968..000000000 --- a/roles/undercloud-minion-deploy/tasks/install-minion.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: Run dstat on the minion prior to minion install - include_role: - name: validate-perf - when: step_install_minion|bool - -- name: Install the minion - shell: > - set -o pipefail && - {{ working_dir }}/minion-install.sh 2>&1 {{ timestamper_cmd }} > - {{ minion_install_log }} - when: step_install_minion|bool diff --git a/roles/undercloud-minion-deploy/tasks/main.yml b/roles/undercloud-minion-deploy/tasks/main.yml deleted file mode 100644 index 75d792cfa..000000000 --- a/roles/undercloud-minion-deploy/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,distribution" - when: ansible_distribution is not defined - -- include: create-scripts.yml - tags: - - minion-scripts - -- name: Run install via tripleo-operator-ansible - when: - - release in ['master'] - - step_install_minion|bool - tags: - - minion-install - block: - - name: Run dstat on the minion prior to minion install - include_role: - name: validate-perf - - name: Install undercloud minion - collections: - - tripleo.operator - include_role: - name: tripleo_undercloud_minion_install - vars: - tripleo_undercloud_minion_install_debug: "{{ minion_minion_debug }}" - -- name: Run legacy install - when: release not in ['master'] - tags: - - minion-install - block: - - include: install-minion.yml diff --git a/roles/undercloud-minion-deploy/templates/containers-prepare-parameter.yaml.j2 b/roles/undercloud-minion-deploy/templates/containers-prepare-parameter.yaml.j2 deleted file mode 100644 index aaa9d7b3f..000000000 --- a/roles/undercloud-minion-deploy/templates/containers-prepare-parameter.yaml.j2 +++ /dev/null @@ -1,12 +0,0 @@ -parameter_defaults: - DockerInsecureRegistryAddress: - - {{ local_docker_registry_host }}:8787 - ContainerImagePrepare: - - set: - tag: "{{ container_build_id }}{{ update_containers_append_tag }}" - namespace: "{{ local_docker_registry_host }}:8787/{{ docker_registry_namespace_used }}" - name_prefix: "{{ docker_prep_prefix }}" - name_suffix: "{{ docker_prep_suffix }}" - ceph_namespace: "{{ docker_ceph_namespace }}" - ceph_image: "{{ docker_ceph_image }}" - ceph_tag: "{{ docker_ceph_tag }}" diff --git a/roles/undercloud-minion-deploy/templates/hieradata-overrides-t-h-t-minion.yaml.j2 b/roles/undercloud-minion-deploy/templates/hieradata-overrides-t-h-t-minion.yaml.j2 deleted file mode 100644 index 29927d732..000000000 --- a/roles/undercloud-minion-deploy/templates/hieradata-overrides-t-h-t-minion.yaml.j2 +++ /dev/null @@ -1,7 +0,0 @@ -parameter_defaults: - UndercloudMinionExtraConfig: - {% if undercloud_heat_workers is defined -%} - heat::engine::num_engine_workers: {{undercloud_heat_workers}} - {% elif undercloud_workers is defined -%} - heat::engine::num_engine_workers: "%{hiera('undercloud_workers')}" - {%- endif %} diff --git a/roles/undercloud-minion-deploy/templates/minion-install.sh.j2 b/roles/undercloud-minion-deploy/templates/minion-install.sh.j2 deleted file mode 100644 index 994210d28..000000000 --- a/roles/undercloud-minion-deploy/templates/minion-install.sh.j2 +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Installing the undercloud minion -## ================================ -## :: - -{% for var in (minion_env_vars|default([])) %} -export {{ var }} -{% endfor %} - -{{ minion_install_cmd }} {{ minion_install_cli_options }} - -### --stop_docs diff --git a/roles/undercloud-minion-deploy/templates/minion-parameter-defaults.yaml.j2 b/roles/undercloud-minion-deploy/templates/minion-parameter-defaults.yaml.j2 deleted file mode 100644 index 53efa9334..000000000 --- a/roles/undercloud-minion-deploy/templates/minion-parameter-defaults.yaml.j2 +++ /dev/null @@ -1,13 +0,0 @@ -{# -This takes advantage of the fact that valid JSON is also -valid YAML. The default to_nice_yaml filter doesn't quote strings, -which can cause unexpected implicit type conversion when the -resulting YAML is consumed, whereas with JSON all strings are quoted. -#} -{% if minion_resource_registry_args %} -{% set minion_resource_registry = {'resource_registry': minion_resource_registry_args} %} -{% else %} -{% set minion_resource_registry = {} %} -{% endif %} -{% set minion_parameter_defaults = {'parameter_defaults': minion_network_environment_args} %} -{{ minion_parameter_defaults|combine(minion_resource_registry, recursive=True)|to_nice_json }} diff --git a/roles/undercloud-minion-deploy/templates/minion.conf.j2 b/roles/undercloud-minion-deploy/templates/minion.conf.j2 deleted file mode 100644 index 4e325e340..000000000 --- a/roles/undercloud-minion-deploy/templates/minion.conf.j2 +++ /dev/null @@ -1,222 +0,0 @@ -[DEFAULT] - -# -# From minion_config -# - -# Cleanup temporary files. Setting this to False will leave the -# temporary files used during deployment in place after the command is -# run. This is useful for debugging the generated files or if errors -# occur. (boolean value) -#cleanup = true - -# Container CLI used for deployment; Can be docker or podman. (string -# value) -container_cli = {{ minion_container_cli }} - -# Whether or not we disable the container healthchecks. (boolean -# value) -container_healthcheck_disabled = {{ minion_healthcheck_disabled }} - -# Heat environment file with parameters for all required container -# images. Or alternatively, parameter "ContainerImagePrepare" to drive -# the required image preparation. (string value) -{% if minion_container_images_file is defined %} -container_images_file = {{ minion_container_images_file }} -{% else %} -container_images_file = {{ working_dir }}/containers-prepare-parameter.yaml -{% endif %} - -# Used to add custom insecure registries for containers. (list value) -# Deprecated group/name - [DEFAULT]/docker_insecure_registries -{% if minion_container_insecure_registries is defined and minion_container_insecure_registries|length>0 %} -container_insecure_registries = {{ minion_container_insecure_registries | join(',') }} -{% elif undercloud_docker_insecure_registries is defined and undercloud_docker_insecure_registries|length>0 %} -container_insecure_registries = {{ undercloud_docker_insecure_registries }} -{% else %} -#container_insecure_registries = -{% endif %} - -# An optional container registry mirror that will be used. (string -# value) -# Deprecated group/name - [DEFAULT]/docker_registry_mirror -#container_registry_mirror = - -# List of any custom environment yaml files to use. These are applied -# after any other configuration and can be used to override any -# derived values. This should be used only by advanced users. (list -# value) -{% if minion_custom_env_files is defined %} -custom_env_files = {{ minion_custom_env_files.split()|join(',') }} -{% else %} -#custom_env_files = -{% endif %} - -# User used to run openstack undercloud install command which will be -# used to add the user to the docker group, required to upload -# containers (string value) -#deployment_user = - -# Whether to install the Heat Engine service. (boolean value) -enable_heat_engine = {{ minion_enable_heat_engine }} - -# Whether to install the Ironic Conductor service. This is currently -# disabled by default. (boolean value) -enable_ironic_conductor = {{ minion_enable_ironic_conductor }} - -# URL for the heat container image to use. (string value) -#heat_container_image = - -# Execute the heat-all process natively on this host. This option -# requires that the heat-all binaries be installed locally on this -# machine. This option is enabled by default which means heat-all is -# executed on the host OS directly. (boolean value) -#heat_native = true - -# Path to hieradata override file. Relative paths get computed inside -# of $HOME. When it points to a heat env file, it is passed in t-h-t -# via "-e ", as is. When the file contains legacy instack data, -# it is wrapped with ExtraConfig and also passed in for -# t-h-t as a temp file created in output_dir. Note, instack hiera data -# may be not t-h-t compatible and will highly likely require a manual -# revision. (string value) -{% if minion_hieradata_override is defined %} -hieradata_override = {{ minion_hieradata_override }} -{% else %} -#hieradata_override = -{% endif %} - -# Whether to enable the debug log level for OpenStack services and -# Container Image Prepare step. (boolean value) -minion_debug = {{ minion_minion_debug }} - -# Enable or disable SELinux during the deployment. (boolean value) -minion_enable_selinux = {{ minion_selinux_enabled }} - -# Run pre-flight checks when installing or upgrading. (boolean value) -#minion_enable_validations = true - -# Fully qualified hostname (including domain) to set on the -# Undercloud. If left unset, the current hostname will be used, but -# the user is responsible for configuring all system hostname settings -# appropriately. If set, the undercloud install will configure all -# system hostname settings. (string value) -#minion_hostname = -minion_hostname = {{ minion_minion_hostname }} - -# Network interface on the Undercloud that will be handling the PXE -# boots and DHCP for Overcloud instances. (string value) -{% if minion_local_interface is defined %} -minion_local_interface = {{ minion_local_interface }} -{% else %} -#minion_local_interface = eth1 -{% endif %} - -# IP information for the interface on the Undercloud that will be -# handling the PXE boots and DHCP for Overcloud instances. The IP -# portion of the value will be assigned to the network interface -# defined by local_interface, with the netmask defined by the prefix -# portion of the value. (string value) -minion_local_ip = {{ minion_local_ip|default( - '%s/%s' % (undercloud_network_cidr|nthhost(4), - undercloud_network_cidr.split('/').1)) }} -#minion_local_ip = 192.168.24.50/24 - -# MTU to use for the local_interface. (integer value) -{% if minion_local_mtu is defined %} -minion_local_mtu = {{ minion_local_mtu }} -{% endif %} -#minion_local_mtu = 1500 - -# The path to a log file to store the undercloud install/upgrade logs. -# (string value) -minion_log_file = {{ minion_install_log }} - -# DNS nameserver(s). Use for the undercloud node and for the overcloud -# nodes. (NOTE: To use different nameserver(s) for the overcloud, -# override the DnsServers parameter in overcloud environment.) (list -# value) -{% if virthost_nameservers is string %} -minion_nameservers = {{ virthost_nameservers }} -{% elif virthost_nameservers is sequence and virthost_nameservers|length > 0 %} -minion_nameservers = {{ virthost_nameservers|join(',') }} -{% elif minion_minion_nameservers is string %} -minion_nameservers = {{ minion_minion_nameservers }} -{% elif minion_minion_nameservers is sequence %} -minion_nameservers = {{ minion_minion_nameservers|join(',') }} -{% elif undercloud_undercloud_nameservers is string %} -minion_nameservers = {{ undercloud_undercloud_nameservers }} -{% elif undercloud_undercloud_nameservers is sequence %} -minion_nameservers = {{ undercloud_undercloud_nameservers|join(',') }} -{% else %} -#minion_nameservers = -{% endif %} - -# List of ntp servers to use. (list value) -{% if minion_minion_ntp_servers is string %} -minion_ntp_servers = {{ minion_minion_ntp_servers }} -{% elif minion_minion_ntp_servers is sequence %} -minion_ntp_servers = {{ minion_minion_ntp_servers|join(',') }} -{% elif undercloud_undercloud_ntp_servers is string %} -minion_ntp_servers = {{ undercloud_undercloud_ntp_servers }} -{% elif undercloud_undercloud_ntp_servers is sequence %} -minion_ntp_servers = {{ undercloud_undercloud_ntp_servers|join(',') }} -{% else %} -#minion_ntp_servers = 0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org -{% endif %} - -# The name of the file to look for the passwords used to connect to -# the undercloud. We assume this file is in the folder where the -# command is executed if a fully qualified path is not provided. -# (string value) -#minion_password_file = tripleo-undercloud-passwords.yaml - -# TODO: Certificate file to use for OpenStack service SSL connections. -# Setting this enables SSL for the OpenStack API endpoints, leaving it -# unset disables SSL. (string value) -#minion_service_certificate = - -# Host timezone to be used. If no timezone is specified, the existing -# timezone configuration is used. (string value) -#minion_timezone = - -# The name of the file to look for the undercloud output file that -# contains configuration information. We assume this file is in the -# folder where the command is executed if a fully qualified path is -# not provided. (string value) -#minion_undercloud_output_file = tripleo-undercloud-output.yaml - -# Path to network config override template.Relative paths get computed -# inside of $HOME. Must be in the json format.Its content overrides -# anything in t-h-t UndercloudNetConfigOverride. The processed -# template is then passed in Heat via the undercloud_parameters.yaml -# file created in output_dir and used to configure the networking via -# run-os-net-config. If you wish to disable you can set this location -# to an empty file.Templated for instack j2 tags may be used, for -# example: -# -# ... snip example because ansible ... -# -# (string value) -#net_config_override = - -# Networks file to override for heat. May be an absolute path or the -# path relative to the t-h-t templates directory used for deployment -# (string value) -#networks_file = - -# Directory to output state, processed heat templates, ansible -# deployment files. (string value) -{% if minion_minion_output_dir is defined %} -output_dir = {{ minion_minion_output_dir }} -{% else %} -#output_dir = $HOME/.undercloud-heat-installer -{% endif %} - -# Roles file to override for heat. May be an absolute path or the path -# relative to the t-h-t templates directory used for deployment -# (string value) -#roles_file = - -# heat templates file to override. (string value) -templates = {{ minion_templates_path }} diff --git a/roles/undercloud-setup/README.md b/roles/undercloud-setup/README.md deleted file mode 100644 index 1b277359f..000000000 --- a/roles/undercloud-setup/README.md +++ /dev/null @@ -1,73 +0,0 @@ -undercloud-setup -================ - -This role encompasses the setup required when using a standard CentOS/RHEL -undercloud host in substitution for a 'ready-made' undercloud image. If an -undercloud machine or node is launched a 'vanilla' CentOS and RHEL image, -there are a number of steps that need to be run to get the undercloud to the -point where TripleO Quickstart can be run. - -Some steps are generic to all undercloud nodes or machines and some -steps are specific to the environment in which the undercloud is -launched. - -Steps to download or build overcloud images are included in the -overcloud-images role. Steps to prepare the undercloud repos are -included in the repo-setup role. - -Requirements ------------- - -This role should not be included in a generic virtual TripleO Quickstart -playbook. Therefore including environment-specific code (which is switch -cased to run only on the desired environment) is acceptable. It will -not add complexity to the default TripleO Quickstart workflow. - -Role Variables --------------- - -- local_working_dir: <"{{ lookup('env', 'HOME') }}/.quickstart"> -- Directory for quickstart.sh script -- non_root_user: -- The non-root user operating on the virthost -- undercloud_user: -- The non-root user operating on the undercloud -- undercloud_key: <"{{ local_working_dir }}/id_rsa_undercloud"> -- Key to access the undercloud node/machine -- non_root_user_setup: -- Switch to setup a non-root user -- vxlan_networking: -- Switch to setup the VXLAN networking from devstack-gate (for multinode) -- vxlan_networking_addr_prefix: -- The IPv4 subnet that will be used for the overcloud bridge between multinode hosts. -- vxlan_networking_addr_netmask: -- The CIDR notation of the subnet mask that will be used for the overcloud bridge. -- undercloud_hostname: -- Optionally, the hostname to set on the host. -- hostname_correction: -- Switch to set the transient hostname to the static hostname (TripleO requirement) -- step_set_undercloud_hostname: -- Switch to set the undercloud hostname explicitly -- package_installs: -- Switch to install required OpenStack packages for an undercloud (requires repos to already be setup) -- custom_nameserver: <['8.8.8.8']> -- A list, added to /etc/resolv.conf for access in custom environments -- ovb_setup_connectivity: -- Setup external network, custom nameserver and set MTUS valuse for OVB environments -- undercloud_ara: -- Install ara on undercloud - -- `undercloud_ansible_cfg`: <'true'> -- Configure ara on the host -- `undercloud_ara_version`: <'0.15.0'> -- Default version of ara to install -Dependencies ------------- - -This playbook has no dependencies. If a provisioning step is not included -in this role, it is assumed that the node/machine to set up already -exists and is accessible. - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Set up CentOS undercloud node to run TripleO Quickstart - hosts: undercloud - gather_facts: false - roles: - - undercloud-setup - -License -------- - -Apache-2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/undercloud-setup/defaults/main.yml b/roles/undercloud-setup/defaults/main.yml deleted file mode 100644 index 7af4cc0f3..000000000 --- a/roles/undercloud-setup/defaults/main.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- - -undercloud_key: "{{ local_working_dir }}/id_rsa_undercloud" -non_root_user_setup: true - -toci_vxlan_networking: false -vxlan_networking: false -vxlan_networking_addr_prefix: "{{ undercloud_network_cidr | ipaddr('network') | replace('.0', '') }}" -vxlan_networking_addr_netmask: "{{ undercloud_network_cidr | ipv4('prefix') }}" -vxlan_mtu: 1450 - -step_set_undercloud_hostname: false -undercloud_hostname: localhost -hostname_correction: false - -package_installs: true - -ovb_setup_connectivity: false -ovb_undercloud_connectivity_log: "{{ working_dir }}/ovb_undercloud_connectivity.log" -mtu: 1350 -mtu_interface: - - eth1 -external_interface: eth2 -external_interface_ip: 10.0.0.1 -external_interface_netmask: 255.255.255.0 -custom_nameserver: - - 8.8.8.8 - -# default value for undercloud_rpm_dependencies -# is in extras-common - -undercloud_ansible_cfg: true - -# NOTE(aschultz): 0.16.0 requires ansible 2.4.5 which we may not have in older -# versions. Once we have 2.5+ everywhere we can likely remove this version and -# specify latest -undercloud_ara_version: 0.15.0 - -# NOTE(rfolco): do not configure ara on undercloud until we pin ara deps to -# each branch - https://bugs.launchpad.net/tripleo/+bug/1792622 -undercloud_ara: false -install_atop: false -atop_command: atop -R -w /var/log/atop.bin -tripleo_set_unique_hostname: false - -undercloud_outputs_dir: "{{ working_dir }}" diff --git a/roles/undercloud-setup/meta/main.yml b/roles/undercloud-setup/meta/main.yml deleted file mode 100644 index a99ff864c..000000000 --- a/roles/undercloud-setup/meta/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -dependencies: - - extras-common - - container-prep diff --git a/roles/undercloud-setup/tasks/ansible_cfg.yml b/roles/undercloud-setup/tasks/ansible_cfg.yml deleted file mode 100644 index c623b99df..000000000 --- a/roles/undercloud-setup/tasks/ansible_cfg.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -# Configure the undercloud to use ARA -# for ansible undercloud or standalone only. Ansible deployment of node -- name: Install ara deps - become: true - pip: - # noqa 403 - name: - - pip - - setuptools - state: latest - # TODO(sshnaidm): https://bugs.launchpad.net/tripleo/+bug/1792622 - ignore_errors: true - -- name: Install ara - become: true - pip: - name: ara - state: present - version: "{{ undercloud_ara_version }}" - ignore_errors: true - -- name: Update the default ansible callback setting in /etc/ansible/ansible.cfg - become: true - lineinfile: - path: /etc/ansible/ansible.cfg - regexp: '^#callback_plugins' - line: | - callback_plugins={% if ansible_python.version.major == 3 %}/usr/local/lib/python3.6/site-packages{% else %}/usr/lib/python2.7/site-packages{% endif %}/ara/plugins/callbacks - -- name: Update the default ansible action setting in /etc/ansible/ansible.cfg - become: true - lineinfile: - path: /etc/ansible/ansible.cfg - regexp: '^#action_plugins' - line: | - action_plugins={% if ansible_python.version.major == 3 %}/usr/local/lib/python3.6/site-packages{% else %}/usr/lib/python2.7/site-packages{% endif %}/ara/plugins/actions diff --git a/roles/undercloud-setup/tasks/atop.yml b/roles/undercloud-setup/tasks/atop.yml deleted file mode 100644 index 1da630a41..000000000 --- a/roles/undercloud-setup/tasks/atop.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -- when: install_atop|bool - ignore_errors: true - become: true - block: - # Run atop in background - - name: Install atop from epel repo when configured so (CentOS < 8) - shell: | - if [ -e /etc/ci/mirror_info.sh ]; then - source /etc/ci/mirror_info.sh - fi - atop_location=$(repoquery --repoid=osepel --repofrompath=osepel,$NODEPOOL_EPEL_MIRROR/7/x86_64/ --location atop) - {{ ansible_pkg_mgr }} install -y $atop_location - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version is version(8, '<') - - - name: Install atop from RDO build-deps repo when configured so (CentOS >= 8) - package: - name: "atop" - state: present - when: - - ansible_distribution == 'CentOS' - - ansible_distribution_major_version is version(8, '>=') - - - name: Run atop - shell: "{{ atop_command }} &" - async: 0 - poll: 0 diff --git a/roles/undercloud-setup/tasks/hostname.yml b/roles/undercloud-setup/tasks/hostname.yml deleted file mode 100644 index 67d5cb509..000000000 --- a/roles/undercloud-setup/tasks/hostname.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -# https://launchpad.net/bugs/1763776 -- name: Add a unique hostname to /etc/hosts resolved to the first IPv4 available - become: true - lineinfile: - dest: /etc/hosts - state: present - insertafter: EOF - line: "{{ ansible_all_ipv4_addresses | first }} {{ ansible_hostname }}-unique" - when: tripleo_set_unique_hostname|default(false)|bool - -- name: Override containerized undercloud CI hostname for tripleo client - when: - - undercloud_undercloud_hostname is not defined - block: - - name: set fact for undercloud_fqdn override when undercloud_cloud_domain was provided - set_fact: - undercloud_fqdn: "{{ ansible_hostname }}.{{ undercloud_cloud_domain }}" - when: - - undercloud_cloud_domain is defined - - - name: set fact for undercloud_fqdn override when we have a domain - set_fact: - undercloud_fqdn: "{{ ansible_fqdn }}" - when: - - ansible_domain|default("") != "" - - undercloud_cloud_domain is not defined - - - name: set fact for undercloud_fqdn override when we don't have a domain - set_fact: - undercloud_fqdn: "{{ ansible_hostname }}.ooo.test" - when: - - ansible_domain|default("") == "" - - undercloud_cloud_domain is not defined - - - name: Set fact for undercloud_hostname override - set_fact: - cacheable: true - undercloud_undercloud_hostname: "{{ undercloud_fqdn }}" diff --git a/roles/undercloud-setup/tasks/main.yml b/roles/undercloud-setup/tasks/main.yml deleted file mode 100644 index e4812f4f9..000000000 --- a/roles/undercloud-setup/tasks/main.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# tasks file for undercloud-setup -# Add a non-root user -- name: Including non_root_user_setup tasks list - include: non_root_user_setup.yml - when: non_root_user_setup|bool - -- name: Including ovb_setup_connectivity tasks list - include: ovb_setup_connectivity.yml - when: ovb_setup_connectivity|bool - -- name: Including repo-setup role - include_role: - name: repo-setup - -- name: Run atop for monitoring - include: atop.yml - -# to_build is enabled via featureset files or featureset overrides -- name: Set variables for gating repos for ovb jobs - set_fact: - artg_repos_dir: "{{ repo_clone_dir|default('/opt/stack/new') }}" - ib_create_web_repo: "{{ to_build|default(false)|bool }}" - cacheable: true - when: to_build|default(false)|bool - tags: - - build - -- name: Run DLRN gate role - vars: - artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" - include_role: - name: build-test-packages - tags: - - build - -- name: Install gated repo - when: compressed_gating_repo is defined - include_role: - name: install-built-repo - tags: - - build - -- name: Including package_installs tasks - include: package_installs.yml - when: package_installs|bool - -- name: Including vxlan_networking tasks - include: vxlan_networking.yml - when: vxlan_networking|bool or toci_vxlan_networking|bool - -- name: Including hostname tasks - include: hostname.yml - when: hostname_correction|bool or step_set_undercloud_hostname|bool - -- name: Include ansible.cfg configuration for the undercloud / node - include: ansible_cfg.yml - when: - - undercloud_ansible_cfg|bool and undercloud_ara|bool diff --git a/roles/undercloud-setup/tasks/non_root_user_setup.yml b/roles/undercloud-setup/tasks/non_root_user_setup.yml deleted file mode 100644 index 74b24c186..000000000 --- a/roles/undercloud-setup/tasks/non_root_user_setup.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -- name: Copy create non-root user script - template: - src: non_root_user_setup.sh.j2 - dest: "/tmp/non_root_user_setup.sh" - mode: 0755 - -- name: Run the non_root_user script - command: "/tmp/non_root_user_setup.sh" - changed_when: true - -- name: Create undercloud access key - delegate_to: localhost - command: > - ssh-keygen -f {{ undercloud_key }} -N '' - -C 'ansible_generated_virt_host' - -t rsa -b 4096 - args: - creates: "{{ undercloud_key }}" - -- name: Configure non-root user authorized_keys on undercloud - authorized_key: - user: "{{ undercloud_user }}" - key: "{{ lookup('file', '{{ undercloud_key }}.pub') }}" - become: true diff --git a/roles/undercloud-setup/tasks/ovb_setup_connectivity.yml b/roles/undercloud-setup/tasks/ovb_setup_connectivity.yml deleted file mode 100644 index a8e515acd..000000000 --- a/roles/undercloud-setup/tasks/ovb_setup_connectivity.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Copy instackenv.json to undercloud - copy: - src: "{{ local_working_dir }}/nodes.json" - dest: "{{ working_dir }}/instackenv.json" - -- name: Copy over setup undercloud connectivity script template - template: - src: ovb-undercloud-connectivity.sh.j2 - dest: "{{ working_dir }}/ovb-undercloud-connectivity.sh" - mode: 0755 - -- name: Setup interfaces, connectivity on the undercloud - become: true - shell: > - set -o pipefail && - {{ working_dir }}/ovb-undercloud-connectivity.sh 2>&1 {{ timestamper_cmd }} > - {{ ovb_undercloud_connectivity_log }} - changed_when: true diff --git a/roles/undercloud-setup/tasks/package_installs.yml b/roles/undercloud-setup/tasks/package_installs.yml deleted file mode 100644 index 768c077a5..000000000 --- a/roles/undercloud-setup/tasks/package_installs.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- name: gather ansible_pkg_mgr - setup: - gather_subset: "!min,pkg_mgr" - when: ansible_pkg_mgr is not defined - -- name: Install package installation script - template: - src: install_packages.sh.j2 - dest: "{{ working_dir }}/install_packages.sh" - mode: 0755 - -- name: Run the package installation script - shell: > - set -o pipefail && - {{ working_dir }}/install_packages.sh 2>&1 {{ timestamper_cmd }} > - {{ working_dir }}/install_packages.sh.log - changed_when: true diff --git a/roles/undercloud-setup/tasks/toci_vxlan_networking.yml b/roles/undercloud-setup/tasks/toci_vxlan_networking.yml deleted file mode 100644 index 197796c64..000000000 --- a/roles/undercloud-setup/tasks/toci_vxlan_networking.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- - -- name: Install the TripleO-CI VXLAN networking script on subnodes - template: - src: toci_vxlan_networking_multinode.sh.j2 - dest: "{{ working_dir }}/toci_vxlan_networking_multinode.sh" - mode: 0755 - when: toci_vxlan_networking_multinode|bool - -- name: Run the TripleO-CI VXLAN networking script on subnodes - shell: > - set -o pipefail && - timeout --preserve-status 60s {{ working_dir }}/toci_vxlan_networking_multinode.sh - 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/toci_vxlan_networking_multinode.sh.log - when: toci_vxlan_networking_multinode|bool - -- name: Install the TripleO-CI VXLAN networking script - copy: - src: toci_vxlan_networking.sh - dest: "{{ working_dir }}/toci_vxlan_networking.sh" - mode: 0755 - -- name: Run the TripleO-CI VXLAN networking script - shell: > - set -o pipefail && - {{ working_dir }}/toci_vxlan_networking.sh - 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/toci_vxlan_networking.sh.log - changed_when: true diff --git a/roles/undercloud-setup/tasks/vxlan_networking.yml b/roles/undercloud-setup/tasks/vxlan_networking.yml deleted file mode 100644 index cbc73b886..000000000 --- a/roles/undercloud-setup/tasks/vxlan_networking.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -- name: Install the TripleO-CI VXLAN networking script - template: - src: vxlan_networking.sh.j2 - dest: "{{ working_dir }}/vxlan_networking.sh" - mode: 0755 - -- name: Run the TripleO-CI VXLAN networking script - shell: > - set -o pipefail && - {{ working_dir }}/vxlan_networking.sh 2>&1 {{ timestamper_cmd }} > {{ working_dir }}/vxlan_networking.sh.log - changed_when: true - -- name: Bring up the bridge on overcloud nodes - shell: > - set -o pipefail && - sudo ip link set dev {{ undercloud_local_interface }} up 2>&1 {{ timestamper_cmd }} >> - {{ working_dir }}/vxlan_networking.sh.log - delegate_to: "{{ item }}" - with_items: "{{ groups['overcloud'] | default([]) }}" - changed_when: true - -- name: Set the MTU on overcloud nodes - shell: > - set -o pipefail && - sudo ip link set dev {{ undercloud_local_interface }} mtu {{ vxlan_mtu }} 2>&1 {{ timestamper_cmd }} >> - {{ working_dir }}/vxlan_networking.sh.log; - echo "MTU={{ vxlan_mtu }}" | sudo tee -a /etc/sysconfig/network-scripts/ifcfg-{{ undercloud_local_interface }} - delegate_to: "{{ item }}" - with_items: "{{ groups['overcloud'] | default([]) }}" - changed_when: true - -- name: Test ping across vxlan tunnel (and optionally restart ovs) - shell: "ping -c 6 -W 3 {{ vxlan_networking_addr_prefix }}.2 || (sudo systemctl restart openvswitch && ping -c 6 -W 3 {{ vxlan_networking_addr_prefix }}.2)" - delegate_to: "{{ item }}" - with_items: "{{ groups['overcloud'] | default([]) }}" - changed_when: true diff --git a/roles/undercloud-setup/tasks/write-outputs.yml b/roles/undercloud-setup/tasks/write-outputs.yml deleted file mode 100644 index 4d9b50ebb..000000000 --- a/roles/undercloud-setup/tasks/write-outputs.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -# write out undercloud_outputs and undercloud_passwords to files -- name: Write out tripleo-undercloud-outputs.yaml - copy: - content: "{{ undercloud_outputs }}" - dest: "{{ undercloud_outputs_dir }}/tripleo-undercloud-outputs.yaml" - -- name: Write out tripleo-undercloud-passwords.yaml - copy: - content: "{{ undercloud_passwords }}" - dest: "{{ undercloud_outputs_dir }}/tripleo-undercloud-passwords.yaml" diff --git a/roles/undercloud-setup/templates/hostname.sh.j2 b/roles/undercloud-setup/templates/hostname.sh.j2 deleted file mode 100644 index db8f0fa8a..000000000 --- a/roles/undercloud-setup/templates/hostname.sh.j2 +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash -set -eux - -### --start_docs -## Adjust the hostname as necessary (usually on the undercloud) -## Note.. run this script with sudo or root -## ============================================================ - -{% if hostname_correction|bool %} -## * Correct the host's transient hostname to a static one -## :: - -hostnamectl set-hostname --transient $(hostnamectl --static) - -{% elif step_set_undercloud_hostname|bool %} -## * Set the host's transient and static hostnames -## :: - -hostnamectl set-hostname --transient {{ undercloud_hostname }} -hostnamectl set-hostname --static {{ undercloud_hostname }} - -{% endif %} - -## * Sanitize the /etc/hosts for duplicate entries -## :: - -cp /etc/hosts /etc/hosts.bak -awk '!seen[$0]++' /etc/hosts > /etc/hosts.new -mv -f /etc/hosts.new /etc/hosts - -### --stop_docs diff --git a/roles/undercloud-setup/templates/install_packages.sh.j2 b/roles/undercloud-setup/templates/install_packages.sh.j2 deleted file mode 100644 index d2c5e9be3..000000000 --- a/roles/undercloud-setup/templates/install_packages.sh.j2 +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -### --start_docs - -## Install the required packages on the undercloud -## =============================================== - -## * Install python-tripleoclient -## :: - -sudo $(command -v dnf || command -v yum) install -y {{ undercloud_rpm_dependencies }} - -### --stop_docs diff --git a/roles/undercloud-setup/templates/non_root_user_setup.sh.j2 b/roles/undercloud-setup/templates/non_root_user_setup.sh.j2 deleted file mode 100644 index a8bbd1eef..000000000 --- a/roles/undercloud-setup/templates/non_root_user_setup.sh.j2 +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -eux - -### --start_docs - -## Set up the non-root user for installation and deployment tasks -## ============================================================== - - -## * Create non-root user on undercloud -## :: - -id -u "{{ undercloud_user }}" || \ -sudo useradd -s /bin/bash -d /home/"{{ undercloud_user }}" "{{ undercloud_user }}" - -## * Grant sudo privileges to non-root user on undercloud -## :: - -echo "{{ undercloud_user }} ALL=(ALL) NOPASSWD:ALL" | sudo tee /etc/sudoers.d/{{ undercloud_user }} -sudo chown root:root /etc/sudoers.d/{{ undercloud_user }} -sudo chmod 440 /etc/sudoers.d/{{ undercloud_user }} - -### --stop_docs diff --git a/roles/undercloud-setup/templates/ovb-undercloud-connectivity.sh.j2 b/roles/undercloud-setup/templates/ovb-undercloud-connectivity.sh.j2 deleted file mode 100644 index 675dfe7aa..000000000 --- a/roles/undercloud-setup/templates/ovb-undercloud-connectivity.sh.j2 +++ /dev/null @@ -1,66 +0,0 @@ -#! /bin/bash - -set -eux - -### --start_docs - -## Set up the undercloud for installation -## ====================================== - -## * Configure external interface -## :: - -# TODO: move this to overcloud-prep-network role -sudo ip addr add {{ external_interface_ip }} dev {{ external_interface }} - -## * Get mac address of external interface -## :: - -export MAC_ADDR_EXT_INTERFACE=$( ip link show {{ external_interface }} | awk '/ether/ {print $2}' ) - -## * Set up external interface -## :: - -sudo -E bash -c 'cat < /etc/sysconfig/network-scripts/ifcfg-{{ external_interface }} -NAME={{ external_interface }} -IPADDR={{ external_interface_ip }} -NETMASK={{ external_interface_netmask }} -NM_CONTROLLED=no -DEFROUTE=yes -IPV4_FAILURE_FATAL=no -IPV6INIT=yes -IPV6_AUTOCONF=yes -IPV6_DEFROUTE=yes -IPV6_FAILURE_FATAL=no -ONBOOT=yes -HWADDR=$MAC_ADDR_EXT_INTERFACE -PEERDNS=yes -PEERROUTES=yes -IPV6_PEERDNS=yes -IPV6_PEERROUTES=yes -EOF' - -sudo ifdown {{ external_interface }} -sudo ifup {{ external_interface }} - -## * Set MTU values -## :: - -{% for interface in (mtu_interface) %} - sudo ip link set {{ interface }} mtu {{ mtu }} - echo "MTU={{ mtu }}" | sudo tee -a /etc/sysconfig/network-scripts/ifcfg-{{ interface }} -{% endfor %} - -## * Add custom nameserver to resolv.conf if required -## :: - -{% if custom_nameserver is defined %} -sudo sed -i '/^nameserver/d' /etc/resolv.conf -{% for name_server in custom_nameserver %} -cat < -- boolean value that will validate IPMI if true -- working_dir: <'/home/stack'> -- working directory for the role. - - -Dependencies ------------- - - - -Example Playbook ----------------- - - 1. Sample playbook to call the role - - - name: Validate IPMI connection to overcloud nodes - hosts: undercloud - roles: - - ansible-role-triple-validate-ipmi - -License -------- - -Apache - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/validate-ipmi/defaults/main.yml b/roles/validate-ipmi/defaults/main.yml deleted file mode 100644 index 716e8b545..000000000 --- a/roles/validate-ipmi/defaults/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- - -validate_ipmi_step: true diff --git a/roles/validate-ipmi/meta/main.yml b/roles/validate-ipmi/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-ipmi/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-ipmi/tasks/main.yml b/roles/validate-ipmi/tasks/main.yml deleted file mode 100644 index 73b6cbac8..000000000 --- a/roles/validate-ipmi/tasks/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- when: validate_ipmi_step|bool - block: - - - name: Copy validate IPMI template to the undercloud - template: - src: validate-overcloud-ipmi-connection.sh.j2 - dest: "{{ working_dir }}/validate-overcloud-ipmi-connection.sh" - mode: 0755 - - - name: wait for script file to exist - wait_for: path="{{ working_dir }}/validate-overcloud-ipmi-connection.sh" - - - name: Run the validate IPMI overcloud connection script - shell: > - set -o pipefail && - {{ working_dir }}/validate-overcloud-ipmi-connection.sh 2>&1 - {{ timestamper_cmd }} | tee {{ working_dir }}/validate-overcloud-ipmi-connection.log diff --git a/roles/validate-ipmi/templates/validate-overcloud-ipmi-connection.sh.j2 b/roles/validate-ipmi/templates/validate-overcloud-ipmi-connection.sh.j2 deleted file mode 100644 index 79acd4c09..000000000 --- a/roles/validate-ipmi/templates/validate-overcloud-ipmi-connection.sh.j2 +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash - -set -eux - -### --start_docs - -## Validate IPM connection to overcloud nodes -## ========================================== - -## * Check if instackenv.json exists in the working directory -## :: - -if [[ ! -f {{ working_dir }}/instackenv.json ]]; then - echo 'File "instackenv.json" is not in the working directory, aborting.' - exit 1 -fi - -## * Install IPMI tools -## :: - -sudo yum install -y git OpenIPMI OpenIPMI-tools - -## * Git clone tools to validate instackenv.json -## :: - -[ -d {{ working_dir }}/clapper ] && rm -rf "{{ working_dir }}/clapper" -git clone "https://github.com/rthallisey/clapper.git" "{{ working_dir }}/clapper" - -## * Validate instackenv.json -## :: - -export IPMI_VALIDATE="$(python {{ working_dir }}/clapper/instackenv-validator.py -f {{ working_dir }}/instackenv.json)" -if [[ $IPMI_VALIDATE != *SUCCESS* ]] ; then - echo "instackenv.json did not validate." - echo $IPMI_VALIDATE - exit 1 -fi - -### --stop_docs diff --git a/roles/validate-ipmi/tests/inventory b/roles/validate-ipmi/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/validate-ipmi/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/validate-ipmi/tests/test.yml b/roles/validate-ipmi/tests/test.yml deleted file mode 100644 index 62cf91624..000000000 --- a/roles/validate-ipmi/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-validate-ipmi diff --git a/roles/validate-minion/README.md b/roles/validate-minion/README.md deleted file mode 100644 index a4dd62341..000000000 --- a/roles/validate-minion/README.md +++ /dev/null @@ -1,39 +0,0 @@ -validate-minion -=============== - -A basic role to validate that a minion is correctly reporting into the undercloud. - -Requirements ------------- - -N/A - -Role Variables --------------- - -- `validate_minion_heat_engine`: <'true'> -- Should the heat-engine service be checked -- `validate_minion_ironic_conductor`: <'false'> -- Should the ironic-conductor service be checked -- `validate_minion_simple_script`: <'validate_minion_simple.sh.j2'> -- Simple validation script source -- `validate_minion_simple_log`: <'False'> -- Log file for the validations -- `undercloud_user`: <'stack'> -- User that the undercloud was installed under. - -Dependencies ------------- - -N/A - -Example Playbook ----------------- - - - name: Validate minion - hosts: undercloud - vars: - validate_minion_heat_engine: true - validate_minion_ironic_conductor: true - roles: - - validate-minion - -License -------- - -Apache diff --git a/roles/validate-minion/defaults/main.yml b/roles/validate-minion/defaults/main.yml deleted file mode 100644 index 9273dbc8c..000000000 --- a/roles/validate-minion/defaults/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -validate_minion_heat_engine: true -validate_minion_ironic_conductor: false -validate_minion_simple_script: validate_minion_simple.sh.j2 -validate_minion_simple_log: validate_minion_simple.log -undercloud_user: stack diff --git a/roles/validate-minion/handlers/main.yml b/roles/validate-minion/handlers/main.yml deleted file mode 100644 index 59c415322..000000000 --- a/roles/validate-minion/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for validate-minion diff --git a/roles/validate-minion/meta/main.yml b/roles/validate-minion/meta/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/roles/validate-minion/meta/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/validate-minion/tasks/main.yml b/roles/validate-minion/tasks/main.yml deleted file mode 100644 index dfbb3d9e8..000000000 --- a/roles/validate-minion/tasks/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Create the tripleo-minion simple validate script - template: - src: "{{ validate_minion_simple_script }}" - dest: "{{ local_working_dir }}/validate_minion_simple.sh" - mode: 0744 - -- name: Execute the simple minion validation - shell: > - set -o pipefail && - {{ local_working_dir }}/validate_minion_simple.sh - | tee {{ validate_minion_simple_log }} - changed_when: false diff --git a/roles/validate-minion/templates/validate_minion_simple.sh.j2 b/roles/validate-minion/templates/validate_minion_simple.sh.j2 deleted file mode 100644 index 2d06231c1..000000000 --- a/roles/validate-minion/templates/validate_minion_simple.sh.j2 +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash -# Copyright 2019 Red Hat, Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# simple script to check if the minion is has successfully reported into the -# undercloud. - -set -eux -VALIDATE_HEAT_ENGINE="${VALIDATE_HEAT_ENGINE:-{{ validate_minion_heat_engine }}}" -VALIDATE_IRONIC_CONDUCTOR="${VALIDATE_IRONIC_CONDUCTOR:-{{ validate_minion_ironic_conductor }}}" -RC=0 - -set +x -source "/home/{{ undercloud_user }}/stackrc" -set -x - -if [[ ${VALIDATE_HEAT_ENGINE,,} == "true" ]]; then - openstack orchestration service list - HOST_COUNT=$(openstack orchestration service list -c Host -f value | sort | uniq | wc -l) - if [ "$HOST_COUNT" -le 1 ]; then - # count should be > 1 if we have an undercloud + minion - echo "ERROR: Heat Engine host count is 1 or less." - RC=1 - fi - - DOWN_STATUS=$(openstack orchestration service list -c Status -f value | grep -v up | wc -l) - if [ "$DOWN_STATUS" -ge 1 ]; then - echo "ERROR: Heat Engine status contains a service that is not up." - RC=1 - fi -fi -if [[ ${VALIDATE_IRONIC_CONDUCTOR,,} == "true" ]]; then - openstack baremetal conductor list - HOST_COUNT=$(openstack baremetal conductor list -c Hostname -f value | sort | uniq | wc -l) - if [ "$HOST_COUNT" -le 1 ]; then - # count should be > 1 if we have an undercloud + minion - echo "ERROR: Ironic Conductor host count is 1 or less." - RC=1 - fi - DOWN_STATUS=$(openstack baremetal conductor list -c Alive -f value | grep -v True | wc -l) - if [ "$DOWN_STATUS" -ge 1 ]; then - echo "ERROR: Ironic Conductor status contains a service that is not up." - RC=1 - fi -fi - -exit $RC diff --git a/roles/validate-minion/vars/main.yml b/roles/validate-minion/vars/main.yml deleted file mode 100644 index 662adad62..000000000 --- a/roles/validate-minion/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for validate-minion diff --git a/roles/validate-perf/defaults/main.yml b/roles/validate-perf/defaults/main.yml deleted file mode 100644 index fc208efb1..000000000 --- a/roles/validate-perf/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -dstat_log_name: dstat-csv.log -dstat_options: tcmndrylpg -dstat_delay: 1 -kernel_sec: true diff --git a/roles/validate-perf/meta/main.yml b/roles/validate-perf/meta/main.yml deleted file mode 100644 index bd990ac59..000000000 --- a/roles/validate-perf/meta/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -galaxy_info: - author: Red Hat - description: | - An Ansible role for generating custom RPMSs from upstream Gerrit changes in - the TripleO project using DLRN. This repo then can be injected in the tested - environment, a repo file created and a yum update should start using the - built RPMs. - license: Apache - platforms: - - name: CentOS - versions: - - 7 - - 8 - - name: EL - versions: - - 7 - - 8 - min_ansible_version: 2.8 - -dependencies: - - extras-common diff --git a/roles/validate-perf/molecule/default/Dockerfile.j2 b/roles/validate-perf/molecule/default/Dockerfile.j2 deleted file mode 100644 index 0de39e63c..000000000 --- a/roles/validate-perf/molecule/default/Dockerfile.j2 +++ /dev/null @@ -1,22 +0,0 @@ -# Molecule managed - -{% if item.registry is defined %} -FROM {{ item.registry.url }}/{{ item.image }} -{% else %} -FROM {{ item.image }} -{% endif %} - -{% if item.env is defined %} -{% for var, value in item.env.items() %} -{% if value %} -ENV {{ var }} {{ value }} -{% endif %} -{% endfor %} -{% endif %} - -RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates iproute2 && apt-get clean; \ - elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash iproute && dnf clean all; \ - elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash iproute && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \ - elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml iproute2 && zypper clean -a; \ - elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \ - elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates iproute2 && xbps-remove -O; fi diff --git a/roles/validate-perf/molecule/default/INSTALL.rst b/roles/validate-perf/molecule/default/INSTALL.rst deleted file mode 100644 index 6a44bde9e..000000000 --- a/roles/validate-perf/molecule/default/INSTALL.rst +++ /dev/null @@ -1,22 +0,0 @@ -******* -Docker driver installation guide -******* - -Requirements -============ - -* Docker Engine - -Install -======= - -Please refer to the `Virtual environment`_ documentation for installation best -practices. If not using a virtual environment, please consider passing the -widely recommended `'--user' flag`_ when invoking ``pip``. - -.. _Virtual environment: https://virtualenv.pypa.io/en/latest/ -.. _'--user' flag: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site - -.. code-block:: bash - - $ pip install 'molecule[docker]' diff --git a/roles/validate-perf/molecule/default/converge.yml b/roles/validate-perf/molecule/default/converge.yml deleted file mode 100644 index 3c0db02c8..000000000 --- a/roles/validate-perf/molecule/default/converge.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Converge - hosts: all - gather_facts: false - tasks: - - include_role: - name: validate-perf - tasks_from: security_disable diff --git a/roles/validate-perf/molecule/default/molecule.yml b/roles/validate-perf/molecule/default/molecule.yml deleted file mode 100644 index 213781eaa..000000000 --- a/roles/validate-perf/molecule/default/molecule.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -driver: - name: docker -log: true -platforms: - - name: instance - image: centos:7 -provisioner: - name: ansible - log: true - env: - # ANSIBLE_STDOUT_CALLBACK: yaml - # hack to make it find 'common' role from tq - ANSIBLE_ROLES_PATH: "${ANSIBLE_ROLES_PATH}:${MOLECULE_SCENARIO_DIRECTORY}/../../../../../tripleo-quickstart/roles" -verifier: - name: ansible diff --git a/roles/validate-perf/molecule/default/verify.yml b/roles/validate-perf/molecule/default/verify.yml deleted file mode 100644 index e0fbb1198..000000000 --- a/roles/validate-perf/molecule/default/verify.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Verify - hosts: all diff --git a/roles/validate-perf/tasks/main.yml b/roles/validate-perf/tasks/main.yml deleted file mode 100644 index eae2794d6..000000000 --- a/roles/validate-perf/tasks/main.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: Validate performance (dstat) on overcloud - become: true - block: - - include_tasks: security_disable.yml - when: not kernel_sec|bool - - name: Install the latest version of dstat on overcloud - package: - name: dstat - state: present - - name: Ensure /var/log/extra exists - file: - path: /var/log/extra - state: directory - mode: 0777 - - name: Run dstat for collecting metrics on overcloud - shell: > - dstat - -{{ dstat_options }} - --nocolor - --output /var/log/extra/{{ dstat_log_name }} - {{ dstat_delay }} - >> /var/log/extra/dstat.txt & - args: - executable: /bin/bash - async: 1 - poll: 0 - changed_when: false - rescue: - - debug: - msg: "Warning: Performance cannot be validated." diff --git a/roles/validate-perf/tasks/security_disable.yml b/roles/validate-perf/tasks/security_disable.yml deleted file mode 100644 index 44abcfb5f..000000000 --- a/roles/validate-perf/tasks/security_disable.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Check /sys/kernel settings before disabling - include_tasks: security_print_vars.yml - -- name: Turn off security - become: true - copy: - dest: "/sys/kernel/debug/x86/{{ item }}" - content: "0" - ignore_errors: true - with_items: - - pti_enabled - - retp_enabled - - ibrs_enabled - -- name: Check /sys/kernel settings after disabling - include_tasks: security_print_vars.yml diff --git a/roles/validate-perf/tasks/security_print_vars.yml b/roles/validate-perf/tasks/security_print_vars.yml deleted file mode 100644 index c857391a9..000000000 --- a/roles/validate-perf/tasks/security_print_vars.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- name: Check /sys/kernel for security performance affecting features - become: true - shell: | - echo "/sys/kernel/debug/x86/{{ item }}: $(cat /sys/kernel/debug/x86/{{ item }})" - register: security_vars - with_items: - - pti_enabled - - retp_enabled - - ibrs_enabled - - ibpb_enabled - ignore_errors: true - changed_when: false - -- name: Debug print the security_vars - debug: - msg: "{{ security_vars.results|map(attribute='stdout')|list }}" diff --git a/roles/validate-sanity-checks/README.md b/roles/validate-sanity-checks/README.md deleted file mode 100644 index 27aa33b03..000000000 --- a/roles/validate-sanity-checks/README.md +++ /dev/null @@ -1,48 +0,0 @@ -Validate-Sanity-Checks -====================== - -This role provides a script for executing sanity checks on an overcloud -deployment. The role creates basic checks using openstack CLI depending -on the services enabled on the overcloud deployment. These sanity checks -are useful when a full overcloud is not deployed and the overcloud -validation roles cannot be run. - -Requirements ------------- - -This role requires that the overcloud is deployed and the services of interest -are available for testing. - -Role Variables --------------- - -* `sanity_content_name`: - The sanity tests to be run in checks -* `sanity_scripts`: - Script to create the sanity checks tests -* `sanity_checks_log`: - Log file to store the output of the sanity checks -* `sanitytest_create`: - Boolean variable whether to create the artifacts to test enabled services -* `sanitytest_cleanup`: - Boolean variable whether to clean up the artifacts created by the sanity checks -* `sanity_step_sanity_checks`: - Boolean variable whether to execute the sanity checks test - -Dependencies ------------- - -No dependencies. - -Example Playbook ----------------- - - # Execute sanity checks against the overcloud deployment - - name: Sanity check the overcloud services - hosts: undercloud - roles: - - { role: validate-sanity-checks, when: run_sanity_checks|bool} - -License -------- - -Apache 2.0 - -Author Information ------------------- - -TripleO CI Team diff --git a/roles/validate-sanity-checks/defaults/main.yml b/roles/validate-sanity-checks/defaults/main.yml deleted file mode 100644 index 88614844c..000000000 --- a/roles/validate-sanity-checks/defaults/main.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -sanity_content_name: sanity_test -sanity_scripts: validate-sanity-checks.sh.j2 -sanity_checks_log: validate_sanity_test.log -# sanitytest step -sanitytest_create: true -sanitytest_cleanup: true -# step -sanity_step_sanity_checks: true diff --git a/roles/validate-sanity-checks/meta/main.yml b/roles/validate-sanity-checks/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-sanity-checks/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-sanity-checks/tasks/create-scripts.yml b/roles/validate-sanity-checks/tasks/create-scripts.yml deleted file mode 100644 index 1b045d161..000000000 --- a/roles/validate-sanity-checks/tasks/create-scripts.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Create Sanity Checks scripts - template: - src: "{{ sanity_scripts }}" - dest: "{{ working_dir }}/validate-sanity-check.sh" - mode: 0755 diff --git a/roles/validate-sanity-checks/tasks/main.yml b/roles/validate-sanity-checks/tasks/main.yml deleted file mode 100644 index 14484d85b..000000000 --- a/roles/validate-sanity-checks/tasks/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- include: create-scripts.yml - -- include: sanity-checks.yml - when: sanity_step_sanity_checks|bool diff --git a/roles/validate-sanity-checks/tasks/sanity-checks.yml b/roles/validate-sanity-checks/tasks/sanity-checks.yml deleted file mode 100644 index e939134a1..000000000 --- a/roles/validate-sanity-checks/tasks/sanity-checks.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Run sanity checks - shell: > - set -o pipefail && - {{ working_dir }}/validate-sanity-check.sh 2>&1 {{ timestamper_cmd }} > - {{ sanity_checks_log }} - changed_when: true diff --git a/roles/validate-sanity-checks/templates/validate-sanity-checks.sh.j2 b/roles/validate-sanity-checks/templates/validate-sanity-checks.sh.j2 deleted file mode 100644 index 85aeb3118..000000000 --- a/roles/validate-sanity-checks/templates/validate-sanity-checks.sh.j2 +++ /dev/null @@ -1,170 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -OVERCLOUD_NAME="overcloud" -SANITYTEST_CONTENT_NAME={{sanity_content_name}} - -function source_rc { - if [ $1 = "stackrc" ]; then - cloud="Undercloud" - else - cloud="Overcloud" - fi - echo "You must source a $1 file for the $cloud." - echo "Attempting to source $HOME/$1" - source $HOME/$1 - echo "Done" -} - -function stackrc_check { - source_rc "stackrc" -} - -function overcloudrc_check { - source_rc "overcloudrc" -} - -function run_cmd { - if ! $@; then - echo "Command: $@ FAILED" >&2 - exitval=1 - else - echo "Command: $@ OK" - fi -} - -function overcloud_sanitytest_create { - ENABLED_SERVICES=$@ - for service in $ENABLED_SERVICES; do - case $service in - "keystone" ) - run_cmd openstack user create ${SANITYTEST_CONTENT_NAME} - run_cmd openstack user list - ;; - "glance_api" ) - run_cmd openstack image create ${SANITYTEST_CONTENT_NAME} - run_cmd openstack image list - ;; - "neutron_api" ) - run_cmd openstack network create ${SANITYTEST_CONTENT_NAME} - run_cmd openstack network list - ;; - "cinder_api" ) - run_cmd openstack volume create ${SANITYTEST_CONTENT_NAME} --size 1 - run_cmd openstack volume list - ;; - "heat_api" ) - echo "heat_template_version: newton" > /tmp/${SANITYTEST_CONTENT_NAME}.yaml - run_cmd openstack stack create ${SANITYTEST_CONTENT_NAME} --template /tmp/${SANITYTEST_CONTENT_NAME}.yaml - run_cmd openstack stack list - ;; - "swift_proxy" ) - run_cmd openstack container create ${SANITYTEST_CONTENT_NAME} - run_cmd openstack container list - ;; - "sahara_api" ) - # glance_api must also be enabled - run_cmd openstack image create sahara_${SANITYTEST_CONTENT_NAME} - run_cmd openstack dataprocessing image register sahara_${SANITYTEST_CONTENT_NAME} --username centos - run_cmd openstack dataprocessing image list - ;; - esac - done -} - -function overcloud_sanitytest_check { - ENABLED_SERVICES=$@ - for service in $ENABLED_SERVICES; do - case $service in - "keystone" ) - run_cmd openstack user show ${SANITYTEST_CONTENT_NAME} - ;; - "glance_api" ) - run_cmd openstack image show ${SANITYTEST_CONTENT_NAME} - ;; - "neutron_api" ) - run_cmd openstack network show ${SANITYTEST_CONTENT_NAME} - ;; - "cinder_api" ) - run_cmd openstack volume show ${SANITYTEST_CONTENT_NAME} - ;; - "heat_api" ) - run_cmd openstack stack show ${SANITYTEST_CONTENT_NAME} - # FIXME(shardy): It'd be good to add pre/post upgrade checks - # on the actual version, but this is still good for debugging - run_cmd openstack orchestration template version list - ;; - "swift_proxy" ) - run_cmd openstack container show ${SANITYTEST_CONTENT_NAME} - ;; - "sahara_api" ) - run_cmd openstack dataprocessing image show sahara_${SANITYTEST_CONTENT_NAME} - ;; - esac - done -} - -function overcloud_sanitytest_cleanup { - ENABLED_SERVICES=$@ - for service in $ENABLED_SERVICES; do - case $service in - "keystone" ) - echo "Sanity test keystone" - run_cmd openstack user delete ${SANITYTEST_CONTENT_NAME} - ;; - "glance_api" ) - run_cmd openstack image delete ${SANITYTEST_CONTENT_NAME} - ;; - "neutron_api" ) - run_cmd openstack network delete ${SANITYTEST_CONTENT_NAME} - ;; - "cinder_api" ) - run_cmd openstack volume delete ${SANITYTEST_CONTENT_NAME} - ;; - "heat_api" ) - run_cmd openstack stack delete --yes ${SANITYTEST_CONTENT_NAME} - ;; - "swift_proxy" ) - run_cmd openstack container delete ${SANITYTEST_CONTENT_NAME} - ;; - "sahara_api" ) - run_cmd openstack dataprocessing image unregister sahara_${SANITYTEST_CONTENT_NAME} - run_cmd openstack image delete sahara_${SANITYTEST_CONTENT_NAME} - ;; - esac - done -} - -echo "Overcloud sanitytest" -exitval=0 -stackrc_check - -if heat stack-show "$OVERCLOUD_NAME" | grep "stack_status " | egrep -q "(CREATE|UPDATE)_COMPLETE"; then - - ENABLED_SERVICES=$(openstack stack output show overcloud EnabledServices -f json | \ - jq -r ".output_value" | jq '.Controller | .[]' | tr "\n" " " | sed "s/\"//g") - echo "Sanity Test, ENABLED_SERVICES=$ENABLED_SERVICES" - - overcloudrc_check - -{% if sanitytest_create|bool %} - overcloud_sanitytest_create $ENABLED_SERVICES -{% endif %} - - overcloud_sanitytest_check $ENABLED_SERVICES - -{% if sanitytest_cleanup|bool %} - overcloud_sanitytest_cleanup $ENABLED_SERVICES -{% endif %} - - if [ $exitval -eq 0 ]; then - echo "Overcloud sanitytest SUCCEEDED" - else - echo "Overcloud sanitytest FAILED" - fi - exit $exitval -else - echo "Overcloud sanitytest FAILED - No stack $OVERCLOUD_NAME." - exit 1 -fi diff --git a/roles/validate-services/tasks/containers.yaml b/roles/validate-services/tasks/containers.yaml deleted file mode 100644 index d04e87aa3..000000000 --- a/roles/validate-services/tasks/containers.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -- name: Do we have docker - stat: - path: /usr/bin/docker - register: docker_stat - -- name: Does docker run - systemd: - name: docker - register: docker_svc - when: docker_stat.stat.exists - -- name: Do we have podman - stat: - path: /usr/bin/podman - register: podman_stat - -- name: Podman related block - when: podman_stat.stat.exists - block: - - name: Get failed containers for podman - become: true - shell: > - {% raw %} - podman ps -a --filter 'status=exited' --format '{{ .Names }} {{ .Status }}' - {% endraw %} - register: failed_podman - - - name: Fail if we detect failed podman container - fail: - msg: | - Failed container detected. Please check the following locations - /var/log/extras/failed_containers.log - /var/log/extras/podman - when: item is not match(".* Exited \(0\) .* ago") - loop: "{{ failed_podman.stdout_lines }}" - -- name: Docker related block - when: - - docker_stat.stat.exists - - docker_svc.status['SubState'] == 'running' - block: - - name: Get failed containers from docker - shell: > - {% raw %} - docker ps -a --filter 'status=exited' --format '{{ .Names }} {{ .Status }}' - {% endraw %} - register: failed_docker - - - name: Fail if we detect failed docker container - fail: - msg: | - Failed container detected. Please check the following locations - /var/log/extras/failed_containers.log - /var/log/extras/docker - when: - - failed_docker is defined - - item is not match(".* Exited \(0\) .* ago") - loop: "{{ failed_docker.stdout_lines }}" diff --git a/roles/validate-services/tasks/main.yaml b/roles/validate-services/tasks/main.yaml deleted file mode 100644 index 8e232512a..000000000 --- a/roles/validate-services/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- include_tasks: containers.yaml -- include_tasks: systemd.yaml diff --git a/roles/validate-services/tasks/systemd.yaml b/roles/validate-services/tasks/systemd.yaml deleted file mode 100644 index 0a5e5b837..000000000 --- a/roles/validate-services/tasks/systemd.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Get failed services from Systemd - shell: > - systemctl list-units --failed --plain --no-legend --no-pager "tripleo_*" - register: systemd_state - changed_when: false - -- name: Print out any failed Systemd services for tripleo_* - debug: - var: systemd_state.stdout_lines - -# once ansible 2.7 is used this task should -# include the following line -# fail_msg: "the following services failed {{ systemd_state.stdout_lines }}"# -# The above debug statement should be removed at that time. -- name: Fails if we find failed systemd units - assert: - that: - - systemd_state.stdout_lines|length == 0 diff --git a/roles/validate-simple/README.md b/roles/validate-simple/README.md deleted file mode 100644 index 53cd223d3..000000000 --- a/roles/validate-simple/README.md +++ /dev/null @@ -1,68 +0,0 @@ -validate-simple -=============== - -This role uses heat templates from -[THT](http://opendev.org/openstack/tripleo-heat-templates/) -to validate an OpenStack installation. By default it does a ping test between -two OpenStack instances. - -Role Variables --------------- - -For the defaults of these variables, see the defaults/main.yml file in this role. - -* `tenantrc` -- file containing the auth variables for the cloud -* `validate_script` -- the jinja template used to create the validation script -* `validate_template_path` -- path where the heat templates can be found -* `validate_template` -- the filename of the heat template used for validation -* `validate_log` -- file to log the output of the validation script -* `validate_stack_name` -- the name of the heat stack used for validation -* `validate_success_status` -- output that signifies successful stack creation -* `validate_image_file` -- name of downloaded image file -* `validate_image_path` -- path to existing image file on disk -* `validate_image_url` -- URL to the image files (without the filenames) -* `image_disk`, `image_initramfs`, `image_kernel` -- name of the disk image, - initramfs and kernel on the previous URL -* `validate_image_name` -- the name used in glance for the assembled image from - the previous files -* `validate_image_dir` -- directory to store the downloaded images -* `release` -- release of the cloud to be validated (mitaka, newton, etc.); - older releases use different heat commands -* `floating_ip_cidr` -- the network CIDR to be used for a public floating IP - network during testing -* `public_net_name`, `public_net_type` -- the name and type of the public - neutron network, used for floating IPs during the validation -* `public_net_pool_start`, `public_net_pool_end`, `public_net_gateway`, - `public_physical_network`, `public_segmentation_id` -- parameters used to - create the public floating IP network -* `validate_template_environment`: used to override variables inside the - validation template, passed as an environment file to heat -* `skip_pingtest_cleanup`: false/true - whether to skip pingtest stack deletion - or not (default is false) - -Dependencies ------------- - -The role uses heat templates from the tripleo-heat-templates package/repository -and downloads Cirros images during the run. - -Example Playbook ----------------- - -```yaml ---- -- name: Validate the overcloud - hosts: undercloud - roles: - - validate-simple -``` - -License -------- - -Apache 2.0 - -Author Information ------------------- - -OpenStack diff --git a/roles/validate-simple/defaults/main.yml b/roles/validate-simple/defaults/main.yml deleted file mode 100644 index 41907916a..000000000 --- a/roles/validate-simple/defaults/main.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -tenantrc: >- - overcloudrc -validate_script: overcloud-validate.sh.j2 -validate_template_path: /usr/share/openstack-tripleo-heat-templates/ci/pingtests -validate_template: tenantvm_floatingip.yaml -validate_log: "{{ working_dir }}/overcloud_validate.log" -validate_stack_name: pingtest_stack -validate_success_status: CREATE_COMPLETE -validate_failed_status: CREATE_FAILED -validate_image_file: cirros-0.5.2-x86_64-uec.tar.gz -validate_image_url: "http://download.cirros-cloud.net/0.5.2/" -validate_image_path: "/opt/cache/files/{{ validate_image_file }}" -image_disk: cirros-0.5.2-x86_64-blank.img -image_initramfs: cirros-0.5.2-x86_64-initrd -image_kernel: cirros-0.5.2-x86_64-vmlinuz -validate_image_name: pingtest_image -validate_image_dir: "{{ working_dir }}/cirros_images" -release: mitaka -floating_ip_cidr: "{{ undercloud_network_cidr }}" -public_net_name: nova -public_net_type: flat -public_net_pool_start: "{{ floating_ip_cidr|nthhost(100) }}" -public_net_pool_end: "{{ floating_ip_cidr|nthhost(120) }}" -public_net_gateway: "{{ floating_ip_cidr|nthhost(1) }}" -public_physical_network: datacentre -public_segmentation_id: '' -validate_template_environment: - parameters: - image: "{{ validate_image_name }}" - public_net_name: "{{ public_net_name }}" -skip_pingtest_cleanup: false -generate_pingtest_subunit: false diff --git a/roles/validate-simple/files/tenantvm_floatingip.yaml b/roles/validate-simple/files/tenantvm_floatingip.yaml deleted file mode 100644 index 8928d9be9..000000000 --- a/roles/validate-simple/files/tenantvm_floatingip.yaml +++ /dev/null @@ -1,143 +0,0 @@ ---- -heat_template_version: 2013-05-23 - -description: > - This template resides in tripleo-ci for Mitaka CI jobs only. - For Newton and beyond, please look in THT. - HOT template to create a new neutron network plus a router to the public - network, and for deploying a server into the new network. The template also - assigns a floating IP address and sets security group rules. ADAPTED FROM - https://raw.githubusercontent.com/openstack/heat-templates/master/hot/servers_in_new_neutron_net.yaml -parameters: - key_name: - type: string - description: Name of keypair to assign to servers - default: 'pingtest_key' - image: - type: string - description: Name of image to use for servers - default: 'pingtest_image' - public_net_name: - type: string - default: 'nova' - description: > - ID or name of public network for which floating IP addresses will be allocated - private_net_name: - type: string - description: Name of private network to be created - default: 'default-net' - private_net_cidr: - type: string - description: Private network address (CIDR notation) - default: '192.168.2.0/24' - private_net_gateway: - type: string - description: Private network gateway address - default: '192.168.2.1' - private_net_pool_start: - type: string - description: Start of private network IP address allocation pool - default: '192.168.2.100' - private_net_pool_end: - type: string - default: '192.168.2.200' - description: End of private network IP address allocation pool - -resources: - - key_pair: - type: OS::Nova::KeyPair - properties: - save_private_key: true - name: {get_param: key_name} - - private_net: - type: OS::Neutron::Net - properties: - 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} - allocation_pools: - - 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} - - router_interface: - type: OS::Neutron::RouterInterface - properties: - router_id: {get_resource: router} - subnet_id: {get_resource: private_subnet} - - volume1: - type: OS::Cinder::Volume - properties: - name: Volume1 - image: {get_param: image} - size: 1 - - server1: - type: OS::Nova::Server - depends_on: volume1 - properties: - name: Server1 - block_device_mapping: - - device_name: vda - volume_id: {get_resource: volume1} - flavor: {get_resource: test_flavor} - key_name: {get_resource: key_pair} - networks: - - port: {get_resource: server1_port} - - server1_port: - type: OS::Neutron::Port - properties: - network_id: {get_resource: private_net} - fixed_ips: - - subnet_id: {get_resource: private_subnet} - security_groups: [{get_resource: server_security_group}] - - server1_floating_ip: - type: OS::Neutron::FloatingIP - # TODO: investigate why we need this depends_on and if we could - # replace it by router_id with get_resource: router_interface - depends_on: router_interface - properties: - floating_network: {get_param: public_net_name} - port_id: {get_resource: server1_port} - - server_security_group: - type: OS::Neutron::SecurityGroup - properties: - description: Add security group rules for server - name: pingtest-security-group - rules: - - remote_ip_prefix: 0.0.0.0/0 - protocol: tcp - port_range_min: 22 - port_range_max: 22 - - remote_ip_prefix: 0.0.0.0/0 - protocol: icmp - - test_flavor: - type: OS::Nova::Flavor - properties: - ram: 512 - vcpus: 1 - -outputs: - server1_private_ip: - description: IP address of server1 in private network - value: {get_attr: [server1, first_address]} - server1_public_ip: - description: Floating IP address of server1 in public network - value: {get_attr: [server1_floating_ip, floating_ip_address]} diff --git a/roles/validate-simple/files/wait_for b/roles/validate-simple/files/wait_for deleted file mode 100644 index 82fe763e2..000000000 --- a/roles/validate-simple/files/wait_for +++ /dev/null @@ -1,179 +0,0 @@ -#!/bin/bash -# -# Copyright 2013 Red Hat -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -set -e # exit on the first non-zero status -set -u # exit on unset variables -set -o pipefail - -SCRIPT_NAME=$(basename $0) - - -function show_options { - EXITVAL=${1:-1} - echo "Usage: $SCRIPT_NAME [-h] [-w TIMEOUT] [-l LOOP_COUNT] [-f FAIL_MATCH] [-s SUCCESS_MATCH] --delay SLEEP_TIME -- COMMAND" - echo - echo "Waits for a command to fail, succeed, or timeout." - echo - echo "Options:" - echo " -h,--help -- this help" - echo " -w,--walltime TIMEOUT -- Timeout after TIMEOUT seconds." - echo " -l,--looptimeout LOOP_COUNT -- Timeout after checking COMMAND LOOP_COUNT times." - echo " -d,--delay SLEEP_TIME -- Seconds to sleep between checks of COMMAND." - echo " -s,--success-match -- Output that indicates a success." - echo " -f,--fail-match -- Output that indicates a short-circuit failure." - echo - echo "Execute the command in a loop until it succeeds, a timeout is reached, or" - echo "a short-circuit failure occurs. Between each check of the command sleep for" - echo "the number of seconds specified by SLEEP_TIME." - echo - echo "Examples:" - echo " wait_for -w 300 --delay 10 -- ping -c 1 192.0.2.2" - echo " wait_for -w 10 --delay 1 -- ls file_we_are_waiting_for" - echo " wait_for -w 30 --delay 3 -- date \| grep 8" - echo " wait_for -w 300 --delay 10 --fail-match CREATE_FAILED -- heat stack-show undercloud" - echo " wait_for -w 300 --delay 10 --success-match CREATE_COMPLETE -- heat stack-show undercloud" - exit $EXITVAL -} - -USE_WALLTIME= -TIMEOUT= -DELAY= - -if [ -n "${SUCCESSFUL_MATCH_OUTPUT:-}" ]; then - echo "DEPRECATION WARNING: Using env vars for specifying SUCCESSFUL_MATCH_OUTPUT is deprecated." -fi -SUCCESSFUL_MATCH_OUTPUT=${SUCCESSFUL_MATCH_OUTPUT:-""} -if [ -n "${FAIL_MATCH_OUTPUT:-}" ]; then - echo "DEPRECATION WARNING: Using env vars for specifying FAIL_MATCH_OUTPUT is deprecated." -fi -FAIL_MATCH_OUTPUT=${FAIL_MATCH_OUTPUT:-""} - -USE_ARGPARSE=0 -# We have to support positional arguments for backwards compat -if [ -n "$1" -a "${1:0:1}" == "-" ]; then - USE_ARGPARSE=1 -else - echo "DEPRECATION WARNING: Using positional arguments for wait_for is deprecated." -fi - -if [ $USE_ARGPARSE -eq 1 ]; then - set +e - TEMP=$(getopt -o h,w:,l:,d:,s:,f: -l help,walltime:,looptimeout:,delay:,success-match:,fail-match: -n $SCRIPT_NAME -- "$@") - if [ $? != 0 ]; then - show_options; - fi - set -e - - # Note the quotes around `$TEMP': they are essential! - eval set -- "$TEMP" - - while true ; do - case "$1" in - -h) show_options 0;; - --help) show_options 0;; - -w|--walltime) [ -n "$USE_WALLTIME" ] && show_options - USE_WALLTIME=1 - TIMEOUT="$2" - shift 2 - ;; - -l|--looptimeout) [ -n "$USE_WALLTIME" ] && show_options - USE_WALLTIME=0 - TIMEOUT="$2" - shift 2 - ;; - -d|--delay) DELAY="$2"; shift 2;; - -s|--success-match) SUCCESSFUL_MATCH_OUTPUT="$2"; shift 2;; - -f|--fail-match) FAIL_MATCH_OUTPUT="$2"; shift 2;; - --) shift ; break ;; - esac - done -else - TIMEOUT=${1:-""} - DELAY=${2:-""} - USE_WALLTIME=0 - shift 2 || true -fi - -COMMAND="$@" - -if [ -z "$TIMEOUT" -o -z "$DELAY" -o -z "$COMMAND" ]; then - show_options -fi - - -ENDTIME=$(($(date +%s) + $TIMEOUT)) -TIME_REMAINING=0 -function update_time_remaining { - CUR_TIME="$(date +%s)" - TIME_REMAINING=$(($ENDTIME - $CUR_TIME)) -} - - -OUTPUT= - -function check_cmd { - STATUS=0 - OUTPUT=$(eval $COMMAND 2>&1) || STATUS=$? - if [[ -n "$SUCCESSFUL_MATCH_OUTPUT" ]] \ - && [[ $OUTPUT =~ $SUCCESSFUL_MATCH_OUTPUT ]]; then - exit 0 - elif [[ -n "$FAIL_MATCH_OUTPUT" ]] \ - && [[ $OUTPUT =~ $FAIL_MATCH_OUTPUT ]]; then - echo "Command output matched '$FAIL_MATCH_OUTPUT'. Exiting..." - exit 1 - elif [[ -z "$SUCCESSFUL_MATCH_OUTPUT" ]] && [[ $STATUS -eq 0 ]]; then - # The command successfully completed and we aren't testing against - # it's output so we have finished waiting. - exit 0 - fi -} - -i=0 -while [ $USE_WALLTIME -eq 1 -o $i -lt $TIMEOUT ]; do - if [ $USE_WALLTIME -eq 1 ]; then - update_time_remaining - if [ $TIME_REMAINING -le 0 ]; then - break - fi - else - i=$((i + 1)) - fi - - check_cmd - - if [ $USE_WALLTIME -eq 1 ]; then - update_time_remaining - if [ $TIME_REMAINING -lt $DELAY ]; then - if [ $TIME_REMAINING -gt 0 ]; then - sleep $TIME_REMAINING - check_cmd - fi - else - sleep $DELAY - fi - else - sleep $DELAY - fi -done -if [ $USE_WALLTIME -eq 1 ]; then - SECONDS=$TIMEOUT -else - SECONDS=$((TIMEOUT * DELAY)) -fi -printf 'Timing out after %d seconds:\nCOMMAND=%s\nOUTPUT=%s\n' \ - "$SECONDS" "$COMMAND" "$OUTPUT" -exit 1 diff --git a/roles/validate-simple/meta/main.yml b/roles/validate-simple/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-simple/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-simple/tasks/main.yml b/roles/validate-simple/tasks/main.yml deleted file mode 100644 index 805920e6e..000000000 --- a/roles/validate-simple/tasks/main.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: Old THT workaround, check for pingtest template - stat: - path: "{{ validate_template_path }}/{{ validate_template }}" - register: template_check - -- name: Old THT workaround, copy over the pingtest template - copy: - src: "tenantvm_floatingip.yaml" - dest: "{{ working_dir }}/tenantvm_floatingip.yaml" - when: - - validate_template == "tenantvm_floatingip.yaml" - - not template_check.stat.exists - -- name: Old THT workaround, override the template path - set_fact: - validate_template_path: "{{ working_dir }}" - when: - - validate_template == "tenantvm_floatingip.yaml" - - not template_check.stat.exists - -- name: Create overcloud validate script - template: - src: "{{ validate_script }}" - dest: "{{ working_dir }}/overcloud-validate.sh" - mode: 0744 - -- name: Copy wait_for script - copy: - src: wait_for - dest: "{{ working_dir }}/wait_for" - mode: 0755 - -- name: Validate the overcloud - shell: > - set -o pipefail && - {{ working_dir }}/overcloud-validate.sh 2>&1 {{ timestamper_cmd }} > {{ validate_log }} - changed_when: true diff --git a/roles/validate-simple/templates/overcloud-validate.sh.j2 b/roles/validate-simple/templates/overcloud-validate.sh.j2 deleted file mode 100644 index 23af5627a..000000000 --- a/roles/validate-simple/templates/overcloud-validate.sh.j2 +++ /dev/null @@ -1,163 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Validate the overcloud deployment -## ================================= - -## .. note: The following set of scripts are generated from a jinja template -## which may be viewed here: https://github.com/openstack/tripleo-quickstart-extras/blob/master/roles/validate-simple/templates/overcloud-validate.sh.j2 - -## * Create cleanup env function for heat -## :: - -function cleanup { - openstack stack delete --yes {{ validate_stack_name }} - if [[ $({{ working_dir }}/wait_for -w 300 -d 30 -s "Stack not found" -- "openstack stack show {{ validate_stack_name }}") ]]; then - echo "openstack stack delete" - else - if [[ $(openstack stack list | grep {{ validate_stack_name }} | grep -i failed) ]]; then - openstack stack delete --yes {{ validate_stack_name }} - fi - fi - openstack image list | awk '/pingtest/ {print $2}' | while read IMAGEID; do openstack image delete $IMAGEID; done - neutron net-delete {{ public_net_name }} -} -{% if not skip_pingtest_cleanup %} -# trap on exit #nodocs -trap cleanup EXIT #nodocs -{% endif %} - -{% if generate_pingtest_subunit|bool %} -# Install dependencies for generate_subunit #nodocs -sudo yum install -y python-os-testr - -## * Start measuring time of test -## :: - -TEST_START=$(date +%s) -{% endif %} - -## * Source tenantrc file -## :: - -source {{ working_dir }}/{{ tenantrc }} - -## * Check if an environment is already deployed and, in case, cleanup it -## :: - -[ "x$(openstack stack list | grep {{ validate_stack_name }} || true)" != "x" ] && cleanup -# get validate image -if [[ ! -d {{ validate_image_dir }} ]]; then - mkdir {{ validate_image_dir }}; -fi - -IMAGE_PATH={{ validate_image_dir }}/{{ image_disk }} -INITRAMFS_PATH={{ validate_image_dir }}/{{ image_initramfs }} -KERNEL_PATH={{ validate_image_dir }}/{{ image_kernel }} - -if [[ -e $IMAGE_PATH && -e $INITRAMFS_PATH && -e $KERNEL_PATH ]]; then - echo "Using existing images in {{ validate_image_dir }}" -else - pushd {{ validate_image_dir }} - if [[ -e {{ validate_image_path }} ]]; then - tar -zxvf {{ validate_image_path }} - else - curl -L -s -S -o {{ validate_image_dir }}/{{ validate_image_file }} {{ validate_image_url }}/{{ validate_image_file }} - tar -zxvf {{ validate_image_file }} - rm -f "{{ validate_image_file }}" - fi - popd -fi - -## * Upload cirros image into glance -## :: - -ramdisk_id=$(openstack image create pingtest_initramfs --public --container-format ari --disk-format ari --file $INITRAMFS_PATH | awk '/ id / {print $4}') -kernel_id=$(openstack image create pingtest_kernel --public --container-format aki --disk-format aki --file $KERNEL_PATH | awk '/ id / {print $4}') -openstack image create {{ validate_image_name }} --public --container-format ami --disk-format ami \ - --property kernel_id=$kernel_id --property ramdisk_id=$ramdisk_id --file $IMAGE_PATH - -## * Create external network - -## .. note: Liberty compatibility: -## (heat can't create an external network in Liberty) -## :: - -if ! neutron net-list | grep '{{ public_net_name }}'; then - -neutron net-create {{ public_net_name }} --router:external=True \ - --provider:network_type {{ public_net_type }} \ - --provider:physical_network {{ public_physical_network }} \ -{% if public_segmentation_id != '' %} - --provider:segmentation_id {{ public_segmentation_id }} -{% endif %} - - -neutron subnet-create --name ext-subnet \ - --allocation-pool \ - start={{ public_net_pool_start }},end={{ public_net_pool_end }} \ - --disable-dhcp \ - --gateway {{ public_net_gateway }} \ - {{ public_net_name }} {{ floating_ip_cidr }} - -fi - -## * Create test ping stack -## :: - -cat << EOF > {{ working_dir }}/validate-template-override.yaml -{{ validate_template_environment|to_nice_yaml }} -EOF - -openstack stack create {{ validate_stack_name }} \ - --template {{ validate_template_path }}/{{ validate_template }} \ - --environment {{ working_dir }}/validate-template-override.yaml - -## * Wait for the stack creation to complete -## * Give time to the instance to boot - -### --stop_docs -/bin/bash {{ working_dir }}/wait_for -w 600 --delay 30 \ - --success-match {{ validate_success_status }} \ - --fail-match {{ validate_failed_status }} -- openstack stack show {{ validate_stack_name }} -sleep 30 - -### --start_docs -## * Get the floating ip -## :: - -### --stop_docs -set +e -### --start_docs - -vm1_ip=`openstack stack output show {{ validate_stack_name }} server1_public_ip --format json | \ - jq -r '.["output_value"]'` - -sleep 30 -ping -c 3 $vm1_ip - -## * Print debug output if ping fails -## :: - -if [ "$?" == "0" ]; then - echo "Overcloud pingtest, SUCCESS" -{% if generate_pingtest_subunit|bool %} - generate-subunit $TEST_START $(( $(date +%s) - TEST_START)) success pingtest > {{ working_dir }}/pingtest.subunit -{% endif %} - exit 0 -else - nova console-log Server1 - nova show Server1 - nova service-list - neutron agent-list - openstack stack show {{ validate_stack_name }} - echo "Overcloud pingtest, FAIL" -{% if generate_pingtest_subunit|bool %} - generate-subunit $TEST_START $(( $(date +%s) - TEST_START)) fail pingtest > {{ working_dir }}/pingtest.subunit -{% endif %} - exit 1 -fi - -### --stop_docs diff --git a/roles/validate-tempest/README.md b/roles/validate-tempest/README.md deleted file mode 100644 index 4198f41a2..000000000 --- a/roles/validate-tempest/README.md +++ /dev/null @@ -1,168 +0,0 @@ -validate-tempest -================ - -Ansible role for running tempest tests on undercloud or overcloud. - -Requirements ------------- - -This Ansible role allows to run tempest tests against installed undercloud or overcloud from undercloud. -It can use upstream sources with virtualenv, RDO packages and kolla container image for tempest. - -Role Variables --------------- - -* `tempest_undercloud`: false/true - whether to run tempest on installed undercloud (default: false) -* `tempest_overcloud`: false/true - whether to run tempest on installed overcloud (default: true) -* `tempest_format`: venv/packages/container - Which tempest installation to use - either install python virtual environment - with installed there python modules from requirements file, or to use installed with RDO RPM packages - or to use Kolla provided tempest container image (default: packages) -* `test_white_regex` - tests regular expression for tempest run, i.e. smoke or tempest.api.object_storage|keystone_tempest_plugin. -* `run_tempest`: false/true - to run tempest or not (default: false) -* `post_tempest`: false/true - to run post processing of tempest results after tempest run -* `tempest_config`: false/true - whether to prepare the script which configures and runs tempest or not (default: true) -* `tempest_whitelist`: list - list of tests you want to be executed. set `skip_file_src` - to empty if you don't want to run with blacklist_file option (default: []) -* `skip_file_src`: path to skip tests file, set it empty if running without skip list: `skip_file_src=''` -* `tempest_workers`: int - how many parallel workers to run (default is half the number of cores/threads) -* `tempest_until_failure`: false/true - default is false, repeat the run again and again until failure occurs -* `tempest_exit_on_failure`: true/false - whether to exit from role with tempest exit code (default: true) -* `tempestmail_config`: config.yaml - name of config file for tempestmail script -* `tempestmail_log_server`: - Server where the logs are saved -* `tempest_track_resources`: true/false - whether to save the state of resources after tempest run (default: true) -* `tempest_log_dir`: - The directory path where tempest log file is stored (default: /var/log/tempest) -* `tempest_log_file`: - The name of tempest log file (default: tempest.log) -* `check_tempest_bugs`: true/false - Will check every bugzilla and launchpad bug in the yaml skip file -* `tempest_plugins`: list - List of openstack services tempest plugins to be - installed -* `tempest_plugins_git`: list - (optional) List of URLs for openstack tempest plugins you want to have installed. - (Required) `tempest_format`: venv - For example: - ``` - tempest_format: venv - tempest_plugins_git: [https://opendev.org/openstack/keystone-tempest-plugin, - https://opendev.org/openstack/cinder-tempest-plugin] - ``` -* `tempest_extra_config`: dict - A dict of tempest configuration which needs to be overridden in tempest.conf, - It should be like section.key: value. -* `tempest_conf_removal`: dict - A dict of tempest configuration which will be - removed from tempest.conf file. - Format: section.key: value -* `public_physical_network`: The name of the border physical network (default: datacentre). -* `tempest_container_registry`: The name of the container registry to use (default: docker.io/tripleomaster) -* `tempest_container_namespace`: The name of tempest container image to use (default: centos-binary-tempest) -* `tempest_container_tag`: The tag of the tempest container image to use (default: current-tripleo) -* `tempest_dir`: The path to tempest workspace directory (default: /home/stack/tempest) -* `tempest_data`: The path to keep tempest related files used for running tempest (default: /home/stack) -* `test_black_regex`: A set of tempest tests to skip (default: []) -* `tempest_version_dict`: A dict with release name as key and tempest tag version for that release as value -* `tempest_version`: The tempest version to use for running tempest -* `tempest_conf_version_dict`: A dict with release name as key and python-tempestconf tag version for that release - as value -* `tempest_test_image_version`: The version of the cloud image used by tempest for testing -* `tempest_test_image_name`: The name of the cloud image used by tempest for testing -* `tempest_test_image_path`: The full path or url of the cloud image used by tempest for testing -* `floating_ip_cidr`: the network CIDR to be used for a public floating IP network during testing -* `public_net_name`, `public_net_type` : the name and type of the public neutron network, used for floating IPs during - the tempest testing -* `public_net_pool_start`, `public_net_pool_end`, `public_net_gateway`, - `public_physical_network`, `public_segmentation_id` -- parameters used to create the public floating IP network -* `tempest_deployer_input_file`: The path to tripleo deployer input file which contains the pre configured - configuration for the deployed cloud using TripleO. -* `tempest_os_cloud`: String name of the cloud to export as OS_CLOUD when using clouds.yaml rather than stackrc -* `tempest_use_headless_chrome`: true/false - whether the headless chrome docker container should be pulled, and run -* `tempest_headless_chrome_port`: - the entrypoint into the headless chrome container - - -Skip tests file ---------------- - -Tempest test can be skipped if they are in a skip file, using the whole test -name or a regular expression. -Since the intention is to use the list of skip tests in other parts of -quickstart-extras, it's easier to have this list of skip tests in yaml format -where you can set the skip test, reason and launchpad or bugzilla. This make -easier later to check whether the test still valid or not to be skipped. -Skip files are under roles/validate-tempest/vars/tempest_skip_VERSION.yaml. -In these files you can add a regex, together with a reason, a bugzilla -or launchpad bug and target host (undercloud/overcloud )related to that -particular test. If target host is set `undercloud:true`, it will be skipped -on the undercloud.Launchpad and/or bugzilla re optional, however you must -specify a reason why you are skipping the test. - -Example of skip file: - - --- - known_failures: - - test: 'tempest.scenario.test_volume_boot_pattern' - reason: 'rdo-manager tempest smoke test failing on "floating ip pool not found"' - bz: 'https://bugzilla.redhat.com/show_bug.cgi?id=1272289' - - test: 'tempest.api.volume.test_volumes_get' - reason: 'rdo-manager tempest smoke test failing on "floating ip pool not found"' - - test: 'tempest.api.identity.*v3' - reason: 'Tempest Identify tests failed on V3 api on OSP-D puddle' - bz: 'https://bugzilla.redhat.com/show_bug.cgi?id=1266947' - - test: 'tempest.api.image.v2.test_images_metadefs_namespace_properties.MetadataNamespacePropertiesTest.test_basic_meta_def_namespace_property' - reason: 'glance is not calling glance-manage db_load_metadefs' - lp: 'https://bugs.launchpad.net/tripleo/+bug/1664995' - # Skip list for undercloud - - test: 'tempest.api.image.v2.test_images_metadefs_namespace_properties.MetadataNamespacePropertiesTest.test_basic_meta_def_namespace_property' - reason: 'glance is not calling glance-manage db_load_metadefs' - lp: 'https://bugs.launchpad.net/tripleo/+bug/1664995' - undercloud: true - - -Real time bug check -------------------- - -If check_tempest_bugs is set to true, a script will be called and will check -in real time, all tests who has a bugzilla or a launchpad bug. This will -generate a new skip file, removing all the bugs that were already closed but -wasn't updated in the yaml skip file yet. - - - -Using validate-tempest role with tripleo-quickstart ---------------------------------------------------- - -To run tempest with tripleo-quickstart, run the following command: - - $WORKSPACE/tripleo-quickstart - - bash quickstart.sh \ - --bootstrap \ - --tags all \ - --config $WORKSPACE/config/general_config/$CONFIG.yml \ - --working-dir $WORKSPACE/ \ - --no-clone \ - --release master-tripleo-ci \ - --extra-vars test_ping=False \ - --extra-vars run_tempest=True \ - $VIRTHOST - -Note: by using --extra-vars, we can change the validate-tempest role variables. - -Dependencies ------------- - -No dependencies - -Example Playbook ----------------- - - --- - - name: Run tempest - hosts: undercloud - gather_facts: false - roles: - - validate-tempest - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/validate-tempest/defaults/main.yml b/roles/validate-tempest/defaults/main.yml deleted file mode 100644 index 7081c55b2..000000000 --- a/roles/validate-tempest/defaults/main.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- - -floating_ip_cidr: "{{ undercloud_network_cidr }}" -public_net_pool_start: "{{ floating_ip_cidr|nthhost(100) }}" -public_net_pool_end: "{{ floating_ip_cidr|nthhost(120) }}" -public_net_gateway: "{{ floating_ip_cidr|nthhost(1) }}" -test_white_regex: "{{ test_regex|default('smoke') }}" -test_black_regex: [] -check_tempest_bugs: false - -public_net_name: public -public_network_type: flat -public_physical_network: datacentre -public_segmentation_id: '' -tenant_network_cidr: 192.168.0.0/24 - -tempest_deployer_input_file: tempest-deployer-input.conf -# steps: -tempest_undercloud: false -tempest_config: true -tempest_overcloud: true -run_tempest: false -post_tempest: true - -# venv or packages or container -tempest_format: packages - -tempest_container_registry: >- - {% if (undercloud_enable_tempest is defined) and undercloud_enable_tempest|bool -%} - {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} - {%- else -%} - {{ docker_registry_host }}/{{ docker_registry_namespace }} - {%- endif %} -tempest_container_namespace: >- - {% if ansible_distribution == 'CentOS' -%} - centos-binary-tempest - {%- elif ansible_distribution == 'RedHat' -%} - rhel-binary-tempest - {%- endif -%} - -tempest_container_tag: >- - {% if (undercloud_enable_tempest is defined and undercloud_enable_tempest|bool) and (update_containers_append_tag is defined)-%} - {{ container_build_id }}{{ update_containers_append_tag }} - {%- else -%} - {{ docker_image_tag }} - {%- endif %} -tempest_dir: >- - {% if tempest_format in ['container'] -%} - /var/lib/tempest/tempest - {%- else -%} - {{ working_dir }}/tempest - {%- endif %} -tempest_data: >- - {% if tempest_format in ['container'] -%} - /var/lib/tempest - {%- else -%} - {{ working_dir }} - {%- endif %} -tempest_whitelist_file_src: "whitelist_file.j2" -tempest_whitelist_file: "whitelist_file.conf" -tempest_whitelist: [] -tempest_log_dir: "/var/log/tempest" -tempest_log_file: "tempest.log" -tempest_plugins: ["python-keystone-tests-tempest", "python-neutron-tests-tempest"] -tempest_plugins_git: [] -tempest_extra_config: {} # A dict containing values which needs to be overridden in tempest.conf -skip_file_src: "skip_file.j2" -skip_file: skip_file -tempest_until_failure: false -tempest_exit_on_failure: true -# Set tempest_version for different release -# For forked-tempest, we have branched name in synced with releases. -tempest_version_dict: - master: 'master' -tempest_version: "{{ tempest_version_dict[release] }}" -tempest_conf_version_dict: {'master': 'master'} -tempest_conf_version: "{{ tempest_conf_version_dict[release] }}" -tempestmail_config: config.yaml -tempestmail_log_server: http://logs.openstack.org -tempest_track_resources: true -tempest_test_image_version: 0.5.2 -tempest_test_image_name: cirros-{{ tempest_test_image_version }}-x86_64-disk.img -tempest_test_image_path: http://download.cirros-cloud.net/{{ tempest_test_image_version }}/{{ tempest_test_image_name }} -# A dict containing values to be removed from tempest.conf -tempest_conf_removal: - network-feature-enabled.api_extensions: dvr -tempest_os_cloud: "" -stackviz_tarball: "https://tarballs.opendev.org/openstack/stackviz/dist/stackviz-latest.tar.gz" - -python_package_prefix: "python" - -# Headless Chrome configuration -tempest_use_headless_chrome: false -tempest_headless_chrome_port: 4444 diff --git a/roles/validate-tempest/files/bugcheck/.testr.conf b/roles/validate-tempest/files/bugcheck/.testr.conf deleted file mode 100644 index 9d6c8ecd7..000000000 --- a/roles/validate-tempest/files/bugcheck/.testr.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \ - OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \ - ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tests} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list -group_regex=([^\.]*\.)* diff --git a/roles/validate-tempest/files/bugcheck/__init__.py b/roles/validate-tempest/files/bugcheck/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/validate-tempest/files/bugcheck/bugcheck.py b/roles/validate-tempest/files/bugcheck/bugcheck.py deleted file mode 100644 index 64829f045..000000000 --- a/roles/validate-tempest/files/bugcheck/bugcheck.py +++ /dev/null @@ -1,228 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# flake8: noqa - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -import argparse -import bugzilla -import logging -import sys -import xmlrpclib -import yaml - -from launchpadlib.launchpad import Launchpad - -LOG = logging.getLogger(__name__) -OPEN = 1 -CLOSED = 2 -INVALID = 3 - - -class LaunchpadConnector(object): - def __init__(self, cachedir='/tmp/.launchpadlib/cache/'): - self.cachedir = cachedir - self.lp = Launchpad.login_anonymously('Bugs', 'production', cachedir, - version='devel') - - def get_bug_status(self, bug_id): - try: - bug = self.lp.bugs[bug_id] - # We are assuming that last task have the final status - # And we cannot slice from the last - task = bug.bug_tasks[len(bug.bug_tasks) - 1] - if task: - if task.status in ['Fix Released', 'Fix Committed', 'Invalid']: - return CLOSED - else: - return OPEN - except KeyError: - LOG.error('Bug {} does not exist in launchpad'.format(bug_id)) - return INVALID - - -class BugzillaConnector(object): - def __init__(self, url='https://bugzilla.redhat.com/xmlrpc.cgi'): - self.bugzilla = bugzilla.Bugzilla(url=url) - - def get_bug_status(self, bug_id): - try: - bug = self.bugzilla.getbug(bug_id) - if bug.status == 'CLOSED': - return CLOSED - else: - return OPEN - except xmlrpclib.Fault as err: - # Fault code 102 means it's a private bug and we don't have - # permission to see, so we can't confirm if it's closed - if err.faultCode == 102: - return OPEN - LOG.error('Bug {} failed with fault code {}'.format(bug_id, - err.faultCode)) - return INVALID - - -class VerifyBug(object): - def __init__(self): - self.bugzilla = BugzillaConnector() - self.launchpad = LaunchpadConnector() - - def check_bug_status(self, url): - connector = self._get_connector(url) - bug_id = self._get_id_from_url(url) - return connector.get_bug_status(bug_id) - - def is_bug_open(self, url): - status = self.check_bug_status(url) - if status in [CLOSED, INVALID]: - return False - else: - return True - - def _get_id_from_url(self, url): - if 'launchpad' in url: - # The format is https://bugs.launchpad.net/tripleo/+bug/1577769 - return int(url.split('/')[-1]) - elif 'bugzilla' in url: - return int(url.split('=')[-1]) - - def _get_connector(self, url): - if 'launchpad' in url: - return self.launchpad - elif 'bugzilla' in url: - return self.bugzilla - else: - raise ValueError('Cannot find a connector for {}'.format(url)) - - -class BugVerifyCmd(object): - def __init__(self): - self.skipped_failures = [] - - def parse_arguments(self, args): - parser = argparse.ArgumentParser(description='Bug verify') - parser.add_argument('--skip-file', dest='skip_file', - help='Load skip file', required=True) - parser.add_argument('--output', action='store_true', - help='Print the output') - parser.add_argument('--format', dest='output_format', - default='yaml', help='Output format', - choices=['yaml', 'txt']) - parser.add_argument('--to-file', dest='to_file', - help='Save the skip list to a file') - parser.add_argument('--report', dest='report', action='store_true', - help='Shows report at the end') - parser.add_argument('--debug', dest='debug', action='store_true', - help='Enable debug') - self.args = parser.parse_args(args) - - def setup_logging(self): - level = logging.DEBUG if self.args.debug else logging.INFO - logging.basicConfig(level=level, - format='%(asctime)s %(levelname)s %(name)s: ' - '%(message)s') - - def load_skip_file(self): - known_failures = [] - try: - with open(self.args.skip_file) as f: - skip = yaml.safe_load(f) - except yaml.constructor.ConstructorError: - LOG.error('Invalid yaml file {}'.format(self.args.skip_file)) - except IOError: - LOG.error('File not found {}'.format(self.args.skip_file)) - else: - for t in skip.get('known_failures'): - bug = {'test': t.get('test'), 'reason': t.get('reason')} - if t.get('lp'): - bug['lp'] = t.get('lp') - if t.get('bz'): - bug['bz'] = t.get('bz') - known_failures.append(bug) - - return known_failures - - def _print_yaml(self, known_failures): - return yaml.dump({'known_failures': known_failures}, - default_flow_style=False, - explicit_start=True) - - def _print_txt(self, known_failures): - output = '' - for bug in known_failures: - output += '# {}\n'.format(bug.get('reason')) - output += '{}\n'.format(bug.get('test')) - return output - - def get_output(self, known_failures, output_format): - output = '' - if output_format == 'txt': - output = self._print_txt(known_failures) - elif output_format == 'yaml': - output = self._print_yaml(known_failures) - else: - raise ValueError( - 'Output format not supported: {}'.format(output_format)) - return output - - def print_output(self, known_failures, output_format): - print(self.get_output(known_failures, output_format)) - - def show_report(self): - print('Here\'s the original list:') - self.print_output(self.original_failures, self.args.output_format) - print('\n\n') - print('Here\'s the skipped list:') - self.print_output(self.skipped_failures, self.args.output_format) - - def save_output(self, known_failures, output_format): - output = self.get_output(known_failures, output_format) - f = open(self.args.to_file, 'w') - f.write(output) - f.close() - - def run(self): - known_failures = self.load_skip_file() - self.original_failures = known_failures - open_failures = [] - - v_bug = VerifyBug() - for bug in known_failures: - LOG.debug('Checking bug: {}'.format(bug)) - if not bug.get('lp') and not bug.get('bz'): - open_failures.append(bug) - continue - bug_url = bug.get('lp') or bug.get('bz') - if not v_bug.is_bug_open(bug_url): - self.skipped_failures.append(bug) - else: - open_failures.append(bug) - if self.args.output: - self.print_output(open_failures, self.args.output_format) - if self.args.to_file: - self.save_output(open_failures, self.args.output_format) - if self.args.report: - self.show_report() - - -def main(): - bvc = BugVerifyCmd() - bvc.parse_arguments(sys.argv[1:]) - bvc.setup_logging() - bvc.run() - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/roles/validate-tempest/files/bugcheck/requirements.txt b/roles/validate-tempest/files/bugcheck/requirements.txt deleted file mode 100644 index b571938c4..000000000 --- a/roles/validate-tempest/files/bugcheck/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -launchpadlib==1.10.5 -python-bugzilla==2.1.0 -PyYAML==3.12 -simplejson==3.10.0 diff --git a/roles/validate-tempest/files/bugcheck/test-requirements.txt b/roles/validate-tempest/files/bugcheck/test-requirements.txt deleted file mode 100644 index c8374d0bc..000000000 --- a/roles/validate-tempest/files/bugcheck/test-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -mock==2.0.0 -os-testr==0.8.2 -pbr==3.0.1 -testresources==2.0.1 -testtools==2.3.0 -unittest2==1.1.0 diff --git a/roles/validate-tempest/files/bugcheck/tests/__init__.py b/roles/validate-tempest/files/bugcheck/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/validate-tempest/files/bugcheck/tests/test_bugcheck.py b/roles/validate-tempest/files/bugcheck/tests/test_bugcheck.py deleted file mode 100644 index edbff569b..000000000 --- a/roles/validate-tempest/files/bugcheck/tests/test_bugcheck.py +++ /dev/null @@ -1,221 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# flake8: noqa - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -from unittest import mock -import os -import tempfile -import unittest -import xmlrpclib - -from bugcheck import BugVerifyCmd -from bugcheck import BugzillaConnector -from bugcheck import CLOSED -from bugcheck import INVALID -from bugcheck import LaunchpadConnector -from bugcheck import OPEN -from bugcheck import VerifyBug - - -class TestLaunchpadConnector(unittest.TestCase): - - @mock.patch('launchpadlib.launchpad.Launchpad.login_anonymously') - def test_get_bug_status(self, launchpad_mock): - lp_connector = LaunchpadConnector() - - bugs = launchpad_mock.return_value.bugs - bug_tasks = bugs.__getitem__().bug_tasks - item = bug_tasks.__getitem__() - - for status in ['Fix Released', 'Fix Committed', 'Invalid']: - item.status = status - self.assertEqual(lp_connector.get_bug_status(1693838), CLOSED) - - item.status = 'No idea' - self.assertEqual(lp_connector.get_bug_status(1693838), OPEN) - - bugs.__getitem__.side_effect = KeyError() - self.assertEqual(lp_connector.get_bug_status(1693838), INVALID) - - -class TestBugzillaConnector(unittest.TestCase): - @mock.patch('bugzilla.Bugzilla') - def test_get_bug_status(self, bugzilla_mock): - bz_connector = BugzillaConnector() - bug = bugzilla_mock.return_value.getbug - bug.return_value.status = 'CLOSED' - self.assertEqual(bz_connector.get_bug_status(123), CLOSED) - bz_status = ['ASSIGNED', 'NEEDINFO', 'NEW', 'REOPENED', 'RESOLVED', - 'UNCONFIRMED', 'VERIFIRED'] - for status in bz_status: - bug.return_value.status = status - self.assertEqual(bz_connector.get_bug_status(123), OPEN) - - bug.side_effect = xmlrpclib.Fault(faultCode=102, - faultString='Permission') - self.assertEqual(bz_connector.get_bug_status(123), OPEN) - bug.side_effect = xmlrpclib.Fault(faultCode=42, - faultString='Other fault') - self.assertEqual(bz_connector.get_bug_status(123), INVALID) - - -class TestVerifyBug(unittest.TestCase): - @mock.patch('launchpadlib.launchpad.Launchpad.login_anonymously') - @mock.patch('bugzilla.Bugzilla') - def setUp(self, bz_mock, lp_mock): - self.v_bug = VerifyBug() - - def test__get_id_from_url(self): - self.assertEqual(self.v_bug._get_id_from_url( - 'https://bugs.launchpad.net/tripleo/+bug/1577769'), 1577769) - self.assertEqual(self.v_bug._get_id_from_url( - 'https://bugzilla.redhat.com/show_bug.cgi?id=1380187'), 1380187) - - def test__get_connector(self): - self.assertIsInstance(self.v_bug._get_connector( - 'https://bugs.launchpad.net/tripleo/+bug/1577769'), - LaunchpadConnector) - self.assertIsInstance(self.v_bug._get_connector( - 'https://bugzilla.redhat.com/show_bug.cgi?id=1380187'), - BugzillaConnector) - self.assertRaises(ValueError, self.v_bug._get_connector, - 'https://review.opendev.org') - - @mock.patch('bugcheck.VerifyBug.check_bug_status') - def test_is_bug_open(self, bug_status_mock): - for status in [CLOSED, INVALID]: - bug_status_mock.return_value = status - self.assertEqual(self.v_bug.is_bug_open( - 'https://bugzilla.redhat.com/show_bug.cgi?id=1380187'), False) - - bug_status_mock.return_value = OPEN - self.assertEqual(self.v_bug.is_bug_open( - 'https://bugzilla.redhat.com/show_bug.cgi?id=1380187'), True) - - -class TestBugVerifyCmd(unittest.TestCase): - def setUp(self): - self.fd_file, self.tmp_file = tempfile.mkstemp() - self._populate_skip_file() - self.known_failures = [ - {'test': '.*test_external_network_visibility', - 'reason': 'Tempest test "external network visibility" fails', - 'lp': 'https://bugs.launchpad.net/tripleo/+bug/1577769'}, - {'test': 'tempest.api.data_processing', - 'reason': 'tempest.api.data_processing tests failing on newton', - 'bz': 'https://bugzilla.redhat.com/show_bug.cgi?id=1357667'}, - {'test': 'neutron.tests.tempest.api.test_revisions.TestRevisions', - 'reason': 'New test, need investigation'}] - self.txt_output = ('# Tempest test "external network visibility" ' - 'fails\n' - '.*test_external_network_visibility\n' - '# tempest.api.data_processing tests failing on ' - 'newton\n' - 'tempest.api.data_processing\n' - '# New test, need investigation\n' - 'neutron.tests.tempest.api.test_revisions.' - 'TestRevisions\n') - self.yaml_output = ('---\nknown_failures:\n' - '- lp: https://bugs.launchpad.net/tripleo/+bug/' - '1577769\n' - ' reason: Tempest test "external network ' - 'visibility" fails\n' - ' test: .*test_external_network_visibility\n' - '- bz: https://bugzilla.redhat.com/show_bug.cgi' - '?id=1357667\n' - ' reason: tempest.api.data_processing tests ' - 'failing on newton\n' - ' test: tempest.api.data_processing\n' - '- reason: New test, need investigation\n' - ' test: neutron.tests.tempest.api.test_' - 'revisions.TestRevisions\n') - self.cmd = BugVerifyCmd() - self.cmd.parse_arguments(['--skip-file', self.tmp_file]) - - def tearDown(self): - os.close(self.fd_file) - os.unlink(self.tmp_file) - - def _populate_skip_file(self): - content = ''' - known_failures: - - test: '.*test_external_network_visibility' - reason: 'Tempest test "external network visibility" fails' - lp: 'https://bugs.launchpad.net/tripleo/+bug/1577769' - - test: 'tempest.api.data_processing' - reason: 'tempest.api.data_processing tests failing on newton' - bz: 'https://bugzilla.redhat.com/show_bug.cgi?id=1357667' - - test: 'neutron.tests.tempest.api.test_revisions.TestRevisions' - reason: 'New test, need investigation' - ''' - self.skip_file = open(self.tmp_file, 'w') - self.skip_file.write(content) - self.skip_file.close() - - def test_load_skip_file(self): - known_failures = self.cmd.load_skip_file() - self.assertEqual(known_failures, self.known_failures) - - def test__print_txt(self): - output = self.cmd._print_txt(self.known_failures) - self.assertEqual(output, self.txt_output) - - def test__print_yaml(self): - output = self.cmd._print_yaml(self.known_failures) - self.assertEqual(output, self.yaml_output) - - @mock.patch('bugcheck.BugVerifyCmd._print_txt') - @mock.patch('bugcheck.BugVerifyCmd._print_yaml') - def test_get_output(self, yaml_mock, txt_mock): - self.cmd.get_output(self.known_failures, 'txt') - self.cmd.get_output(self.known_failures, 'yaml') - yaml_mock.assert_called_once() - txt_mock.assert_called_once() - self.assertRaises(ValueError, - self.cmd.get_output, self.known_failures, 'xml') - - def test_save_output(self): - fd, tmp_f = tempfile.mkstemp() - cmd = BugVerifyCmd() - cmd.parse_arguments(['--skip-file', self.tmp_file, '--to-file', tmp_f]) - cmd.save_output(self.known_failures, 'txt') - output = open(tmp_f, 'r').readlines() - expected = ['# Tempest test "external network visibility" fails\n', - '.*test_external_network_visibility\n', - '# tempest.api.data_processing tests failing on newton\n', - 'tempest.api.data_processing\n', - '# New test, need investigation\n', - 'neutron.tests.tempest.api.test_revisions.TestRevisions\n'] - self.assertEqual(output, expected) - - cmd.save_output(self.known_failures, 'yaml') - output = open(tmp_f, 'r').readlines() - expected = ['---\n', - 'known_failures:\n', - '- lp: https://bugs.launchpad.net/tripleo/+bug/1577769\n', - ' reason: Tempest test "external network visibility" ' - 'fails\n', - ' test: .*test_external_network_visibility\n', - '- bz: https://bugzilla.redhat.com/show_bug.cgi?' - 'id=1357667\n', - ' reason: tempest.api.data_processing tests failing on ' - 'newton\n', - ' test: tempest.api.data_processing\n', - '- reason: New test, need investigation\n', - ' test: neutron.tests.tempest.api.test_revisions.Tes' - 'tRevisions\n'] - self.assertEqual(output, expected) diff --git a/roles/validate-tempest/files/check-skip-list/__init__.py b/roles/validate-tempest/files/check-skip-list/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/validate-tempest/files/check-skip-list/check_skip.py b/roles/validate-tempest/files/check-skip-list/check_skip.py deleted file mode 100644 index 74db93580..000000000 --- a/roles/validate-tempest/files/check-skip-list/check_skip.py +++ /dev/null @@ -1,110 +0,0 @@ -#! /usr/bin/env python - -# Copyright Red Hat, Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import argparse -import json -import logging -import re -import requests -import sys -import yaml - - -TESTRE = re.compile(r'(tempest[^ \(\)]+|\w+\.tests\.[^ \(\)]+)') -OK = "... ok" - - -class CheckSkipCmd(object): - def __init__(self): - self.parse_arguments(sys.argv[1:]) - if self.args.debug: - self.setup_logging() - - def run(self): - console = self.download_console_log() - ok_results = self.get_test_results(console) - skip_file = self.load_skip_file() - - regex_removed = self.compare_results(skip_file, ok_results) - print(json.dumps(regex_removed, indent=4, sort_keys=True)) - - def parse_arguments(self, args): - parser = argparse.ArgumentParser(description='Check skip list content') - parser.add_argument('--log-url', dest='console_log', required=True, - help='Url for the console log result') - parser.add_argument('--skip-file', dest='skip_file', - required=True, help='Skip file to compare') - parser.add_argument('--undercloud', dest='undercloud', - action='store_true', - help='Load undercloud skip list', - default=False) - parser.add_argument('--debug', dest='debug', action='store_true', - help='Enable debug') - - self.args = parser.parse_args(args) - - def setup_logging(self): - self.log = logging.getLogger(self.__class__) - logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(levelname)s %(name)s: ' - '%(message)s') - - def download_console_log(self): - resp = requests.get(self.args.console_log) - try: - resp.raise_for_status() - except requests.exceptions.HTTPError as e: - self.log.error('An error occurred when trying to download ' - 'console log: {}'.format(e)) - return None - return resp.content.decode('utf-8') - - def load_skip_file(self): - known_failures = [] - try: - skip = yaml.safe_load(open(self.args.skip_file)) - for t in skip.get('known_failures'): - if self.args.undercloud == t.get('undercloud', False): - known_failures.append(t.get('test')) - except yaml.constructor.ConstructorError: - self.log.error('Invalid yaml file {}'.format(self.args.skip_file)) - finally: - return known_failures - - def get_test_results(self, console): - ok = [TESTRE.search(line).group(1) - for line in console.splitlines() if OK in line] - return ok - - def compare_results(self, known_failures, ok_results): - regex_to_be_removed = {} - - for kf in known_failures: - for o_r in ok_results: - if re.match(kf, o_r): - if not regex_to_be_removed.get(kf): - regex_to_be_removed[kf] = [] - regex_to_be_removed[kf].append(o_r) - return regex_to_be_removed - - -def main(): - cmd = CheckSkipCmd() - cmd.run() - - -if __name__ == '__main__': - main() diff --git a/roles/validate-tempest/files/check-skip-list/requirements.txt b/roles/validate-tempest/files/check-skip-list/requirements.txt deleted file mode 100644 index 6c9fdba97..000000000 --- a/roles/validate-tempest/files/check-skip-list/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -PyYAML -requests diff --git a/roles/validate-tempest/files/tempest-undercloud-config.conf b/roles/validate-tempest/files/tempest-undercloud-config.conf deleted file mode 100644 index e06b8faab..000000000 --- a/roles/validate-tempest/files/tempest-undercloud-config.conf +++ /dev/null @@ -1,15 +0,0 @@ -[compute-feature-enabled] -console_output = false - -[object-storage] -operator_role = swiftoperator - -[volume] -backend1_name = tripleo_iscsi - -[volume-feature-enabled] -bootable = true - -[baremetal] -provision_timeout = 300 -driver_enabled = True diff --git a/roles/validate-tempest/files/tempestmail/.testr.conf b/roles/validate-tempest/files/tempestmail/.testr.conf deleted file mode 100644 index 9d6c8ecd7..000000000 --- a/roles/validate-tempest/files/tempestmail/.testr.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \ - OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \ - ${PYTHON:-python} -m subunit.run discover -t ${OS_TOP_LEVEL:-./} ${OS_TEST_PATH:-./tests} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list -group_regex=([^\.]*\.)* diff --git a/roles/validate-tempest/files/tempestmail/README.md b/roles/validate-tempest/files/tempestmail/README.md deleted file mode 100644 index 81a618c8d..000000000 --- a/roles/validate-tempest/files/tempestmail/README.md +++ /dev/null @@ -1,201 +0,0 @@ -Tempest mail tool -================= - -Description ------------ - -This is a tool to send mails to people interested in TripleO periodic jobs -status. - -Usage ------ - -```bash -tempestmail.py -c config.yaml --jobs periodic-tripleo-ci-centos-7-ovb-ha-tempest -``` - -Config file example -------------------- - -```yaml -mail_username: username -mail_password: password -smtp_server: smtp.gmail.com:587 -mail_from: username@gmail.com -template_path: template/ -log_url: 'http://logs.openstack.org/periodic' -emails: - - mail: 'arxcruz@gmail.com' - name: 'Arx Cruz' -template: template.html -known_failures: - - test: 'tempest.scenario.test_volume_boot_pattern.*' - reason: 'http://bugzilla.redhat.com/1272289' - - test: 'tempest.api.identity.*v3.*' - reason: 'https://bugzilla.redhat.com/1266947' - - test: '.*test_external_network_visibility' - reason: 'https://bugs.launchpad.net/tripleo/+bug/1577769' -``` - -With this config file, the user will always get an email independent of the -failed tempest test. -You can also filter to receive the notification, only for a specific set of -jobs. Doing so, the user will only receive an email when the job being -executed matches with one in the jobs list: - -```yaml -mail_username: username -mail_password: password -smtp_server: smtp.gmail.com:587 -mail_from: username@gmail.com -template_path: template/ -log_url: 'http://logs.openstack.org/periodic' -emails: - - mail: 'arxcruz@gmail.com' - name: 'Arx Cruz' - jobs: - - gate-tripleo-ci-centos-7-ovb-ha-oooq - - gate-tripleo-ci-centos-7-ovb-containers-oooq -template: template.html -known_failures: - - test: 'tempest.scenario.test_volume_boot_pattern.*' - reason: 'http://bugzilla.redhat.com/1272289' -``` - -In this case, the user will not receive the email if the job name is not -gate-tripleo-ci-centos-7-ovb-ha-oooq or -gate-tripleo-ci-centos-7-ovb-containers-oooq. -You can also set a regular expression with the failure test you are interested. -In this case, you will only receive the email, if the regex matches a test that -fails for that particular job: - -```yaml -mail_username: username -mail_password: password -smtp_server: smtp.gmail.com:587 -mail_from: username@gmail.com -template_path: template/ -log_url: 'http://logs.openstack.org/periodic' -emails: - - mail: 'arxcruz@gmail.com' - name: 'Arx Cruz' - jobs: - - gate-tripleo-ci-centos-7-ovb-ha-oooq - - gate-tripleo-ci-centos-7-ovb-containers-oooq - regex: - - 'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest' - - 'tempest.scenario.test_network_basic_ops.TestNetworkBasicOps.test_mtu_sized_frames' -template: template.html -known_failures: - - test: 'tempest.scenario.test_volume_boot_pattern.*' - reason: 'http://bugzilla.redhat.com/1272289' -``` - -In this example, the user will only receive an email if the job -gate-tripleo-ci-centos-7-ovb-ha-oooq or -gate-tripleo-ci-centos-7-ovb-containers-oooq has a test failure that matches -the regex. - -```yaml -... -emails: - - mail: fail1@example.com - regex: '.*foo.*' - topics: foo1 - - mail: fail1@example.com - regex: '.*bar.*' - topics: bar1 - - mail: fail2@example.com - regex: '.*bar.*' - topics: bar2,extra -... -``` - -if a jobs contains tests matching both 'foo' and 'bar', then: -* fail1@ will receive an email '[foo1]...' and an email '[bar1]...' -* fail2@ will receive an email '[bar2][extra]...' - - -So, the order is: - -1. If there's no jobs list the user will receive all the emails. -1. If there's a jobs list the user will receive emails only for that jobs. -1. If there's a regex the user will only receive emails when a regex matches. -1. If there's a job list and a regex list the user will only receive an email - when both matches. - -HTML template example ---------------------- - -Tempest mail uses Jinja2 to create templates in html, and it parses the -following data to HTML (stored in the data dictionary) - -* run - Bool - Whether the job runs or not -* date - String - In the format %Y-%m-%d %H:%M -* link - String - Contain the log url -* job - String - The job name -* failed - List - List of tests that fails in string format -* covered - List - List of tests covered in dictionary format, containing: - * failure - String - Test name - * reason - String - Reason of the failure -* new - List - List of new failures -* errors - List - Errors found in the log - -An example of output of the data is showed below: - -```python -[ - { - 'errors': [], - 'run': True, - 'failed': [ - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_too_many_objects', - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_valid_object' - ], - 'job': 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', - 'link': u'http://logs.openstack.org/periodic/periodic-tripleo-ci-centos-7-ovb-ha-tempest/1ce5e95/console.html', - 'covered': [], - 'date': datetime.datetime(2017, 1, 19, 8, 27), - 'new': [ - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_too_many_objects', - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_valid_object' - ] - } -] -``` - -And here's an example you can use as email template: - -```html - - - -

    Hello,

    -

    Here's the result of the latest tempest run for job {{ data.get('job') }}.

    -

    The job ran on {{ data.get('date') }}.

    -

    For more details, you can check the URL: {{ data.get('link') }} - {% if data.get('new') %}

    -

    New failures

    -
      - {% for fail in data.get('new') %} -
    • {{ fail }}
    • - {% endfor %} -
    - {% endif %} - - {% if data.get('covered') %} -

    Known failures

    -
      - {% for fail in data.get('covered') %} -
    • {{ fail.get('failure') }} - {{ fail.get('reason') }}
    • - {% endfor %} -
    - {% endif %} - - -``` - -Tests ------ - -[user@localhost tempestmail]$ python -m unittest discover -v diff --git a/roles/validate-tempest/files/tempestmail/__init__.py b/roles/validate-tempest/files/tempestmail/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/validate-tempest/files/tempestmail/config.yaml b/roles/validate-tempest/files/tempestmail/config.yaml deleted file mode 100644 index 9a36e4ac8..000000000 --- a/roles/validate-tempest/files/tempestmail/config.yaml +++ /dev/null @@ -1,74 +0,0 @@ ---- -require_auth: true -mail_from: tripleoresults@gmail.com -templates_path: template/ -log_url: 'http://logs.openstack.org/periodic/' -api_server: 'http://tempest-sendmail.tripleo.org:8080/api/v1.0/sendmail' -use_api_server: true -default_log_url: 'http://logs.openstack.org' -emails: - - mail: 'arxcruz@redhat.com' - name: 'Arx Cruz' - - mail: 'sshnaidm@redhat.com' - name: 'Sagi Shnaidman' - fail_only: true - - mail: 'rhos-telemetry@redhat.com' - name: 'Rhos Telemetry' - fail_only: true - jobs: - - 'gate-tripleo-ci-centos-7-scenario001-multinode-oooq-puppet' - - 'gate-tripleo-ci-centos-7-scenario001-multinode-oooq-container' - - 'gate-tripleo-ci-centos-7-scenario001-multinode-oooq' - regex: - - 'ceilometer.tests.tempest.scenario.test_telemetry_integration.TestTelemetryIntegration' - - 'telemetry_tempest_plugin.scenario.test_telemetry_integration.TestTelemetryIntegration' - - mail: 'abregman@redhat.com' - name: 'RHOS Networking' - fail_only: true - jobs: - - 'periodic-tripleo-ci-centos-7-ovb-1ctlr_1comp-featureset020-master' - - 'periodic-tripleo-ci-centos-7-ovb-1ctlr_1comp-featureset020-pike' - - 'periodic-tripleo-ci-centos-7-ovb-1ctlr_1comp-featureset020-ocata' - regex: - - 'tempest.api.network.*' - - 'tempest.scenario.test_network_advanced_server_ops' - - 'tempest.scenario.test_network_basic_ops' - - 'tempest.scenario.test_network_v6' - - 'tempest.scenario.test_security_groups_basic_ops' - - mail: 'rhos-storage-tests@redhat.com' - name: 'RHOSP Storage - Cinder' - topics: cinder - fail_only: true - regex: - - '^tempest\.api\.volume\.' - - '^cinder\.tests\.tempest\.' - - '^cinder_tempest_plugin\.' - - '^tempest\.scenario\.test_encrypted_cinder_volumes' - - '^tempest\.scenario\.test_volume_boot_pattern' - - '^tempest\.scenario\.test_volume_migrate_attached' - - mail: 'rhos-storage-tests@redhat.com' - name: 'RHOSP Storage - Glance' - topics: glance - fail_only: true - regex: - - '^tempest\.api\.image\.' - - mail: 'rhos-storage-tests@redhat.com' - name: 'RHOSP Storage - Manila' - topics: manila - fail_only: true - regex: - - '^manila_tempest_tests\.tests\.' - - mail: 'rhos-storage-tests@redhat.com' - name: 'RHOSP Storage - Sahara' - topics: sahara - fail_only: true - regex: - - '^sahara_tempest_plugin\.tests\.' - - mail: 'rhos-storage-tests@redhat.com' - name: 'RHOSP Storage - Swift' - topics: swift - fail_only: true - regex: - - '^tempest\.api\.object_storage\.' - - '^tempest\.scenario\.test_object_storage_basic_ops' -template: template.html diff --git a/roles/validate-tempest/files/tempestmail/config2.yaml b/roles/validate-tempest/files/tempestmail/config2.yaml deleted file mode 100644 index 10f10dcda..000000000 --- a/roles/validate-tempest/files/tempestmail/config2.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -require_auth: true -mail_from: tripleoresults@gmail.com -templates_path: template/ -log_url: 'http://logs.openstack.org/periodic/' -api_server: 'http://tempest-sendmail.tripleo.org:8080/api/v1.0/sendmail' -use_api_server: true -default_log_url: 'http://logs.openstack.org' -emails: - - mail: 'arxcruz@gmail.com' - name: 'Arx Cruz' -template: template.html diff --git a/roles/validate-tempest/files/tempestmail/requirements.txt b/roles/validate-tempest/files/tempestmail/requirements.txt deleted file mode 100644 index 0f651c4b4..000000000 --- a/roles/validate-tempest/files/tempestmail/requirements.txt +++ /dev/null @@ -1,11 +0,0 @@ -extras==1.0.0 -fixtures==3.0.0 -funcsigs==1.0.2 -futures==3.0.5 -Jinja2==2.8 -pbr==1.10.0 -PyYAML==3.12 -requests==2.12.3 -secure-smtpd==3.0.0 -six==1.10.0 -smtpd-tls==0.1 diff --git a/roles/validate-tempest/files/tempestmail/tempestmail.py b/roles/validate-tempest/files/tempestmail/tempestmail.py deleted file mode 100755 index 21fba8ad2..000000000 --- a/roles/validate-tempest/files/tempestmail/tempestmail.py +++ /dev/null @@ -1,410 +0,0 @@ -#! /usr/bin/env python - -# Copyright Red Hat, Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import argparse -import datetime -import logging -import os -import re -import requests -import smtplib -import sys -import yaml - -from email.mime.text import MIMEText -from jinja2 import Environment -from jinja2 import FileSystemLoader -from six.moves.urllib.parse import urljoin - -HREF = re.compile('href="([^"]+)"') -JOBRE = re.compile('[a-z0-9]{7}/') -TESTRE = re.compile(r'(tempest[^ \(\)]+|\w+\.tests\.[^ \(\)]+)') -TIMEST = re.compile(r'(\d{4}-\d{2}-\d{2} \d{2}:\d{2}):\d{2}\.\d+ \|') -TITLE = re.compile('(.*?)') - -FAILED = "... FAILED" -OK = "... ok" -ERROR = "... ERROR" -SKIPPED = "... SKIPPED" - -NLINKS = 1 - - -def compare_tests(failures, config): - '''Detect fails covered by bugs and new''' - covered, new = [], [] - for fail in failures: - for test in config.known_failures: - if re.search(test.get('test'), fail): - covered.append({'failure': fail, 'reason': test.get('reason')}) - new = [fail for fail in failures if not any( - c['failure'] == fail for c in covered)] - return covered, new - - -def get_html(url): - try: - resp = requests.get(url) - if resp is None: - raise TypeError - except TypeError as e: - print("Exception %s" % str(e)) - return - return resp - - -def get_tests_results(console): - '''Get results of tests from console''' - failed = [TESTRE.search(line).group(1) - for line in console.splitlines() if FAILED in line] - ok = [TESTRE.search(line).group(1) - for line in console.splitlines() if OK in line] - errors = [TESTRE.search(line).group(1) - for line in console.splitlines() if ERROR in line] - - # all_skipped = [TESTRE.search(l).group(1) - # for l in console.splitlines() if SKIPPED in l] - return failed, ok, errors - - -class Config(object): - pass - - -class Mail(object): - def __init__(self, config): - self.config = config - self.log = logging.getLogger('Mail') - self.mail_from = config.mail_from - self.username = config.username - self.password = config.password - self.smtp = config.smtp - self.require_auth = config.require_auth - self.templates_path = os.path.join(os.path.dirname(__file__), - config.templates_path) - self.template = config.template - - def render_template(self, data): - self.log.debug('Rendering template') - env = Environment(loader=FileSystemLoader(self.templates_path)) - env.filters['datetimeformat'] = self.datetimeformat - template = env.get_template(self.template) - return template.render(data=data) - - def datetimeformat(self, value, format="%d-%m-%Y %H:%M"): - return value.strftime(format) - - def filter_emails(self, job, data): - has_errors = False - bookaddr = {} - - for error in [data.get(x, []) for x in ('new', 'failed', 'errors')]: - if error: - self.log.debug('There are tests with failed result') - has_errors = True - break - - if has_errors: - # Check if the user is assigned for the job - # If there's no job assigned, we add the user anyway - emails = [m for m in self.config.emails if job in - m.get('jobs') or not - m.get('jobs')] - - # Add all addresses except those that regex don't match - for email in emails: - add = True - if email.get('regex'): - for r in email.get('regex'): - if len(filter(r.search, data.get('new'))): - break - add = False - if add: - topics = '' - if email.get('topics'): - # Parse topics and format it between brackets - t = email.get('topics').split(',') - topics = ''.join('[{}]'.format(s) for s in t) - # Add the address to the bookaddr dict - # {'[foo][bar]' : ['john@redhat.com', 'mary@redhat.com']} - bookaddr.setdefault(topics, []).append(email.get('mail')) - else: - self.log.debug('No failures send email to everybody') - addresses = [m.get('mail') for m in self.config.emails - if not m.get('fail_only')] - # Single group with empty topic is added to the bookaddr - bookaddr.setdefault('', []).append(addresses) - - data['has_errors'] = has_errors - - return bookaddr - - def _send_mail_local(self, addresses, message, subject, output): - msg = MIMEText(message, 'html') - msg['Subject'] = subject - msg['From'] = self.mail_from - msg['To'] = ",".join(addresses) - s = smtplib.SMTP(self.smtp) - if self.require_auth: - s.ehlo() - s.starttls() - s.login(self.username, self.password) - s.sendmail(self.mail_from, addresses, msg.as_string()) - self.log.debug('Sending mail') - s.quit() - - if output: - self.log.debug('Writing email in {}'.format(output)) - with open(output, 'w') as f: - f.write(msg.as_string()) - - def _send_mail_api(self, addresses, message, subject): - data = {'addresses': addresses, 'message': message, 'subject': subject, - 'mime_type': 'html'} - requests.post(self.config.api_server, data=data) - - def send_mail(self, job, data, output): - bookaddr = self.filter_emails(job, data) - message = self.render_template(data) - - # Send a separate email to the addresses grouped by topics - for topics, addresses in bookaddr.items(): - subject = '{} Job {} results'.format(topics, job).lstrip() - if self.config.use_api_server: - self._send_mail_api(addresses, message, subject) - else: - self._send_mail_local(addresses, message, subject, output) - - -class TempestMailCmd(object): - def parse_arguments(self, args): - parser = argparse.ArgumentParser(description='tempest-mail') - parser.add_argument('-c', dest='config', - default='/etc/tempest-mail/tempest-mail.yaml', - help='Path to config file') - parser.add_argument('-l', dest='logconfig', - help='Path to log config file') - parser.add_argument('--version', dest='version', - help='Show version') - parser.add_argument('--job', dest='job', - help='Job name', required=True) - parser.add_argument('--file', dest='file', - help='File containing tempest output') - parser.add_argument('--skip-file', dest='skip_file', - help='List of skip files') - parser.add_argument('--output', dest='output', - help='Save the email content in a file') - parser.add_argument('--log-url', dest='log_url', - help='Set log url') - self.args = parser.parse_args(args) - - def setup_logging(self): - self.log = logging.getLogger('tempestmail.TempestMail') - logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(levelname)s %(name)s: ' - '%(message)s') - - def get_index(self): - '''Get index page of periodic job and returns all links to jobs''' - url = urljoin(self.config.log_url, self.args.job) - res = get_html(url) - if res is None or not res.ok: - return [] - - body = res.content.decode() if res.content else '' - hrefs = [HREF.search(line).group(1) - for line in body.splitlines() if HREF.search(line)] - links = ["/".join((url, link)) - for link in hrefs if JOBRE.match(link)] - if links: - # Number of links to return - return links[:NLINKS] - else: - return [] - - def get_console(self, job_url=None): - '''Get console page of job''' - - if self.args.file and not job_url: - try: - with open(self.args.file) as f: - console = f.read() - except IOError: - return (None, None, None) - - log_path = os.environ.get('LOG_PATH', None) - if log_path: - log_path = urljoin(getattr( - self.args, 'log_url', self.config.default_log_url), log_path) - - return (console, datetime.datetime.now(), log_path) - - def _good_result(res): - if res is None or int(res.status_code) not in (200, 404): - return False - else: - return True - - def _get_date(c): - text = c.splitlines() - # find last line with timestamp - for line in text[::-1]: - if TIMEST.match(line): - return datetime.datetime.strptime( - TIMEST.search(line).group(1), - "%Y-%m-%d %H:%M") - return None - - url = urljoin(job_url, "console.html.gz") - res = get_html(url) - if not _good_result(res): - print("Error getting console %s" % url) - # Try again - res = get_html(url) - if not _good_result(res): - return (None, None, None) - elif int(res.status_code) == 404: - url = urljoin(job_url, "console.html") - res = get_html(url) - if not _good_result(res): - # Try again - res = get_html(url) - if not _good_result(res): - print("Error getting console %s" % url) - return (None, None, None) - console = res.content.decode('utf-8') - date = _get_date(console) - return console, date, url - - def get_data(self, console, date, link): - fails, ok, errors = get_tests_results(console) - - d = { - 'run': True, - 'date': date, - 'link': link, - 'job': self.args.job - } - - if fails or errors: - covered, new = compare_tests(fails, self.config) - d.update({ - 'failed': fails, - 'covered': covered, - 'new': new, - 'errors': errors, - }) - elif ok: - d['ok'] = ok - elif not fails and not ok and not errors: - d['run'] = False - - return d - - def load_skip_file(self, skipfile): - known_failures = [] - try: - skip = yaml.safe_load(open(self.args.skip_file)) - except yaml.constructor.ConstructorError: - self.log.error('Invalid yaml file {}'.format(self.args.skip_file)) - else: - for t in skip.get('known_failures'): - known_failures.append({'test': t.get('test'), - 'reason': t.get('reason')}) - - return known_failures - - def checkJobs(self): - data = [] - if self.args.file: - console, date, link = self.get_console() - link = link or '' - d = self.get_data(console, date, link) - - data.append(d) - else: - index = self.get_index() - for run in index: - console, date, link = self.get_console(run) - - if not console or not date: - continue - - link = link or '' - d = self.get_data(console, date, link) - - data.append(d) - - data = sorted(data, key=lambda x: x['date']) - last = data[-1] - send_mail = Mail(self.config) - send_mail.send_mail(self.args.job, last, self.args.output) - - def setupConfig(self): - self.log.debug("Loading configuration") - try: - config = yaml.safe_load(open(self.args.config)) - except yaml.constructor.ConstructorError: - self.log.error('Invalid yaml file {}'.format(self.args.config)) - - newconfig = Config() - known_failures = [] - - newconfig.emails = [] - newconfig.username = config.get('mail_username', '') - newconfig.password = config.get('mail_password', '') - newconfig.mail_from = config.get('mail_from', '') - newconfig.smtp = config.get('smtp_server', '') - newconfig.templates_path = config.get('templates_path') - newconfig.template = config.get('template') - newconfig.log_url = config.get('log_url') - newconfig.require_auth = config.get('require_auth', False) - newconfig.default_log_url = config.get('default_log_url', - 'http://logs.openstack.org') - - for e in config.get('emails'): - regex = [re.compile(r) for r in e.get('regex', [])] - - newconfig.emails.append({'name': e.get('name'), - 'mail': e.get('mail'), - 'jobs': e.get('jobs', []), - 'regex': regex, - 'topics': e.get('topics'), - 'fail_only': e.get('fail_only', False)}) - for t in config.get('known_failures', []): - known_failures.append({'test': t.get('test'), - 'reason': t.get('reason')}) - - if self.args.skip_file: - known_failures = ( - known_failures + self.load_skip_file(self.args.skip_file)) - - newconfig.known_failures = known_failures - newconfig.api_server = config.get('api_server') - newconfig.use_api_server = config.get('use_api_server', False) - self.config = newconfig - - -def main(): - tmc = TempestMailCmd() - tmc.parse_arguments(sys.argv[1:]) - tmc.setup_logging() - tmc.setupConfig() - tmc.checkJobs() - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/roles/validate-tempest/files/tempestmail/template/template.html b/roles/validate-tempest/files/tempestmail/template/template.html deleted file mode 100644 index a056fad7e..000000000 --- a/roles/validate-tempest/files/tempestmail/template/template.html +++ /dev/null @@ -1,53 +0,0 @@ - - - -

    Hello,

    -

    This is an automated email with tempest results for job {{ data.get('job') }}.

    -

    The job ran on {{ data.get('date')|datetimeformat }}.

    - {% if 'Not available yet' not in data.get('link') %} -

    The logs are being uploaded, and it will be available soon. Usually, it take between 5 and 10 minutes to became available, depending of the amount of data it's being uploaded, so don't worry if you don't see the logs right now.

    -

    Once the logs are available, you can check clicking here

    -

    Mostly jobs upstream provides a tool to easily visualize and analyze the performance and execution of each tempest job.

    -

    This tool is called stackviz, and you can see the results here if available

    - {% else %} -

    Unfortunate the script that send this email wasn't able to find the url where the logs are. Perhaps wasn't passed

    -

    to the script, or something wrong happened. If you think it's a mistake, please contact us on channel

    -

    #tripleo on OFTC irc if it's related to a upstream job, or if you're using this service in your own infrastructure,

    -

    be sure you are setting the environment variable LOG_PATH in your job.

    - {% endif %} -

    Below you can see a resume of the tempest execution for this particular job:

    - {% if 'new' in data and data.new %} -

    New failures ({{ data.new|length}}):

    -

    These are new failures for this particular run, some action is needed in order to fix it

    -
      - {% for fail in data.new %} -
    • {{ fail }}
    • - {% endfor %} -
    - {% endif %} - {% if 'covered' in data and data.covered %} -

    Known failures ({{ data.covered|length }}):

    -

    These are known failures, and should have a launchpad or a bugzilla opened for it.

    -
      - {% for fail in data.covered %} -
    • {{ fail.failure }} - {{ fail.reason }}
    • - {% endfor %} -
    - {% endif %} - {% if ('has_errors' in data and 'run' in data) and not data.has_errors and data.run %} -

    Job ran successfully!

    -

    We consider a successfull run even if it has Known failures, since these are covered.

    - {% endif %} - {% if not data.run %} -

    There's no tempest results!

    -

    This means that the TripleO installation might have finished sucessfully, however, tempest either fail before tests started, or didn't ran at all.

    -

    One of the places to begin check is here (the link might don't exist depending of the type of error) - {% endif %} -

    -

    You are receiving this email because someone from TripleO team though you would be interested in these results.

    -

    -

    If you're interested in receive these emails, please submit a code review here - including your email address

    -

    We also have a website with status of our current jobs if you are interested.

    - - diff --git a/roles/validate-tempest/files/tempestmail/test-requirements.txt b/roles/validate-tempest/files/tempestmail/test-requirements.txt deleted file mode 100644 index c8374d0bc..000000000 --- a/roles/validate-tempest/files/tempestmail/test-requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -mock==2.0.0 -os-testr==0.8.2 -pbr==3.0.1 -testresources==2.0.1 -testtools==2.3.0 -unittest2==1.1.0 diff --git a/roles/validate-tempest/files/tempestmail/tests/__init__.py b/roles/validate-tempest/files/tempestmail/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/validate-tempest/files/tempestmail/tests/fixtures/config.yaml b/roles/validate-tempest/files/tempestmail/tests/fixtures/config.yaml deleted file mode 100644 index ce8977c1b..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/fixtures/config.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -require_auth: true -mail_from: tripleoresults@gmail.com -templates_path: template/ -log_url: 'http://logs.openstack.org/periodic/' -api_server: 'http://tempest-tripleoci.rhcloud.com/api/v1.0/sendmail' -use_api_server: true -default_log_url: 'http://logs.openstack.org' -emails: - - mail: 'arxcruz@redhat.com' - name: 'Arx Cruz' - - mail: 'whayutin@redhat.com' - name: 'Wes' - - mail: 'gcerami@redhat.com' - name: 'Gabriele' - - mail: 'sshnaidm@redhat.com' - name: 'Sagi Shnaidman' - - mail: 'myoung@redhat.com' - name: 'Matt Young' -template: template.html diff --git a/roles/validate-tempest/files/tempestmail/tests/fixtures/console_fail.log b/roles/validate-tempest/files/tempestmail/tests/fixtures/console_fail.log deleted file mode 100644 index f580bfa79..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/fixtures/console_fail.log +++ /dev/null @@ -1,2 +0,0 @@ -2017-01-18 08:51:03.877973 | {0} tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_valid_object [0.263364s] ... FAILED -2017-01-18 08:51:46.676254 | {1} tempest.api.orchestration.stacks.test_soft_conf.TestSoftwareConfig.test_get_deployment_metadata [0.899338s] ... FAILED diff --git a/roles/validate-tempest/files/tempestmail/tests/fixtures/console_ok.log b/roles/validate-tempest/files/tempestmail/tests/fixtures/console_ok.log deleted file mode 100644 index 441b71a31..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/fixtures/console_ok.log +++ /dev/null @@ -1,2 +0,0 @@ -2017-01-18 08:47:46.883811 | {3} tempest.api.compute.flavors.test_flavors.FlavorsV2TestJSON.test_get_flavor [0.576186s] ... ok -2017-01-18 08:47:47.016820 | {3} tempest.api.compute.flavors.test_flavors.FlavorsV2TestJSON.test_list_flavors [0.132801s] ... ok diff --git a/roles/validate-tempest/files/tempestmail/tests/fixtures/content_job.html b/roles/validate-tempest/files/tempestmail/tests/fixtures/content_job.html deleted file mode 100644 index ecd96aed8..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/fixtures/content_job.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - Index of /periodic/periodic-tripleo-ci-centos-7-ovb-nonha-tempest-oooq-master - - -

    Index of /periodic/periodic-tripleo-ci-centos-7-ovb-nonha-tempest-oooq-master

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    [ICO]NameLast modifiedSizeDescription

    [PARENTDIR]Parent Directory  -  
    [DIR]613de4e/2017-06-21 10:42 -  
    [DIR]7d6d7c5/2017-06-20 10:42 -  
    [DIR]266c5ed/2017-06-19 10:56 -  
    [DIR]669020c/2017-06-18 10:41 -  
    [DIR]4d6d6c2/2017-06-18 00:12 -  
    [DIR]c930f7c/2017-06-18 00:12 -  
    [DIR]f28dc4b/2017-06-18 00:10 -  
    [DIR]de0db2c/2017-06-18 00:10 -  
    [DIR]4648408/2017-06-18 00:10 -  
    [DIR]6817d3a/2017-06-18 00:10 -  
    [DIR]169a409/2017-06-18 00:08 -  
    [DIR]16cbf33/2017-06-17 10:57 -  
    [DIR]5a2f6f0/2017-06-12 07:32 -  
    [DIR]cb4751f/2017-06-12 07:32 -  
    [DIR]577be59/2017-06-12 07:32 -  
    [DIR]461b549/2017-06-12 07:31 -  
    [DIR]c4483e0/2017-06-12 07:31 -  
    [DIR]120eee9/2017-06-12 07:30 -  
    [DIR]6aa4747/2017-06-12 07:30 -  
    [DIR]eca830a/2017-06-04 21:37 -  
    [DIR]4bae1d9/2017-06-04 21:37 -  
    [DIR]63eae3a/2017-06-04 21:37 -  
    [DIR]4e5e59b/2017-06-04 21:36 -  
    [DIR]99887a8/2017-06-04 21:36 -  
    [DIR]4884a6e/2017-06-04 21:36 -  
    [DIR]73611a6/2017-06-04 21:36 -  
    [DIR]2a4b73b/2017-05-28 21:35 -  
    [DIR]ddabcd9/2017-05-28 21:35 -  
    [DIR]eb45103/2017-05-28 21:35 -  
    [DIR]c01f4d9/2017-05-28 21:34 -  
    [DIR]4e41041/2017-05-28 21:34 -  
    [DIR]bc89fc5/2017-05-28 21:34 -  
    [DIR]2ac63ac/2017-05-28 21:33 -  
    [DIR]081ac24/2017-05-21 23:38 -  
    [DIR]43f6d54/2017-05-21 23:38 -  
    [DIR]ffb8447/2017-05-21 23:38 -  

    - diff --git a/roles/validate-tempest/files/tempestmail/tests/fixtures/template.html b/roles/validate-tempest/files/tempestmail/tests/fixtures/template.html deleted file mode 100644 index 53e8ffde6..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/fixtures/template.html +++ /dev/null @@ -1,37 +0,0 @@ - - - -

    Hello,

    -

    Here's the result of the latest tempest run for job {{ data.get('job') }}.

    -

    The job ran on {{ data.get('date') }}.

    -

    For more details, you can check the URL: {{ data.get('link') }} (It might take a few minutes to upload the logs).

    - {% if 'new' in data and data.new %} -

    New failures

    -
      - {% for fail in data.new %} -
    • {{ fail }}
    • - {% endfor %} -
    - {% endif %} - - {% if 'covered' in data and data.covered %} -

    Known failures

    -
      - {% for fail in data.covered %} -
    • {{ fail.failure }} - {{ fail.reason }}
    • - {% endfor %} -
    - {% endif %} - {% if ('has_errors' in data and 'run' in data) and not data.has_errors and data.run %} -

    Job ran successfully!

    -

    We consider a successfull run even if it has Known failures, since these are covered.

    - {% endif %} - {% if not data.run %} -

    There's no tempest results!

    -

    This means that the TripleO installation might have finished sucessfully, however, tempest either fail before tests started, or didn't ran at all.

    - {% endif %} -

    -

    You are receiving this email because someone from TripleO team though you were interested in these results.

    -

    - - diff --git a/roles/validate-tempest/files/tempestmail/tests/test_tempestmail.py b/roles/validate-tempest/files/tempestmail/tests/test_tempestmail.py deleted file mode 100644 index ebac3ed25..000000000 --- a/roles/validate-tempest/files/tempestmail/tests/test_tempestmail.py +++ /dev/null @@ -1,354 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# flake8: noqa - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -import datetime -from unittest import mock -import re -import tempfile -import unittest - -from tempestmail import Config -from tempestmail import Mail -from tempestmail import TempestMailCmd - - -class MailTest(unittest.TestCase): - def setUp(self): - self.config = self._generate_config() - self.data = self._generate_data() - self.render_output = self._get_render_template_output() - self.maxDiff = None - - def _generate_config(self): - config = Config() - config.mail_from = 'tripleoresults@gmail.com' - config.templates_path = 'tests/fixtures/' - config.log_url = 'http://logs.openstack.org/periodic/' - config.api_server = 'http://tempest-tripleoci.rhcloud.com/api/v1.0/sendmail' - config.use_api_server = True - config.default_log_url = 'http://logs.openstack.org' - config.username = '' - config.password = '' - config.smtp = '' - config.require_auth = True - config.emails = [ - {'mail': 'email1@example.com', 'name': 'name 1', - 'jobs': [], 'regex': [], 'topics': ''}, - {'mail': 'email2@example.com', 'name': 'name 2', - 'jobs': [], 'regex': [], 'topics': ''} - ] - config.template = 'template.html' - return config - - def _get_render_template_output(self): - output = (u'\n \n \n ' - '

    Hello,

    \n

    Here\'s the result of the latest ' - 'tempest run for job ' - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest.

    \n ' - '

    The job ran on 2017-01-19 08:27:00.

    \n ' - '

    For more details, you can check the URL: ' - 'http://logs.openstack.org/periodic/periodic-tripleo-ci-' - 'centos-7-ovb-ha-tempest/1ce5e95/console.html (It might take ' - 'a few minutes to upload the logs).

    \n \n ' - '

    New failures

    \n
      \n \n
    • ' - 'tempest.api.object_storage.test_container_quotas.' - 'ContainerQuotasTest.test_upload_too_many_objects
    • ' - '\n \n
    • tempest.api.object_storage.test_' - 'container_quotas.ContainerQuotasTest.' - 'test_upload_valid_object
    • \n \n
    \n \n\n ' - '\n \n \n

    \n

    You are receiving this ' - 'email because someone from TripleO team though you were ' - 'interested in these results.

    \n

    \n ' - '\n\n') - return output - - def _generate_data(self): - data = { - 'errors': [], - 'run': True, - 'failed': [ - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_too_many_objects', - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_valid_object' - ], - 'job': 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', - 'link': u'http://logs.openstack.org/periodic/periodic-tripleo-ci-centos-7-ovb-ha-tempest/1ce5e95/console.html', - 'covered': [], - 'date': datetime.datetime(2017, 1, 19, 8, 27), - 'new': [ - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_too_many_objects', - u'tempest.api.object_storage.test_container_quotas.ContainerQuotasTest.test_upload_valid_object' - ] - } - return data - - def test_render_template(self): - mail = Mail(self.config) - content = mail.render_template(self.data) - self.assertEqual(self.render_output, content) - - def test_filter_emails(self): - mail = Mail(self.config) - self.assertEqual(self.data.get('has_errors'), None) - addresses = mail.filter_emails( - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', self.data) - self.assertEqual({'': ['email1@example.com', 'email2@example.com']}, - addresses) - mail.config.emails[0]['jobs'].append('another-job') - addresses = mail.filter_emails( - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', self.data) - self.assertEqual({'': ['email2@example.com']}, addresses) - self.assertEqual(self.data['has_errors'], True) - mail.config.emails[0]['jobs'] = [] - mail.config.emails[0]['regex'].append(re.compile( - 'tempest.some.regex')) - self.assertEqual({'': ['email2@example.com']}, addresses) - - def test_filter_emails_topics(self): - mail = Mail(self.config) - addresses = mail.filter_emails( - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', self.data) - self.assertEqual({'': ['email1@example.com', - 'email2@example.com']}, - addresses) - mail.config.emails[0]['jobs'].append( - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest') - mail.config.emails[0]['regex'].append(re.compile( - 'upload_too_many_objects')) - mail.config.emails[0]['topics'] = 'many_objects' - mail.config.emails[1]['regex'].append(re.compile( - 'upload_valid_object')) - mail.config.emails[1]['topics'] = 'valid_object' - new = {'mail': 'email2@example.com', 'name': 'name 2', - 'jobs': ['periodic-tripleo-ci-centos-7-ovb-ha-tempest'], - 'regex': [re.compile('upload_valid_object')], - 'topics': 'valid_object,object_storage'} - mail.config.emails.append(new) - addresses = mail.filter_emails( - 'periodic-tripleo-ci-centos-7-ovb-ha-tempest', self.data) - bookaddr = {'[many_objects]': ['email1@example.com'], - '[valid_object]': ['email2@example.com'], - '[valid_object][object_storage]': ['email2@example.com']} - self.assertEqual(bookaddr, addresses) - - @mock.patch('tempestmail.Mail._send_mail_api') - @mock.patch('tempestmail.Mail._send_mail_local') - def test_send_mail(self, mock_local, mock_api): - mail = Mail(self.config) - mail.send_mail('periodic-tripleo-ci-centos-7-ovb-ha-tempest', - self.data, False) - mock_api.assert_called_with(['email1@example.com', - 'email2@example.com'], - self.render_output, - 'Job periodic-tripleo-ci-centos-7-ovb-ha-' - 'tempest results') - mock_local.assert_not_called() - mock_api.reset_mock() - self.config.use_api_server = False - mail = Mail(self.config) - mail.send_mail('periodic-tripleo-ci-centos-7-ovb-ha-tempest', - self.data, False) - mock_local.assert_called_with(['email1@example.com', - 'email2@example.com'], - self.render_output, - 'Job periodic-tripleo-ci-centos-7-ovb-ha-' - 'tempest results', False) - - -class TestTempestMailCmd(unittest.TestCase): - def setUp(self): - self.content_job = self._get_content_file( - 'tests/fixtures/content_job.html') - self.console_ok = self._get_content_file( - 'tests/fixtures/console_ok.log') - self.console_fail = self._get_content_file( - 'tests/fixtures/console_fail.log') - self.fd_file, self.tmp_file = tempfile.mkstemp() - self._populate_skip_file() - - def _get_content_file(self, filename): - with open(filename) as f: - content = f.read() - - return content - - def _populate_skip_file(self): - content = ''' - known_failures: - - test: '.*test_external_network_visibility' - reason: 'Tempest test "external network visibility" fails' - lp: 'https://bugs.launchpad.net/tripleo/+bug/1577769' - - test: 'tempest.api.data_processing' - reason: 'tempest.api.data_processing tests failing on newton' - bz: 'https://bugzilla.redhat.com/show_bug.cgi?id=1357667' - - test: 'neutron.tests.tempest.api.test_revisions.TestRevisions' - reason: 'New test, need investigation' - ''' - self.skip_file = open(self.tmp_file, 'w') - self.skip_file.write(content) - self.skip_file.close() - - @mock.patch('tempestmail.get_html') - def test_get_index(self, html_mock): - tmc = TempestMailCmd() - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master']) - tmc.setup_logging() - tmc.setupConfig() - - html_mock.return_value.content.decode.return_value = self.content_job.decode() - index = tmc.get_index() - self.assertEqual( - index, - [(u'http://logs.openstack.org/periodic/periodic-tripleo-ci' - '-centos-7-ovb-nonha-tempest-oooq-master/613de4e/')]) - - html_mock.return_value.content.decode.return_value = 'No links' - index = tmc.get_index() - self.assertEqual(index, []) - - html_mock.return_value = None - index = tmc.get_index() - self.assertEqual(index, []) - - html_mock.ok.return_value = None - index = tmc.get_index() - self.assertEqual(index, []) - - html_mock.ok.return_value = True - html_mock.content.return_value = None - index = tmc.get_index() - self.assertEqual(index, []) - - @mock.patch('tempestmail.get_html') - def test_get_console(self, html_mock): - tmc = TempestMailCmd() - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/console_ok.log']) - tmc.setup_logging() - tmc.setupConfig() - - console, date, log_path = tmc.get_console() - self.assertEqual(console, self.console_ok) - self.assertEqual(log_path, None) - - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/not_found.log']) - self.assertEqual(tmc.get_console(), (None, None, None)) - - html_mock.return_value.status_code = '300' - result = tmc.get_console(job_url='http://logs.openstack.org') - self.assertEqual(result, (None, None, None)) - - html_mock.return_value.status_code = '200' - html_mock.return_value.content = self.console_ok - console, date, url = tmc.get_console( - job_url='http://logs.openstack.org') - - self.assertEqual(console, self.console_ok.decode('utf-8')) - self.assertEqual(url, 'http://logs.openstack.org/console.html.gz') - - html_mock.return_value = None - result = tmc.get_console(job_url='http://logs.openstack.org') - self.assertEqual(result, (None, None, None)) - - def test_get_data(self): - tmc = TempestMailCmd() - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/not_found.log']) - tmc.setup_logging() - tmc.setupConfig() - - data = tmc.get_data(self.console_ok, None, 'http://logs.openstack.org') - - self.assertEqual( - data['job'], - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-oooq-master') - self.assertEqual(data['date'], None) - self.assertEqual(data['run'], True) - self.assertEqual(data['link'], 'http://logs.openstack.org') - self.assertEqual(len(data['ok']), 2) - self.assertEqual(data.get('failed'), None) - self.assertEqual(data.get('covered'), None) - self.assertEqual(data.get('new'), None) - self.assertEqual(data.get('errors'), None) - - data = tmc.get_data('some content', None, 'http://logs.openstack.org') - self.assertEqual(data['run'], False) - - data = tmc.get_data(self.console_fail, None, - 'http://logs.openstack.org') - self.assertNotEqual(data['failed'], None) - - def test_load_skip_file(self): - tmc = TempestMailCmd() - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/not_found.log', '--skip-file', - self.tmp_file]) - tmc.setup_logging() - tmc.setupConfig() - - result = tmc.load_skip_file(self.tmp_file) - - expected = [ - {'test': '.*test_external_network_visibility', - 'reason': 'Tempest test "external network visibility" fails'}, - {'test': 'tempest.api.data_processing', - 'reason': 'tempest.api.data_processing tests failing on newton'}, - {'test': 'neutron.tests.tempest.api.test_revisions.TestRevisions', - 'reason': 'New test, need investigation'} - ] - self.assertEqual(result, expected) - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/not_found.log', '--skip-file', - 'non_exist_file.txt']) - result = tmc.load_skip_file(self.tmp_file) - self.assertEqual(result, []) - - def test_setup_config(self): - tmc = TempestMailCmd() - tmc.parse_arguments(['-c', 'tests/fixtures/config.yaml', '--job', - 'periodic-tripleo-ci-centos-7-ovb-nonha-tempest-' - 'oooq-master', '--file', - 'tests/fixtures/not_found.log', '--skip-file', - self.tmp_file]) - tmc.setup_logging() - tmc.setupConfig() - config = tmc.config - - self.assertEqual(config.require_auth, True) - self.assertEqual(config.mail_from, 'tripleoresults@gmail.com') - self.assertEqual(config.templates_path, 'template/') - self.assertEqual( - config.log_url, - 'http://logs.openstack.org/periodic/') - self.assertEqual( - config.api_server, - 'http://tempest-tripleoci.rhcloud.com/api/v1.0/sendmail') - self.assertEqual(config.use_api_server, True) - self.assertEqual(config.default_log_url, 'http://logs.openstack.org') diff --git a/roles/validate-tempest/meta/main.yml b/roles/validate-tempest/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-tempest/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-tempest/tasks/main.yml b/roles/validate-tempest/tasks/main.yml deleted file mode 100644 index 793e6661b..000000000 --- a/roles/validate-tempest/tasks/main.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,python,processor" - when: > - ansible_python is not defined or - ansible_processor_vcpus is not defined - -- name: set python_cmd - set_fact: - python_cmd: "python{{ ansible_python.version.major }}" - cacheable: true - when: python_cmd is not defined - -- name: change python_package_prefix for python > 2 - set_fact: - python_package_prefix: "python{{ ansible_python.version.major }}" - cacheable: true - when: ansible_python.version.major > 2 - -- include: tempest-venv.yml - when: tempest_config|bool and tempest_format == 'venv' - tags: - - pre-tempest-config - -- include: tempest-rpm.yml - when: tempest_config|bool and tempest_format == 'packages' - tags: - - pre-tempest-config - -- include: tempest-containers.yml - when: tempest_config|bool and tempest_format == 'container' - tags: - - pre-tempest-config - -- include: pre-tempest.yml - when: tempest_config|bool or run_tempest|bool - tags: - - pre-tempest-config - -- include: run-tempest.yml - when: run_tempest|bool - tags: - - run-tempest - -- include: tempest-results.yml - when: run_tempest|bool - tags: - - tempest-results - -- include: stackviz.yml - when: run_tempest|bool - tags: - - run-stackviz - ignore_errors: true - -- include: post-tempest.yml - when: post_tempest|bool and run_tempest|bool - tags: - - post-tempest diff --git a/roles/validate-tempest/tasks/post-tempest.yml b/roles/validate-tempest/tasks/post-tempest.yml deleted file mode 100644 index a66eca686..000000000 --- a/roles/validate-tempest/tasks/post-tempest.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: Exit with tempest result code if configured - shell: tail -10 {{ tempest_log_file }}; exit {{ tempest_result.rc }} - when: tempest_result.rc != 0 and tempest_exit_on_failure|bool diff --git a/roles/validate-tempest/tasks/pre-tempest.yml b/roles/validate-tempest/tasks/pre-tempest.yml deleted file mode 100644 index 2cabd8aa2..000000000 --- a/roles/validate-tempest/tasks/pre-tempest.yml +++ /dev/null @@ -1,106 +0,0 @@ ---- -- name: Set the number of workers in tempest - set_fact: - tempest_workers: "{{ ansible_processor_vcpus|int // 2 }}" - when: tempest_workers is not defined - -- name: Set rc file to be sourced to run tempest - set_fact: - rc_file: "{{ working_dir }}/{% if tempest_undercloud %}stackrc{% else %}overcloudrc{% endif %}" - -- name: Set rc file to be sourced to run tempest with in container - set_fact: - rc_file_container: "{{ tempest_data }}/{% if tempest_undercloud %}stackrc{% else %}overcloudrc{% endif %}" - when: tempest_format == 'container' - -- name: copy tls related files to undercloud home directory - copy: - src: '/etc/novajoin/krb5.keytab' - dest: '{{ working_dir }}/krb5.keytab' - owner: '{{ undercloud_user }}' - group: '{{ undercloud_user }}' - remote_src: true - become: true - when: - - enable_tls_everywhere is defined - - enable_tls_everywhere|bool - -- name: Create overcloud tempest setup script - template: - src: tempest-setup.j2 - dest: "{{ working_dir }}/tempest-setup.sh" - mode: 0744 - -- name: Deprecation message for test_regex - debug: - msg: "WARNING: The variable test_regex is deprecated and will be removed by end of ROCKY release in the favor of test_white_regex." - when: test_regex is defined - -- name: Load skip list variables (undercloud or overcloud) - include_vars: - file: "tempest_skip_{{ release }}.yml" - when: skip_file_src != '' - -- name: Create tempest skipfile - template: - src: "{{ skip_file_src }}" - dest: "{{ working_dir }}/{{ skip_file }}" - mode: 0644 - when: skip_file_src != '' - -- name: Create tempest white file - template: - src: "{{ tempest_whitelist_file_src }}" - dest: "{{ working_dir }}/{{ tempest_whitelist_file }}" - mode: 0644 - when: tempest_whitelist|length > 0 - -- name: Install packages to generate subunit results - become: true - package: - name: - - "{{ python_package_prefix }}-os-testr" - - "{{ python_package_prefix }}-subunit" - - subunit-filters - state: present - when: tempest_format in ['container', 'packages'] - -- name: Install stestr - become: true - package: - name: "{{ python_package_prefix }}-stestr" - state: present - when: tempest_format in ['container', 'packages'] - -- ignore_errors: true - block: - - name: Copying bugcheck files - synchronize: - src: bugcheck/ - dest: "{{ working_dir }}/bugcheck/" - use_ssh_args: true - - - name: Copying skip file - synchronize: - src: "vars/tempest_skip_{{ release }}.yml" - dest: "{{ working_dir }}/bugcheck/" - use_ssh_args: true - - - name: Setting virtualenv - shell: > - virtualenv "{{ working_dir }}/bugcheck/.venv" - - - name: Installing requirements - pip: - requirements: "{{ working_dir }}/bugcheck/requirements.txt" - virtualenv: "{{ working_dir }}/bugcheck/.venv" - - - name: Verifying bugs in bugzilla and launchpad and generating skip file - shell: > - source "{{ working_dir }}"/bugcheck/.venv/bin/activate; - python bugcheck.py --skip-file "{{ working_dir }}/bugcheck/tempest_skip_{{ release }}.yml" - --to-file "{{ working_dir }}/{{ skip_file }}" --format txt - args: - chdir: "{{ working_dir }}/bugcheck" - ignore_errors: true - when: check_tempest_bugs|bool diff --git a/roles/validate-tempest/tasks/run-tempest.yml b/roles/validate-tempest/tasks/run-tempest.yml deleted file mode 100644 index 4e001324f..000000000 --- a/roles/validate-tempest/tasks/run-tempest.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Execute tempest - shell: > - set -o pipefail && - {{ working_dir }}/tempest-setup.sh 2>&1 {{ timestamper_cmd }} > {{ tempest_log_file }} - register: tempest_result - ignore_errors: true - changed_when: true diff --git a/roles/validate-tempest/tasks/stackviz.yml b/roles/validate-tempest/tasks/stackviz.yml deleted file mode 100644 index 9a5bfeddd..000000000 --- a/roles/validate-tempest/tasks/stackviz.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -- name: Install stackviz - pip: - name: "{{ stackviz_tarball }}" - virtualenv: "{{ working_dir }}/tempest/.stackviz" - -- name: Check if dstats file exists - stat: path=/var/log/extra/dstat-csv.log - register: dstat_result - -- name: Set dstat fact - set_fact: - tempest_dstat_opt: '--dstat /var/log/extra/dstat-csv.log' - when: dstat_result.stat.exists - -- name: Copy stackviz static file to home directory - shell: > - cp -r "{{ working_dir }}/tempest/.stackviz/share/stackviz-html" "{{ working_dir }}/stackviz" - changed_when: true - -- name: Collecting data from tempest - shell: | - set -o pipefail - source "{{ working_dir }}/tempest/.stackviz/bin/activate" - stackviz-export {{ tempest_dstat_opt | default('') }} --env -f {{ working_dir }}/tempest/testrepository.subunit {{ working_dir }}/stackviz/data - register: stackviz_result - args: - chdir: "{{ working_dir }}/tempest" - changed_when: true - -- name: Ensure /var/log/extra exists - file: - path: /var/log/extra - state: directory - mode: 0755 - become: true - -- name: Moving stackviz to /var/log/extra - shell: | - set -o pipefail - mv {{ working_dir }}/stackviz/ /var/log/extra - become: true - when: stackviz_result.rc == 0 diff --git a/roles/validate-tempest/tasks/tempest-containers.yml b/roles/validate-tempest/tasks/tempest-containers.yml deleted file mode 100644 index c54b42717..000000000 --- a/roles/validate-tempest/tasks/tempest-containers.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -- name: Set tempest init command - set_fact: - tempest_init: "tempest init {{ tempest_dir }}" - -- name: Set tempestconf call - set_fact: - tempestconf: "/usr/bin/discover-tempest-config" - -- name: Create /var/log/containers/tempest - file: - path: /var/log/containers/tempest - state: directory - become: true - -- name: Create /var/lib/tempestdata - file: - path: /var/lib/tempestdata - state: directory - become: true diff --git a/roles/validate-tempest/tasks/tempest-results.yml b/roles/validate-tempest/tasks/tempest-results.yml deleted file mode 100644 index 2ff3657c7..000000000 --- a/roles/validate-tempest/tasks/tempest-results.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- -- ignore_errors: true - when: tempest_format == 'container' - block: - - name: Set the proper permission for tempest directory and files - file: - dest: "/var/lib/tempestdata" - owner: "{{ undercloud_user }}" - group: "{{ undercloud_user }}" - recurse: true - become: true - - # Using cp here because copy module doesn't allow recursive copy with - # remote_src set to true and synchronize is too slow - - name: copy files from tempest container to home directory - command: "cp -Rf --reflink=auto /var/lib/tempestdata/tempest {{ working_dir }}" - args: - warn: false - changed_when: true - -- block: - - name: Check for .stestr directory - stat: - path: "{{ working_dir }}/tempest/.stestr" - register: testr_dir - - - name: Define testr facts - set_fact: - testr_command: "{{ testr_dir.stat.exists | ternary(python_cmd + ' -m stestr.cli', 'testr') }}" - - - name: Change permission of tempest container log directory - shell: | - sudo chmod -R 777 /var/log/containers/tempest - when: tempest_format == 'container' - - - name: Generate testrepository.subunit results file - shell: > - set -o pipefail && - {% if tempest_format == 'venv' %}source {{ working_dir }}/tempest_git/.venv/bin/activate; {% endif %} - {{ testr_command }} last --subunit | subunit-1to2 > {{ working_dir }}/tempest/testrepository.subunit - args: - chdir: "{{ working_dir }}/tempest" - - - name: Generate HTML results file - shell: | - set -o pipefail && - {% if tempest_format == 'venv' %}source {{ working_dir }}/tempest_git/.venv/bin/activate; {% endif %} - subunit2html {{ working_dir }}/tempest/testrepository.subunit {{ working_dir }}/tempest/tempest.html - - - name: Generate XML results file - shell: | - set -o pipefail && - {%- if tempest_format == 'venv' -%} - source {{ working_dir }}/tempest_git/.venv/bin/activate; - {%- endif -%} - subunit2junitxml {{ working_dir }}/tempest/testrepository.subunit --output-to {{ working_dir }}/tempest/tempest.xml 2>&1 >> {{ tempest_log_file }} - - - name: Fetch HTML results - fetch: - src: "{{ working_dir }}/tempest/tempest.html" - dest: "{{ local_working_dir }}/tempest.html" - flat: true - - - name: Fetch nosetests results - fetch: - src: "{{ working_dir }}/tempest/tempest.xml" - dest: "{{ local_working_dir }}/nosetests.xml" - flat: true - - - name: Copying tempestmail files - synchronize: - src: tempestmail/ - dest: "{{ working_dir }}/tempestmail/" - use_ssh_args: true - - - name: Copying skip file - synchronize: - src: "vars/tempest_skip_{{ release }}.yml" - dest: "{{ working_dir }}/tempestmail/" - use_ssh_args: true - - - name: Send tempest results by mail - shell: > - {% if lookup('env', 'LOG_PATH') %}LOG_PATH='{{ lookup('env', 'LOG_PATH') }}' {% endif %} - ./tempestmail.py -c {{ tempestmail_config }} --job - "{{ lookup('env', 'JOB_NAME')|default('Periodic job', true) }}" - --file "{{ working_dir }}/{{ tempest_log_file }}" - --log-url "{{ tempestmail_log_server }}" - --skip-file "{{ working_dir }}/tempestmail/tempest_skip_{{ release }}.yml" || - { ERR=$?; echo -e "\0127ARNING: Send tempest results by mail failed with code $ERR"; exit $ERR; } - args: - chdir: "{{ working_dir }}/tempestmail" - ignore_errors: true - when: send_mail_tempest|default(false)|bool diff --git a/roles/validate-tempest/tasks/tempest-rpm.yml b/roles/validate-tempest/tasks/tempest-rpm.yml deleted file mode 100644 index 33917a5b5..000000000 --- a/roles/validate-tempest/tasks/tempest-rpm.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: Install openstack services tempest plugins - # noqa 403 - package: - state: latest - name: "{{ item | regex_replace( '^python[0-9]*-(.*)$', python_package_prefix + '-\\1' ) }}" - with_items: "{{ tempest_plugins }}" - become: true - when: tempest_plugins|length > 0 - -- name: Install openstack tempest - package: - name: - - openstack-tempest - - "{{ python_package_prefix }}-junitxml" - state: present - become: true - -- name: Install python-tempestconf - package: - name: "{{ python_package_prefix }}-tempestconf" - state: present - become: true - -- name: Set tempest init command - set_fact: - tempest_init: "tempest init {{ tempest_dir }}" - -- name: Set tempestconf call - set_fact: - tempestconf: "/usr/bin/discover-tempest-config" diff --git a/roles/validate-tempest/tasks/tempest-venv.yml b/roles/validate-tempest/tasks/tempest-venv.yml deleted file mode 100644 index 0c5f02935..000000000 --- a/roles/validate-tempest/tasks/tempest-venv.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -- name: Cloning tempest from openstack repository - git: - repo: 'https://opendev.org/openstack/tempest' - dest: '{{ working_dir }}/tempest_git' - version: '{{ tempest_version }}' - -- name: Cloning python-tempestconf - git: - repo: 'https://opendev.org/openinfra/python-tempestconf' - dest: '{{ working_dir }}/tempestconf_git' - version: '{{ tempest_conf_version }}' - -- name: Check if virtualenv is in the system - command: "{{ python_cmd }} -m virtualenv --version" - register: virtualenv_exist - failed_when: false - changed_when: false - -- when: virtualenv_exist.rc != 0 - name: Install virtualenv - package: - state: present - name: > - {% if ansible_python.version.major == 3 %} - python3-virtualenv - {% else %} - python-virtualenv - {% endif %} - -- name: Clone tempest plugins - git: - repo: "{{ item }}" - dest: "{{ working_dir }}/{{ item.split('/')[-1] }}" - version: master - with_items: "{{ tempest_plugins_git }}" - when: - - tempest_format == 'venv' - -- name: Install packages required for create venv - package: - state: present - name: - - gcc - - libffi-devel - - openssl-devel - -- name: Set tempest init command - set_fact: - tempest_init: "{{ working_dir }}/tempest_git/tools/with_venv.sh tempest init" - -- name: Set tempestconf call - set_fact: - tempestconf: > - {{ working_dir }}/tempest_git/tools/with_venv.sh discover-tempest-config diff --git a/roles/validate-tempest/templates/cleanup-network.sh.j2 b/roles/validate-tempest/templates/cleanup-network.sh.j2 deleted file mode 100644 index 3b3ca21bd..000000000 --- a/roles/validate-tempest/templates/cleanup-network.sh.j2 +++ /dev/null @@ -1,63 +0,0 @@ -for i in $(openstack floating ip list -c ID -f value) -do - openstack floating ip unset --port $i - openstack floating ip delete $i -done -for i in $(openstack router list -c ID -f value); do openstack router unset --external-gateway $i; done -for r in $(openstack router list -c ID -f value); do - for p in $(openstack port list --router $r -c ID -f value); do - openstack router remove subnet $r $p || true - done -done -for i in $(openstack router list -c ID -f value); do openstack router delete $i; done -for i in $(openstack port list -c ID -c Name -f value | sed -e '/octavia/d' | cut -f 1 -d ' '); do openstack port delete $i; done -for i in $(openstack network list -c ID -c Name -f value | sed -e '/lb-mgmt-net/d' | cut -f 1 -d ' '); do openstack network delete $i; done - -{% if ironic_overcloud|default(false)|bool %} - -curl https://tarballs.opendev.org/openstack/ironic-python-agent/tinyipa/tinyipa-stable-pike.tar.gz | tar -C ~ -xzf - -IPAKERNEL=$(openstack image create --public --container-format aki --disk-format aki --file ~/tinyipa-stable-pike.vmlinuz deploy-kernel -f value -c id) -IPARD=$(openstack image create --public --container-format ari --disk-format ari --file ~/tinyipa-stable-pike.gz deploy-ramdisk -f value -c id) - -openstack image create --public --container-format bare --disk-format qcow2 --file {{ tempest_test_image_path }} cirros - -openstack network create --share --provider-network-type flat --provider-physical-network datacentre --external provisioning -openstack subnet create --network provisioning --subnet-range 192.168.24.0/24 --gateway 192.168.24.40 --allocation-pool start=192.168.24.41,end=192.168.24.100 provisioning-subnet - -NODEID=$(openstack baremetal node create --driver ipmi --driver-info ipmi_username=admin --driver-info ipmi_password=password --driver-info ipmi_address=127.0.0.1 --driver-info ipmi_port=1161 --resource-class baremetal --name node1 -f value -c uuid) -# TODO: MAC shouldn't be hardcoded -openstack baremetal port create --node $NODEID --local-link-connection switch_info=net-ans-br --local-link-connection port_id=ovs-node1i1 --local-link-connection switch_id=00:00:00:00:00:00 66:0d:1d:d8:0b:11 -openstack baremetal node set --property memory_mb=4096 --property cpus=4 --property local_gb=10 --property cpu_arch=x86_64 $NODEID - -openstack baremetal node manage $NODEID --wait -openstack baremetal node set $NODEID --driver-info deploy_kernel=$IPAKERNEL --driver-info deploy_ramdisk=$IPARD -openstack baremetal node provide $NODEID --wait - -NODEID=$(openstack baremetal node create --driver ipmi --driver-info ipmi_username=admin --driver-info ipmi_password=password --driver-info ipmi_address=127.0.0.1 --driver-info ipmi_port=1162 --resource-class baremetal --name node2 -f value -c uuid) -# TODO: MAC shouldn't be hardcoded -openstack baremetal port create --node $NODEID --local-link-connection switch_info=net-ans-br --local-link-connection port_id=ovs-node2i1 --local-link-connection switch_id=00:00:00:00:00:00 66:0d:1d:d8:0b:22 -openstack baremetal node set --property memory_mb=4096 --property cpus=4 --property local_gb=10 --property cpu_arch=x86_64 $NODEID - -openstack baremetal node manage $NODEID --wait -openstack baremetal node set $NODEID --driver-info deploy_kernel=$IPAKERNEL --driver-info deploy_ramdisk=$IPARD -openstack baremetal node provide $NODEID --wait - -{% else %} - -openstack network create {{ public_net_name }} --external \ -{% if public_physical_network != '' %} - --provider-network-type {{ public_network_type }} \ - {% if public_segmentation_id != '' %} - --provider-segment {{ public_segmentation_id }} \ -{% endif %} - --provider-physical-network {{ public_physical_network }} -{% endif %} - -openstack subnet create ext-subnet \ - --allocation-pool \ - start={{ public_net_pool_start }},end={{ public_net_pool_end }} \ - --no-dhcp \ - --gateway {{ public_net_gateway }} \ - --network {{ public_net_name }} \ - --subnet-range {{ floating_ip_cidr }} -{% endif %} diff --git a/roles/validate-tempest/templates/configure-tempest.sh.j2 b/roles/validate-tempest/templates/configure-tempest.sh.j2 deleted file mode 100644 index b35557c56..000000000 --- a/roles/validate-tempest/templates/configure-tempest.sh.j2 +++ /dev/null @@ -1,187 +0,0 @@ -## Configure tempest -## ----------------- - -## * Clean up from any previous tempest run -## :: - -# On doing tempest init workspace, it will create workspace directory -# as well as .workspace directory to store workspace information -# We need to delete .workspace directory otherwise tempest init failed -# to create tempest directory. -# We are doing this as sudo because tempest in containers create the files as -# root. -{% if tempest_format in ["venv", "packages"] %} -sudo rm -rf {{ working_dir }}/.tempest -sudo rm -rf {{ tempest_dir }} -{% endif %} - - -# Cloud Credentials -{% if tempest_os_cloud != '' %} -export OS_CLOUD={{ tempest_os_cloud }} -{% else %} -source {{ rc_file }} -{% endif %} - -## Create Tempest resources -## ------------------------ -## * For overcloud - -{% if tempest_overcloud|bool or tempest_os_cloud != '' %} - -## * Clean up network if it exists from previous run -## :: - -{% include 'cleanup-network.sh.j2' %} - -{% endif %} - -## * Ensure creator and Member role is present -## * Member role is needed for Heat tests. -## * creator role is needed for Barbican for running volume encryption tests. -## * ResellerAdmin role is needed for swift/RGW to grant object-store admin permissions. -## :: - -openstack role show Member > /dev/null || openstack role create Member - -openstack role show creator > /dev/null || openstack role create creator - -openstack role show ResellerAdmin > /dev/null || openstack role create ResellerAdmin - -## Install openstack-tempest -## ------------------------- -## * Using git -## :: - -{% if tempest_format == "venv" %} -# Create .venv in tempest_git directory with --system-site-packages to access tempest plugins -virtualenv --system-site-packages {{ working_dir }}/tempest_git/.venv -{{ working_dir }}/tempest_git/tools/with_venv.sh pip install -U pip -{{ working_dir }}/tempest_git/tools/with_venv.sh pip install -U setuptools -{{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/tempest_git junitxml -# Install tempest plugins in tempest .venv -{% for tempest_plugin in (tempest_plugins_git|default([])) %} -{{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/{{ tempest_plugin.replace('.git', '').split('/')[-1] }} -{% endfor %} - -# Install python-tempestconf -{{ working_dir }}/tempest_git/tools/with_venv.sh pip install {{ working_dir }}/tempestconf_git -{% endif %} - -{% if tempest_format == "container" %} -echo "========= Note: Executing tempest via a container ==========" - -cat <<'EOF' > {{ working_dir }}/tempest_container.sh -# Set the exit status for the command -set -e - -# Load rc file or os_cloud file - -{% if tempest_os_cloud == '' %} -source {{ rc_file_container }} -{% else %} -export OS_CLOUD="standalone" -cp -Rf /var/lib/tempest/.config ~/ -{% endif %} - -# Get the list of tempest/-plugins rpms installed within a tempest container -# It will be useful for debugging and making sure at what commit -# tempest/tempest plugins rpms are installed in the same. - -rpm -qa | grep tempest - -# Remove the existing tempest workspace -if [ -d {{ tempest_dir }}/etc ]; then -tempest workspace remove --name {{ tempest_dir | basename }} --rmdir -fi -{% endif %} - -## Create Tempest Workspace -## ------------------------ -## :: - - -# Create Tempest directory - -mkdir {{ tempest_dir }} - -# Create Tempest workspace -pushd {{ tempest_dir }} -{{ tempest_init }} -popd - -## Generate tempest configuration using python-tempestconf -## ------------------------------------------------------- -## :: -export TEMPESTCONF="{{ tempestconf }}" - -{% if tempest_overcloud|bool or tempest_os_cloud != '' %} -# Get public net id - -{% if ironic_overcloud|default(false)|bool %} -public_net_id=$(openstack network show provisioning -f value -c id) -{% else %} -public_net_id=$(openstack network show {{ public_net_name }} -f value -c id) -{% endif %} -{% endif %} - -region_name=${OS_REGION_NAME:-'regionOne'} - -{% if not tempest_overcloud|bool %} -# query the endpoint if not set (e.g. clouds.yaml) -export OS_AUTH_URL=${OS_AUTH_URL:-$(openstack endpoint list --service=identity --interface=public -c URL -f value)} -# set the itentity api version if not set (e.g. clouds.yaml) -export OS_IDENTITY_API_VERSION=${OS_IDENTITY_API_VERSION:-3} -# OS_AUTH_URL does not contains identity api version in stackrc from -# Pike onwards. -export OS_AUTH_URL="$OS_AUTH_URL/v$OS_IDENTITY_API_VERSION" -{% endif %} -# Generate Tempest Config file using python-tempestconf -# Notice aodh_plugin will be set to False if telemetry service is disabled -cd {{ tempest_dir }} -$TEMPESTCONF --out etc/tempest.conf \ - {% if tempest_overcloud|bool %} - --deployer-input {{ tempest_data }}/{{ tempest_deployer_input_file }} \ - --network-id $public_net_id \ - {% endif %} - {% if tempest_os_cloud != '' %} - --os-cloud {{ tempest_os_cloud }} \ - --network-id $public_net_id \ - {% endif %} - --image {{ tempest_test_image_path }} \ - --debug \ - {% if tempest_conf_removal and tempest_overcloud|bool %} - {% for key, value in tempest_conf_removal.items() %} - --remove {{ key }}={{ value }} \ - {% endfor %} - {% endif %} - --create \ - {% if tempest_format == 'container' %} - DEFAULT.log_dir {{ tempest_log_dir }} \ - DEFAULT.log_file {{ tempest_log_file }} \ - {% endif %} - identity.region $region_name \ - auth.use_dynamic_credentials true \ - network-feature-enabled.port_security true \ - network.tenant_network_cidr {{ tenant_network_cidr }} \ - compute.build_timeout 500 \ - network.build_timeout 500 \ - volume.build_timeout 500 \ - service_available.aodh_plugin False \ - {% if tempest_extra_config %} - {% for key, value in tempest_extra_config.items() %} - {{ key }} {{ value }} \ - {% endfor %} - {% endif %} - orchestration.stack_owner_role Member \ - compute_feature_enabled.config_drive True - -{% if ironic_overcloud|default(false)|bool %} -# tempest is using the m1.nano flavor, set it up for using a resource class if testing ironic -openstack flavor set m1.nano --property resources:VCPU=0 \ - --property resources:MEMORY_MB=0 \ - --property resources:CUSTOM_BAREMETAL=1 \ - --property resources:DISK_GB=0 -{% endif %} - -### --stop_docs diff --git a/roles/validate-tempest/templates/run-tempest.sh.j2 b/roles/validate-tempest/templates/run-tempest.sh.j2 deleted file mode 100644 index 1142716ea..000000000 --- a/roles/validate-tempest/templates/run-tempest.sh.j2 +++ /dev/null @@ -1,105 +0,0 @@ -## Run tempest -## ----------- - -## :: - -{% if tempest_format == "venv" %} -export TEMPESTCLI='{{ working_dir }}/tempest_git/tools/with_venv.sh tempest' -export OSTESTR='{{ working_dir }}/tempest_git/tools/with_venv.sh ostestr' -{% else %} -export OSTESTR='ostestr' -export TEMPESTCLI='/usr/bin/tempest' -{% endif %} -export TEMPESTDATA={{ tempest_data }} - -## List tempest plugins - -## :: - -$TEMPESTCLI list-plugins - -## Save the resources before running tempest tests -## It will create saved_state.json in tempest workspace. -## :: - -{% if tempest_track_resources|bool %} -$TEMPESTCLI cleanup --init-saved-state -{% endif %} - -$TEMPESTCLI run {% if test_white_regex != '' %} --regex '({{ test_white_regex }})' {% endif %} -{% if tempest_whitelist|length > 0 %} --whitelist_file=$TEMPESTDATA/{{ tempest_whitelist_file }} {% endif %} -{% if test_black_regex|length > 0 %} --black-regex='{{ test_black_regex|join('|') }}'{% endif %} -{% if skip_file_src != '' %} --blacklist_file=$TEMPESTDATA/{{ skip_file }} {% endif %} -{% if tempest_workers is defined %} --concurrency {{ tempest_workers }} {% endif %} -{% if tempest_until_failure|bool %} --until-failure {% endif %} - -## Check which all tenants would be modified in the tempest run -## It will create dry_run.json in tempest workspace. -## :: - -{% if tempest_track_resources|bool %} -$TEMPESTCLI cleanup --dry-run -{% endif %} - -{% if tempest_format == "container" %} -EOF -chmod +x {{ working_dir }}/tempest_container.sh -# Copy all the required files in a temprory directory -export TEMPEST_HOST_DATA='/var/lib/tempestdata' - -if [ ! -d $TEMPEST_HOST_DATA ] -then - sudo mkdir -p $TEMPEST_HOST_DATA -fi - -sudo cp \ - {% if tempest_os_cloud == '' %} - {{ rc_file }} \ - {% endif %} - {% if skip_file_src != '' %} - {{ working_dir }}/{{ skip_file }} \ - {% endif %} - {% if tempest_whitelist|length > 0 %} - {{ working_dir }}/{{ tempest_whitelist_file }} \ - {% endif %} - {% if tempest_overcloud|bool %} - {{ working_dir }}/{{ tempest_deployer_input_file }} \ - {% endif %} - {{ working_dir }}/tempest_container.sh \ - $TEMPEST_HOST_DATA - -{% if tempest_os_cloud != '' %} -sudo cp -Rf {{ working_dir }}/.config $TEMPEST_HOST_DATA -{% endif %} - -export CONTAINER_BINARY='podman' - -sudo $CONTAINER_BINARY pull {{ tempest_container_registry }}/{{ tempest_container_namespace }}:{{ tempest_container_tag }} - -{% if tempest_use_headless_chrome|bool %} -sudo $CONTAINER_BINARY pull selenium/standalone-chrome -sudo $CONTAINER_BINARY run -d \ - -p {{ tempest_headless_chrome_port }}:{{ tempest_headless_chrome_port }} \ - -v /dev/shm:/dev/shm selenium/standalone-chrome -{% endif %} -# Run tempest container using docker mouting required files -sudo $CONTAINER_BINARY run --net=host -i -v $TEMPEST_HOST_DATA:{{ tempest_data }} \ - -e PYTHONWARNINGS="${PYTHONWARNINGS:-}" \ - -e CURL_CA_BUNDLE="" \ - --user=root \ -{% if (enable_tls_everywhere is defined and enable_tls_everywhere|bool) %} - -e KRB5_CLIENT_KTNAME="${KRB5_CLIENT_KTNAME:-}" \ - -v /etc/novajoin/krb5.keytab:/etc/novajoin/krb5.keytab:ro \ - -v /home/{{ undercloud_user }}/krb5.keytab:/home/{{ undercloud_user }}/krb5.keytab:ro \ - -v /etc/ipa/default.conf:/etc/ipa/default.conf:ro \ - -v /etc/ipa/ca.crt:/etc/ipa/ca.crt:ro \ -{% endif %} - -v /var/log/containers/tempest:{{ tempest_log_dir }} \ - {% if not 'http' in tempest_test_image_path %} - -v {{ tempest_test_image_path }}:{{ tempest_test_image_path }} \ - {% endif %} - {{ tempest_container_registry }}/{{ tempest_container_namespace }}:{{ tempest_container_tag }} \ - /usr/bin/bash -c 'set -e; {{ tempest_data }}/tempest_container.sh' - -{% endif %} -### --stop_docs diff --git a/roles/validate-tempest/templates/skip_file.j2 b/roles/validate-tempest/templates/skip_file.j2 deleted file mode 100644 index 5531dbec0..000000000 --- a/roles/validate-tempest/templates/skip_file.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for skip_test in tempest_test_blacklist %} -{{ skip_test }} -{% endfor %} diff --git a/roles/validate-tempest/templates/tempest-setup.j2 b/roles/validate-tempest/templates/tempest-setup.j2 deleted file mode 100644 index 6152bdda0..000000000 --- a/roles/validate-tempest/templates/tempest-setup.j2 +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -set -eux - -### --start_docs -## Validate the overcloud deployment with tempest -## ============================================== - -{% include 'configure-tempest.sh.j2' %} - -{% include 'run-tempest.sh.j2' %} - -### --stop_docs diff --git a/roles/validate-tempest/templates/whitelist_file.j2 b/roles/validate-tempest/templates/whitelist_file.j2 deleted file mode 100644 index 82738884e..000000000 --- a/roles/validate-tempest/templates/whitelist_file.j2 +++ /dev/null @@ -1,3 +0,0 @@ -{% for test in tempest_whitelist %} -{{ test }} -{% endfor %} diff --git a/roles/validate-tempest/vars/tempest_skip_liberty.yml b/roles/validate-tempest/vars/tempest_skip_liberty.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_liberty.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_master.yml b/roles/validate-tempest/vars/tempest_skip_master.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_master.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_mitaka.yml b/roles/validate-tempest/vars/tempest_skip_mitaka.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_mitaka.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_newton.yml b/roles/validate-tempest/vars/tempest_skip_newton.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_newton.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_ocata.yml b/roles/validate-tempest/vars/tempest_skip_ocata.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_ocata.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_pike.yml b/roles/validate-tempest/vars/tempest_skip_pike.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_pike.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_queens.yml b/roles/validate-tempest/vars/tempest_skip_queens.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_queens.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_rocky.yml b/roles/validate-tempest/vars/tempest_skip_rocky.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_rocky.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_stein.yml b/roles/validate-tempest/vars/tempest_skip_stein.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_stein.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_train.yml b/roles/validate-tempest/vars/tempest_skip_train.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_train.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tempest/vars/tempest_skip_ussuri.yml b/roles/validate-tempest/vars/tempest_skip_ussuri.yml deleted file mode 100644 index 807821453..000000000 --- a/roles/validate-tempest/vars/tempest_skip_ussuri.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -## THIS FILE IS DEPRECATED, PLEASE USE: -## openstack/openstack-tempest-skiplist -known_failures: [] diff --git a/roles/validate-tobiko/README.md b/roles/validate-tobiko/README.md deleted file mode 100644 index c46d10677..000000000 --- a/roles/validate-tobiko/README.md +++ /dev/null @@ -1,88 +0,0 @@ -validate-tobiko -================ - -Ansible role for running [Tobiko](https://opendev.org/x/tobiko/) -tests on undercloud or overcloud. - -This role should be run on deployed undercloud or overcloud. It may also be run -e.g. after update or upgrade of cloud. -This role supports run on standalone deployment too. -Example of tests which are run by this role are: - -* tobiko.tests.scenario.neutron.test_floating_ip - to test connectivity to VM with - floating IP, -* tobiko.tests.scenario.nova.test_server.ServerStackResourcesTest.test_server - to - test server actions. - -Role Variables --------------- - -* `tobiko_config`: false/true - to prepare tobiko's config or not (default: yes) -* `tobiko_run`: false/true - to run tobiko tests or not (default: false) -* `tobiko_envlist`: - The name of tox envlist to be run (default: - scenario) -* `tobiko_extra_args`: - Extra arguments to be passed to tobiko tox - command (default: "") -* `tobiko_config_dir`: - directory where tobiko config files will be - stored (default: "{{ working_dir }}/.tobiko") -* `tobiko_config_file`: - name of tobiko config file (default: - "tobiko.conf") -* `tobiko_log_dir`: - directory where tobiko log files will be - stored (default: "{{ working_dir }}/.tobiko") -* `tobiko_log_file`: - name of tobiko log file (default: "tobiko.log") -* `tobiko_key_file_name`: - path to ssh key used by tobiko in tests - (default: "~/.ssh/id_rsa") -* `tobiko_floating_ip_network`: - name of floating IP network used by - tobiko in tests (default: "public") -* `public_network_type`: - type of public neutron network used for floating - IPs during tobiko testing (default: flat) -* `public_network_pool_start`: - neutron public network allocation pool start - (default: {{ floating_ip_cidr|nthhost(100) }}) -* `public_network_pool_end`: - neutron public network allocation pool end - (default: {{ floating_ip_cidr|nthhost(120) }}) -* `public_network_gateway`: - gateway IP for neutron public network, when - not set, neutron will choose it automatically - (default: {{ floating_ip_cidr|nthhost(1) }}) -* `public_physical_network`: - name of physical network used in neutron for public - network (default: datacentre) -* `public_segmentation_id`: - segmentation_id for neutron public network - (default: '') -* `floating_ip_cidr`: - the network CIDR to be used for a public floating IP - network during testing (default: {{ undercloud_network_cidr }}) - - -Using validate-tobiko role with tripleo-quickstart ---------------------------------------------------- - -To run tobiko with tripleo-quickstart, run the following command: - - $WORKSPACE/tripleo-quickstart - - bash quickstart.sh \ - --tags all \ - --no-clone \ - --release master \ - --extra-vars run_tobiko=True \ - $VIRTHOST - -Note: by using --extra-vars, we can change the validate-tobiko role variables. - -Example Playbook ----------------- - - --- - - name: Run tobiko - hosts: undercloud - gather_facts: false - roles: - - validate-tobiko - -License -------- - -Apache 2.0 - -Author Information ------------------- - -RDO-CI Team diff --git a/roles/validate-tobiko/defaults/main.yml b/roles/validate-tobiko/defaults/main.yml deleted file mode 100644 index f9a66909b..000000000 --- a/roles/validate-tobiko/defaults/main.yml +++ /dev/null @@ -1,23 +0,0 @@ ---- -tobiko_config: true -tobiko_run: true - -tobiko_envlist: "scenario" -tobiko_extra_args: "" -tobiko_config_dir: "{{ working_dir }}/.tobiko" -tobiko_config_file: "tobiko.conf" - -tobiko_log_dir: "{{ working_dir }}/.tobiko" -tobiko_log_file_base: "tobiko" -tobiko_key_file_name: "~/.ssh/id_rsa" - -tobiko_floating_ip_network: "public" -public_network_type: "flat" -public_physical_network: datacentre -public_segmentation_id: '' -floating_ip_cidr: "{{ undercloud_network_cidr }}" -public_network_pool_start: "{{ floating_ip_cidr|nthhost(100) }}" -public_network_pool_end: "{{ floating_ip_cidr|nthhost(120) }}" -public_network_gateway: "{{ floating_ip_cidr|nthhost(1) }}" - -python_package_prefix: "python" diff --git a/roles/validate-tobiko/meta/main.yml b/roles/validate-tobiko/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-tobiko/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-tobiko/tasks/main.yml b/roles/validate-tobiko/tasks/main.yml deleted file mode 100644 index 6a0066009..000000000 --- a/roles/validate-tobiko/tasks/main.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,python,processor" - when: > - ansible_python is not defined or - ansible_processor_vcpus is not defined - -- name: set python_cmd - set_fact: - python_cmd: "python{{ ansible_python.version.major }}" - cacheable: true - when: python_cmd is not defined - -- name: change python_package_prefix for python > 2 - set_fact: - python_package_prefix: "python{{ ansible_python.version.major }}" - cacheable: true - when: ansible_python.version.major > 2 - -- include: prepare-tobiko.yml - when: tobiko_config|bool - tags: - - prepare-tobiko - -- include: run-tobiko.yml - when: tobiko_run|bool - tags: - - tobiko-run - -- include: tobiko-results.yml - when: tobiko_run|bool - tags: - - tobiko-results diff --git a/roles/validate-tobiko/tasks/prepare-tobiko.yml b/roles/validate-tobiko/tasks/prepare-tobiko.yml deleted file mode 100644 index b17531e6d..000000000 --- a/roles/validate-tobiko/tasks/prepare-tobiko.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -- name: Install packages to generate subunit results - become: true - package: - name: - - "{{ python_package_prefix }}-os-testr" - - "{{ python_package_prefix }}-subunit" - - subunit-filters - state: present - -- name: Install packages required for create venv - become: true - package: - state: present - name: - - gcc - - libffi-devel - - openssl-devel - -- name: Install virtualenv - become: true - package: - state: present - name: "{{ python_package_prefix }}-virtualenv" - -- name: Install pip - become: true - package: - state: present - name: "{{ python_package_prefix }}-pip" - -- name: Copy tobiko to undercloud node - synchronize: - src: "{{ ansible_user_dir }}/src/opendev.org/x/tobiko" - dest: "{{ working_dir }}" - use_ssh_args: true - recursive: true - -- name: Get number of existing tobiko log files - shell: | - set -eo pipefail - number_of_files=$(ls {{ tobiko_log_dir }} | grep -E "{{ tobiko_log_file_base }}-[0-9]+.log$" -c) - echo $(( $number_of_files + 1 )); - register: current_tobiko_log_file_number - changed_when: true - -- name: Set tobiko_file_name - set_fact: - tobiko_log_file: "{{ tobiko_log_file_base }}-{{ current_tobiko_log_file_number.stdout }}.log" - -- name: Ensure tobiko config dir exists - file: - path: "{{ tobiko_config_dir }}" - state: directory - mode: '0755' - -- name: Create tobiko config file - template: - src: "tobiko.conf.j2" - dest: "{{ tobiko_config_dir }}/{{ tobiko_config_file }}" - mode: 0755 - -- name: Create tobiko network config script - template: - src: "configure_public_network.sh.j2" - dest: "{{ tobiko_config_dir }}/configure_public_network.sh" - mode: 0755 - -- name: Ensure floating IP network exists - shell: > - bash {{ tobiko_config_dir }}/configure_public_network.sh - changed_when: true diff --git a/roles/validate-tobiko/tasks/run-tobiko.yml b/roles/validate-tobiko/tasks/run-tobiko.yml deleted file mode 100644 index cde2a16b8..000000000 --- a/roles/validate-tobiko/tasks/run-tobiko.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Execute Tobiko - shell: > - set -o pipefail && - tools/ci/tox -e {{ tobiko_envlist }} {{ tobiko_extra_args }} 2>&1 {{ timestamper_cmd }} > {{ tobiko_log_dir }}/{{ tobiko_log_file }}; - args: - chdir: "{{ working_dir }}/tobiko" - executable: /bin/bash - register: tobiko_tests_run - ignore_errors: true - environment: - OS_CLOUD: "{{ tempest_cloud_name }}" - changed_when: true diff --git a/roles/validate-tobiko/tasks/tobiko-results.yml b/roles/validate-tobiko/tasks/tobiko-results.yml deleted file mode 100644 index ba06ec8c4..000000000 --- a/roles/validate-tobiko/tasks/tobiko-results.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- name: Check for .stestr directory - stat: - path: "{{ working_dir }}/tobiko/.stestr" - register: testr_dir - -- name: Define testr facts - set_fact: - testr_command: "{{ python_cmd }} -m stestr.cli" - -- name: Generate testrepository.subunit results file - shell: > - set -o pipefail && - {{ testr_command }} last --subunit > {{ tobiko_log_dir }}/testrepository.subunit - args: - chdir: "{{ working_dir }}/tobiko" - changed_when: true - -- name: Generate HTML results file - shell: | - set -o pipefail && - subunit2html {{ tobiko_log_dir }}/testrepository.subunit {{ tobiko_log_dir }}/{{ tobiko_log_file }}.html - changed_when: true - -- name: Fetch HTML results - fetch: - src: "{{ tobiko_log_dir }}/{{ tobiko_log_file }}.html" - dest: "{{ local_working_dir }}/{{ tobiko_log_file }}.html" - flat: true - -- name: Fail if tobiko tests did not succeed - assert: - that: - - "tobiko_tests_run.rc == 0" diff --git a/roles/validate-tobiko/templates/configure_public_network.sh.j2 b/roles/validate-tobiko/templates/configure_public_network.sh.j2 deleted file mode 100644 index d0cd44a37..000000000 --- a/roles/validate-tobiko/templates/configure_public_network.sh.j2 +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -export OS_CLOUD={{ tempest_cloud_name }} - -openstack network list -c Name -f value | grep -q -e "^{{ tobiko_floating_ip_network }}$" -if [ $? -eq 0 ]; then - exit 0 -fi - -openstack network create {{ tobiko_floating_ip_network }} --external \ -{% if public_physical_network != '' %} - --provider-network-type {{ public_network_type }} \ - {% if public_segmentation_id != '' %} - --provider-segment {{ public_segmentation_id }} \ - {% endif %} - --provider-physical-network {{ public_physical_network }} -{% endif %} - -openstack subnet create ext-subnet \ - --allocation-pool \ - start={{ public_network_pool_start }},end={{ public_network_pool_end }} \ - --no-dhcp \ - --gateway {{ public_network_gateway }} \ - --network {{ tobiko_floating_ip_network }} \ - --subnet-range {{ floating_ip_cidr }} diff --git a/roles/validate-tobiko/templates/tobiko.conf.j2 b/roles/validate-tobiko/templates/tobiko.conf.j2 deleted file mode 100644 index a3ecf64da..000000000 --- a/roles/validate-tobiko/templates/tobiko.conf.j2 +++ /dev/null @@ -1,18 +0,0 @@ -[DEFAULT] -debug = True -log_file = "{{ tobiko_log_file }}" -log_dir = "{{ working_dir }}" - -{% if tobiko_no_proxy_servers is defined %} -[http] -no_proxy = "{{ tobiko_no_proxy_servers }}" -{% endif %} - -[nova] -key_file = "{{ tobiko_key_file_name }}" - -[neutron] -floating_network = "{{ tobiko_floating_ip_network }}" - -[glance] -images_dir = "{{ working_dir }}"/.tobiko/cache/glance/images" diff --git a/roles/validate-ui/.travis.yml b/roles/validate-ui/.travis.yml deleted file mode 100644 index 121cc4993..000000000 --- a/roles/validate-ui/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -language: python -python: "2.7" - -# Use the new container infrastructure -sudo: false - -# Install ansible -addons: - apt: - packages: - - python-pip - -install: - # Install ansible - - pip install ansible - - # Check ansible version - - ansible --version - - # Create ansible.cfg with correct roles_path - - printf '[defaults]\nroles_path=../' >ansible.cfg - -script: - # Basic role syntax check - - ansible-playbook tests/test.yml -i tests/inventory --syntax-check - -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ diff --git a/roles/validate-ui/README.md b/roles/validate-ui/README.md deleted file mode 100644 index 3ebede35b..000000000 --- a/roles/validate-ui/README.md +++ /dev/null @@ -1,38 +0,0 @@ -Role Name -========= - -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. - -Role Variables --------------- - -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -Apache - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/validate-ui/defaults/main.yml b/roles/validate-ui/defaults/main.yml deleted file mode 100644 index e4aea6730..000000000 --- a/roles/validate-ui/defaults/main.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -validate_ui_simple: false -ui_validate_simple_script: validate_ui_simple.sh.j2 -ui_validate_simple_log: validate_ui_simple.log -virthost_addr: "{{ hostvars[groups['virthost'][0]].ansible_host }}" diff --git a/roles/validate-ui/handlers/main.yml b/roles/validate-ui/handlers/main.yml deleted file mode 100644 index 8038d7f2d..000000000 --- a/roles/validate-ui/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# handlers file for validate-ui diff --git a/roles/validate-ui/meta/main.yml b/roles/validate-ui/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/validate-ui/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-ui/tasks/main.yml b/roles/validate-ui/tasks/main.yml deleted file mode 100644 index fb15bd372..000000000 --- a/roles/validate-ui/tasks/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- -- name: Create the tripleo-ui simple validate script - template: - src: "{{ ui_validate_simple_script }}" - dest: "{{ local_working_dir }}/ui_validate_simple.sh" - mode: 0744 - -- name: Execute the simple tripleo-ui validation - shell: > - set -o pipefail && - {{ local_working_dir }}/ui_validate_simple.sh - | tee {{ ui_validate_simple_log }} - changed_when: true diff --git a/roles/validate-ui/templates/validate_ui_simple.sh.j2 b/roles/validate-ui/templates/validate_ui_simple.sh.j2 deleted file mode 100644 index 918a3822d..000000000 --- a/roles/validate-ui/templates/validate_ui_simple.sh.j2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -# -# simple script to check if the TripleO-UI is available via the ssh-tunnel -# on libvirt - -curl --insecure "https://{{ virthost_addr }}/login" | grep tripleo_ui.js diff --git a/roles/validate-ui/vars/main.yml b/roles/validate-ui/vars/main.yml deleted file mode 100644 index 8a55c197e..000000000 --- a/roles/validate-ui/vars/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# vars file for validate-ui diff --git a/roles/validate-undercloud/defaults/main.yml b/roles/validate-undercloud/defaults/main.yml deleted file mode 100644 index 9c683e56f..000000000 --- a/roles/validate-undercloud/defaults/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - -undercloud_sanity_check_script: undercloud-sanity-check.sh.j2 -undercloud_sanity_check_log: "{{ working_dir }}/undercloud_sanity_check.log" -undercloud_check_idempotency: false -undercloud_check_sanity: false -undercloud_reinstall_log: "{{ working_dir }}/undercloud_reinstall.log" diff --git a/roles/validate-undercloud/meta/main.yml b/roles/validate-undercloud/meta/main.yml deleted file mode 100644 index 937d01d10..000000000 --- a/roles/validate-undercloud/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/validate-undercloud/tasks/main.yml b/roles/validate-undercloud/tasks/main.yml deleted file mode 100644 index 9502186f0..000000000 --- a/roles/validate-undercloud/tasks/main.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -- name: gather facts used by role - setup: - gather_subset: "!min,pkg_mgr" - when: ansible_pkg_mgr is not defined - -- name: Reinstall the undercloud to check idempotency - shell: > - set -o pipefail && - {{ working_dir }}/undercloud-install.sh 2>&1 {{ timestamper_cmd }} > - {{ undercloud_reinstall_log }} - when: undercloud_check_idempotency|bool - tags: - - undercloud-validate - -- name: Create undercloud sanity check script - template: - src: "{{ undercloud_sanity_check_script }}" - dest: "{{ working_dir }}/undercloud-sanity-check.sh" - mode: 0755 - tags: - - undercloud-scripts - -- name: check undercloud sanity - shell: > - set -o pipefail && - {{ working_dir }}/undercloud-sanity-check.sh 2>&1 {{ timestamper_cmd }} > - {{ undercloud_sanity_check_log }} - when: undercloud_check_sanity|bool - tags: - - undercloud-validate diff --git a/roles/validate-undercloud/templates/undercloud-sanity-check.sh.j2 b/roles/validate-undercloud/templates/undercloud-sanity-check.sh.j2 deleted file mode 100644 index b21818e33..000000000 --- a/roles/validate-undercloud/templates/undercloud-sanity-check.sh.j2 +++ /dev/null @@ -1,70 +0,0 @@ -### --start_docs - -## Validate the undercloud installation -## ==================================== -script_return_value=0 - -## * Install deps for subunit results -sudo {{ ansible_pkg_mgr }} install -y python-os-testr - -## * Set the uri of TripleO UI based on SSL usage -## :: -{% set ui_uri = "https://%s" % undercloud_network_cidr|nthhost(2) if undercloud_generate_service_certificate|bool else "http://%s:3000" % undercloud_network_cidr|nthhost(1) %} - -## * Specify the function to test UI -## :: -function ui_sanity_check { - if [ -f "/etc/httpd/conf.d/25-tripleo-ui.conf" ]; then - if ! curl {{ ui_uri }} 2>/dev/null | grep -q 'TripleO'; then - echo "ERROR: TripleO UI front page is not loading." - generate-subunit $(date +%s) 10 fail tripleo_ui_test >> {{ working_dir }}/undercloud_sanity.subunit - script_return_value=1 - fi - generate-subunit $(date +%s) 10 success tripleo_ui_test >> {{ working_dir }}/undercloud_sanity.subunit - fi -} - -# * Specify the function to test CLI -## :: -function citest { - test_name=`sed 's/ /_/g' <<< "$@"` - "$@" - local status=$? - if [ $status -ne 0 ]; then - echo "error with ${test_name}" >&2 - generate-subunit $(date +%s) 10 fail $test_name >> {{ working_dir }}/undercloud_sanity.subunit - script_return_value=1 - else - generate-subunit $(date +%s) 10 success $test_name >> {{ working_dir }}/undercloud_sanity.subunit - fi - return $status -} - - - -## * Check the answers from each undercloud service -## :: - -set -x -rm -f {{ working_dir }}/undercloud_sanity.subunit.gz -rm -f {{ working_dir }}/undercloud_sanity.subunit - -source {{ working_dir}}/stackrc -{% if undercloud_enable_nova|bool %} -citest openstack compute service list -citest openstack image list -{% endif %} -citest openstack subnet list -citest openstack network list -citest openstack network agent list -citest openstack baremetal node list -{% if undercloud_enable_heat|bool %} -citest openstack stack list -{% endif %} -ui_sanity_check - -exit $script_return_value - -set +x - -### --stop_docs diff --git a/roles/virthost-full-cleanup/README.md b/roles/virthost-full-cleanup/README.md deleted file mode 100644 index baba129ed..000000000 --- a/roles/virthost-full-cleanup/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Role Name -========= - -This role, virthost-full-cleanup, will remove any known tripleo related rpms -from the system and remove libvirt. This role is destructive and will remove ALL libvirt guests. This is done to ensure a clean starting point for deployments. - -Requirements ------------- - - - -Role Variables --------------- - - - -Dependencies ------------- - -Example: ----------------- -./deploy.sh -c -p cleanup-destructive - - -License -------- - -Apache 2.0 - -Author Information ------------------- diff --git a/roles/virthost-full-cleanup/defaults/main.yml b/roles/virthost-full-cleanup/defaults/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/roles/virthost-full-cleanup/defaults/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/virthost-full-cleanup/meta/main.yml b/roles/virthost-full-cleanup/meta/main.yml deleted file mode 100644 index 98bfef3b5..000000000 --- a/roles/virthost-full-cleanup/meta/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -dependencies: - - extras-common diff --git a/roles/virthost-full-cleanup/tasks/main.yml b/roles/virthost-full-cleanup/tasks/main.yml deleted file mode 100644 index d6aae6cdc..000000000 --- a/roles/virthost-full-cleanup/tasks/main.yml +++ /dev/null @@ -1,197 +0,0 @@ -# tasks file for ansible-role-tripleo-cleanup-nfo ---- -- name: remove sudoers requiretty - lineinfile: dest=/etc/sudoers state=absent regexp="Defaults requiretty" - -- block: - - - name: unregister rhn via subscription manager - redhat_subscription: state=absent - - - debug: msg="All errors in this block are ignored" - - - name: ensure libvirt-python is installed - yum: name=libvirt-python state=present - - - name: get list of running libvirt guests - virt: command=list_vms - register: vms - - - name: display list of vms - debug: var=vms.list_vms - - - name: undefine vms - virt: command=undefine name={{ item }} - with_items: "{{ vms.list_vms }}" - - - name: destroy any remaining vms - virt: command=destroy name={{ item }} - with_items: "{{ vms.list_vms }}" - - - name: remove images from /var/lib/libvirt/images - shell: rm -rf /var/lib/libvirt/images/*.qcow2 - - - name: remove tripleo-quickstart image cache (/var/cache/tripleo-quickstart/images) - shell: find /var/cache/tripleo-quickstart/images/* -mtime +3 -exec rm -rf {} \; - - - name: remove tripleo-quickstart /var/oooqvms - command: rm -rf /var/oooqvms/ - changed_when: true - - - name: remove ansible-role-tripleo-image-build artifacts - shell: > - rm -rf /var/log/artib; - rm -rf /home/oooq-images; - rm -rf /var/lib/oooq-images; - rm -rf /root/.cache/image-create; - - - name: destroy brbm network - command: virsh net-destroy brbm - - - name: destroy default network - command: virsh net-destroy default - - - name: destroy default pool - become: true - command: virsh pool-destroy default - - - name: destroy local libvirt storage, networks and config - become: true - command: "rm -rf {{ working_dir }}/.config/libvirt" - - - name: get user_id for stack user - shell: > - set -euo pipefail; - cat /etc/passwd | grep stack | awk -F ':' '{ print $3 }' - register: user_id - - - name: destroy /run/user/ for stack - shell: > - rm -Rf /run/user/{{ item }}/libvirt - with_items: "{{ user_id.stdout }}" - - - name: destroy virbr0 network if present - command: brctl delbr virbr0 - - - name: stop libvirtd - service: name=libvirtd state=stopped - - - name: remove remaining libvirt config - command: rm -Rf /etc/libvirt - - - name: remove epel-release - yum: name=epel-release state=absent - - - name: ensure yum repos metadata and cache are clean - shell: > - yum-complete-transaction; - yum clean all; - rm -Rfv /var/cache/yum; - - - name: remove files from /tmp - shell: > - rm -Rfv /tmp/*; - - - name: remove any openvswitch bridge networks - openvswitch_bridge: bridge=brbm state=absent - - - name: stop openvswitch - service: name=openvswitch state=stopped - - - name: kill all processes owned by stack - command: killall -u {{ non_root_user }} - - - name: destroy the stack user - user: name={{ non_root_user }} remove=yes force=yes state=absent - - - name: remove stack home dir - command: rm -Rf {{ item }} - with_items: - - /home/{{ non_root_user }} - - /var/spool/mail/{{ non_root_user }} - changed_when: true - - - name: remove files automation files from /root - file: name={{ item }} state=absent - with_items: - - /root/KEYS - - /root/fedora-prep - - /root/.ssh/known_hosts - - /root/.ssh/id_rsa_virt_power - - - name: kill all the network managers processes - shell: kill -9 $(ps aux | grep NetworkManager | awk '{print $2}') - ignore_errors: true # When no NM running, killall exits with 1 - - - name: ensure the network service is enabled - service: name=network enabled=yes - - - name: remove files automation files from /root - file: name={{ item }} state=absent - with_items: - - /usr/share/instack-undercloud - - /usr/bin/instack-setup-host - - - name: remove any instack rpms from the host - yum: - name: - - instack-* - - rdo-release - - rhos-release - - libvirt - - libvirt-daemon - - openvswitch - - NetworkManager - - qemu-* - - openstack-* - - python-qpid-* - - pexpect - - python-pexpect - - python-tuskarclient* - - python-keystone* - - python-openstackclient - - python-oslo* - - python-qpid - - python-ironic* - - python-eventlet - - tripleo-* - - python-rdomanager-* - - jq - - python-tripleo* - state: absent - ignore_errors: true - - - name: find any remaining rpms from director repos - shell: "yumdb search from_repo rhelosp-*-director* | egrep -v from_repo | grep -v '^$' | tail -n +2 " - register: director_rpms - - - name: find any remaining rpms from rhos repos - shell: "yumdb search from_repo rhelosp-*-p* | egrep -v from_repo | grep -v '^$' | tail -n +2 " - register: rhos_rpms - - - name: find any remaining rpms from delorean repos - shell: "yumdb search from_repo delorean* | egrep -v from_repo | grep -v '^$' | tail -n +2 " - register: delorean_rpms - - # BUG: when this task encounters an rpm of the form "1:somerpm" it fails - # - name: debug - # debug: var={{ item }} - # with_flattened: - # - director_rpms.stdout_lines - # - rhos_rpms.stdout_lines - # - delorean_rpms.stdout_lines - - - name: remove any openstack rpms from the host - yum: name={{ item }} state=absent - ignore_errors: true - with_flattened: - - "{{ director_rpms.stdout_lines }}" - - "{{ rhos_rpms.stdout_lines }}" - - "{{ delorean_rpms.stdout_lines }}" - - # this task *MUST* be the last task that is run - - name: remove all the yum repos - shell: rm -Rf /etc/yum.repos.d/* - - # end of block - ignore_errors: true diff --git a/roles/virthost-full-cleanup/tests/inventory b/roles/virthost-full-cleanup/tests/inventory deleted file mode 100644 index 2fbb50c4a..000000000 --- a/roles/virthost-full-cleanup/tests/inventory +++ /dev/null @@ -1 +0,0 @@ -localhost diff --git a/roles/virthost-full-cleanup/tests/test.yml b/roles/virthost-full-cleanup/tests/test.yml deleted file mode 100644 index ef8e51328..000000000 --- a/roles/virthost-full-cleanup/tests/test.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -- hosts: localhost - remote_user: root - roles: - - ansible-role-tripleo-cleanup-nfo diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bf3ea060a..000000000 --- a/setup.cfg +++ /dev/null @@ -1,43 +0,0 @@ -[metadata] -name = tripleo-quickstart-extras -summary = "Extend tripleo-quickstart's abilities to deploy and test TripleO" -description_file = - README.rst -author = OpenStack -author_email = openstack-discuss@lists.openstack.org -home_page = http://docs.openstack.org/developer/tripleo-quickstart/ -classifier = - License :: OSI Approved :: Apache Software License - Development Status :: 4 - Beta - Intended Audience :: Developers - Intended Audience :: System Administrators - Intended Audience :: Information Technology - Topic :: Utilities - -[files] -data_files = - config/environments = config/environments/* - config/general_config = config/general_config/* - playbooks = playbooks/* - vars = vars/* - usr/local/share/ansible/roles = roles/* - -[pbr] -skip_authors = True -skip_changelog = True - -[flake8] -# E123, E125 skipped as they are invalid PEP-8. -# E402 module level import not at top of file -# E501 line too long -# F403 'from ansible.module_utils.basic import *' used; unable to detect undefined names -# H303 No wildcard (*) import -# H301 one import per line -# F405 ... may be undefined, or defined from star imports: -show-source = True -ignore = E123,E125,E501,F403,H303,F405 -builtins = _ - -[tool:pytest] -# these break pytest collection due to missing imports -norecursedirs = .tox .eggs roles/validate-tempest/files diff --git a/setup.py b/setup.py deleted file mode 100644 index 58ffb5224..000000000 --- a/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright Red Hat, Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import setuptools - -setuptools.setup( - setup_requires=['pbr'], - py_modules=[], - pbr=True) diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index c74568679..000000000 --- a/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -ansible-core>=2.11,<2.12 -jinja2 diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 630255e52..000000000 --- a/tox.ini +++ /dev/null @@ -1,63 +0,0 @@ -[tox] -minversion = 3.9.0 -envlist = linters - -[testenv] -basepython = python3 -usedevelop = True -install_command = python3 -m pip install {opts} {packages} -setenv = - ANSIBLE_FORCE_COLOR=1 -passenv = - ANSIBLE_* - CURL_CA_BUNDLE - DOCKER_* - MOLECULE_* - REQUESTS_CA_BUNDLE - SSH_AUTH_SOCK - SSL_CERT_FILE - TERM -deps = - -r {toxinidir}/test-requirements.txt -allowlist_externals = bash - -[testenv:bindep] -basepython = python3 -# Do not install any requirements. We want this to be fast and work even if -# system dependencies are missing, since it's used to tell you what system -# dependencies are missing! This also means that bindep must be installed -# separately, outside of the requirements files. -deps = bindep -commands = bindep test - -[testenv:releasenotes] -deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - -r{toxinidir}/doc/requirements.txt -basepython = python3 -allowlist_externals = bash -commands = bash -c ci-scripts/releasenotes_tox.sh - -[testenv:linters] -basepython = python3 -deps = - -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} - {[testenv]deps} - jinja2 - pre-commit -commands = - ansible-galaxy collection install -f openstack.cloud - python -m pre_commit run -a - # TODO(ssbarnea) make is a real pre-commit hook so we can reuse it - python ci-scripts/validate_jinja2.py - -[testenv:venv] -basepython = python3 -commands = {posargs} - -[testenv:molecule] -deps = - {[testenv]deps} - -r {toxinidir}/molecule-requirements.txt -commands = - python -m pytest --color=yes --html={envlogdir}/reports.html --self-contained-html -rA --molecule-unavailable-driver=fail {tty:-s} {posargs:-k 'molecule and docker'} diff --git a/vars b/vars deleted file mode 120000 index ac373f2a0..000000000 --- a/vars +++ /dev/null @@ -1 +0,0 @@ -roles/validate-tempest/vars \ No newline at end of file diff --git a/zuul.d/layout.yaml b/zuul.d/layout.yaml deleted file mode 100644 index 36dea6364..000000000 --- a/zuul.d/layout.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- project: - queue: tripleo - templates: - - tripleo-multinode-branchful - check: - jobs: - - openstack-tox-linters - - tripleo-ci-centos-9-content-provider-wallaby: - dependencies: - - openstack-tox-linters - gate: - jobs: - - openstack-tox-linters