Add tripleo overcloud deploy role

Adds tripleo_overcloud_deploy role to run the overcloud deployment.

Change-Id: I40e6f1c2ed71ab57d6597c086554186e233d7b94
This commit is contained in:
Alex Schultz 2020-01-30 16:29:16 -07:00 committed by Sagi Shnaidman
parent 49a562aa8d
commit 9d67fc26ed
11 changed files with 834 additions and 0 deletions

View File

@ -22,6 +22,9 @@ class FilterModule(object):
}
def shell_arg_list(self, arg, parameter=None):
# Nothing was passed into this, just return an empty string
if not arg:
return ''
if not isinstance(arg, (list, tuple)):
arg = [arg]
return_value = []

View File

@ -0,0 +1,97 @@
tripleo_overcloud_deploy
========================
A role to execute an overcloud deployment.
Requirements
------------
None.
Role Variables
--------------
* `tripleo_overcloud_deploy_answers_file`: (String) File path to a deployment answers file.
* `tripleo_overcloud_deploy_baremetal_deployment`: (String) File path to a baremetal deployment configuration.
* `tripleo_overcloud_deploy_config_download`: (Boolean) Flag to add --config-download option. This is the default as of Rocky and enabling this should have no effect. Default: false
* `tripleo_overcloud_deploy_config_download_timeout`: (Integer) Timeout in minutes for the config-download steps.
* `tripleo_overcloud_deploy_debug`: (Boolean) Flag to print out the command that is run. Default: false
* `tripleo_overcloud_deploy_deployed_server`: (Boolean) Flag to use pre-provisioned nodes. Default: false
* `tripleo_overcloud_deploy_deployment_python_interpreter`: (String) Path to a python interpreter for the deployment actions.
* `tripleo_overcloud_deploy_disable_password_generation`: (Boolean) Flag to disable password generation. Default: false
* `tripleo_overcloud_deploy_disable_validations`: (Boolean) Flag to disable validations. Default: false
* `tripleo_overcloud_deploy_dry_run`: (Boolean) Flag to enabel dry run. Default: false
* `tripleo_overcloud_deploy_environment_dirs`: (List) A list of directory paths containing environment files for the deployment. Should not be used with environment files.
* `tripleo_overcloud_deploy_environment_files`: (List) A list of environment file paths for the deployment. Should not be used with environment dirs.
* `tripleo_overcloud_deploy_force_postconfig`: (Boolean) Force the overclodu post-deployment configuration. Default: false
* `tripleo_overcloud_deploy_home_dir`: (String) Home directory to where the command is run from. Default: "{{ ansible_env.HOME }}"
* `tripleo_overcloud_deploy_inflight_validations`: (Boolean) Flag to enable inflight validations. Default: false
* `tripleo_overcloud_deploy_libvirt_type`: (String) Libvirt domain time. Setting `NovaComputeLibvirtType` in an environment file is prefered over this option.
* `tripleo_overcloud_deploy_log`: (String) Path to a log file for the command output. Default: "{{ tripleo_overcloud_deploy_home_dir }}/overcloud_deploy.log"
* `tripleo_overcloud_deploy_log_combine`: (Boolean) Flag to enable captching stderr with stdout. Default: true
* `tripleo_overcloud_deploy_log_output`: (Boolean) Flag to enable logging to a file. Since the output of this command can be large, it is not recommended to disable this. Default: true
* `tripleo_overcloud_deploy_networks_file`: (String) File path to a networks file for the deployment.
* `tripleo_overcloud_deploy_no_cleanup`: (Boolean) String to enable no cleanup. Default: false
* `tripleo_overcloud_deploy_no_config_download`: (Boolean) String to disable the config download software configuration. Default: false
* `tripleo_overcloud_deploy_no_proxy`: (String) String containing a comma seperated list of hosts to skip proxing when http_proxy and https_proxy are used.
* `tripleo_overcloud_deploy_ntp_server`: (String) String containing a comma seperated list of ntp servers. Setting `NtpServer` in an environment file is prefered over this option.
* `tripleo_overcloud_deploy_os_cloud`: (String) (String) OS_CLOUD value to use when running the command. If `tripleo_os_cloud` is defined, it will be the default. Otherwise the default is ''. This variable takes precedence over `tripleo_overcloud_deploy_rc_file`.
* `tripleo_overcloud_deploy_output_dir`: (String) Path to a directory to output for the configuration download output.
* `tripleo_overcloud_deploy_overcloud_ssh_enable_timeout`: (Integer) Timeout for the ssh enable process to finish.
* `tripleo_overcloud_deploy_overcloud_ssh_key`: (String) Path to an ssh key file to use to access the overcloud nodes.
* `tripleo_overcloud_deploy_overcloud_ssh_network`: (String) Network name to use for the ssh access to the overcloud nodes.
* `tripleo_overcloud_deploy_overcloud_ssh_port_timeout`: (Integer) Timeout to wait for the ssh port to become active.
* `tripleo_overcloud_deploy_overcloud_ssh_user`: (String) User for ssh access to the overcloud nodes.
* `tripleo_overcloud_deploy_override_ansible_cfg`: (String) File path to an ansible.cfg containing override values.
* `tripleo_overcloud_deploy_plan_environment_file`: (String) File path to a plan environment file.
* `tripleo_overcloud_deploy_poll`: (Integer) Number of seconds to wait between each checks to see if the deployment command has completed. Default: 10
* `tripleo_overcloud_deploy_rc_file`: (String) (String) Path to the credential file to use. If `tripleo_rc_file` is defined, it will be the default. Default: "{{ ansible_env.HOME }}/stackrc"
* `tripleo_overcloud_deploy_roles_file`: (String) File path to a deployment roles file.
* `tripleo_overcloud_deploy_run_validations`: (Boolean) Flag to enable running validations. Default: false
* `tripleo_overcloud_deploy_skip_deploy_identifier`: (Boolean) Flag to enable skip deploy identifier. Default: false
* `tripleo_overcloud_deploy_skip_postconfig`: (Boolean) Flag to enable skip postconfig. Default: false
* `tripleo_overcloud_deploy_stack`: (String) Name of the stack to deploy. Default: overcloud
* `tripleo_overcloud_deploy_templates`: (String) Path to a directory containing the tripleo-heat-templates for the deployment. Default: /usr/share/openstack-tripleo-heat-templates/
* `tripleo_overcloud_deploy_timeout`: (Integer) Number in seconds to wait for the ansible execution of the deployment command to finish. This should be larger than the `tripleo_overcloud_deploy_timeout_arg` value. Default: 5700
* `tripleo_overcloud_deploy_timeout_arg`: (Integer) Number in minutes for the deployment to run. Default: 90
* `tripleo_overcloud_deploy_update_plan_only`: (Boolean) Flag to enable only updating the plan. Default: false
* `tripleo_overcloud_deploy_validation_errors_nonfatal`: (Boolean) Flag to make validation errors not fatal. Default: false
* `tripleo_overcloud_deploy_validation_warnings_fatal`: (Boolean) Flag to make validation warnings fatal. Default: false
NOTE: Please note that this command should be run against the undercloud so the
OS_CLOUD or rc file variables should be set to use the 'undercloud' when
calling this role. If you are not defining `tripleo_os_cloud` or `tripleo_rc_file`,
stackrc will be used by default.
Output Variables
----------------
* `tripleo_overcloud_deploy_output`: (String) The command standard output.
* `tripleo_overcloud_deploy_result`: Ansible shell execution results
Dependencies
------------
None.
Example Playbook
----------------
Example overcloud deploy execution playbook
```yaml
- hosts: undercloud
gather_facts: true
tasks:
- name: Run overcloud deploy
import_role:
name: tripleo_overcloud_deploy
vars:
tripleo_overcloud_deploy_environment_files:
- /usr/share/openstack-tripleo-heat-templates/environments/enable-swap.yaml
```
License
-------
Apache-2.0

