Skip to content
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

Modified playbooks as per hosted_engine_setup role #63

Merged
merged 3 commits into from Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion playbooks/hc-ansible-deployment/gluster_inventory.yml
@@ -1,4 +1,4 @@
hc-nodes:
hc_nodes:
hosts:
# Host1
host1:
Expand Down
3 changes: 2 additions & 1 deletion playbooks/hc-ansible-deployment/he_gluster_vars.json
Expand Up @@ -12,5 +12,6 @@
"he_storage_domain_addr": "host1",
"he_mount_options": "backup-volfile-servers=host2:host3",
"he_bridge_if": "interface name for bridge creation",
"he_enable_hc_gluster_service": true
"he_enable_hc_gluster_service": true,
"he_mem_size_MB": "4096"
}
44 changes: 22 additions & 22 deletions playbooks/hc-ansible-deployment/tasks/add_hosts_storage_domains.yml
Expand Up @@ -18,31 +18,31 @@
async: 50
poll: 0
ignore_errors: true
ovirt_hosts:
cluster: Default
name: "{{ host }}"
address: "{{ host }}"
state: present
public_key: true
auth: "{{ ovirt_auth }}"
hosted_engine: deploy
with_items: "{{ groups['gluster'] }}"
ovirt_host:
cluster: "{{ he_cluster }}"
name: "{{ host }}"
address: "{{ host }}"
state: present
public_key: true
auth: "{{ ovirt_auth }}"
hosted_engine: deploy
with_items: "{{ gluster.hosts }}"
loop_control:
loop_var: host
when: "'gluster' in groups"
loop_var: host
when: "gluster is defined and 'hosts' in gluster"

- name: "Add additional glusterfs storage domains"
ignore_errors: true
ovirt_storage_domains:
name: "{{ sd.name }}"
host: "{{ he_host_name }}"
auth: "{{ ovirt_auth }}"
data_center: "{{ datacenter_name }}"
glusterfs:
address: "{{ he_storage_domain_addr }}"
mount_options: "{{ sd.mount_options }}"
path: "{{ sd.path }}"
with_items: "{{ hostvars[groups['gluster'][0]]['storage_domains'] }}"
ovirt_storage_domain:
name: "{{ sd.name }}"
host: "{{ he_host_name }}"
auth: "{{ ovirt_auth }}"
data_center: "{{ datacenter_name }}"
glusterfs:
address: "{{ he_storage_domain_addr }}"
mount_options: "{{ sd.mount_options }}"
path: "{{ sd.path }}"
with_items: "{{ gluster.vars.storage_domains }}"
loop_control:
loop_var: sd
when: "'gluster' in groups"
when: "gluster is defined and 'hosts' in gluster and 'vars' in gluster"
3 changes: 2 additions & 1 deletion playbooks/hc-ansible-deployment/tasks/gluster_cleanup.yml
@@ -1,8 +1,9 @@
---
- name: Remove gluster setup
hosts: hc-nodes
hosts: hc_nodes
remote_user: root
gather_facts: False
ignore_errors: True
tasks:
- name: Delete the volumes
gluster_volume:
Expand Down
Expand Up @@ -2,7 +2,7 @@

# Gluster deployment start here
- name: Setup backend and deploy HCI
hosts: hc-nodes
hosts: hc_nodes
remote_user: root
gather_facts: no
any_errors_fatal: true
Expand Down
71 changes: 2 additions & 69 deletions playbooks/hc-ansible-deployment/tasks/he_deployment.yml
@@ -1,74 +1,7 @@
---
- name: Install packages and bootstrap local engine VM
- name: Deploy oVirt hosted engine
hosts: localhost
connection: local
vars:
he_install_packages: true
he_pre_checks: true
he_initial_clean: true
he_bootstrap_local_vm: true
ovirt_repositories_ovirt_release_rpm: "{{ ovirt_repo_release_rpm }}"
roles:
- role: oVirt.repositories
when: ovirt_repo_release_rpm is defined
- role: oVirt.hosted-engine-setup

- name: Local engine VM installation - Pre tasks
hosts: engine
vars:
he_bootstrap_pre_install_local_engine_vm: true
roles:
- role: oVirt.hosted-engine-setup

- name: Engine Setup on local VM
hosts: engine
no_log: True
vars:
ovirt_engine_setup_hostname: "{{ he_fqdn.split('.')[0] }}"
ovirt_engine_setup_organization: "{{ he_cloud_init_domain_name }}"
ovirt_engine_setup_dwh_db_host: "{{ he_fqdn.split('.')[0] }}"
ovirt_engine_setup_firewall_manager: null
ovirt_engine_setup_answer_file_path: /root/ovirt-engine-answers
ovirt_engine_setup_use_remote_answer_file: True
ovirt_engine_setup_accept_defaults: True
ovirt_engine_setup_update_all_packages: false
ovirt_engine_setup_offline: true
# Please ensure to encrypt `he_admin_password` variable using ansible-vault
ovirt_engine_setup_admin_password: "{{ he_admin_password }}"
roles:
- role: oVirt.engine-setup

- name: Local engine VM installation - Post tasks
hosts: engine
vars:
he_bootstrap_post_install_local_engine_vm: true
roles:
- role: oVirt.hosted-engine-setup

- name: Configure engine VM on a shared storage domain
hosts: localhost
connection: local
vars:
he_bootstrap_local_vm_add_host: true
he_create_storage_domain: true
he_create_target_vm: true
roles:
- role: oVirt.hosted-engine-setup

- name: Configure database settings
hosts: engine
vars:
he_engine_vm_configuration: true
roles:
- role: oVirt.hosted-engine-setup

- name: Closeup
hosts: localhost
connection: local
vars:
he_final_tasks: true
he_final_clean: true
roles:
- role: oVirt.hosted-engine-setup
- role: ovirt.hosted_engine_setup

- include: add_hosts_storage_domains.yml