Adds support for leaping from Mitaka

Adds a few tweaks to get Mitaka to function as a
leapfrog source.

- Adds Mitaka as option
- Adjusts detection to include eol branches
- Creates file if user_variables.yml doesn't exist
- Checks if osa_secrets_file_name exists

Change-Id: Id0bce1441456bc545deca67710004b750901e81b
This commit is contained in:
Antony Messerli 2018-06-13 17:52:32 -05:00
parent 582e5199f3
commit 851d22e4d5
3 changed files with 14 additions and 11 deletions

View File

@ -172,8 +172,8 @@ function validate_upgrade_input {
echo echo
warning "Please enter the source series to upgrade from." warning "Please enter the source series to upgrade from."
notice "JUNO, KILO or LIBERTY" notice "JUNO, KILO, LIBERTY or MITAKA"
read -p 'Enter "JUNO", "KILO", or "LIBERTY" to continue: ' UPGRADE_FROM read -p 'Enter "JUNO", "KILO", "LIBERTY" or "MITAKA" to continue: ' UPGRADE_FROM
export INPUT_UPGRADE_FROM=${UPGRADE_FROM} export INPUT_UPGRADE_FROM=${UPGRADE_FROM}
if [[ ${INPUT_UPGRADE_FROM} == ${CODE_UPGRADE_FROM} ]]; then if [[ ${INPUT_UPGRADE_FROM} == ${CODE_UPGRADE_FROM} ]]; then
@ -206,19 +206,19 @@ function discover_code_version {
else else
source /etc/openstack-release source /etc/openstack-release
case "${DISTRIB_RELEASE%%.*}" in case "${DISTRIB_RELEASE%%.*}" in
*11) *11|eol-kilo)
export CODE_UPGRADE_FROM="KILO" export CODE_UPGRADE_FROM="KILO"
notice "You seem to be running Kilo" notice "You seem to be running Kilo"
;; ;;
*12) *12|liberty-eol)
export CODE_UPGRADE_FROM="LIBERTY" export CODE_UPGRADE_FROM="LIBERTY"
notice "You seem to be running Liberty" notice "You seem to be running Liberty"
;; ;;
*13) *13|mitaka-eol)
export CODE_UPGRADE_FROM="MITAKA" export CODE_UPGRADE_FROM="MITAKA"
notice "You seem to be running Mitaka" notice "You seem to be running Mitaka"
;; ;;
*14) *14|newton-eol)
export CODE_UPGRADE_FROM="NEWTON" export CODE_UPGRADE_FROM="NEWTON"
notice "You seem to be running Newton" notice "You seem to be running Newton"
;; ;;

View File

@ -56,6 +56,7 @@
regexp: "^{{ item.key }}" regexp: "^{{ item.key }}"
line: "{{ item.key }}: {{ item.value }}" line: "{{ item.key }}: {{ item.value }}"
state: present state: present
create: yes
with_items: with_items:
- key: "default_bind_mount_logs" - key: "default_bind_mount_logs"
value: false value: false

View File

@ -1,5 +1,5 @@
--- ---
# Copyright 2015, Rackspace US, Inc. # Copyright 2018, Rackspace US, Inc.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@ -24,20 +24,22 @@
register: secrets register: secrets
- name: Rename changed secrets - name: Rename changed secrets
lineinfile: lineinfile:
dest: "/etc/openstack_deploy/user_secrets.yml" dest: "/etc/openstack_deploy/{{ _osa_secrets_file_name }}"
regexp: "^{{ item.old_name }}: (.*)$" regexp: "^{{ item.old_name }}: (.*)$"
line: "{{ item.new_name }}: \\1" line: "{{ item.new_name }}: \\1"
backrefs: yes backrefs: yes
with_items: with_items:
- { old_name: "ironic_galera_password", new_name: "ironic_container_mysql_password" } - { old_name: "ironic_galera_password", new_name: "ironic_container_mysql_password" }
- name: Read user secrets file - name: Read user secrets file
shell: "grep '^[a-zA-Z]' /etc/openstack_deploy/user_secrets.yml" shell: "grep '^[a-zA-Z]' /etc/openstack_deploy/{{ _osa_secrets_file_name }}"
register: user_secrets register: user_secrets
- name: Add missing secrets - name: Add missing secrets
lineinfile: lineinfile:
dest: "/etc/openstack_deploy/user_secrets.yml" dest: "/etc/openstack_deploy/{{ _osa_secrets_file_name }}"
line: "{{ item }}" line: "{{ item }}"
with_items: "{{ secrets.stdout_lines }}" with_items: "{{ secrets.stdout_lines }}"
when: user_secrets.stdout.find("{{ item }}") == -1 when: user_secrets.stdout.find("{{ item }}") == -1
- name: Generate new secrets - name: Generate new secrets
shell: "{{ osa_playbook_dir }}/scripts/pw-token-gen.py --file /etc/openstack_deploy/user_secrets.yml" shell: "{{ osa_playbook_dir }}/scripts/pw-token-gen.py --file /etc/openstack_deploy/{{ _osa_secrets_file_name }}"
vars:
_osa_secrets_file_name: "{{ osa_secrets_file_name | default('user_secrets.yml') }}"