Last active
October 30, 2020 15:31
-
-
Save robinsg/4c3159273831056fe01feb3bed1f9d91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- - - | |
# defaults file for ../roles/aix_users | |
dft_pwd: "PassW@rd" | |
user_group: "appgrp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- - - | |
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- - - | |
# 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