Skip to content
Snippets Groups Projects
Commit 2afdc224 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

feat: create user/group for integration tests

parent b315bdae
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,13 @@ ...@@ -6,6 +6,13 @@
state: "{{ item.value.mystate | default('present') }}" state: "{{ item.value.mystate | default('present') }}"
with_dict: "{{ vault_groups }}" with_dict: "{{ vault_groups }}"
- name: create group for integration tests (needs to be done manually, because Ansible doesn't handle non_unique in the group module correctly)
command: "groupadd -g {{ item.gid }} -o {{ item.name }}"
loop: "{{ vault_group_integrationtest }}"
register: integrationtest_group
ignore_errors: true
changed_when: "\"group '{{ item.name }}' already exists\" not in integrationtest_group.stderr"
- name: add HUMAN users to groups - name: add HUMAN users to groups
user: user:
name: "{{ item }}" name: "{{ item }}"
...@@ -28,7 +35,8 @@ ...@@ -28,7 +35,8 @@
groups: "{{ item.value.groups }}" groups: "{{ item.value.groups }}"
home: "/home/{{ item.key }}/" home: "/home/{{ item.key }}/"
name: "{{ item.key }}" name: "{{ item.key }}"
password: "{{ item.value.password | default(omit) }}" non_unique: "{{ item.value.non_unique | default(false) }}"
password: "{{ lookup('password', '/dev/null length=100 chars=ascii_letters')|password_hash('sha512') | default(omit) }}"
shell: "{{ item.value.shell | default('/bin/bash') }}" shell: "{{ item.value.shell | default('/bin/bash') }}"
state: "{{ item.value.state | default('present') }}" state: "{{ item.value.state | default('present') }}"
uid: "{{ item.value.uid | default(omit) }}" uid: "{{ item.value.uid | default(omit) }}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment