summaryrefslogtreecommitdiff
path: root/test/integration/targets/win_psmodule/tasks/main.yml
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2019-11-08 07:40:25 +1000
committerMatt Clay <matt@mystile.com>2019-11-07 13:40:25 -0800
commitab910e1f5a12fbf028d4d70d28dd7ec36427e602 (patch)
tree21c97735035d510cb96f06c983bbf0d60e05be95 /test/integration/targets/win_psmodule/tasks/main.yml
parent0b4b832f9cbab4246ec9aab7bd36c0447e04549d (diff)
downloadansible-ab910e1f5a12fbf028d4d70d28dd7ec36427e602.tar.gz
win_psmodule - remove reliance on PSGallery in the tests for stable-2.7 (#64468)
* win_psmodule - remove reliance on PSGallery in the tests for stable-2.7 * Ignore non-powershell files from sanity check
Diffstat (limited to 'test/integration/targets/win_psmodule/tasks/main.yml')
-rw-r--r--test/integration/targets/win_psmodule/tasks/main.yml47
1 files changed, 24 insertions, 23 deletions
diff --git a/test/integration/targets/win_psmodule/tasks/main.yml b/test/integration/targets/win_psmodule/tasks/main.yml
index 7daa468550..5e094aec40 100644
--- a/test/integration/targets/win_psmodule/tasks/main.yml
+++ b/test/integration/targets/win_psmodule/tasks/main.yml
@@ -1,28 +1,29 @@
-# test code for the win_psmodule module when using winrm connection
-# (c) 2017, Daniele Lazzari <lazzari@mailup.com>
+---
+- name: get PowerShell version of the host
+ win_shell: $PSVersionTable.PSVersion.Major
+ changed_when: False
+ register: ps_version
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+- name: setup and run tests block
+ when: ps_version.stdout | trim | int >= 5
+ block:
+ - name: create temporary directory
+ win_tempfile:
+ state: directory
+ suffix: .test
+ register: remote_tmp_dir
+ notify:
+ - delete temporary directory
+ - name: record temporary directory
+ set_fact:
+ remote_tmp_dir: '{{ remote_tmp_dir.path }}'
-- name: get facts
- setup:
+ - name: update PSGet and PackageManagement for tests
+ include_tasks: install.yml
-- name: Perform integration tests for Powershell 5+
- when: ansible_powershell_version >= 5
- block:
+ - name: setup local PSRepository with test modules
+ include_tasks: repo.yml
- - name: run all tasks
- include: test.yml
+ - name: test win_psmodule
+ include_tasks: test.yml