-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
oVirt engine config | ||
=================== | ||
|
||
This role allows tune installed engine using ``engine-config`` CLI tool. | ||
|
||
|
||
Requirements | ||
------------ | ||
|
||
oVirt installed and running. | ||
|
||
|
||
Role Variables | ||
-------------- | ||
|
||
You can specify options one by one. | ||
|
||
``` | ||
ovirt_engine_config: | ||
- | ||
key: "option name" | ||
value: "option value" | ||
version: desired-version | ||
``` | ||
|
||
Or specify set of options in property file. | ||
This way is preferable when you want to set passwords. | ||
|
||
``` | ||
ovirt_engine_config_property_file: "properties content" | ||
``` | ||
|
||
|
||
Dependencies | ||
------------ | ||
|
||
None | ||
|
||
|
||
Example Playbook | ||
---------------- | ||
|
||
```yaml | ||
--- | ||
hosts: engine | ||
remote_user: root | ||
vars: | ||
ovirt_engine_config: | ||
- | ||
key: "EnableMACAntiSpoofingFilterRules" | ||
value: false | ||
version: "general" | ||
roles: | ||
- | ||
role: "ovirt_engine_config" | ||
``` | ||
Author Information | ||
------------------ | ||
Lukas Bednar | ||
[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
galaxy_info: | ||
author: "Lukas Bednar" | ||
description: "oVirt engine config tool" | ||
company: "Red Hat" | ||
license: "GPLv3" | ||
min_ansible_version: 1.9 | ||
platforms: | ||
- name: EL | ||
versions: | ||
- all | ||
galaxy_tags: | ||
- installer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
- name: Tune oVirt engine with engine-config, version specific | ||
shell: "engine-config -s {{ item.key }}='{{ item.value }}' --cver={{ item.version }}" | ||
with_items: "{{ ovirt_engine_config | list }}" | ||
when: ovirt_engine_config is defined and item.version != "general" | ||
|
||
- name: Tune oVirt engine with engine-config, regardless version | ||
shell: "engine-config -s {{ item.key }}='{{ item.value }}'" | ||
with_items: "{{ ovirt_engine_config | list }}" | ||
when: ovirt_engine_config is defined and item.version == "general" | ||
|
||
- name: Copy property file to engine | ||
copy: | ||
content: "{{ ovirt_engine_config_property_file }}" | ||
dest: "/tmp/ovirt_engine_config.properties" | ||
when: ovirt_engine_config_property_file is defined | ||
|
||
- name: Tune oVirt engine with engine-config; from property file | ||
shell: "engine-config --properties=/tmp/ovirt_engine_config.properties" | ||
when: ovirt_engine_config_property_file is defined | ||
|
||
# oVirt engine restart is required | ||
- name: restart of ovirt-engine service | ||
service: | ||
name: ovirt-engine | ||
state: restarted | ||
|
||
- name: check health status of page | ||
uri: | ||
url: "http://localhost/ovirt-engine/services/health" | ||
status_code: 200 | ||
register: health_page | ||
retries: 12 | ||
delay: 10 | ||
until: health_page|success |