"Fossies" - the Fresh Open Source Software Archive

Member "ansible-6.1.0/ansible_collections/ovirt/ovirt/roles/hosted_engine_setup/tasks/create_target_vm/02_engine_vm_configuration.yml" (9 Jun 2022, 3254 Bytes) of package /linux/misc/ansible-6.1.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "02_engine_vm_configuration.yml": 5.9.0_vs_6.0.0.

    1 ---
    2 - name: Engine VM configuration tasks
    3   block:
    4   - name: Create a temporary directory for ansible as postgres user
    5     file:
    6       path: /var/lib/pgsql/.ansible/tmp
    7       state: directory
    8       owner: postgres
    9       group: postgres
   10       mode: 0700
   11   - name: Update target VM details at DB level
   12     command: >-
   13       "{{ engine_psql }}" -c
   14       "UPDATE vm_static SET {{ item.field }}={{ item.value }} WHERE
   15       vm_guid='{{ hostvars[he_ansible_host_name]['he_vm_details']['vm']['id'] }}'"
   16     environment: "{{ he_cmd_lang }}"
   17     changed_when: true
   18     register: db_vm_update
   19     with_items:
   20       - {field: 'origin', value: 6}
   21   - name: Insert Hosted Engine configuration disk uuid into Engine database
   22     command: >-
   23       "{{ engine_psql }}" -c
   24       "UPDATE vdc_options SET option_value=
   25       '{{ hostvars[he_ansible_host_name]['he_conf_disk_details']['disk']['id'] }}'
   26       WHERE option_name='HostedEngineConfigurationImageGuid' AND version='general'"
   27     environment: "{{ he_cmd_lang }}"
   28     changed_when: true
   29     register: db_conf_update
   30   - name: Fetch host SPM_ID
   31     command: >-
   32       "{{ engine_psql }}" -t -c
   33       "SELECT vds_spm_id FROM vds WHERE vds_name='{{ hostvars[he_ansible_host_name]['he_host_name'] }}'"
   34     environment: "{{ he_cmd_lang }}"
   35     changed_when: true
   36     register: host_spm_id_out
   37   - name: Parse host SPM_ID
   38     set_fact: host_spm_id="{{ host_spm_id_out.stdout_lines|first|trim }}"
   39   - name: Restore original DisableFenceAtStartupInSec
   40     shell: "engine-config -s DisableFenceAtStartupInSec=$(cat /root/DisableFenceAtStartupInSec.txt)"
   41     environment: "{{ he_cmd_lang }}"
   42     changed_when: true
   43     when: he_restore_from_file is defined and he_restore_from_file
   44   - name: Remove DisableFenceAtStartupInSec temporary file
   45     file:
   46       path: /root/DisableFenceAtStartupInSec.txt
   47       state: absent
   48     when: he_restore_from_file is defined and he_restore_from_file
   49   - name: Restore original OvfUpdateIntervalInMinutes
   50     shell: "engine-config -s OvfUpdateIntervalInMinutes=$(cat /root/OvfUpdateIntervalInMinutes.txt)"
   51     environment: "{{ he_cmd_lang }}"
   52     changed_when: true
   53   - name: Remove OvfUpdateIntervalInMinutes temporary file
   54     file:
   55       path: /root/OvfUpdateIntervalInMinutes.txt
   56       state: absent
   57     changed_when: true
   58   - name: Restore original SSO_ALTERNATE_ENGINE_FQDNS
   59     block:
   60       - name: Removing temporary value
   61         lineinfile:
   62           path: /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
   63           regexp: '^SSO_ALTERNATE_ENGINE_FQDNS=.* # hosted-engine-setup'
   64           state: absent
   65       - name: Restoring original value
   66         replace:
   67           path: /etc/ovirt-engine/engine.conf.d/11-setup-sso.conf
   68           regexp: '^#(SSO_ALTERNATE_ENGINE_FQDNS=.*) # pre hosted-engine-setup'
   69           replace: '\1'
   70   - name: Remove temporary directory for ansible as postgres user
   71     file:
   72       path: /var/lib/pgsql/.ansible
   73       state: absent
   74   - name: Configure PermitRootLogin for sshd to its final value
   75     lineinfile:
   76       dest: /etc/ssh/sshd_config
   77       regexp: "^\\s*PermitRootLogin"
   78       line: "PermitRootLogin {{ he_root_ssh_access }}"
   79       state: present
   80   - name: Clean cloud-init configuration
   81     include_tasks: ../clean_cloud_init_config.yml