Skip to content

Commit

Permalink
use ovirt host upgrade role
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsimcall committed Jun 28, 2018
1 parent acb0b5e commit 8f7dfb4
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 45 deletions.
3 changes: 3 additions & 0 deletions iad.lab/inventory
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
rhdata1
rhdata2
rhdata3

[rhvm]
rhvm-2940.dota-lab.iad.redhat.com
12 changes: 9 additions & 3 deletions iad.lab/rhvm-vault.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
rhvuser: admin@internal
rhvpass: redhat1
rhvurl: https://rhvm-2940.dota-lab.iad.redhat.com/ovirt-engine/api
engine_url: https://rhvm-2940.dota-lab.iad.redhat.com/ovirt-engine/api
engine_user: admin@internal
engine_password: redhat1
engine_cafile: /etc/pki/ovirt-engine/ca.pem

# Define John's old variable names
rhvurl: "{{ engine_url }}"
rhvuser: "{{ engine_user }}"
rhvpass: "{{ engine_password }}"
25 changes: 25 additions & 0 deletions rhv-upgrade-hosts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# sudo ansible-galaxy install oVirt.cluster-upgrade -p /etc/ansible/roles/
# https://github.com/oVirt/ovirt-ansible-cluster-upgrade

---
- name: Upgrade RHV Hosts
hosts: rhvm
vars_files:
- "{{ ansible_domain }}/rhvm-vault.yml"
vars:
cluster_name: Default
check_upgrade: true
reboot_after_upgrade: true
upgrade_timeout: 1200
host_names:
- rhclient2
# host_statuses:
# - up
# - installing
# - install_failed
# - non_operational
# stopped_vms:
# - gluster-win10

roles:
- oVirt.cluster-upgrade
42 changes: 0 additions & 42 deletions rhv_upgrade_hosts.yml

This file was deleted.

25 changes: 25 additions & 0 deletions scratch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
- hosts: rhvm
gather_facts: yes
vars_files:
- "{{ ansible_domain }}/rhvm-vault.yml"

tasks:
- name: Login to RHV
ovirt_auth:
url: "{{ rhvurl }}"
insecure: yes
username: "{{ rhvuser }}"
password: "{{ rhvpass }}"

- ovirt_hosts_facts:
#pattern: name=host* and datacenter=west
pattern: '*'
auth: "{{ ovirt_auth }}"
- debug:
var: ovirt_hosts

- name: Cleanup RHV auth token
ovirt_auth:
ovirt_auth: "{{ ovirt_auth }}"
state: absent

0 comments on commit 8f7dfb4

Please sign in to comment.