Browse Source

Merge "Remove all ununsed plan related playbooks"

changes/68/774768/1
Zuul 6 months ago
committed by Gerrit Code Review
parent
commit
ad5a1f9577
  1. 14
      doc/source/modules/modules-tripleo_image_params_prepare.rst
  2. 14
      doc/source/modules/modules-tripleo_plan_deploy.rst
  3. 14
      doc/source/modules/modules-tripleo_plan_parameters_update.rst
  4. 14
      doc/source/modules/modules-tripleo_swift_tempurl.rst
  5. 14
      doc/source/modules/modules-tripleo_templates_upload.rst
  6. 112
      tripleo_ansible/ansible_plugins/modules/tripleo_image_params_prepare.py
  7. 124
      tripleo_ansible/ansible_plugins/modules/tripleo_plan_deploy.py
  8. 131
      tripleo_ansible/ansible_plugins/modules/tripleo_plan_parameters_update.py
  9. 130
      tripleo_ansible/ansible_plugins/modules/tripleo_swift_tempurl.py
  10. 112
      tripleo_ansible/ansible_plugins/modules/tripleo_templates_upload.py
  11. 136
      tripleo_ansible/playbooks/cli-create-deployment-plan.yaml
  12. 106
      tripleo_ansible/playbooks/cli-deploy-deployment-plan.yaml
  13. 67
      tripleo_ansible/playbooks/cli-update-deployment-plan.yaml

14
doc/source/modules/modules-tripleo_image_params_prepare.rst

@ -1,14 +0,0 @@
=====================================
Module - tripleo_image_params_prepare
=====================================
This module provides for the following ansible plugin:
* tripleo_image_params_prepare
.. ansibleautoplugin::
:module: tripleo_ansible/ansible_plugins/modules/tripleo_image_params_prepare.py
:documentation: true
:examples: true

14
doc/source/modules/modules-tripleo_plan_deploy.rst

@ -1,14 +0,0 @@
============================
Module - tripleo_plan_deploy
============================
This module provides for the following ansible plugin:
* tripleo_plan_deploy
.. ansibleautoplugin::
:module: tripleo_ansible/ansible_plugins/modules/tripleo_plan_deploy.py
:documentation: true
:examples: true

14
doc/source/modules/modules-tripleo_plan_parameters_update.rst

@ -1,14 +0,0 @@
=======================================
Module - tripleo_plan_parameters_update
=======================================
This module provides for the following ansible plugin:
* tripleo_plan_parameters_update
.. ansibleautoplugin::
:module: tripleo_ansible/ansible_plugins/modules/tripleo_plan_parameters_update.py
:documentation: true
:examples: true

14
doc/source/modules/modules-tripleo_swift_tempurl.rst

@ -1,14 +0,0 @@
==============================
Module - tripleo_swift_tempurl
==============================
This module provides for the following ansible plugin:
* tripleo_swift_tempurl
.. ansibleautoplugin::
:module: tripleo_ansible/ansible_plugins/modules/tripleo_swift_tempurl.py
:documentation: true
:examples: true

14
doc/source/modules/modules-tripleo_templates_upload.rst

@ -1,14 +0,0 @@
=================================
Module - tripleo_templates_upload
=================================
This module provides for the following ansible plugin:
* tripleo_templates_upload
.. ansibleautoplugin::
:module: tripleo_ansible/ansible_plugins/modules/tripleo_templates_upload.py
:documentation: true
:examples: true

112
tripleo_ansible/ansible_plugins/modules/tripleo_image_params_prepare.py

