Skip to content

Commit

Permalink
ansible: create group on ibm i (#3507)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
abmusse authored Oct 18, 2023
1 parent b3368a1 commit 49d03c1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ansible/roles/user-create/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 49d03c1

Please sign in to comment.