mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Initial commit
This commit is contained in:
commit
aebc1b03fd
4861 changed files with 812621 additions and 0 deletions
3
tests/integration/targets/iso_extract/aliases
Normal file
3
tests/integration/targets/iso_extract/aliases
Normal file
|
@ -0,0 +1,3 @@
|
|||
shippable/posix/group1
|
||||
destructive
|
||||
skip/aix
|
BIN
tests/integration/targets/iso_extract/files/test.iso
Normal file
BIN
tests/integration/targets/iso_extract/files/test.iso
Normal file
Binary file not shown.
3
tests/integration/targets/iso_extract/meta/main.yml
Normal file
3
tests/integration/targets/iso_extract/meta/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
|||
dependencies:
|
||||
- prepare_tests
|
||||
- setup_epel
|
66
tests/integration/targets/iso_extract/tasks/7zip.yml
Normal file
66
tests/integration/targets/iso_extract/tasks/7zip.yml
Normal file
|
@ -0,0 +1,66 @@
|
|||
# Test code for the iso_extract module.
|
||||
# (c) 2017, James Tanner <tanner.jc@gmail.com>
|
||||
# (c) 2017, Dag Wieers <dag@wieers.com>
|
||||
|
||||
# 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: Gather facts
|
||||
setup:
|
||||
become: yes
|
||||
|
||||
- name: Include distribution specific variables
|
||||
include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_facts.distribution }}.yml"
|
||||
- "{{ ansible_facts.os_family }}.yml"
|
||||
- default.yml
|
||||
paths:
|
||||
- "{{ role_path }}/vars"
|
||||
|
||||
- name: "{{ ansible_facts.os_family | upper }} | Install 7zip package"
|
||||
action: "{{ ansible_facts.pkg_mgr }}"
|
||||
args:
|
||||
name: "{{ iso_extract_7zip_package }}"
|
||||
state: present
|
||||
when: ansible_facts.distribution != 'MacOSX'
|
||||
|
||||
- name: macOS
|
||||
when: ansible_facts.distribution == 'MacOSX'
|
||||
block:
|
||||
- name: MACOS | Find brew binary
|
||||
command: which brew
|
||||
register: brew_which
|
||||
when: ansible_distribution in ['MacOSX']
|
||||
|
||||
- name: MACOS | Get owner of brew binary
|
||||
stat:
|
||||
path: "{{ brew_which.stdout }}"
|
||||
register: brew_stat
|
||||
when: ansible_distribution in ['MacOSX']
|
||||
|
||||
- name: MACOS | Install 7zip package
|
||||
homebrew:
|
||||
name: p7zip
|
||||
state: present
|
||||
update_homebrew: no
|
||||
become: yes
|
||||
become_user: "{{ brew_stat.stat.pw_name }}"
|
||||
# Newer versions of brew want to compile a package which takes a long time. Do not upgrade homebrew until a
|
||||
# proper solution can be found
|
||||
environment:
|
||||
HOMEBREW_NO_AUTO_UPDATE: True
|
43
tests/integration/targets/iso_extract/tasks/main.yml
Normal file
43
tests/integration/targets/iso_extract/tasks/main.yml
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Test code for the iso_extract module.
|
||||
# (c) 2017, James Tanner <tanner.jc@gmail.com>
|
||||
# (c) 2017, Dag Wieers <dag@wieers.com>
|
||||
|
||||
# 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/>.
|
||||
|
||||
- set_fact:
|
||||
output_dir_test: '{{ output_dir }}/test_iso_extract'
|
||||
|
||||
- name: Install 7zip
|
||||
import_tasks: 7zip.yml
|
||||
|
||||
- name: Prepare environment
|
||||
import_tasks: prepare.yml
|
||||
|
||||
- name: Test in normal mode
|
||||
import_tasks: tests.yml
|
||||
vars:
|
||||
in_check_mode: no
|
||||
|
||||
- name: Prepare environment
|
||||
import_tasks: prepare.yml
|
||||
|
||||
- name: Test in check-mode
|
||||
import_tasks: tests.yml
|
||||
vars:
|
||||
in_check_mode: yes
|
||||
check_mode: yes
|
||||
|
||||
# FIXME - fill this in after figuring out how to allow mounts
|
33
tests/integration/targets/iso_extract/tasks/prepare.yml
Normal file
33
tests/integration/targets/iso_extract/tasks/prepare.yml
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Test code for the iso_extract module.
|
||||
# (c) 2017, James Tanner <tanner.jc@gmail.com>
|
||||
# (c) 2017, Dag Wieers <dag@wieers.com>
|
||||
|
||||
# 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: Make sure our testing sub-directory does not exist
|
||||
file:
|
||||
path: '{{ output_dir_test }}'
|
||||
state: absent
|
||||
|
||||
- name: Create our testing sub-directory
|
||||
file:
|
||||
path: '{{ output_dir_test }}'
|
||||
state: directory
|
||||
|
||||
- name: copy the iso to the test dir
|
||||
copy:
|
||||
src: test.iso
|
||||
dest: '{{ output_dir_test }}'
|
52
tests/integration/targets/iso_extract/tasks/tests.yml
Normal file
52
tests/integration/targets/iso_extract/tasks/tests.yml
Normal file
|
@ -0,0 +1,52 @@
|
|||
# Test code for the iso_extract module.
|
||||
# (c) 2017, James Tanner <tanner.jc@gmail.com>
|
||||
# (c) 2017, Dag Wieers <dag@wieers.com>
|
||||
|
||||
# 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: Extract the iso
|
||||
iso_extract:
|
||||
image: '{{ output_dir_test }}/test.iso'
|
||||
dest: '{{ output_dir_test }}'
|
||||
files:
|
||||
- 1.txt
|
||||
- 2.txt
|
||||
register: iso_extract_test0
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- iso_extract_test0 is changed == true
|
||||
|
||||
- name: Extract the iso again
|
||||
iso_extract:
|
||||
image: '{{ output_dir_test }}/test.iso'
|
||||
dest: '{{ output_dir_test }}'
|
||||
files:
|
||||
- 1.txt
|
||||
- 2.txt
|
||||
register: iso_extract_test0_again
|
||||
|
||||
- name: Test iso_extract_test0_again (normal mode)
|
||||
assert:
|
||||
that:
|
||||
- iso_extract_test0_again is changed == false
|
||||
when: not in_check_mode
|
||||
|
||||
- name: Test iso_extract_test0_again (check-mode)
|
||||
assert:
|
||||
that:
|
||||
- iso_extract_test0_again is changed == true
|
||||
when: in_check_mode
|
1
tests/integration/targets/iso_extract/vars/FreeBSD.yml
Normal file
1
tests/integration/targets/iso_extract/vars/FreeBSD.yml
Normal file
|
@ -0,0 +1 @@
|
|||
iso_extract_7zip_package: p7zip
|
1
tests/integration/targets/iso_extract/vars/RedHat.yml
Normal file
1
tests/integration/targets/iso_extract/vars/RedHat.yml
Normal file
|
@ -0,0 +1 @@
|
|||
iso_extract_7zip_package: p7zip-plugins
|
1
tests/integration/targets/iso_extract/vars/Suse.yml
Normal file
1
tests/integration/targets/iso_extract/vars/Suse.yml
Normal file
|
@ -0,0 +1 @@
|
|||
iso_extract_7zip_package: p7zip
|
1
tests/integration/targets/iso_extract/vars/Ubuntu.yml
Normal file
1
tests/integration/targets/iso_extract/vars/Ubuntu.yml
Normal file
|
@ -0,0 +1 @@
|
|||
iso_extract_7zip_package: p7zip-full
|
0
tests/integration/targets/iso_extract/vars/default.yml
Normal file
0
tests/integration/targets/iso_extract/vars/default.yml
Normal file
Loading…
Add table
Add a link
Reference in a new issue