@ -1,112 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 OpenStack Foundation
# 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 yaml
from ansible.module_utils import tripleo_common_utils as tc
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
from ansible.module_utils.openstack import openstack_module_kwargs
from ansible.module_utils.openstack import openstack_cloud_from_module
from tripleo_common.utils import plan as plan_utils
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tripleo_image_params_prepare
short_description: Update plan image params
version_added: "2.8"
description:
- "Prepare Image params and update plan"
options:
container:
description:
- Overcloud plan container name
type: str
default: overcloud
with_roledata:
description:
- With role data
type: bool
default: false
author:
- Rabi Mishra (@ramishra)
requirements: ["openstacksdk", "tripleo-common"]
'''
EXAMPLES = '''
- name: Prepare image params and update plan
tripleo_image_params_prepare:
container: overcloud
with_roledata: true
'''
def run_module():
result = dict(
success=False,
changed=False,
error="",
)
argument_spec = openstack_full_argument_spec(
**yaml.safe_load(DOCUMENTATION)['options']
)
module = AnsibleModule(
argument_spec,
supports_check_mode=False,
**openstack_module_kwargs()
)
try:
container = module.params.get('container')
with_roledata = module.params.get('with_roledata')
_, conn = openstack_cloud_from_module(module)
tripleo = tc.TripleOCommon(session=conn.session)
swift = tripleo.get_object_client()
plan_utils.update_plan_environment_with_image_parameters(
swift, container, with_roledata=with_roledata)
result['success'] = True
result['changed'] = True
except Exception as err:
result['error'] = str(err)
result['msg'] = ("Error updating image parms for plan %s: %s" % (
container, err))
module.fail_json(**result)
# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()

124
tripleo_ansible/ansible_plugins/modules/tripleo_plan_deploy.py

@ -1,124 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 OpenStack Foundation
# 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 yaml
from ansible.module_utils import tripleo_common_utils as tc
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
from ansible.module_utils.openstack import openstack_module_kwargs
from ansible.module_utils.openstack import openstack_cloud_from_module
from tripleo_common.utils import stack as stack_utils
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tripleo_plan_deploy
short_description: Deploy Plan
version_added: "2.8"
description:
- "Deploy Plan"
options:
container:
description:
- Overcloud plan container name
type: str
default: overcloud
skip_deploy_identifier:
description:
- Skip deploy indetifier
type: bool
default: false
timeout_mins:
description:
- Stack deploy timeout in mins
type: int
default: 240
author:
- Rabi Mishra (@ramishra)
requirements: ["openstacksdk", "tripleo-common"]
'''
EXAMPLES = '''
- name: Deploy Plan
tripleo_plan_deploy:
container: overcloud
skip_deploy_identifier: false
timeout_mins: 240
'''
def run_module():
result = dict(
success=False,
changed=False,
error="",
)
argument_spec = openstack_full_argument_spec(
**yaml.safe_load(DOCUMENTATION)['options']
)
module = AnsibleModule(
argument_spec,
supports_check_mode=False,
**openstack_module_kwargs()
)
try:
container = module.params.get('container')
skip_deploy_identifier = module.params.get('skip_deploy_identifier')
timeout_mins = module.params.get('timeout_mins')
_, conn = openstack_cloud_from_module(module)
tripleo = tc.TripleOCommon(session=conn.session)
swift = tripleo.get_object_client()
heat = tripleo.get_orchestration_client()
stack_utils.deploy_stack(
swift, heat,
container=container,
skip_deploy_identifier=skip_deploy_identifier,
timeout_mins=timeout_mins)
result['success'] = True
result['changed'] = True
except Exception as err:
result['error'] = str(err)
result['msg'] = ("Error updating parameters for plan %s: %s" % (
container, err))
module.fail_json(**result)
# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()

131
tripleo_ansible/ansible_plugins/modules/tripleo_plan_parameters_update.py

