Skip to content
This repository was archived by the owner on Feb 9, 2022. It is now read-only.

Commit e0c7356

Browse files
committed
Fix upgrade flow
Change-Id: I9b32e6568dcdda2ac1d5851ef17eb805ff25cc0d Signed-off-by: Ondra Machacek <[email protected]>
1 parent de4c151 commit e0c7356

8 files changed

+11
-14
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ as ``ovirt_engine_setup_answer_file_path``.
5555
| ovirt_engine_setup_update_setup_packages | False | If `True`, setup packages will be updated before `engine-setup` will be executed. Makes sense if Engine is already installed. |
5656
| ovirt_engine_setup_update_all_packages | True | If `True`, all packages will be updated before `engine-setup` will be executed. |
5757
| ovirt_engine_setup_offline | False | If `True`, `engine-setup` will not search for package updates. |
58-
| ovirt_engine_setup_accept_defaults | False | If `True` default answers will be automatically used in questions that have them during `engine-setup`. |
5958
| ovirt_engine_setup_require_rollback | UNDEF | If `True` setup will require to be able to rollback new packages in case of a failure. If not passed the default answer from `engine-setup` will be chosen. Valid for updating/upgrading. |
6059
| ovirt_engine_setup_admin_password | UNDEF | Password for the automatically created administrative user of the oVirt Engine.
6160
| ovirt_engine_setup_perform_upgrade | False | If true this role is used to perform upgrade. |

tasks/engine_setup.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
# fixed by suggested update_only parameter.
3333
command: yum -y update ovirt\*setup\*
3434
when: ovirt_engine_setup_update_setup_packages or ovirt_engine_setup_perform_upgrade
35+
args:
36+
warn: false
3537
tags:
3638
- "skip_ansible_lint" # ANSIBLE0006
3739

@@ -43,16 +45,12 @@
4345
tags:
4446
- "skip_ansible_lint" # ANSIBLE0010
4547

46-
- name: Set accept defaults parameter if variable is set
47-
set_fact:
48-
accept_defaults: "{{ '--accept-defaults' if ovirt_engine_setup_accept_defaults or ovirt_engine_setup_perform_upgrade else '' }}"
49-
5048
- name: Set offline parameter if variable is set
5149
set_fact:
5250
offline: "{{ '--offline' if ovirt_engine_setup_offline else '' }}"
5351

5452
- name: Run engine-setup with answerfile
55-
command: "engine-setup --config-append={{ answer_file_path }} {{ accept_defaults }} {{ offline }}"
53+
command: "engine-setup --accept-defaults --config-append={{ answer_file_path }} {{ offline }}"
5654
tags:
5755
- skip_ansible_lint
5856

@@ -68,7 +66,7 @@
6866
register: health_page
6967
retries: 12
7068
delay: 10
71-
until: health_page|success
69+
until: health_page is success
7270

7371
always:
7472
- name: Clean temporary files

templates/answerfile_4.1_basic.txt.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{% include "./templates/basic_answerfile.txt.j2" %},
1+
{% include "./templates/basic_answerfile.txt.j2" %}
22
OVESETUP_DB/engineVacuumFull=bool:{{ ovirt_engine_setup_engine_vacuum_full }}
33
OVESETUP_DB/dwhVacuumFull=bool:{{ ovirt_engine_setup_dwh_vacuum_full }}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{% include "./templates/basic_answerfile.txt.j2" %},
1+
{% include "./templates/basic_answerfile.txt.j2" %}

templates/answerfile_4.2_basic.txt.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% include "./templates/basic_answerfile.txt.j2" %},
1+
{% include "./templates/basic_answerfile.txt.j2" %}
22
OVESETUP_DB/engineVacuumFull=bool:{{ ovirt_engine_setup_engine_vacuum_full }}
33
OVESETUP_DB/dwhVacuumFull=bool:{{ ovirt_engine_setup_dwh_vacuum_full }}
44
{% if ovirt_engine_setup_provider_ovn_configure is defined and ovirt_engine_setup_provider_ovn_configure %}

templates/answerfile_4.2_upgrade.txt.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% include "./templates/basic_answerfile.txt.j2" %},
1+
{% include "./templates/basic_answerfile.txt.j2" %}
22
{% if ovirt_engine_setup_provider_ovn_configure is defined and ovirt_engine_setup_provider_ovn_configure %}
33
OVESETUP_DB/engineVacuumFull=bool:True
44
OVESETUP_OVN/ovirtProviderOvn=bool:True

templates/basic_answerfile.txt.j2

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ OSETUP_RPMDISTRO/requireRollback=none:None
1313
{% endif %}
1414
OVESETUP_DB/host=str:{{ovirt_engine_setup_db_host}}
1515
OVESETUP_DB/user=str:{{ovirt_engine_setup_db_user}}
16+
OVESETUP_SYSTEM/memCheckEnabled=bool:False
1617
{% if ovirt_engine_setup_db_password is defined %}
1718
OVESETUP_DB/password=str:{{ovirt_engine_setup_db_password}}
1819
{% else %}
@@ -44,7 +45,9 @@ OVESETUP_DWH_DB/securedHostValidation=bool:False
4445
{% else %}
4546
OVESETUP_DWH_DB/securedHostValidation=none:None
4647
{% endif %}
48+
{% if ovirt_engine_setup_organization is defined %}
4749
OVESETUP_PKI/organization=str:{{ ovirt_engine_setup_organization }}
50+
{% endif %}
4851
OVESETUP_CONFIG/adminPassword=str:{{ ovirt_engine_setup_admin_password }}
4952
{% if ovirt_engine_setup_dwh_db_configure is defined and ovirt_engine_setup_dwh_db_configure %}
5053
OVESETUP_DWH_CORE/enable=bool:True

tests/engine-upgrade.yml

-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@
1414
roles:
1515
- role: oVirt.repositories
1616
- role: oVirt.engine-setup
17-
# --accept-defaults needed because of: https://bugzilla.redhat.com/show_bug.cgi?id=1518697
18-
# Can be solved also with https://bugzilla.redhat.com/show_bug.cgi?id=1396925
19-
ovirt_engine_setup_accept_defaults: true
2017
ovirt_engine_setup_answer_file_path: "answerfile_{{ ovirt_engine_setup_version }}_upgrade.txt.j2"

0 commit comments

Comments
 (0)