View File

@ -0,0 +1,49 @@
---
# defaults file for tripleo_overcloud_deploy
openstack_bin: openstack
tripleo_overcloud_deploy_answers_file:
tripleo_overcloud_deploy_baremetal_deployment:
tripleo_overcloud_deploy_config_download: false
tripleo_overcloud_deploy_config_download_timeout:
tripleo_overcloud_deploy_debug: false
tripleo_overcloud_deploy_deployed_server: false
tripleo_overcloud_deploy_deployment_python_interpreter:
tripleo_overcloud_deploy_disable_password_generation: false
tripleo_overcloud_deploy_disable_validations: false
tripleo_overcloud_deploy_dry_run: false
tripleo_overcloud_deploy_environment_dirs: []
tripleo_overcloud_deploy_environment_files: []
tripleo_overcloud_deploy_force_postconfig: false
tripleo_overcloud_deploy_home_dir: "{{ ansible_env.HOME }}"
tripleo_overcloud_deploy_inflight_validations: false
tripleo_overcloud_deploy_libvirt_type:
tripleo_overcloud_deploy_log: "{{ tripleo_overcloud_deploy_home_dir }}/overcloud_deploy.log"
tripleo_overcloud_deploy_log_combine: true
tripleo_overcloud_deploy_log_output: true
tripleo_overcloud_deploy_networks_file:
tripleo_overcloud_deploy_no_cleanup: false
tripleo_overcloud_deploy_no_config_download: false
tripleo_overcloud_deploy_no_proxy:
tripleo_overcloud_deploy_ntp_server:
tripleo_overcloud_deploy_os_cloud: "{{ tripleo_os_cloud | default('') }}"
tripleo_overcloud_deploy_output_dir:
tripleo_overcloud_deploy_overcloud_ssh_enable_timeout:
tripleo_overcloud_deploy_overcloud_ssh_key:
tripleo_overcloud_deploy_overcloud_ssh_network:
tripleo_overcloud_deploy_overcloud_ssh_port_timeout:
tripleo_overcloud_deploy_overcloud_ssh_user:
tripleo_overcloud_deploy_override_ansible_cfg:
tripleo_overcloud_deploy_plan_environment_file:
tripleo_overcloud_deploy_poll: 10
tripleo_overcloud_deploy_rc_file: "{{ tripleo_rc_file | default(ansible_env.HOME ~ '/stackrc') }}"
tripleo_overcloud_deploy_roles_file:
tripleo_overcloud_deploy_run_validations: false
tripleo_overcloud_deploy_skip_deploy_identifier: false
tripleo_overcloud_deploy_skip_postconfig: false
tripleo_overcloud_deploy_stack: overcloud
tripleo_overcloud_deploy_templates: /usr/share/openstack-tripleo-heat-templates
tripleo_overcloud_deploy_timeout: 5700
tripleo_overcloud_deploy_timeout_arg: 90
tripleo_overcloud_deploy_update_plan_only: false
tripleo_overcloud_deploy_validation_errors_nonfatal: false
tripleo_overcloud_deploy_validation_warnings_fatal: false

