mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 07:35:31 +01:00
Skipping tests for CentOS 6
This commit is contained in:
parent
8788d4d103
commit
c7d610b662
1 changed files with 85 additions and 81 deletions
|
|
@ -29,7 +29,9 @@
|
||||||
## at
|
## at
|
||||||
##
|
##
|
||||||
|
|
||||||
- name: define distros to attempt installing at on
|
- name: Run At tests
|
||||||
|
block:
|
||||||
|
- name: define distros to attempt installing at on
|
||||||
set_fact:
|
set_fact:
|
||||||
package_distros:
|
package_distros:
|
||||||
- RedHat
|
- RedHat
|
||||||
|
|
@ -40,22 +42,22 @@
|
||||||
- Debian
|
- Debian
|
||||||
- openSUSE Leap
|
- openSUSE Leap
|
||||||
|
|
||||||
- name: ensure at is installed
|
- name: ensure at is installed
|
||||||
package:
|
package:
|
||||||
name: at
|
name: at
|
||||||
state: present
|
state: present
|
||||||
when: ansible_distribution in package_distros
|
when: ansible_distribution in package_distros
|
||||||
|
|
||||||
- name: run the first example
|
- name: run the first example
|
||||||
at:
|
at:
|
||||||
command: "ls -d / > /dev/null"
|
command: "ls -d / > /dev/null"
|
||||||
count: 20
|
count: 20
|
||||||
units: minutes
|
units: minutes
|
||||||
register: at_test0
|
register: at_test0
|
||||||
|
|
||||||
- debug: var=at_test0
|
- debug: var=at_test0
|
||||||
|
|
||||||
- name: validate results
|
- name: validate results
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- 'at_test0.changed is defined'
|
- 'at_test0.changed is defined'
|
||||||
|
|
@ -64,7 +66,7 @@
|
||||||
- 'at_test0.state is defined'
|
- 'at_test0.state is defined'
|
||||||
- 'at_test0.units is defined'
|
- 'at_test0.units is defined'
|
||||||
|
|
||||||
- name: Add a useless command using at
|
- name: Add a useless command using at
|
||||||
at:
|
at:
|
||||||
command: /bin/logger 'AT task ran from Ansible'
|
command: /bin/logger 'AT task ran from Ansible'
|
||||||
count: 1
|
count: 1
|
||||||
|
|
@ -72,13 +74,13 @@
|
||||||
unique: yes
|
unique: yes
|
||||||
register: at_add
|
register: at_add
|
||||||
|
|
||||||
- debug: var=at_add
|
- debug: var=at_add
|
||||||
|
|
||||||
- name: Wait for at to run the previous command
|
- name: Wait for at to run the previous command
|
||||||
pause:
|
pause:
|
||||||
minutes: 1
|
minutes: 1
|
||||||
|
|
||||||
- name: Add a useless command
|
- name: Add a useless command
|
||||||
at:
|
at:
|
||||||
command: /bin/logger 'AT task ran from Ansible'
|
command: /bin/logger 'AT task ran from Ansible'
|
||||||
count: 1
|
count: 1
|
||||||
|
|
@ -87,29 +89,28 @@
|
||||||
state: absent
|
state: absent
|
||||||
register: at_removal
|
register: at_removal
|
||||||
|
|
||||||
- debug: var=at_removal
|
- debug: var=at_removal
|
||||||
|
|
||||||
- name: Wait for at to run the previous command
|
- name: Wait for at to run the previous command
|
||||||
pause:
|
pause:
|
||||||
minutes: 1
|
minutes: 1
|
||||||
|
|
||||||
- name: Validate results
|
- name: Validate results
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- at_add is changed
|
- at_add is changed
|
||||||
- at_removal is changed
|
- at_removal is changed
|
||||||
when: (ansible_facts['distribution'] == "CentOS" and ansible_facts['distribution_major_version'] != "6") or (ansible_facts['distribution'] not in ('Ubuntu','FreeBSD'))
|
|
||||||
|
|
||||||
- name: Create an at command with chdir with valid value
|
- name: Create an at command with chdir with valid value
|
||||||
at:
|
at:
|
||||||
command: /bin/logger 'AT task ran from Ansible with chdir'
|
command: /bin/logger 'AT task ran from Ansible with chdir'
|
||||||
count: 1
|
count: 1
|
||||||
units: minutes
|
units: minutes
|
||||||
chdir: /tmp
|
chdir: /tmp
|
||||||
register: at_chdir_valid
|
register: at_chdir_valid
|
||||||
- debug: var=at_chdir_valid
|
- debug: var=at_chdir_valid
|
||||||
|
|
||||||
- name: Create an at command with chdir with invalid value
|
- name: Create an at command with chdir with invalid value
|
||||||
at:
|
at:
|
||||||
command: /bin/logger 'AT task ran from Ansible with chdir'
|
command: /bin/logger 'AT task ran from Ansible with chdir'
|
||||||
count: 1
|
count: 1
|
||||||
|
|
@ -118,10 +119,13 @@
|
||||||
register: at_chdir_invalid
|
register: at_chdir_invalid
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- debug: var=at_chdir_invalid
|
- debug: var=at_chdir_invalid
|
||||||
|
|
||||||
- name: Validate results
|
- name: Validate results
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- at_chdir_valid is changed
|
- at_chdir_valid is changed
|
||||||
- at_chdir_invalid is changed
|
- at_chdir_invalid is changed
|
||||||
|
when:
|
||||||
|
- not (ansible_facts['distribution'] in ('Ubuntu','FreeBSD'))
|
||||||
|
- not (ansible_distribution == "CentOS" and ansible_distribution_version is version('6', '=='))
|
||||||
Loading…
Reference in a new issue