mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
* Enable at, patch and synchronize tests * Remove commented out tasks * Skip currently unsupported platforms * Skip AIX on at
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
# Test code for the at module.
|
|
# (c) 2017, James Tanner <tanner.jc@gmail.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/>.
|
|
|
|
- debug:
|
|
msg: >-
|
|
Skipping {{ ansible_distribution }} as ansible-base does not contain
|
|
the packaging module ({{ ansible_pkg_mgr }}) for this operating system
|
|
when: ansible_pkg_mgr not in ['apt', 'dnf', 'yum'] or ansible_distribution in ['AIX']
|
|
|
|
- name: stop executing on hosts that we don't have package manager modules for
|
|
meta: end_host
|
|
when: ansible_pkg_mgr not in ['apt', 'dnf', 'yum'] or ansible_distribution in ['AIX']
|
|
|
|
- set_fact: output_dir_test={{output_dir}}/at
|
|
|
|
- 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
|
|
|
|
##
|
|
## at
|
|
##
|
|
|
|
- name: ensure at is installed
|
|
package:
|
|
name: at
|
|
state: present
|
|
when: ansible_pkg_mgr in ['apt', 'dnf', 'yum']
|
|
|
|
- name: run the first example
|
|
at:
|
|
command: "ls -d / > /dev/null"
|
|
count: 20
|
|
units: minutes
|
|
register: at_test0
|
|
- debug: var=at_test0
|
|
- name: validate results
|
|
assert:
|
|
that:
|
|
- 'at_test0.changed is defined'
|
|
- 'at_test0.count is defined'
|
|
- 'at_test0.script_file is defined'
|
|
- 'at_test0.state is defined'
|
|
- 'at_test0.units is defined'
|