View File

@ -0,0 +1,42 @@
---
# 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.
galaxy_info:
author: OpenStack
description: TripleO Operator Role -- tripleo_overcloud_failures
company: Red Hat
license: Apache-2.0
min_ansible_version: 2.8
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
platforms:
- name: CentOS
versions:
- 7
- 8
galaxy_tags:
- tripleo
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
dependencies: []

View File

@ -0,0 +1,22 @@
---
driver:
name: delegated
options:
managed: false
ansible_connection_options:
ansible_connection: local
log: true
lint:
name: yamllint
enabled: false
platforms:
- name: instance
provisioner:
name: ansible
scenario:
name: default
test_sequence:
- prepare
- syntax
- converge
- verify

View File

@ -0,0 +1,506 @@
---
- name: Converge
hosts: all
collections:
- tripleo.operator
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_debug: true
tripleo_overcloud_deploy_log_output: false
tripleo_overcloud_deploy_log_combine: false
tripleo_overcloud_deploy_poll: 1
tasks:
- name: "Include tripleo_overcloud_deploy"
include_role:
name: "tripleo_overcloud_deploy"
- name: Check role
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --templates /usr/share/openstack-tripleo-heat-templates --stack overcloud --timeout 90"
- name: Check parameter "tripleo_overcloud_deploy_stack"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack: test
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
- name: Assert "tripleo_overcloud_deploy_stack"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --stack test"
- name: Check parameter "tripleo_overcloud_deploy_libvirt_type"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_libvirt_type: qemu
- name: Assert "tripleo_overcloud_deploy_libvirt_type"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --libvirt-type qemu"
- name: Check parameter "tripleo_overcloud_deploy_ntp_server"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_ntp_server: 0.pool.ntp.org,1.pool.ntp.org
- name: Assert "tripleo_overcloud_deploy_ntp_server"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --ntp-server 0.pool.ntp.org,1.pool.ntp.org"
- name: Check parameter "tripleo_overcloud_deploy_no_proxy"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_no_proxy: 192.168.24.1
- name: Assert "tripleo_overcloud_deploy_no_proxy"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --no-proxy 192.168.24.1"
- name: Check parameter "tripleo_overcloud_deploy_overcloud_ssh_user"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_overcloud_ssh_user: bob
- name: Assert "tripleo_overcloud_deploy_overcloud_ssh_user"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --overcloud-ssh-user bob"
- name: Check parameter "tripleo_overcloud_deploy_overcloud_ssh_key"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_overcloud_ssh_key: /tmp/foo
- name: Assert "tripleo_overcloud_deploy_overcloud_ssh_key"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --overcloud-ssh-key /tmp/foo"
- name: Check parameter "tripleo_overcloud_deploy_overcloud_ssh_network"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_overcloud_ssh_network: external
- name: Assert "tripleo_overcloud_deploy_overcloud_ssh_network"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --overcloud-ssh-network external"
- name: Check parameter "tripleo_overcloud_deploy_overcloud_ssh_enable_timeout"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_overcloud_ssh_enable_timeout: 12
- name: Assert "tripleo_overcloud_deploy_overcloud_ssh_enable_timeout"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --overcloud-ssh-enable-timeout 12"
- name: Check parameter "tripleo_overcloud_deploy_overcloud_ssh_port_timeout"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_overcloud_ssh_port_timeout: 200
- name: Assert "tripleo_overcloud_deploy_overcloud_ssh_port_timeout"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --overcloud-ssh-port-timeout 200"
- name: Check parameter "tripleo_overcloud_deploy_environment_files"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_environment_files:
- a.yaml
- b.yaml
- name: Assert "tripleo_overcloud_deploy_environment_files"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy -e a.yaml -e b.yaml"
- name: Check parameter "tripleo_overcloud_deploy_environment_dirs"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_environment_dirs:
- /home/foo/overcloud/
- name: Assert "tripleo_overcloud_deploy_environment_dirs"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --environment-directory /home/foo/overcloud/"
- name: Check parameter "tripleo_overcloud_deploy_roles_files"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_roles_file: roles.yaml
- name: Assert "tripleo_overcloud_deploy_roles_files"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy -r roles.yaml"
- name: Check parameter "tripleo_overcloud_deploy_networks_file"
include_role:
name: "tripleo_overcloud_deploy"
vars:
openstack_bin: echo
tripleo_os_cloud: undercloud
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_networks_file: networks.yaml
- name: Assert "tripleo_overcloud_deploy_networks_file"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy -n networks.yaml"
- name: Check parameter "tripleo_overcloud_deploy_plan_environment_file"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_no_cleanup: true
- name: Assert "tripleo_overcloud_deploy_no_cleanup"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --no-cleanup"
- name: Check parameter "tripleo_overcloud_deploy_update_plan_only"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_update_plan_only: true
- name: Assert "tripleo_overcloud_deploy_update_plan_only"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --update-plan-only"
- name: Check parameter "tripleo_overcloud_deploy_validation_errors_nonfatal"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_validation_errors_nonfatal: true
- name: Assert "tripleo_overcloud_deploy_validation_errors_nonfatal"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --validation-errors-nonfatal"
- name: Check parameter "tripleo_overcloud_deploy_validation_warnings_fatal"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_validation_warnings_fatal: true
- name: Assert "tripleo_overcloud_deploy_validation_warnings_fatal"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --validation-warnings-fatal"
- name: Check parameter "tripleo_overcloud_deploy_disable_validations"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_disable_validations: true
- name: Assert "tripleo_overcloud_deploy_disable_validations"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --disable-validations"
- name: Check parameter "tripleo_overcloud_deploy_inflight_validations"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_inflight_validations: true
- name: Assert "tripleo_overcloud_deploy_inflight_validations"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --inflight-validations"
- name: Check parameter "tripleo_overcloud_deploy_dry_run"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_dry_run: true
- name: Assert "tripleo_overcloud_deploy_dry_run"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --dry-run"
- name: Check parameter "tripleo_overcloud_deploy_run_validations"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_run_validations: true
- name: Assert "tripleo_overcloud_deploy_run_validations"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --run-validations"
- name: Check parameter "tripleo_overcloud_deploy_skip_postconfig"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_skip_postconfig: true
- name: Assert "tripleo_overcloud_deploy_skip_postconfig"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --skip-postconfig"
- name: Check parameter "tripleo_overcloud_deploy_force_postconfig"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_force_postconfig: true
- name: Assert "tripleo_overcloud_deploy_force_postconfig"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --force-postconfig"
- name: Check parameter "tripleo_overcloud_deploy_answers_file"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_answers_file: foo.yaml
- name: Assert "tripleo_overcloud_deploy_answers_file"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --answers-file foo.yaml"
- name: Check parameter "tripleo_overcloud_deploy_disable_password_generation"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_disable_password_generation: true
- name: Assert "tripleo_overcloud_deploy_disable_password_generation"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --disable-password-generation"
- name: Check parameter "tripleo_overcloud_deploy_deployed_server"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_deployed_server: true
- name: Assert "tripleo_overcloud_deploy_deployed_server"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --deployed-server"
- name: Check parameter "tripleo_overcloud_deploy_config_download"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_config_download: true
- name: Assert "tripleo_overcloud_deploy_config_download"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --config-download"
- name: Check parameter "tripleo_overcloud_deploy_no_config_download"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_no_config_download: true
- name: Assert "tripleo_overcloud_deploy_no_config_download"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --no-config-download"
- name: Check parameter "tripleo_overcloud_deploy_output_dir"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_output_dir: /tmp/output
- name: Assert "tripleo_overcloud_deploy_output_dir"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --output-dir /tmp/output"
- name: Check parameter "tripleo_overcloud_deploy_override_ansible_cfg"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_override_ansible_cfg: foo.cfg
- name: Assert "tripleo_overcloud_deploy_override_ansible_cfg"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --override-ansible-cfg foo.cfg"
- name: Check parameter "tripleo_overcloud_deploy_config_download_timeout"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_config_download_timeout: 12
- name: Assert "tripleo_overcloud_deploy_config_download_timeout"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --config-download-timeout 12"
- name: Check parameter "tripleo_overcloud_deploy_deployment_python_interpreter"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_deployment_python_interpreter: python3
- name: Assert "tripleo_overcloud_deploy_deployment_python_interpreter"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --deployment-python-interpreter python3"
- name: Check parameter "tripleo_overcloud_deploy_baremetal_deployment"
include_role:
name: "tripleo_overcloud_deploy"
vars:
tripleo_overcloud_deploy_stack:
tripleo_overcloud_deploy_templates:
tripleo_overcloud_deploy_timeout_arg:
tripleo_overcloud_deploy_baremetal_deployment: bare.yaml
- name: Assert "tripleo_overcloud_deploy_baremetal_deployment"
assert:
that:
- tripleo_overcloud_deploy_output == "overcloud deploy --baremetal-deployment bare.yaml"

View File

@ -0,0 +1,8 @@
---
- name: Prepare
hosts: all
tasks:
- name: Include molecule prep
include_role:
name: test_molecule_prep

View File

@ -0,0 +1,92 @@
---
# tasks file for tripleo_overcloud_deploy
- name: Setup overcloud deploy facts
set_fact:
_deploy_cmd: >-
{{ tripleo_overcloud_deploy_os_cloud | ternary('', "source " ~ tripleo_overcloud_deploy_rc_file ~ "; ") }}
{{ openstack_bin }} overcloud deploy
{{ tripleo_overcloud_deploy_templates | ternary('--templates $DEPLOY_TEMPLATES', '') }}
{{ tripleo_overcloud_deploy_stack | ternary('--stack $DEPLOY_STACK', '') }}
{{ tripleo_overcloud_deploy_timeout_arg | ternary('--timeout $DEPLOY_TIMEOUT_ARG', '') }}
{{ tripleo_overcloud_deploy_libvirt_type | ternary('--libvirt-type $DEPLOY_LIBVIRT_TYPE', '') }}
{{ tripleo_overcloud_deploy_ntp_server | ternary('--ntp-server $DEPLOY_NTP_SERVER', '') }}
{{ tripleo_overcloud_deploy_no_proxy | ternary('--no-proxy $DEPLOY_NO_PROXY', '') }}
{{ tripleo_overcloud_deploy_overcloud_ssh_user | ternary('--overcloud-ssh-user $DEPLOY_OVERCLOUD_SSH_USER', '') }}
{{ tripleo_overcloud_deploy_overcloud_ssh_key | ternary('--overcloud-ssh-key $DEPLOY_OVERCLOUD_SSH_KEY', '') }}
{{ tripleo_overcloud_deploy_overcloud_ssh_network | ternary('--overcloud-ssh-network $DEPLOY_OVERCLOUD_SSH_NETWORK', '') }}
{{ tripleo_overcloud_deploy_overcloud_ssh_enable_timeout | ternary('--overcloud-ssh-enable-timeout $DEPLOY_OVERCLOUD_SSH_ENABLE_TIMEOUT', '') }}
{{ tripleo_overcloud_deploy_overcloud_ssh_port_timeout | ternary('--overcloud-ssh-port-timeout $DEPLOY_OVERCLOUD_SSH_PORT_TIMEOUT', '') }}
{{ tripleo_overcloud_deploy_environment_files | tripleo.operator.shell_arg_list(parameter='-e') }}
{{ tripleo_overcloud_deploy_environment_dirs | tripleo.operator.shell_arg_list(parameter='--environment-directory') }}
{{ tripleo_overcloud_deploy_roles_file | ternary('-r $DEPLOY_ROLES_FILE', '') }}
{{ tripleo_overcloud_deploy_networks_file | ternary('-n $DEPLOY_NETWORKS_FILE', '') }}
{{ tripleo_overcloud_deploy_plan_environment_file | ternary('-p $DEPLOY_PLAN_ENV_FILE', '') }}
{{ tripleo_overcloud_deploy_no_cleanup | ternary('--no-cleanup', '') }}
{{ tripleo_overcloud_deploy_update_plan_only | ternary('--update-plan-only', '') }}
{{ tripleo_overcloud_deploy_validation_errors_nonfatal | ternary('--validation-errors-nonfatal', '') }}
{{ tripleo_overcloud_deploy_validation_warnings_fatal | ternary('--validation-warnings-fatal', '') }}
{{ tripleo_overcloud_deploy_disable_validations | ternary('--disable-validations', '') }}
{{ tripleo_overcloud_deploy_inflight_validations | ternary('--inflight-validations', '') }}
{{ tripleo_overcloud_deploy_dry_run | ternary('--dry-run', '') }}
{{ tripleo_overcloud_deploy_run_validations | ternary('--run-validations', '') }}
{{ tripleo_overcloud_deploy_skip_postconfig | ternary('--skip-postconfig', '') }}
{{ tripleo_overcloud_deploy_force_postconfig | ternary('--force-postconfig', '') }}
{{ tripleo_overcloud_deploy_skip_deploy_identifier | ternary('--skip-deploy-identifier', '') }}
{{ tripleo_overcloud_deploy_answers_file | ternary('--answers-file $DEPLOY_ANSWERS_FILE', '') }}
{{ tripleo_overcloud_deploy_disable_password_generation | ternary('--disable-password-generation', '') }}
{{ tripleo_overcloud_deploy_deployed_server | ternary('--deployed-server', '') }}
{{ tripleo_overcloud_deploy_config_download | ternary('--config-download', '') }}
{{ tripleo_overcloud_deploy_no_config_download | ternary('--no-config-download', '') }}
{{ tripleo_overcloud_deploy_output_dir | ternary('--output-dir $DEPLOY_OUTPUT_DIR', '') }}
{{ tripleo_overcloud_deploy_override_ansible_cfg | ternary('--override-ansible-cfg $DEPLOY_OVERRIDE_ANSIBLE_CFG', '') }}
{{ tripleo_overcloud_deploy_config_download_timeout | ternary('--config-download-timeout $DEPLOY_CONFIG_DOWNLOAD_TIMEOUT', '') }}
{{ tripleo_overcloud_deploy_deployment_python_interpreter | ternary('--deployment-python-interpreter $DEPLOY_PYTHON_INTERPRETER', '') }}
{{ tripleo_overcloud_deploy_baremetal_deployment | ternary('--baremetal-deployment $DEPLOY_BAREMETAL_DEPLOYMENT', '') }}
{{ tripleo_overcloud_deploy_log_output | ternary((">" ~ tripleo_overcloud_deploy_log), '') }}
{{ tripleo_overcloud_deploy_log_combine | ternary("2>&1", '') }}
- name: Preserve existing log file if exists
timestamp_file:
path: "{{ tripleo_overcloud_deploy_log }}"
when: tripleo_overcloud_deploy_log_output|bool
- name: Show the overcloud deploy command
debug:
var: _deploy_cmd
when: tripleo_overcloud_deploy_debug|bool
- name: Overcloud deploy
shell: "{{ _deploy_cmd }}" # noqa 305
environment:
DEPLOY_TEMPLATES: "{{ tripleo_overcloud_deploy_templates }}"
DEPLOY_STACK: "{{ tripleo_overcloud_deploy_stack }}"
DEPLOY_TIMEOUT_ARG: "{{ tripleo_overcloud_deploy_timeout_arg }}"
DEPLOY_LIBVIRT_TYPE: "{{ tripleo_overcloud_deploy_libvirt_type }}"
DEPLOY_NTP_SERVER: "{{ tripleo_overcloud_deploy_ntp_server }}"
DEPLOY_NO_PROXY: "{{ tripleo_overcloud_deploy_no_proxy }}"
DEPLOY_OVERCLOUD_SSH_USER: "{{ tripleo_overcloud_deploy_overcloud_ssh_user }}"
DEPLOY_OVERCLOUD_SSH_KEY: "{{ tripleo_overcloud_deploy_overcloud_ssh_key }}"
DEPLOY_OVERCLOUD_SSH_NETWORK: "{{ tripleo_overcloud_deploy_overcloud_ssh_network }}"
DEPLOY_OVERCLOUD_SSH_ENABLE_TIMEOUT: "{{ tripleo_overcloud_deploy_overcloud_ssh_enable_timeout }}"
DEPLOY_OVERCLOUD_SSH_PORT_TIMEOUT: "{{ tripleo_overcloud_deploy_overcloud_ssh_port_timeout }}"
DEPLOY_ROLES_FILE: "{{ tripleo_overcloud_deploy_roles_file }}"
DEPLOY_NETWORKS_FILE: "{{ tripleo_overcloud_deploy_networks_file }}"
DEPLOY_PLAN_ENV_FILE: "{{ tripleo_overcloud_deploy_plan_environment_file }}"
DEPLOY_ANSWERS_FILE: "{{ tripleo_overcloud_deploy_answers_file }}"
DEPLOY_OUTPUT_DIR: "{{ tripleo_overcloud_deploy_output_dir }}"
DEPLOY_OVERRIDE_ANSIBLE_CFG: "{{ tripleo_overcloud_deploy_override_ansible_cfg }}"
DEPLOY_CONFIG_DOWNLOAD_TIMEOUT: "{{ tripleo_overcloud_deploy_config_download_timeout }}"
DEPLOY_PYTHON_INTERPRETER: "{{ tripleo_overcloud_deploy_deployment_python_interpreter }}"
DEPLOY_BAREMETAL_DEPLOYMENT: "{{ tripleo_overcloud_deploy_baremetal_deployment }}"
args:
chdir: "{{ tripleo_overcloud_deploy_home_dir }}"
warn: false
register: tripleo_overcloud_deploy_result
async: "{{ tripleo_overcloud_deploy_timeout }}"
poll: "{{ tripleo_overcloud_deploy_poll }}"
changed_when: false
when: not ansible_check_mode|bool
- name: Set output fact
set_fact:
tripleo_overcloud_deploy_output: "{{ tripleo_overcloud_deploy_result.stdout }}"

