Skip to content

Commit

Permalink
Merge pull request ansible#1024 from cloin/win-tests
Browse files Browse the repository at this point in the history
Windows workshop integration tests
  • Loading branch information
cloin authored Nov 18, 2020
2 parents 3be062e + cbf7326 commit 6ed8de0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions provisioner/tests/windows_verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
- name: Check each student environment
hosts: all
gather_facts: true

tasks:
- name: Control host
block:
- name: Check if ansible is installed
package_facts:

- name: Fail if ansible is not of a recent enough version
fail:
msg: "Ansible is not of a recent enough version on {{ inventory_hostname }}."
when: ((ansible_facts.packages['ansible'][0]['version'] is not defined) or (ansible_facts.packages['ansible'][0]['version']|string) is version("2.9.0",'<'))

- name: Test access by exporting assets
tower_receive:
inventory:
- all
tower_host: "{{ inventory_hostname|regex_replace('-ansible-1', '') }}.{{ workshop_name }}.rhdemo.io"
tower_username: admin
tower_password: "{{ tower_password }}"
register: export_assets
until: export_assets is success
delay: 3
retries: 60

- name: Check for local project directory
file:
path: /home/student1/windows-workshop/workshop_project/
state: directory
become: true
become_user: student1
check_mode: true
register: project_stat
failed_when:
- project_stat.changed == true

when: '"ansible-1" in inventory_hostname'

0 comments on commit 6ed8de0

Please sign in to comment.