Skip to content

Commit 3331ced

Browse files
myakovelukas-bednar
authored andcommitted
Add role for set parameters for oVirt ISO uploader isouploader.conf (#107)
1 parent d186193 commit 3331ced

File tree

8 files changed

+121
-0
lines changed

8 files changed

+121
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ This host group is meant for virtual machines hosted by oVirt Engine.
4848
* [ovirt-engine-remote-db]
4949
* [ovirt-engine-setup]
5050
* [ovirt-guest-agent]
51+
* [ovirt-iso-uploader-conf]
5152

5253
## Example
5354

@@ -114,3 +115,4 @@ ansible-playbook tests/test.yml -i tests/inventory
114115
[ovirt-engine-setup]: https://github.com/rhevm-qe-automation/ovirt-ansible/blob/master/roles/ovirt-engine-setup/README.md
115116
[ovirt-guest-agent]: https://github.com/rhevm-qe-automation/ovirt-ansible/blob/master/roles/ovirt-guest-agent/README.md
116117
[provision_docker]: https://github.com/chrismeyersfsu/provision_docker/
118+
[ovirt-iso-uploader-conf]: https://github.com/rhevm-qe-automation/ovirt-ansible/blob/master/roles/ovirt-iso-uploader-conf/README.md
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#### ISO uploader Host Section ####
2+
# Password for SSH connection to host
3+
ansible_ssh_pass=fillme
4+
5+
[iso-uploader-host]
6+
## Host for ISO uploader ##
7+
# Add ip or hostname of machines
8+
192.168.1.1
9+
host.example.com
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# example playbook set ISO uploader username and password
3+
# use with examples/inventory/iso_uploader_conf.inv
4+
- hosts: iso-uploader-host
5+
remote_user: root
6+
roles:
7+
- {role: ovirt-iso-uploader-conf}
+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
ovirt-iso-uploader-conf
2+
=================================================
3+
4+
This role set config variables to oVirt upload ISO config file
5+
6+
Target systems
7+
--------------
8+
9+
* any
10+
11+
Requirements
12+
------------
13+
14+
oVirt repository configured
15+
16+
17+
Role Variables
18+
--------------
19+
20+
```yaml
21+
---
22+
ovirt_iso_uploader_user: username to use with the REST API
23+
ovirt_iso_uploader_password: the oVirt Engine REST API password.
24+
ovirt_iso_uploader_engine: hostname or IP address of the oVirt Engine
25+
ovirt_iso_uploader_cert_file: CA certificate used to validate the engine.
26+
ovirt_iso_uploader_iso_domain: the ISO domain to which the file(s) should be uploaded
27+
ovirt_iso_uploader_nfs_server: the NFS server to which the file(s) should be uploaded.
28+
ovirt_iso_uploader_ssh_user: the SSH user that the program will use for SSH file transfers.
29+
ovirt_iso_uploader_ssh_port: the port to ssh and scp on
30+
ovirt_iso_uploader_key_file: the identity file (private key) to be used for accessing the file server
31+
```
32+
33+
Dependencies
34+
------------
35+
36+
* ovirt-common
37+
38+
39+
Example Playbook
40+
----------------
41+
42+
```yaml
43+
---
44+
- hosts: engine
45+
roles:
46+
- ovirt-iso-uploader-conf
47+
```
48+
49+
50+
Author Information
51+
------------------
52+
53+
Meni Yakove
54+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
ovirt_iso_uploader_conf: '/etc/ovirt-engine/isouploader.conf'
3+
ovirt_iso_uploader_user: 'admin@internal'
4+
ovirt_iso_uploader_password: '123456'
5+
ovirt_iso_uploader_engine: ""
6+
ovirt_iso_uploader_cert_file: ""
7+
ovirt_iso_uploader_iso_domain: ""
8+
ovirt_iso_uploader_nfs_server: ""
9+
ovirt_iso_uploader_ssh_user: ""
10+
ovirt_iso_uploader_ssh_port: ""
11+
ovirt_iso_uploader_key_file: ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
galaxy_info:
3+
author: "Meni Yakove"
4+
description: "Set parameters for ovirt-iso-uploader in isouploader.conf"
5+
company: "Red Hat"
6+
license: "GPLv3"
7+
min_ansible_version: 1.9
8+
platforms:
9+
- name: EL
10+
versions:
11+
- all
12+
galaxy_tags:
13+
- installer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
- name: Make sure that ovirt-iso-uploader installed
3+
yum:
4+
name: "ovirt-iso-uploader"
5+
state: present
6+
7+
- name: Set ovirt-iso-uploader parameters in config file
8+
lineinfile:
9+
dest: "{{ ovirt_iso_uploader_conf }}"
10+
line: "{{ item.key }}={{ item.val }}"
11+
regexp: "^{{ item.key }} *=.*$"
12+
insertafter: EOF
13+
when:
14+
item.val != ""
15+
with_items:
16+
- { key: "user", val: "{{ ovirt_iso_uploader_user }}" }
17+
- { key: "passwd", val: "{{ ovirt_iso_uploader_password }}" }
18+
- { key: "engine", val: "{{ ovirt_iso_uploader_engine }}" }
19+
- { key: "cert-file", val: "{{ ovirt_iso_uploader_cert_file }}" }
20+
- { key: "iso-domain", val: "{{ ovirt_iso_uploader_iso_domain }}" }
21+
- { key: "nfs-server", val: "{{ ovirt_iso_uploader_nfs_server }}" }
22+
- { key: "ssh-user", val: "{{ ovirt_iso_uploader_ssh_user }}" }
23+
- { key: "ssh-port", val: "{{ ovirt_iso_uploader_ssh_port }}" }
24+
- { key: "key-file", val: "{{ ovirt_iso_uploader_key_file }}" }

tests/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
- role: ovirt-engine-install-packages
3939
- role: ovirt-engine-setup
4040
- role: ovirt-engine-config
41+
- role: ovirt-iso-uploader-conf
4142
# - role: ovirt-collect-logs # Issue #102
4243

4344
- name: Run ovirt-engine-cleanup on containerized environments

0 commit comments

Comments
 (0)