mirror of https://github.com/ansible/ansible.git
parent
6bf6844a1c
commit
20465ba11a
@ -0,0 +1,3 @@
|
|||||||
|
minor_changes:
|
||||||
|
- Add ``uid_min``, ``uid_max`` to the user plugin to overwrite the defaults provided by the ``/etc/login.defs`` file (https://github.com/ansible/ansible/pull/81770).
|
||||||
|
- Add ``gid_min``, ``gid_max`` to the group plugin to overwrite the defaults provided by the ``/etc/login.defs`` file (https://github.com/ansible/ansible/pull/81770).
|
@ -0,0 +1,73 @@
|
|||||||
|
---
|
||||||
|
- name: create a group with a specific gid
|
||||||
|
group:
|
||||||
|
name: testgroupone
|
||||||
|
gid: 8000
|
||||||
|
state: present
|
||||||
|
register: group_test0_1
|
||||||
|
|
||||||
|
- name: create another group without a specific gid
|
||||||
|
group:
|
||||||
|
name: testgrouptwo
|
||||||
|
state: present
|
||||||
|
register: group_test0_2
|
||||||
|
|
||||||
|
- name: show that the last group gets an id higher than the previous highest one
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
group_test0_1.gid < group_test0_2.gid
|
||||||
|
|
||||||
|
- name: create a group within gid_max range
|
||||||
|
group:
|
||||||
|
name: testgroupthree
|
||||||
|
gid_max: 1999
|
||||||
|
state: present
|
||||||
|
register: group_test0_3
|
||||||
|
|
||||||
|
- name: assert that a group with gid_max gets a lower gid
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
group_test0_2.gid > group_test0_3.gid
|
||||||
|
|
||||||
|
- name: proof of range limits
|
||||||
|
block:
|
||||||
|
- name: create group 1 within min 1500 and max 1501
|
||||||
|
group:
|
||||||
|
name: testgroupfour
|
||||||
|
gid_min: 1500
|
||||||
|
gid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: group_test0_4
|
||||||
|
|
||||||
|
- name: create group 2 within min 1500 and max 1501
|
||||||
|
group:
|
||||||
|
name: testgroupfive
|
||||||
|
gid_min: 1500
|
||||||
|
gid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: group_test0_5
|
||||||
|
|
||||||
|
- name: create group 3 within min 1500 and max 1501 and show that the range applies
|
||||||
|
group:
|
||||||
|
name: testgroupsix
|
||||||
|
gid_min: 1500
|
||||||
|
gid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: group_test0_6
|
||||||
|
failed_when: not group_test0_6.failed
|
||||||
|
|
||||||
|
- name: show that creating a group by setting both gid_min and local is not possible
|
||||||
|
group:
|
||||||
|
name: gidminlocalgroup_test_1
|
||||||
|
gid_min: 1000
|
||||||
|
local: true
|
||||||
|
register: gidminlocalgroup_test_1
|
||||||
|
failed_when: not gidminlocalgroup_test_1.failed
|
||||||
|
|
||||||
|
- name: show that creating a group by setting both gid_max and local is not possible
|
||||||
|
group:
|
||||||
|
name: gidmaxlocalgroup_test_1
|
||||||
|
gid_max: 2000
|
||||||
|
local: true
|
||||||
|
register: gidmaxlocalgroup_test_1
|
||||||
|
failed_when: not gidmaxlocalgroup_test_1.failed
|
@ -0,0 +1,73 @@
|
|||||||
|
---
|
||||||
|
- name: create a user with a specific uid
|
||||||
|
user:
|
||||||
|
name: testuserone
|
||||||
|
uid: 8000
|
||||||
|
state: present
|
||||||
|
register: user_test0_1
|
||||||
|
|
||||||
|
- name: create another user without a specific uid
|
||||||
|
user:
|
||||||
|
name: testusertwo
|
||||||
|
state: present
|
||||||
|
register: user_test0_2
|
||||||
|
|
||||||
|
- name: show that the last user gets an id higher than the previous highest one
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
user_test0_1.uid < user_test0_2.uid
|
||||||
|
|
||||||
|
- name: create a user within max range
|
||||||
|
user:
|
||||||
|
name: testuserthree
|
||||||
|
uid_max: 1999
|
||||||
|
state: present
|
||||||
|
register: user_test0_3
|
||||||
|
|
||||||
|
- name: assert that user with uid_max gets a lower uid
|
||||||
|
assert:
|
||||||
|
that:
|
||||||
|
user_test0_2.uid > user_test0_3.uid
|
||||||
|
|
||||||
|
- name: proof of range limits
|
||||||
|
block:
|
||||||
|
- name: create user 1 within min 1500 and max 1501
|
||||||
|
user:
|
||||||
|
name: testuserfour
|
||||||
|
uid_min: 1500
|
||||||
|
uid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: user_test0_4
|
||||||
|
|
||||||
|
- name: create user 2 within min 1500 and max 1501
|
||||||
|
user:
|
||||||
|
name: testuserfive
|
||||||
|
uid_min: 1500
|
||||||
|
uid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: user_test0_5
|
||||||
|
|
||||||
|
- name: create user 3 within min 1500 and max 1501 and show that the range applies
|
||||||
|
user:
|
||||||
|
name: testusersix
|
||||||
|
uid_min: 1500
|
||||||
|
uid_max: 1501
|
||||||
|
state: present
|
||||||
|
register: user_test0_6
|
||||||
|
failed_when: not user_test0_6.failed
|
||||||
|
|
||||||
|
- name: show that creating a group by setting both uid_min and local is not possible
|
||||||
|
user:
|
||||||
|
name: uidminlocaluser_test_1
|
||||||
|
uid_min: 1000
|
||||||
|
local: true
|
||||||
|
register: uidminlocaluser_test_1
|
||||||
|
failed_when: not uidminlocaluser_test_1.failed
|
||||||
|
|
||||||
|
- name: show that creating a group by setting both uid_max and local is not possible
|
||||||
|
user:
|
||||||
|
name: uidmaxlocaluser_test_1
|
||||||
|
uid_max: 2000
|
||||||
|
local: true
|
||||||
|
register: uidmaxlocaluser_test_1
|
||||||
|
failed_when: not uidmaxlocaluser_test_1.failed
|
Loading…
Reference in New Issue