New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote dwh fresh engine install #137

Merged
merged 19 commits into from Aug 28, 2017
Commits
File filter...
Filter file types
Jump to file or symbol
Failed to load files and symbols.
+102 −8
Diff settings

Always

Just for now

[3vmsetup] Added dwhservice playbook

DONE
====
- Completed the feature of adding the remaining role for remote dwh
  where there is a 3 VM setup.
- Added docs documenting the process

TODO
====
- work on upgrade tests playbook
  • Loading branch information...
tasdikrahman committed Aug 4, 2017
commit 8dd39bdd46e1a73e9ccf8d09bf7e96de2f3d38cc
@@ -72,7 +72,7 @@ After which you have to configure your remote DWH installation to the previous h
ovirt_engine_db_host: 'dwhmanualenginetest.ovirt.org' # FQDN of the ovirt-engine installation host, should be resolvable from the new DWH host
ovirt_engine_host_fqdn: 'dwhmanualenginetest.ovirt.org'
ovirt_engine_dwh_db_host: 'localhost'
ovirt_dwh_on_dwh: True
ovirt_engine_history_db_on_dwhservice_host: True
roles:
- role: ovirt-common
- role: ovirt-engine-install-packages
@@ -151,7 +151,33 @@ $ ansible-playbook site.yml -i inventory

Now VM which hosts the `dwhservice` needs to be setup.

TODO
```yaml
---
- hosts: dwhservice
vars:
ovirt_engine_type: 'ovirt-engine'
ovirt_engine_version: '4.1'
ovirt_rpm_repo: 'http://resources.ovirt.org/pub/yum-repo/ovirt-release41.rpm'
ovirt_engine_host_root_passwd: 'pycon2017' # the root password of the host where ovirt-engine is installed
ovirt_engine_firewall_manager: 'firewalld'
ovirt_engine_host_fqdn: 'testengine.ovirt.org' # FQDN of the ovirt-engine installation host, should be resolvable from the new DWH host
ovirt_engine_db_host: 'testengine.ovirt.org'
ovirt_engine_dwh_db_host: 'testdwhdb.ovirt.org'
ovirt_engine_dwh_db_password: 'password'
ovirt_engine_history_db_on_dwhservice_host: False
roles:
- role: ovirt-common
- role: ovirt-engine-install-packages
- role: ovirt-engine-remote-dwh-setup
```

Running this would be

```bash
$ ansible-playbook site.yml -i inventory --skip-tags skip_yum_install_ovirt_engine,skip_yum_install_ovirt_engine_dwh -vvv
```

Now restart `ovirt-engine` in VM A by doing a `systemctl restart ovirt-engine`

This will setup your ovirt-engine setup ready for the incoming remote DWH installation setup

@@ -1,9 +1,17 @@
---
- name: check PostgreSQL service
service:
name: postgresql
state: started
register: postgresql_status
ignore_errors: True

- name: install postgresql
yum:
name: postgresql-server
state: installed
update_cache: yes
when: postgresql_status|failed

- name: Check if the db is initialized
stat:
@@ -12,12 +20,13 @@

- name: Initialize the postgresql db
command: su -l postgres -c "/usr/bin/initdb --locale=en_US.UTF8 --auth='ident' --pgdata=/var/lib/pgsql/data/"
when: db_initialised.stat.isdir is not defined
when: postgresql_status|failed

- name: Start postgresql.service
systemd:
state: started
name: postgresql
when: postgresql_status|failed

- name: creating directory for sql scripts in /tmp/ansible-sql
file:
@@ -11,18 +11,27 @@
ignore_errors: True

# copy dwh on dwh answer file
- name: copy default answerfile
# this answerfile results in a 2 VM setup where
# VM 1: holds engine and it's `engine` DB instance
# and VM 2: which holds dwh service and it's `ovirt_engine_history` DB
- name: copy answerfile for `ovirt_engine_history` db to be on dwhservice VM
template:
src: answerfile_{{ ovirt_engine_version }}_dwh_on_dwh.txt.j2
src: answerfile_{{ ovirt_engine_version }}_ovirt_engine_history_db_on_dwhservice_host.txt.j2
dest: /tmp/answerfile.txt
mode: 0644
owner: root
group: root
when: ovirt_dwh_on_dwh == True
when: ovirt_engine_history_db_on_dwhservice_host == True

