diff --git a/iad.lab/inventory b/iad.lab/inventory index 64d7050..68b2af7 100644 --- a/iad.lab/inventory +++ b/iad.lab/inventory @@ -1,3 +1,6 @@ rhdata1 rhdata2 rhdata3 + +[rhvm] +rhvm-2940.dota-lab.iad.redhat.com diff --git a/iad.lab/rhvm-vault.yml b/iad.lab/rhvm-vault.yml index c060d9c..83d2244 100644 --- a/iad.lab/rhvm-vault.yml +++ b/iad.lab/rhvm-vault.yml @@ -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 }}" diff --git a/rhv-upgrade-hosts.yml b/rhv-upgrade-hosts.yml new file mode 100644 index 0000000..6ce195f --- /dev/null +++ b/rhv-upgrade-hosts.yml @@ -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 diff --git a/rhv_upgrade_hosts.yml b/rhv_upgrade_hosts.yml deleted file mode 100644 index 3c87628..0000000 --- a/rhv_upgrade_hosts.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -- name: Rolling upgrade of RHV-H nodes - hosts: localhost - gather_facts: yes - vars: - choices: - tasks: - - find: - path: "{{ playbook_dir }}/{{ ansible_domain }}" - pattern: "*-vars.yml" - register: result - - set_fact: - choices: "{{ choices }} {{ item.path | basename }}" - with_items: "{{ result.files }}" - no_log: true - - debug: - msg: "Please choose one of these:{{ choices }}" - - -- hosts: localhost -#- hosts: rhvm - gather_facts: yes - vars_prompt: - - prompt: "Please choose one of the above" - name: input - private: no - vars_files: - - "{{ ansible_domain }}/{{ input }}" - - "{{ ansible_domain }}/rhvm-vault.yml" - - tasks: - - name: Login to RHV - ovirt_auth: - url: "{{ rhvurl }}" - insecure: yes - username: "{{ rhvuser }}" - password: "{{ rhvpass }}" - - - name: Cleanup RHV auth token - ovirt_auth: - ovirt_auth: "{{ ovirt_auth }}" - state: absent diff --git a/scratch.yml b/scratch.yml new file mode 100644 index 0000000..51b5454 --- /dev/null +++ b/scratch.yml @@ -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