@ -1,131 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 OpenStack Foundation
# 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 yaml
from ansible.module_utils import tripleo_common_utils as tc
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
from ansible.module_utils.openstack import openstack_module_kwargs
from ansible.module_utils.openstack import openstack_cloud_from_module
from tripleo_common.utils import stack_parameters as stack_param_utils
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tripleo_plan_parameters_update
short_description: Update plan parameters
version_added: "2.8"
description:
- "Update plan parameters and validate stack"
options:
container:
description:
- Overcloud plan container name
type: str
default: overcloud
parameters:
description:
- Parameters to update
type: dict
default: {}
parameter_key:
description:
- Heat parameter key
type: str
default: parameter_defaults
validate:
description:
- Validate heat stack
type: bool
default: true
author:
- Rabi Mishra (@ramishra)
requirements: ["openstacksdk", "tripleo-common"]
'''
EXAMPLES = '''
- name: Update Plan params
tripleo_plan_parameters_update:
container: overcloud
parameters:
RootStackName: overcloud
validate: false
'''
def run_module():
result = dict(
success=False,
changed=False,
error="",
)
argument_spec = openstack_full_argument_spec(
**yaml.safe_load(DOCUMENTATION)['options']
)
module = AnsibleModule(
argument_spec,
supports_check_mode=False,
**openstack_module_kwargs()
)
try:
container = module.params.get('container')
parameters = module.params.get('parameters')
parameter_key = module.params.get('parameter_key')
validate = module.params.get('validate')
_, conn = openstack_cloud_from_module(module)
tripleo = tc.TripleOCommon(session=conn.session)
swift = tripleo.get_object_client()
heat = tripleo.get_orchestration_client()
stack_param_utils.update_parameters(
swift, heat, parameters,
container=container,
parameter_key=parameter_key,
validate=validate)
result['success'] = True
result['changed'] = True
except Exception as err:
result['error'] = str(err)
result['msg'] = ("Error updating parameters for plan %s: %s" % (
container, err))
module.fail_json(**result)
# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()

130
tripleo_ansible/ansible_plugins/modules/tripleo_swift_tempurl.py

@ -1,130 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 OpenStack Foundation
# 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 yaml
from ansible.module_utils import tripleo_common_utils as tc
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
from ansible.module_utils.openstack import openstack_module_kwargs
from ansible.module_utils.openstack import openstack_cloud_from_module
from tripleo_common.utils import swift as swift_utils
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tripleo_swift_tempurl
short_description: Get swift tempurl
version_added: "2.8"
description:
- "Get swift tempurl for object."
options:
container:
description:
- Container name
type: str
default: overcloud-swift-rings
object:
description:
- Object name
type: str
defult: swift-rings.tar.gz
method:
description:
- An HTTP method to allow for this tempurl
type: str
default: GET
author:
- Rabi Mishra (@ramishra)
requirements: ["openstacksdk", "tripleo-common"]
'''
EXAMPLES = '''
- name: Get tempurl for swit backup
tripleo_swift_tempurl:
container: overcloud-swift-rings
object: swift-rings.tar.gz
method: GET
register: tempurl
'''
RETURN = '''
tempurl:
description: tempurl for object
returned: always
type: string
no_log: true
'''
def run_module():
result = dict(
success=False,
error="",
changed=False,
tempurl=""
)
argument_spec = openstack_full_argument_spec(
**yaml.safe_load(DOCUMENTATION)['options']
)
module = AnsibleModule(
argument_spec,
supports_check_mode=False,
**openstack_module_kwargs()
)
try:
container = module.params.get('container')
obj = module.params.get('object')
method = module.params.get('method')
_, conn = openstack_cloud_from_module(module)
tripleo = tc.TripleOCommon(session=conn.session)
swift = tripleo.get_object_client()
tempurl = swift_utils.get_temp_url(swift, container, obj, method)
result['success'] = True
result['changed'] = True
result['tempurl'] = tempurl
except Exception as err:
result['error'] = str(err)
result['msg'] = ("Error getting %s tempurl for %s/%s: %s" % (
method, container, obj, err))
module.fail_json(**result)
# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()

112
tripleo_ansible/ansible_plugins/modules/tripleo_templates_upload.py

