Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #31 from oVirt/master-post-branch
Browse files Browse the repository at this point in the history
Rebase on ansible 2.9
  • Loading branch information
sandrobonazzola committed Mar 6, 2020
2 parents d250a07 + ff50caa commit 04aaf48
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sudo: required
language: python
python:
- "2.7"
- "3.6"

services:
- docker
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Possible improvements are tracked here: https://bugzilla.redhat.com/1609029
Requirements
------------

* Ansible version 2.6 or higher
* Ansible version 2.9 or higher
* Python SDK version 4.2 or higher

Dependencies
Expand Down
2 changes: 1 addition & 1 deletion automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distros:
- el7
- el8
release_branches:
master: [ "ovirt-master", "ovirt-4.3" ]
master: ovirt-master
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="1.0.5"
VERSION="1.1.0"
MILESTONE=master
RPM_RELEASE="0.0.$MILESTONE.$(date -u +%Y%m%d%H%M%S)"

Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ galaxy_info:

license: Apache License 2.0

min_ansible_version: 2.7
min_ansible_version: 2.9

platforms:
- name: EL
Expand Down
2 changes: 1 addition & 1 deletion ovirt-ansible-shutdown-env.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Group: Virtualization/Management
BuildArch: noarch
Url: http://www.ovirt.org

Requires: ansible >= 2.7
Requires: ansible >= 2.9

%description
This Ansible role provide funtionality to perform a clean and ordered shutdown of all the entities (vms, hosts)
Expand Down
10 changes: 6 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@
hosted-engine --set-maintenance --mode=none
- name: Get VM list
ovirt_vm_facts:
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
all_content: true
register: vm_result

- block:
- name: Shutdown all VMs, except HostedEngine
Expand All @@ -99,13 +100,14 @@
wait: true
when: "item.origin != 'managed_hosted_engine'"
with_items:
- "{{ ovirt_vms }}"
- "{{ vm_result.ovirt_vms }}"
ignore_errors: true

- name: Refresh VM list
ovirt_vm_facts:
ovirt_vm_info:
auth: "{{ ovirt_auth }}"
all_content: true
register: vm_result

- name: Forcefully shutdown remaining VMs, except HostedEngine
ovirt_vm:
Expand All @@ -116,7 +118,7 @@
force: true
when: "item.origin != 'managed_hosted_engine' and item.status != 'down'"
with_items:
- "{{ ovirt_vms }}"
- "{{ vm_result.ovirt_vms }}"

- name: Shutdown hosts, except HE ones, via IPMI (if configured)
ovirt_host:
Expand Down

0 comments on commit 04aaf48

Please sign in to comment.