# TODO
# ====
# - case where the database of dwh on 3rd machine
- name: copy answerfile for `ovirt_engine_history` db to be on remote VM and not on dwhservice VM
template:
src: answerfile_{{ ovirt_engine_version }}_ovirt_engine_history_db_not_on_dwhservice_host.txt.j2
dest: /tmp/answerfile.txt
mode: 0644
owner: root
group: root
when: ovirt_engine_history_db_on_dwhservice_host == False

- name: run engine-setup with answerfile
shell: 'engine-setup --config-append=/tmp/answerfile.txt'
@@ -78,4 +87,9 @@
until: ovirt_engine_status|success
ignore_errors: True

- name: Restart `ovirt-engine-dwhd` service
service:
name: ovirt-engine-dwhd
state: restarted

- debug: msg='Restart ovirt-engine on the remote host by doing a `service ovirt-engine restart`'
@@ -0,0 +1,45 @@
# action=setup
[environment:default]
OVESETUP_DIALOG/confirmSettings=bool:True
OVESETUP_CONFIG/remoteEngineSetupStyle=str:auto_ssh
OVESETUP_CONFIG/remoteEngineHostRootPassword=str:{{ovirt_engine_host_root_passwd}}
OVESETUP_CONFIG/firewallChangesReview=none:None
{% if ovirt_engine_firewall_manager %}
OVESETUP_CONFIG/updateFirewall=bool:True
OVESETUP_CONFIG/firewallManager=str:{{ovirt_engine_firewall_manager}}
{% else %}
OVESETUP_CONFIG/updateFirewall=bool:False
OVESETUP_CONFIG/firewallManager=none:None
{% endif %}
OVESETUP_CONFIG/remoteEngineHostSshPort=int:22
OVESETUP_CONFIG/fqdn=str:{{ansible_fqdn}}
OSETUP_RPMDISTRO/requireRollback=none:None
OSETUP_RPMDISTRO/enableUpgrade=none:None
OVESETUP_APACHE/configureSsl=none:None
OVESETUP_DB/secured=bool:False
OVESETUP_DB/user=str:{{ovirt_engine_db_user}}
OVESETUP_DB/password=str:{{ovirt_engine_db_password}}
OVESETUP_DB/database=str:{{ovirt_engine_db_name}}
OVESETUP_DB/host=str:{{ovirt_engine_db_host}}
OVESETUP_DB/port=str:{{ovirt_engine_db_port}}
OVESETUP_DB/securedHostValidation=bool:False
OVESETUP_ENGINE_CORE/enable=none:None
OVESETUP_DWH_CORE/enable=bool:True
OVESETUP_DWH_CONFIG/scale=str:2
OVESETUP_DWH_CONFIG/dwhDbBackupDir=str:/var/lib/ovirt-engine-dwh/backups
OVESETUP_DWH_DB/secured=bool:False
OVESETUP_DWH_DB/restoreBackupLate=bool:True
OVESETUP_DWH_DB/disconnectExistingDwh=none:None
OVESETUP_DWH_DB/host=str:{{ovirt_engine_dwh_db_host}}
OVESETUP_DWH_DB/user=str:{{ovirt_engine_dwh_db_user}}
OVESETUP_DWH_DB/password=str:{{ovirt_engine_dwh_db_password}}
OVESETUP_DWH_DB/dumper=str:pg_custom
OVESETUP_DWH_DB/database=str:{{ovirt_engine_dwh_db_name}}
OVESETUP_DWH_DB/performBackup=none:None
OVESETUP_DWH_DB/port=str:{{ovirt_engine_dwh_db_port}}
OVESETUP_DWH_DB/filter=none:None
OVESETUP_DWH_DB/restoreJobs=int:2
OVESETUP_DWH_DB/securedHostValidation=bool:False
OVESETUP_DWH_PROVISIONING/postgresProvisioningEnabled=none:None
OVESETUP_ENGINE_CONFIG/fqdn=str:{{ovirt_engine_host_fqdn}}
OVESETUP_DWH_PROVISIONING/postgresProvisioningEnabled=bool:False
ProTip! Use n and p to navigate between commits in a pull request.