@ -1,112 +0,0 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 OpenStack Foundation
# 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 yaml
from ansible.module_utils import tripleo_common_utils as tc
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.openstack import openstack_full_argument_spec
from ansible.module_utils.openstack import openstack_module_kwargs
from ansible.module_utils.openstack import openstack_cloud_from_module
from tripleo_common.utils import template as template_utils
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: tripleo_templates_upload
short_description: Upload Templates
version_added: "2.8"
description:
- "Upload Templates to plan"
options:
container:
description:
- Overcloud plan container name
type: str
default: overcloud
templates_dir:
description:
- templates_dir
type: str
default: '/usr/share/openstack-tripleo-heat-templates/'
author:
- Rabi Mishra (@ramishra)
requirements: ["openstacksdk", "tripleo-common"]
'''
EXAMPLES = '''
- name: Upload templates to plan
tripleo_templates_upload:
container: overcloud
templates_dir: '/usr/share/openstack-tripleo-heat-templates/'
'''
def run_module():
result = dict(
success=False,
changed=False,
error="",
)
argument_spec = openstack_full_argument_spec(
**yaml.safe_load(DOCUMENTATION)['options']
)
module = AnsibleModule(
argument_spec,
supports_check_mode=False,
**openstack_module_kwargs()
)
try:
container = module.params.get('container')
templates_dir = module.params.get('templates_dir')
_, conn = openstack_cloud_from_module(module)
tripleo = tc.TripleOCommon(session=conn.session)
swift = tripleo.get_object_client()
template_utils.upload_templates_as_tarball(
swift, container, templates_dir)
result['success'] = True
result['changed'] = True
except Exception as err:
result['error'] = str(err)
result['msg'] = ("Error uploading templates for plan %s: %s" % (
container, err))
module.fail_json(**result)
# in the event of a successful module execution, you will want to
# simple AnsibleModule.exit_json(), passing the key/value results
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()

136
tripleo_ansible/playbooks/cli-create-deployment-plan.yaml

@ -1,136 +0,0 @@
---
# 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.
- import_playbook: cli-undercloud-local-artifacts.yaml
vars:
stack: "{{ container | default('overcloud') }}"
- name: Create Deployment Plan
connection: "{{ (tripleo_target_host is defined) | ternary('ssh', 'local') }}"
hosts: "{{ tripleo_target_host | default('localhost') }}"
remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}"
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true
vars:
container: overcloud
source_url: null
generate_passwords: true
disable_image_params_prepare: false
plan_environment: plan-environment.yaml
default_templates_dir: '/usr/share/openstack-tripleo-heat-templates/'
use_default_templates: false
hide_sensitive_logs: true
handlers:
- name: Cleanup temp directory
file:
path: "{{ temp_dir.path }}"
state: absent
when: temp_dir is defined
pre_tasks:
- name: Set facts from environment
set_fact:
auth_version: "{{ lookup('env', 'OS_IDENTITY_API_VERSION') }}"
os_auth_url: "{{ lookup('env', 'OS_AUTH_URL') }}"
os_username: "{{ lookup('env', 'OS_USERNAME') }}"
os_password: "{{ lookup('env', 'OS_PASSWORD') }}"
os_project_name: "{{ lookup('env', 'OS_PROJECT_NAME') }}"
run_once: true
no_log: "{{ hide_sensitive_logs | bool }}"
tasks:
- name: crate container and upload templates
block:
- name: Create plan if does not exist
shell: >
swift --os-auth-url "{{ os_auth_url }}"
--os-username "{{ os_username }}"
--os-password "{{ os_password }}"
--os-project-name "{{ os_project_name }}"
--auth-version "{{ auth_version }}"
post "{{ container }}" --header 'x-container-meta-usage-tripleo:plan'
no_log: "{{ hide_sensitive_logs | bool }}"
- name: Create temp directory
tempfile:
state: directory
suffix: "{{ '_' + container + '_import' }}"
register: temp_dir
notify:
- "Cleanup temp directory"
when: source_url is not none
- name: Git clone remote url
git:
repo: "{{ source_url }}"
dest: "{{ temp_dir }}"
when: source_url is not none
- name: Upload templates
tripleo_templates_upload:
container: "{{ container }}"
templates_dir: "{{ temp_dir.path }}"
when: source_url is not none
- name: Upload default templates
tripleo_templates_upload:
container: "{{ container }}"
templates_dir: "{{ default_templates_dir }}"
when: use_default_templates|bool
when: use_default_templates|bool or source_url is not none
- name: Create plan environment if does not exist
os_object:
container: "{{ container }}"
name: plan-environment.yaml
state: present
filename: "{{ plan_environment | tht_abspath }}"
- name: Check Plan file
stat:
path: "/var/lib/tripleo/stacks/{{ container }}/plan-environment.yaml"
register: plan_file
- name: Write local plan copy
copy:
src: "{{ plan_environment | tht_abspath }}"
dest: "/var/lib/tripleo/stacks/{{ container }}/plan-environment.yaml"
remote_src: true
when:
- not (plan_file.stat.exists | bool)
- name: Generate passwords and update plan
tripleo_passwords_rotate:
container: "{{ container }}"
when: generate_passwords|bool
no_log: "{{ hide_sensitive_logs | bool }}"
- name: Prepare Container images and update plan
tripleo_image_params_prepare:
container: "{{ container }}"
with_roledata: false
when: not (disable_image_params_prepare | bool)
- name: Add root stack name
tripleo_plan_parameters_update:
container: "{{ container }}"
parameters:
RootStackName: "{{ container }}"
parameter_key: parameter_defaults
validate: false

106
tripleo_ansible/playbooks/cli-deploy-deployment-plan.yaml

@ -1,106 +0,0 @@
---
# 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.
- name: Deploy Deployment Plan
connection: "{{ (tripleo_target_host is defined) | ternary('ssh', 'local') }}"
hosts: "{{ tripleo_target_host | default('localhost') }}"
remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}"
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true
vars:
container: overcloud
run_validations: false
timeout_mins: 240
skip_deploy_identifier: false
pre_tasks:
- name: Set ansible_home for for local connection
set_fact:
ansible_home: "{{ lookup('env', 'HOME') }}"
run_once: true
when:
- (tripleo_target_host is defined) | ternary('ssh', 'local') == 'local'
tasks:
- name: Validations block
when:
- run_validations | bool
block:
- name: Check if validation enabled
set_fact:
validations_enabled: "{{ lookup('hiera', 'tripleo_validations_enabled') }}"
run_once: true
become: true
# Pre-deployment validation
# NOTE(cloudnull): The stackrc file is sourced because validations are not
# 100% compatible with clouds.yaml at this time.
- name: Run Validations
shell: |-
source "{{ ansible_home }}/stackrc"
openstack --os-cloud undercloud tripleo validator run --group "pre-deployment"
when:
- validations_enabled | bool
- name: Fail if validations are disabled
fail:
msg: >-
Run validations were enabled but via hiera information disabled.
Check the configuration and try again.
when:
- not (validations_enabled | bool)
- name: Prepare Container images and update plan
tripleo_image_params_prepare:
container: "{{ container }}"
with_roledata: true
- name: Get backup tempurl for GET
tripleo_swift_tempurl:
container: "{{container + '-swift-rings' }}"
object: "swift-rings.tar.gz"
method: GET
register: backup_get_tempurl
- name: Get backup tempurl for POST
tripleo_swift_tempurl:
container: "{{container + '-swift-rings' }}"
object: "swift-rings.tar.gz"
method: PUT
register: backup_put_tempurl
- name: Update plan with backup tempurl parameters
tripleo_plan_parameters_update:
container: "{{ container }}"
parameters:
SwiftRingGetTempurl: "{{ backup_get_tempurl.tempurl }}"
SwiftRingPutTempurl: "{{ backup_put_tempurl.tempurl }}"
parameter_key: parameter_defaults
validate: true
- name: Deploy Plan
tripleo_plan_deploy:
container: "{{ container }}"
skip_deploy_identifier: "{{ skip_deploy_identifier }}"
timeout_mins: "{{ timeout_mins|int }}"
- name: Wait for stack status
command: |
openstack --os-cloud undercloud stack show --no-resolve-outputs "{{ container }}" -c stack_status
register: check_status
until: "'IN_PROGRESS' not in check_status.stdout"
retries: "{{ (timeout_mins|int * 60 / 10)|int }}"
delay: 10

67
tripleo_ansible/playbooks/cli-update-deployment-plan.yaml

@ -1,67 +0,0 @@
---
# 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.
- name: Update Deployment Plan
connection: "{{ (tripleo_target_host is defined) | ternary('ssh', 'local') }}"
hosts: "{{ tripleo_target_host | default('localhost') }}"
remote_user: "{{ tripleo_target_user | default(lookup('env', 'USER')) }}"
gather_facts: "{{ (tripleo_target_host is defined) | ternary(true, false) }}"
any_errors_fatal: true
vars:
container: overcloud
generate_passwords: true
reset_passwords: false
disable_image_params_prepare: false
hide_sensitive_logs: true
tasks:
- name: Generate passwords if does not exist and update plan
tripleo_passwords_rotate:
container: "{{ container }}"
rotate_passwords: "{{ reset_passwords }}"
when:
- (generate_passwords | bool) or (reset_passwords | bool)
no_log: "{{ hide_sensitive_logs | bool }}"
- name: Prepare Container images and update plan
tripleo_image_params_prepare:
container: "{{ container }}"
with_roledata: false
when: not (disable_image_params_prepare | bool)
- name: Get backup tempurl for GET
tripleo_swift_tempurl:
container: "{{container + '-swift-rings' }}"
object: "swift-rings.tar.gz"
method: GET
register: backup_get_tempurl
- name: Get backup tempurl for POST
tripleo_swift_tempurl:
container: "{{container + '-swift-rings' }}"
object: "swift-rings.tar.gz"
method: PUT
register: backup_put_tempurl
- name: Update plan with root stack and backup tempurl parameters
tripleo_plan_parameters_update:
container: "{{ container }}"
parameters:
RootStackName: "{{ container }}"
SwiftRingGetTempurl: "{{ backup_get_tempurl.tempurl }}"
SwiftRingPutTempurl: "{{ backup_put_tempurl.tempurl }}"
parameter_key: parameter_defaults
validate: false
Loading…
Cancel
Save