Skip to content

Commit

Permalink
remove scl prefix from engine on postgres el8
Browse files Browse the repository at this point in the history
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1806526

Signed-off-by: Evgeny Slutsky <eslutsky@redhat.com>
  • Loading branch information
eslutsky committed Mar 5, 2020
1 parent 772e6e7 commit 5c7f0b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
8 changes: 3 additions & 5 deletions tasks/create_target_vm/02_engine_vm_configuration.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
- name: Engine VM configuration tasks
block:
- include_tasks: pg_scl.yml
- debug: var=scl_conf
- name: Create a temporary directory for ansible as postgres user
file:
path: /var/lib/pgsql/.ansible/tmp
Expand All @@ -12,7 +10,7 @@
mode: 0700
- name: Update target VM details at DB level
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"UPDATE vm_static SET {{ item.field }}={{ item.value }} WHERE
vm_guid='{{ hostvars[he_ansible_host_name]['he_vm_details']['vm']['id'] }}'"
environment: "{{ he_cmd_lang }}"
Expand All @@ -26,7 +24,7 @@
- debug: var=db_vm_update
- name: Insert Hosted Engine configuration disk uuid into Engine database
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"UPDATE vdc_options SET option_value=
'{{ hostvars[he_ansible_host_name]['he_conf_disk_details']['disk']['id'] }}'
WHERE option_name='HostedEngineConfigurationImageGuid' AND version='general'"
Expand All @@ -39,7 +37,7 @@
- debug: var=db_conf_update
- name: Fetch host SPM_ID
command: >-
{{ scl_pg_prefix }} psql -t -d engine -c
psql -t -d engine -c
"SELECT vds_spm_id FROM vds WHERE vds_name='{{ hostvars[he_ansible_host_name]['he_host_name'] }}'"
environment: "{{ he_cmd_lang }}"
become: true
Expand Down
15 changes: 0 additions & 15 deletions tasks/pg_scl.yml

This file was deleted.

10 changes: 5 additions & 5 deletions tasks/restore_backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- include_tasks: pg_scl.yml
- name: Remove previous hosted-engine VM
command: >-
{{ scl_pg_prefix }} psql -d engine -c "SELECT deletevm(vm_guid) FROM (SELECT vm_guid FROM vms WHERE origin=6) t"
psql -d engine -c "SELECT deletevm(vm_guid) FROM (SELECT vm_guid FROM vms WHERE origin=6) t"
environment: "{{ he_cmd_lang }}"
become: true
become_user: postgres
Expand All @@ -31,7 +31,7 @@
register: db_remove_old_enginevm
- name: Update dynamic data for VMs on the host used to redeploy
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"UPDATE vm_dynamic SET run_on_vds = NULL, status=0 /* Down */ WHERE run_on_vds IN
(SELECT vds_id FROM vds
WHERE upper(vds_unique_id)=upper('{{ hostvars[he_ansible_host_name]['unique_id_out']['stdout_lines']|first }}'))"
Expand All @@ -44,7 +44,7 @@
- debug: var=db_update_host_vms
- name: Update dynamic data for VMs migrating to the host used to redeploy
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"UPDATE vm_dynamic SET migrating_to_vds = NULL, status=0 /* Down */ WHERE migrating_to_vds IN
(SELECT vds_id FROM vds WHERE
upper(vds_unique_id)=upper('{{ hostvars[he_ansible_host_name]['unique_id_out']['stdout_lines']|first }}'))"
Expand All @@ -57,7 +57,7 @@
- debug: var=db_update_host_migrating_vms
- name: Remove host used to redeploy
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"SELECT deletevds(vds_id) FROM
(SELECT vds_id FROM vds WHERE
upper(vds_unique_id)=upper('{{ hostvars[he_ansible_host_name]['unique_id_out']['stdout_lines']|first }}')) t"
Expand All @@ -70,7 +70,7 @@
- debug: var=db_remove_he_host
- name: Rename previous HE storage domain to avoid name conflicts
command: >-
{{ scl_pg_prefix }} psql -d engine -c
psql -d engine -c
"UPDATE storage_domain_static SET
storage_name='{{ he_storage_domain_name }}_old_{{ ansible_date_time.iso8601_basic_short }}' WHERE
storage_name='{{ he_storage_domain_name }}'"
Expand Down

0 comments on commit 5c7f0b7

Please sign in to comment.