View File

@ -0,0 +1 @@
localhost

View File

@ -0,0 +1,4 @@
---
- hosts: localhost
roles:
- tripleo_overcloud_deploy

View File

@ -7,6 +7,7 @@
- tripleo-operator-molecule-tripleo_container_image_list
- tripleo-operator-molecule-tripleo_container_image_push
- tripleo-operator-molecule-tripleo_container_image_show
- tripleo-operator-molecule-tripleo_overcloud_deploy
- tripleo-operator-molecule-tripleo_overcloud_export
- tripleo-operator-molecule-tripleo_overcloud_failures
- tripleo-operator-molecule-tripleo_overcloud_node_introspect
@ -18,6 +19,7 @@
- tripleo-operator-molecule-tripleo_container_image_list
- tripleo-operator-molecule-tripleo_container_image_push
- tripleo-operator-molecule-tripleo_container_image_show
- tripleo-operator-molecule-tripleo_overcloud_deploy
- tripleo-operator-molecule-tripleo_overcloud_export
- tripleo-operator-molecule-tripleo_overcloud_failures
- tripleo-operator-molecule-tripleo_overcloud_node_introspect
@ -70,6 +72,14 @@
vars:
tox_extra_args: tripleo_container_image_show
- job:
files:
- ^roles/tripleo_overcloud_deploy/.*
name: tripleo-operator-molecule-tripleo_overcloud_deploy
parent: tripleo-operator-molecule-base
vars:
tox_extra_args: tripleo_overcloud_deploy
- job:
files:
- ^roles/tripleo_overcloud_export/.*