mirror of https://github.com/ansible/ansible.git
Integration tests clean up (#85130)
* Integration tests clean up
* more
* we only test with Ubuntu 24.04 on the controller
(cherry picked from commit 40c919d7bd)
pull/85255/head
parent
35a951b611
commit
108f349e1d
@ -1 +0,0 @@
|
|||||||
multiarch_test_pkg: libunistring2
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
- name: Setup remote constraints
|
|
||||||
include_tasks: setup-remote-constraints.yml
|
|
||||||
- name: Install Paramiko for Python 3 on RHEL 8
|
|
||||||
pip: # no python3-paramiko package exists for RHEL 8
|
|
||||||
name: paramiko
|
|
||||||
extra_args: "-c {{ remote_constraints }}"
|
|
||||||
environment:
|
|
||||||
SETUPTOOLS_USE_DISTUTILS: stdlib
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
- name: Uninstall Paramiko for Python 3 on RHEL 8
|
|
||||||
pip: # no python3-paramiko package exists for RHEL 8
|
|
||||||
name: paramiko
|
|
||||||
state: absent
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
- name: Uninstall Paramiko for Python 3 using zypper
|
|
||||||
command: zypper --quiet --non-interactive remove --clean-deps python3-paramiko
|
|
||||||
@ -1,74 +1,41 @@
|
|||||||
# Test inactive setting when creating a new account
|
- block:
|
||||||
- name: Remove ansibulluser
|
- name: Remove ansibulluser
|
||||||
user:
|
user:
|
||||||
name: ansibulluser
|
name: ansibulluser
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
- name: Create user account with inactive set to 15
|
- name: Create user account with inactive set to 15
|
||||||
user:
|
user:
|
||||||
name: ansibulluser
|
name: ansibulluser
|
||||||
state: present
|
state: present
|
||||||
password_expire_account_disable: 15
|
password_expire_account_disable: 15
|
||||||
|
|
||||||
- name: Verify inactive setting for Linux
|
- name: Get inactive value for ansibulluser
|
||||||
when: ansible_facts.os_family in ['RedHat', 'Debian', 'Suse']
|
|
||||||
block:
|
|
||||||
- name: LINUX | Get inactive value for ansibulluser
|
|
||||||
getent:
|
getent:
|
||||||
database: shadow
|
database: shadow
|
||||||
key: ansibulluser
|
key: ansibulluser
|
||||||
|
|
||||||
- name: LINUX | Ensure inactive is set to 15
|
- name: Ensure inactive is set to 15
|
||||||
assert:
|
assert:
|
||||||
msg: "expiry is supposed to be empty or 15, not {{ getent_shadow['ansibulluser'][7] }}"
|
msg: "expiry is supposed to be empty or 15, not {{ getent_shadow['ansibulluser'][7] }}"
|
||||||
that:
|
that:
|
||||||
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 15
|
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 15
|
||||||
|
|
||||||
- name: Verify inactive setting for BSD
|
- name: Update user account with inactive set to 10
|
||||||
when: ansible_facts.system in ['NetBSD','OpenBSD']
|
user:
|
||||||
block:
|
name: ansibulluser
|
||||||
- name: BSD | Get inactive value for ansibulluser
|
state: present
|
||||||
getent:
|
password_expire_account_disable: 10
|
||||||
database: shadow
|
|
||||||
key: ansibulluser
|
|
||||||
|
|
||||||
- name: BSD | Ensure inactive is set to 15
|
|
||||||
assert:
|
|
||||||
msg: "expiry is supposed to be empty or 15, not {{ getent_shadow['ansibulluser'][7] }}"
|
|
||||||
that:
|
|
||||||
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 15
|
|
||||||
|
|
||||||
- name: Update user account with inactive set to 10
|
- name: Get inactive value for ansibulluser
|
||||||
user:
|
|
||||||
name: ansibulluser
|
|
||||||
state: present
|
|
||||||
password_expire_account_disable: 10
|
|
||||||
register: return_user_information
|
|
||||||
|
|
||||||
- name: Verify updated inactive setting for Linux
|
|
||||||
when: ansible_facts.os_family in ['RedHat', 'Debian', 'Suse']
|
|
||||||
block:
|
|
||||||
- name: LINUX | Get inactive value for ansibulluser
|
|
||||||
getent:
|
getent:
|
||||||
database: shadow
|
database: shadow
|
||||||
key: ansibulluser
|
key: ansibulluser
|
||||||
|
|
||||||
- name: LINUX | Ensure inactive is set to 10
|
- name: Ensure inactive is set to 10
|
||||||
assert:
|
assert:
|
||||||
msg: "expiry is supposed to be empty or 10, not {{ getent_shadow['ansibulluser'][7] }}"
|
msg: "expiry is supposed to be empty or 10, not {{ getent_shadow['ansibulluser'][7] }}"
|
||||||
that:
|
that:
|
||||||
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 10
|
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 10
|
||||||
|
|
||||||
- name: Verify updated inactive setting for BSD
|
when: ansible_facts.os_family in ['RedHat', 'Debian']
|
||||||
when: ansible_facts.system in ['NetBSD','OpenBSD']
|
|
||||||
block:
|
|
||||||
- name: BSD | Get inactive value for ansibulluser
|
|
||||||
getent:
|
|
||||||
database: shadow
|
|
||||||
key: ansibulluser
|
|
||||||
|
|
||||||
- name: BSD | Ensure inactive is set to 10
|
|
||||||
assert:
|
|
||||||
msg: "expiry is supposed to be empty or 10, not {{ getent_shadow['ansibulluser'][7] }}"
|
|
||||||
that:
|
|
||||||
- not getent_shadow['ansibulluser'][7] or getent_shadow['ansibulluser'][7] | int != 10
|
|
||||||
|
|||||||
@ -1,21 +0,0 @@
|
|||||||
- name: Test shadow backup on Solaris
|
|
||||||
when: ansible_facts.os_family == 'Solaris'
|
|
||||||
block:
|
|
||||||
- name: Create a user to test shadow file backup
|
|
||||||
user:
|
|
||||||
name: ansibulluser
|
|
||||||
state: present
|
|
||||||
register: result
|
|
||||||
|
|
||||||
- name: Find shadow backup files
|
|
||||||
find:
|
|
||||||
path: /etc
|
|
||||||
patterns: 'shadow\..*~$'
|
|
||||||
use_regex: yes
|
|
||||||
register: shadow_backups
|
|
||||||
|
|
||||||
- name: Assert that a backup file was created
|
|
||||||
assert:
|
|
||||||
that:
|
|
||||||
- result.bakup
|
|
||||||
- shadow_backups.files | map(attribute='path') | list | length > 0
|
|
||||||
Loading…
Reference in New Issue