Skip to content

Commit

Permalink
Add engine-config role (#49)
Browse files Browse the repository at this point in the history
Fix #49
  • Loading branch information
lukas-bednar authored and StLuke committed Aug 23, 2016
1 parent ba55567 commit 9563af3
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
63 changes: 63 additions & 0 deletions roles/ovirt-engine-config/README.md
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]
13 changes: 13 additions & 0 deletions roles/ovirt-engine-config/meta/main.yml
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
35 changes: 35 additions & 0 deletions roles/ovirt-engine-config/tasks/main.yml
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

0 comments on commit 9563af3

Please sign in to comment.