Merge "Add undercloud minion roles"
This commit is contained in:
48
roles/tripleo-undercloud-minion-install/README.md
Normal file
48
roles/tripleo-undercloud-minion-install/README.md
Normal file
@@ -0,0 +1,48 @@
|
||||
tripleo-undercloud-minion-install
|
||||
==========================
|
||||
|
||||
A role to run the install a TripleO undercloud minion.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
None.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
|
||||
* `tripleo_undercloud_minion_install_debug`: (Boolean) Flag used to enable the debug version of commands. Default: false
|
||||
* `tripleo_undercloud_minion_install_home_dir`: (String) Home directory for the undercloud user. Default: "{{ ansible_env.HOME }}"
|
||||
* `tripleo_undercloud_minion_install_dry_run`: (Boolean) Flag to add --dry-run to the install. Default: false
|
||||
* `tripleo_undercloud_minion_install_force_stack_update`: (Boolean) Flag to add --force-stack-update to the install. Default: false
|
||||
* `tripleo_undercloud_minion_install_no_validations`: (Boolean) Flag to add --no-validations to the install. Default: false
|
||||
* `tripleo_undercloud_minion_install_timeout`: (Number) Timeout for the install command. Default: 7200
|
||||
* `tripleo_undercloud_minion_install_yes`: (Boolean) Flag to add --yes to the install. Default: false
|
||||
* `tripleo_undercloud_minion_install_log_combine`: (Boolean) Flag to combine stdout and stderr in the logfile. Default: true
|
||||
* `tripleo_undercloud_minion_install_log_output`: (Boolean) Flag to log the output to a file rather than show it in the ansible output. Default: true
|
||||
* `tripleo_undercloud_minion_install_log`: (String) Install log file path. Default: "{{ tripleo_undercloud_minion_install_home_dir }}/undercloud_minion_install.log"
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Example install execution playbook
|
||||
|
||||
- hosts: undercloud
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: Install undercloud minion
|
||||
import_role:
|
||||
name: tripleo-undercloud-minion-install
|
||||
vars:
|
||||
tripleo_undercloud_minion_install_debug: true
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Apache-2.0
|
||||
12
roles/tripleo-undercloud-minion-install/defaults/main.yml
Normal file
12
roles/tripleo-undercloud-minion-install/defaults/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# defaults file for tripleo-undercloud-minion-install
|
||||
tripleo_undercloud_minion_install_debug: false
|
||||
tripleo_undercloud_minion_install_home_dir: "{{ ansible_env.HOME }}"
|
||||
tripleo_undercloud_minion_install_dry_run: false
|
||||
tripleo_undercloud_minion_install_force_stack_update: false
|
||||
tripleo_undercloud_minion_install_no_validations: false
|
||||
tripleo_undercloud_minion_install_timeout: 7200
|
||||
tripleo_undercloud_minion_install_yes: false
|
||||
tripleo_undercloud_minion_install_log_combine: true
|
||||
tripleo_undercloud_minion_install_log_output: true
|
||||
tripleo_undercloud_minion_install_log: "{{ tripleo_undercloud_minion_install_home_dir }}/undercloud_minion_install.log"
|
||||
42
roles/tripleo-undercloud-minion-install/meta/main.yml
Normal file
42
roles/tripleo-undercloud-minion-install/meta/main.yml
Normal 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-undercloud-minion-install
|
||||
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: []
|
||||
28
roles/tripleo-undercloud-minion-install/tasks/main.yml
Normal file
28
roles/tripleo-undercloud-minion-install/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Setup undercloud minion install facts
|
||||
set_fact:
|
||||
_install_cmd: >-
|
||||
openstack undercloud minion install
|
||||
{{ tripleo_undercloud_minion_install_force_stack_update | ternary("--force-stack-update", '') }}
|
||||
{{ tripleo_undercloud_minion_install_no_validations | ternary("--no-validations", '') }}
|
||||
{{ tripleo_undercloud_minion_install_dry_run | ternary("--dry-run", '') }}
|
||||
{{ tripleo_undercloud_minion_install_yes | ternary("--yes", '') }}
|
||||
{{ tripleo_undercloud_minion_install_log_output | ternary((">" ~ tripleo_undercloud_minion_install_log), '') }}
|
||||
{{ tripleo_undercloud_minion_install_log_combine | ternary("2>&1", '') }}
|
||||
|
||||
- name: Preserve existing log file if exists
|
||||
timestamp_file:
|
||||
path: "{{ tripleo_undercloud_minion_install_log }}"
|
||||
|
||||
- name: Show the underclound minion install command
|
||||
debug:
|
||||
var: _install_cmd
|
||||
when: tripleo_undercloud_minion_install_debug|bool
|
||||
|
||||
- name: undercloud minion install
|
||||
shell: "{{ _install_cmd }}" # noqa 305
|
||||
args:
|
||||
chdir: "{{ tripleo_undercloud_minion_install_home_dir }}"
|
||||
async: "{{ tripleo_undercloud_minion_install_timeout }}"
|
||||
poll: 10
|
||||
changed_when: true
|
||||
2
roles/tripleo-undercloud-minion-install/tests/inventory
Normal file
2
roles/tripleo-undercloud-minion-install/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/tripleo-undercloud-minion-install/tests/test.yml
Normal file
5
roles/tripleo-undercloud-minion-install/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- tripleo-undercloud-minion-install
|
||||
49
roles/tripleo-undercloud-minion-upgrade/README.md
Normal file
49
roles/tripleo-undercloud-minion-upgrade/README.md
Normal file
@@ -0,0 +1,49 @@
|
||||
tripleo-undercloud-minion-upgrade
|
||||
=================================
|
||||
|
||||
A role to run the upgrade of a TripleO undercloud minion.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
None.
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
|
||||
* `tripleo_undercloud_minion_upgrade_debug`: (Boolean) Flag used to enable the debug version of commands. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_dry_run`: (Boolean) Flag to add --dry-run to the upgrade command. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_force_stack_update`: (Boolean) Flag to add --force-stack-update to the upgrade command. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_home_dir`: (String) Home directory for the undercloud user. Default: "{{ ansible_env.HOME }}"
|
||||
* `tripleo_undercloud_minion_upgrade_inflight_validations`: (Boolean) Flag to add --inflight-validations to the upgrade. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_log_combine`: (Boolean) Flag to combine stdout and stderr in the logfile. Default: true
|
||||
* `tripleo_undercloud_minion_upgrade_log_output`: (Boolean) Flag to log the output to a file rather than show it in the ansible output. Default: true
|
||||
* `tripleo_undercloud_minion_upgrade_no_validations`: (Boolean) Flag to add --no-validations to the upgrade. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_timeout`: (Number) Timeout for the upgrade command. Default: 7200
|
||||
* `tripleo_undercloud_minion_upgrade_yes`: (Boolean) Flag to add --yes to the upgrade. Default: false
|
||||
* `tripleo_undercloud_minion_upgrade_log`: (String) Upgrade log file path. Default: "{{ tripleo_undercloud_minion_upgrade_home_dir }}/undercloud_minion_upgrade.log"
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
None.
|
||||
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
Example upgrade execution playbook
|
||||
|
||||
- hosts: undercloud
|
||||
gather_facts: true
|
||||
tasks:
|
||||
- name: Upgrade undercloud minion
|
||||
import_role:
|
||||
name: tripleo-undercloud-minion-upgrade
|
||||
vars:
|
||||
tripleo_undercloud_minion_upgrade_debug: true
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Apache-2.0
|
||||
12
roles/tripleo-undercloud-minion-upgrade/defaults/main.yml
Normal file
12
roles/tripleo-undercloud-minion-upgrade/defaults/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
# defaults file for tripleo-undercloud-minion-upgrade
|
||||
tripleo_undercloud_minion_upgrade_debug: false
|
||||
tripleo_undercloud_minion_upgrade_dry_run: false
|
||||
tripleo_undercloud_minion_upgrade_force_stack_update: false
|
||||
tripleo_undercloud_minion_upgrade_home_dir: "{{ ansible_env.HOME }}"
|
||||
tripleo_undercloud_minion_upgrade_log_combine: true
|
||||
tripleo_undercloud_minion_upgrade_log_output: true
|
||||
tripleo_undercloud_minion_upgrade_no_validations: false
|
||||
tripleo_undercloud_minion_upgrade_timeout: 7200
|
||||
tripleo_undercloud_minion_upgrade_yes: false
|
||||
tripleo_undercloud_minion_upgrade_log: "{{ tripleo_undercloud_minion_home_dir }}/undercloud_minion_upgrade.log"
|
||||
42
roles/tripleo-undercloud-minion-upgrade/meta/main.yml
Normal file
42
roles/tripleo-undercloud-minion-upgrade/meta/main.yml
Normal 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-undercloud-minion-install
|
||||
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: []
|
||||
28
roles/tripleo-undercloud-minion-upgrade/tasks/main.yml
Normal file
28
roles/tripleo-undercloud-minion-upgrade/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Setup undercloud minion upgrade facts
|
||||
set_fact:
|
||||
_upgrade_cmd: >-
|
||||
openstack undercloud minion upgrade
|
||||
{{ tripleo_undercloud_minion_upgrade_force_stack_update | ternary("--force-stack-update", '') }}
|
||||
{{ tripleo_undercloud_minion_upgrade_no_validations | ternary("--no-validations", '') }}
|
||||
{{ tripleo_undercloud_minion_upgrade_dry_run | ternary("--dry-run", '') }}
|
||||
{{ tripleo_undercloud_minion_upgrade_yes | ternary("--yes", '') }}
|
||||
{{ tripleo_undercloud_minion_upgrade_log_output | ternary((">" ~ tripleo_undercloud_minion_upgrade_log), '') }}
|
||||
{{ tripleo_undercloud_minion_upgrade_log_combine | ternary("2>&1", '') }}
|
||||
|
||||
- name: Preserve existing log file if exists
|
||||
timestamp_file:
|
||||
path: "{{ tripleo_undercloud_minion_upgrade_log }}"
|
||||
|
||||
- name: Show the underclound minion upgrade command
|
||||
debug:
|
||||
var: _upgrade_cmd
|
||||
when: tripleo_undercloud_minion_upgrade_debug|bool
|
||||
|
||||
- name: undercloud minion upgrade
|
||||
shell: "{{ _upgrade_cmd }}" # noqa 305
|
||||
args:
|
||||
chdir: "{{ tripleo_undercloud_minion_upgrade_home_dir }}"
|
||||
async: "{{ tripleo_undercloud_minion_upgrade_timeout }}"
|
||||
poll: 10
|
||||
changed_when: true
|
||||
2
roles/tripleo-undercloud-minion-upgrade/tests/inventory
Normal file
2
roles/tripleo-undercloud-minion-upgrade/tests/inventory
Normal file
@@ -0,0 +1,2 @@
|
||||
localhost
|
||||
|
||||
5
roles/tripleo-undercloud-minion-upgrade/tests/test.yml
Normal file
5
roles/tripleo-undercloud-minion-upgrade/tests/test.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
remote_user: root
|
||||
roles:
|
||||
- tripleo-undercloud-minion-upgrade
|
||||
Reference in New Issue
Block a user