Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.

Commit 6ae6e22

Browse files
fabiendupontnyoxi
authored andcommitted
Continue refactoring role for UCI
1 parent 3d69dad commit 6ae6e22

File tree

6 files changed

+11
-69
lines changed

6 files changed

+11
-69
lines changed

Diff for: ansible/manageiq.v2v-conversion-host/tasks/check-transport-vddk-facts.yml

+1-17
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,6 @@
55
ignore_errors: "yes"
66
register: stat_vddk_library
77

8-
- name: Stat VDDK nbdkit plugin
9-
stat:
10-
path: "/usr/lib64/nbdkit/plugins/nbdkit-vddk-plugin.so"
11-
ignore_errors: "yes"
12-
register: stat_nbdkit_plugin
13-
14-
- name: Check if VDDK nbdkit plugin works
15-
command: nbdkit --dump-plugin vddk
16-
environment:
17-
LD_LIBRARY_PATH: "{{ v2v_vddk_install_dir }}/vmware-vix-disklib-distrib/lib64"
18-
ignore_errors: "yes"
19-
register: command_nbdkit_plugin
20-
changed_when: false
21-
22-
- name: Set VDDK and nbdkit facts
8+
- name: Set VDDK facts
239
set_fact:
2410
v2v_vddk_library_installed: "{{ stat_vddk_library.stat.exists }}"
25-
v2v_nbdkit_plugin_installed: "{{ stat_nbdkit_plugin.stat.exists }}"
26-
v2v_nbdkit_plugin_working: "{{ command_nbdkit_plugin.rc == 0 }}"

Diff for: ansible/manageiq.v2v-conversion-host/tasks/check-transport-vddk.yml

-10
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,3 @@
55
assert:
66
that: "{{ v2v_vddk_library_installed }}"
77
msg: "VDDK library is not installed"
8-
9-
- name: Assert that VDDK nbdkit plugin is installed
10-
assert:
11-
that: "{{ v2v_nbdkit_plugin_installed }}"
12-
msg: "VDDK nbdkit plugin is not installed"
13-
14-
- name: Assert that VDDK nbdkit plugin test succeeded
15-
assert:
16-
that: "{{ v2v_nbdkit_plugin_working }}"
17-
msg: "VDDK nbdkit plugin failed validation"
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,31 @@
11
---
2-
- name: Set facts ssh_config_path, ssh_config_owner
3-
set_fact:
4-
ssh_config_path: "/var/lib/vdsm/.ssh"
5-
ssh_config_owner: "vdsm"
6-
ssh_config_group: "kvm"
7-
when:
8-
- "v2v_host_type == 'rhevm'"
9-
10-
- name: Set facts ssh_config_path, ssh_config_owner
11-
set_fact:
12-
ssh_config_path: "/root/.ssh"
13-
ssh_config_owner: "root"
14-
ssh_config_group: "root"
15-
when:
16-
- "v2v_host_type == 'openstack'"
17-
182
- name: Look for existing SSH private key file
193
stat:
20-
path: "{{ ssh_config_path }}/id_rsa"
4+
path: "/root/.ssh/id_rsa"
215
ignore_errors: "yes"
226
register: stat_ssh_key
237

248
- block:
259
- name: Check var v2v_ssh_private_key
2610
fail:
27-
msg: "No file named '{{ ssh_config_path }}/id_rsa' found and no 'v2v_ssh_private_key' variable set"
11+
msg: "No file named '/root/.ssh/id_rsa' found and no 'v2v_ssh_private_key' variable set"
2812
when:
2913
- "v2v_ssh_private_key is not defined"
3014

3115
- name: Create .ssh directory
3216
file:
33-
path: "{{ ssh_config_path }}"
34-
owner: "{{ ssh_config_owner }}"
35-
group: "{{ ssh_config_group }}"
17+
path: "/root/.ssh"
18+
owner: "root"
19+
group: "root"
3620
mode: 0700
3721
state: directory
3822

3923
- name: Create the SSH private key file
4024
copy:
41-
dest: "{{ ssh_config_path }}/id_rsa"
25+
dest: "/root/.ssh/id_rsa"
4226
content: "{{ v2v_ssh_private_key }}"
43-
owner: "{{ ssh_config_owner }}"
27+
owner: "root"
28+
group: "root"
4429
mode: 0600
4530

4631
when: not stat_ssh_key.stat.exists

Diff for: ansible/manageiq.v2v-conversion-host/tasks/install-transport-vddk.yml

+1-8
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,4 @@
2828
remote_src: true
2929

3030
when:
31-
- not v2v_vddk_library_installed or
32-
not v2v_nbdkit_plugin_installed or
33-
not v2v_nbdkit_plugin_working
34-
35-
- name: Make sure VDDK plugin is installed
36-
yum:
37-
state: "{{ v2v_yum_check }}"
38-
name: nbdkit-plugin-vddk
31+
- not v2v_vddk_library_installed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
---
2-
- name: Set facts ssh_config_path, ssh_config_owner
3-
set_fact:
4-
ssh_config_path: "/root/.ssh"
5-
ssh_config_owner: "root"
6-
72
- name: Delete SSH private key file for VMware host
83
file:
9-
path: "{{ ssh_config_path }}/id_rsa"
4+
path: "/root/.ssh/id_rsa"
105
state: absent
116
when:
127
- "v2v_ssh_private_key is defined"
13-
- "ssh_config_path is defined"

Diff for: docs/Ansible.md

-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@ to be changed.
66

77
| Variable | Default value | Description |
88
| ----------------------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------- |
9-
| v2v_host_type | | Platform where the conversion host is deployed. Valid values: `rhevm`, `openstack`. |
109
| v2v_transport_method | | Transport method to configure on the conversion host. Valid values: `vddk`, 'ssh`. |
1110
| v2v_vddk_package_url | | URL to the VDDK library package. |
1211
| v2v_vddk_override | false | Normally the install role is not run if the plugin is already installed. To force the deployment set this variable to `true`. |
1312
| v2v_ssh_private_key | | The private key to use to connect to the VMware host. |
1413
| v2v_ca_bundle | | A bundle of CA certificates to allow connection to the provider where the conversion host belongs. See below for value. |
1514
| v2v_checks_override | false | The install role does performs some compatibility checks. By setting `v2v_checks_override` to `true` one can disable them. |
16-
| v2v_yum_check | latest | Can be used to change the requirement on installed packages. Normally we check if the installed packages are at the latest version. This can cause troubles on disconnected or unconfigured systems. In that case the check can be ... by setting the value to `present`. (Since 1.7) |
1715

1816
## CA Bundle
1917

@@ -32,10 +30,8 @@ all:
3230
vars:
3331
hosts:
3432
chost1.example.com:
35-
v2v_host_type: rhevm
3633
v2v_transport_method: vddk
3734
chost2.example.com:
38-
v2v_host_type: openstack
3935
v2v_transport_method: ssh
4036
vars:
4137
v2v_vddk_package_url: "http://content.example.com/VMware-vix-disklib-6.5.2-6195444.x86_64.tar.gz"

0 commit comments

Comments
 (0)