From 49d03c1219bea2bb714682b392ce816222065896 Mon Sep 17 00:00:00 2001 From: Abdirahim Musse <33973272+abmusse@users.noreply.github.com> Date: Wed, 18 Oct 2023 18:41:58 +0000 Subject: [PATCH] ansible: create group on ibm i (#3507) On IBM i group profiles are a subset of user profiles therefore user profiles and group profiles can't have the same name In this case I created group named grp and added the server_user to the group --- ansible/roles/user-create/tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ansible/roles/user-create/tasks/main.yml b/ansible/roles/user-create/tasks/main.yml index 84ce9df18..d362ed192 100644 --- a/ansible/roles/user-create/tasks/main.yml +++ b/ansible/roles/user-create/tasks/main.yml @@ -15,12 +15,22 @@ group: "{{ server_user }}" shell: "{{ bash_path[os|stripversion]|default('/bin/bash') }}" +- name: create group for ibmi + when: os|startswith("ibmi") + command: "/QOpenSys/usr/bin/system 'CRTUSRPRF USRPRF(GRP) GID(*GEN)'" + args: + creates: "/QSYS.LIB/GRP.USRPRF" + - name: create user for ibmi when: os|startswith("ibmi") command: "/QOpenSys/usr/bin/system 'CRTUSRPRF USRPRF({{ server_user }}) PASSWORD(*none)'" args: creates: "/QSYS.LIB/IOJS.USRPRF" +- name: add user to the group + when: os|startswith("ibmi") + command: "/QOpenSys/usr/bin/system 'CHGUSRPRF USRPRF({{ server_user }}) GRPPRF(GRP)'" + - name: setup user home directory for ibmi when: os|startswith("ibmi") file: