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 controllerpull/84452/merge
parent
97dd5f104c
commit
40c919d7bd
@ -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
|
||||
- name: Remove ansibulluser
|
||||
user:
|
||||
name: ansibulluser
|
||||
state: absent
|
||||
|
||||
- name: Create user account with inactive set to 15
|
||||
user:
|
||||
name: ansibulluser
|
||||
state: present
|
||||
password_expire_account_disable: 15
|
||||
|
||||
- name: Verify inactive setting for Linux
|
||||
when: ansible_facts.os_family in ['RedHat', 'Debian', 'Suse']
|
||||
block:
|
||||
- name: LINUX | Get inactive value for ansibulluser
|
||||
- block:
|
||||
- name: Remove ansibulluser
|
||||
user:
|
||||
name: ansibulluser
|
||||
state: absent
|
||||
|
||||
- name: Create user account with inactive set to 15
|
||||
user:
|
||||
name: ansibulluser
|
||||
state: present
|
||||
password_expire_account_disable: 15
|
||||
|
||||
- name: Get inactive value for ansibulluser
|
||||
getent:
|
||||
database: shadow
|
||||
key: ansibulluser
|
||||
|
||||
- name: LINUX | Ensure inactive is set to 15
|
||||
- name: 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: Verify inactive setting for BSD
|
||||
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 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
|
||||
user:
|
||||
name: ansibulluser
|
||||
state: present
|
||||
password_expire_account_disable: 10
|
||||
|
||||
- name: Update user account with inactive set to 10
|
||||
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
|
||||
- name: Get inactive value for ansibulluser
|
||||
getent:
|
||||
database: shadow
|
||||
key: ansibulluser
|
||||
|
||||
- name: LINUX | Ensure inactive is set to 10
|
||||
- name: 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
|
||||
|
||||
- name: Verify updated inactive setting for BSD
|
||||
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
|
||||
when: ansible_facts.os_family in ['RedHat', 'Debian']
|
||||
|
||||
@ -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