Skip to content

Instantly share code, notes, and snippets.

@robinsg
Last active October 30, 2020 15:31
Show Gist options
  • Save robinsg/4c3159273831056fe01feb3bed1f9d91 to your computer and use it in GitHub Desktop.
Save robinsg/4c3159273831056fe01feb3bed1f9d91 to your computer and use it in GitHub Desktop.
- - -
# defaults file for ../roles/aix_users
dft_pwd: "PassW@rd"
user_group: "appgrp"
- - -
# tasks file for ../roles/aix_users
# Non-admin users
- name: Create the users
ibm.power_aix.user:
name: "{{ item }}"
state: present
attributes:
pgrp: "{{ user_group }}"
data: "-1"
shell: "/usr/bin/ksh"
with_items: "{{ user_names }}"
tags:
- aix_users
- name: Set default password for users
shell: "echo \"{{ item }}:{{ dft_pwd }}\" | chpasswd"
with_items: "{{ user_names }}"
tags:
- aix_users
# Admin users
- name: Create the admin users
ibm.power_aix.user:
name: "{{ item }}"
state: present
attributes:
admin: "true"
pgrp: "system"
groups: "{{ user_group }}"
data: "-1"
shell: "/usr/bin/bash"
with_items: "{{ admin_names }}"
tags:
- aix_users
- name: Set default password for admin users
shell: "echo \"{{ item }}:{{ dft_pwd }}\" | chpasswd"
with_items: "{{ admin_names }}"
tags:
- aix_users
- - -
# vars file for ../roles/aix_users
admin_names:
- robinsg
- admin01
- admin02
user_names:
- app01
- app02
- app03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment