Restructure Ansible playbooks repo

This commit moves all the Ansible playbooks from "bootstrap"
and "backup-restore" folder into "playbooks" folder and makes
necessary changes to the paths in the files.

Tests done:
  - remote and local bootstrap controller-0
  - remote and local backup
  - remote and local restore_platform

Story: 2004761
Task: 36571

Change-Id: I2c7e2035bab4d32ba33d32dc575f3edd9565f82b
Signed-off-by: Wei Zhou <wei.zhou@windriver.com>
changes/34/682734/1
Wei Zhou 3 years ago
parent 2f59acce07
commit 6e6e564a4f
  1. 52
      playbookconfig/src/playbooks/backup-restore/host_vars/default.yml
  2. 0
      playbookconfig/src/playbooks/backup.yml
  3. 29
      playbookconfig/src/playbooks/bootstrap.yml
  4. 29
      playbookconfig/src/playbooks/bootstrap/bootstrap.yml
  5. 40
      playbookconfig/src/playbooks/host_vars/default.yml
  6. 0
      playbookconfig/src/playbooks/restore_openstack.yml
  7. 4
      playbookconfig/src/playbooks/restore_platform.yml
  8. 0
      playbookconfig/src/playbooks/roles/backup/backup-system/files/fm_alarm.py
  9. 14
      playbookconfig/src/playbooks/roles/backup/backup-system/tasks/main.yml
  10. 0
      playbookconfig/src/playbooks/roles/backup/backup-system/vars/main.yml
  11. 0
      playbookconfig/src/playbooks/roles/backup/prepare-env/tasks/main.yml
  12. 0
      playbookconfig/src/playbooks/roles/backup/prepare-env/vars/main.yml
  13. 0
      playbookconfig/src/playbooks/roles/bootstrap/apply-bootstrap-manifest/defaults/main.yml
  14. 0
      playbookconfig/src/playbooks/roles/bootstrap/apply-bootstrap-manifest/tasks/main.yml
  15. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/bringup_flock_services.yml
  16. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/bringup_helm.yml
  17. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/bringup_kubemaster.yml
  18. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/load_images_from_archive.yml
  19. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/main.yml
  20. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/refresh_local_dns.yml
  21. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/tasks/setup_registry_certificate_and_keys.yml
  22. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/templates/calico-cni.yaml.j2
  23. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/templates/kubelet.conf.j2
  24. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/templates/multus-cni.yaml.j2
  25. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/templates/sriov-cni.yaml.j2
  26. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/templates/sriov-plugin.yaml.j2
  27. 0
      playbookconfig/src/playbooks/roles/bootstrap/bringup-essential-services/vars/main.yml
  28. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/files/populate_initial_config.py
  29. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/tasks/main.yml
  30. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/tasks/one_time_config_tasks.yml
  31. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/tasks/shutdown_services.yml
  32. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/tasks/update_sysinv_database.yml
  33. 0
      playbookconfig/src/playbooks/roles/bootstrap/persist-config/vars/main.yml
  34. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/files/check_root_disk_size.py
  35. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/handlers/main.yml
  36. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/tasks/load_patching_tasks.yml
  37. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/tasks/main.yml
  38. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/tasks/restore_prep_tasks.yml
  39. 0
      playbookconfig/src/playbooks/roles/bootstrap/prepare-env/vars/main.yml
  40. 0
      playbookconfig/src/playbooks/roles/bootstrap/store-passwd/tasks/main.yml
  41. 0
      playbookconfig/src/playbooks/roles/bootstrap/store-passwd/vars/main.yml
  42. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/meta/main.yml
  43. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/tasks/main.yml
  44. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/tasks/validate_address.yml
  45. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/tasks/validate_address_range.yml
  46. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/tasks/validate_url.yml
  47. 0
      playbookconfig/src/playbooks/roles/bootstrap/validate-config/vars/main.yml
  48. 0
      playbookconfig/src/playbooks/roles/common/tasks/main.yml
  49. 0
      playbookconfig/src/playbooks/roles/include-override-files/tasks/main.yml
  50. 0
      playbookconfig/src/playbooks/roles/restore-openstack/restore/tasks/main.yml
  51. 0
      playbookconfig/src/playbooks/roles/restore-openstack/restore/vars/main.yml
  52. 0
      playbookconfig/src/playbooks/roles/restore-platform/pre-restore-bootstrap/tasks/main.yml
  53. 0
      playbookconfig/src/playbooks/roles/restore-platform/restore-more-data/tasks/main.yml
  54. 0
      playbookconfig/src/playbooks/roles/restore-platform/restore-more-data/vars/main.yml

@ -1,52 +0,0 @@
---
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
#
# Default directory where user override file(s) can be found
#
override_files_dir: "{{ lookup('env', 'HOME') }}"
# Default directory where the backup tar file(s) can be found
# on the active controller
backup_dir: /opt/backups
#
# The platform backup tarball will be named in this format:
# <platform_backup_filename_prefix>_<timestamp>.tgz
#
platform_backup_filename_prefix: "{{ inventory_hostname }}_platform_backup"
#
# The stx-openstack application backup tarball will be named in this format:
# <openstack_backup_filename_prefix>_<timestamp>.tgz
#
openstack_backup_filename_prefix: "{{ inventory_hostname }}_openstack_backup"
#
# System backup tarball filename. User must provide the filename either
# in the override file or via -e option at the command line.
#
# This variable refers to the tarball that is generated by the backup
# procedure and used in the restore phase.
#
backup_filename:
#
# An indication whether it is a full restore or partial restore.
# True: a full restore where storage partition(s) is/are wiped during
# platform restore and ceph data needs restored
# False: a partial restore where ceph data remain intact during restore
#
# This variable is used for StarlingX OpenStack application restore only
#
restore_ceph_data: false
#
# Default directory where the system backup tarballs fetched from the
# active controller can be found
#
host_backup_dir: "{{ lookup('env', 'HOME') }}"

@ -0,0 +1,29 @@
---
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
- hosts: all
# If gathering facts is really necessary, run setup task AFTER host connectivity
# check block in prepare-env role.
gather_facts: no
vars_files:
- host_vars/default.yml
# Main play
roles:
- include-override-files
- bootstrap/prepare-env
- { role: bootstrap/validate-config, when: not skip_play, become: yes }
- { role: bootstrap/store-passwd, when: not skip_play and save_password, become: yes }
- { role: bootstrap/apply-bootstrap-manifest, when: not skip_play and not replayed, become: yes }
- { role: bootstrap/persist-config, when: not skip_play, become: yes }
- { role: bootstrap/bringup-essential-services, when: not skip_play, become: yes }
vars:
change_password: false
skip_play: false
replayed: false
mode: 'bootstrap'

@ -1,29 +0,0 @@
---
#
# Copyright (c) 2019 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
- hosts: all
# If gathering facts is really necessary, run setup task AFTER host connectivity
# check block in prepare-env role.
gather_facts: no
vars_files:
- host_vars/default.yml
# Main play
roles:
- include-override-files
- prepare-env
- { role: validate-config, when: not skip_play, become: yes }
- { role: store-passwd, when: not skip_play and save_password, become: yes }
- { role: apply-bootstrap-manifest, when: not skip_play and not replayed, become: yes }
- { role: persist-config, when: not skip_play, become: yes }
- { role: bringup-essential-services, when: not skip_play, become: yes }
vars:
change_password: false
skip_play: false
replayed: false
mode: 'bootstrap'

@ -229,14 +229,46 @@ password_change_responses:
#
override_files_dir: "{{ lookup('env', 'HOME') }}"
# BACKUP AND RESTORE
# ==================
#
# Location where the platform backup tar file is placed to restore the platform.
# Location where the backup tar file is placed to perform the restore.
# This location must be specified at the command line via ansible-playbook -e option.
initial_backup_dir:
# Platform backup tar file. The filename must be specified at the command line via
# ansible-playbook -e option.
# This variable refers to the tar file that is generated by the backup
# procedure and used in the restore phase. The filename must be specified
# at the command line via ansible-playbook -e option.
backup_filename:
# Default directory where the backup tar file(s) can be found
# on the active controller
backup_dir: /opt/backups
# The platform backup tarball will be named in this format:
# <platform_backup_filename_prefix>_<timestamp>.tgz
#
platform_backup_filename_prefix: "{{ inventory_hostname }}_platform_backup"
# The stx-openstack application backup tarball will be named in this format:
# <openstack_backup_filename_prefix>_<timestamp>.tgz
#
openstack_backup_filename_prefix: "{{ inventory_hostname }}_openstack_backup"
# An indication whether it is a full restore or partial restore.
# true: a full restore where storage partition(s) is/are wiped during
# platform restore and ceph data needs restored
# false: a partial restore where ceph data remain intact during restore
#
# This variable is used for StarlingX OpenStack application restore only
#
restore_ceph_data: false
# Default directory where the system backup tarballs fetched from the
# active controller can be found
#
host_backup_dir: "{{ lookup('env', 'HOME') }}"
# Flag file to indicate if platform restore is in progress
#
restore_in_progress_flag: /etc/platform/.restore_in_progress

@ -12,7 +12,7 @@
roles:
- include-override-files
- pre-restore-bootstrap
- restore-platform/pre-restore-bootstrap
vars:
change_password: false
@ -28,4 +28,4 @@
roles:
- include-override-files
- { role: restore-more-data, become: yes }
- { role: restore-platform/restore-more-data, become: yes }

@ -453,14 +453,18 @@
Backup tar file(s) are now available in {{ backup_dir }} on the active controller.
- block:
- name: Transfer backup tar files to the local machine
- name: Transfer platform backup tar file to the local machine
fetch:
src: "{{ item }}"
src: "{{ platform_backup_file_path }}"
dest: "{{ host_backup_dir }}/"
flat: yes
with_items:
- "{{ platform_backup_file_path }}"
- "{{ openstack_backup_file_path }}"
- name: Transfer openstack backup tar files to the local machine if it exists
fetch:
src: "{{ openstack_backup_file_path}}"
dest: "{{ host_backup_dir }}/"
flat: yes
when: check_mariadb_pod.rc == 0 or check_openstack_uploaded.rc == 0
- name: Notify the user where the backup tar file(s) can be found
debug:
Loading…
Cancel
Save