44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
---
|
|
# Create users for both desktop and server machines.
|
|
|
|
# Scheduler
|
|
- name: General | Account Management | User | Ansible
|
|
user:
|
|
name: ansible
|
|
comment: Ansible
|
|
system: yes
|
|
|
|
|
|
# Superuser
|
|
- name: General | Account Management | User | Hyperling
|
|
user:
|
|
name: ling
|
|
comment: Hyperling
|
|
groups:
|
|
- sudo
|
|
append: yes
|
|
shell: "{{ bash_exec.stdout }}"
|
|
create_home: yes
|
|
generate_ssh_key: yes
|
|
#password: "{{ ling_passwd }}"
|
|
register: user_ling
|
|
|
|
- name: General | Account Management | User | Hyperling | TRASH Folder
|
|
file:
|
|
path: "{{ user_ling.home }}/TRASH"
|
|
state: directory
|
|
mode: '0755'
|
|
when: user_ling.home != ""
|
|
|
|
- name: General | Account Management | User | Hyperling | .bashrc Entries
|
|
blockinfile:
|
|
path: "{{ user_ling.home }}/.bashrc"
|
|
block: |
|
|
alias cp='cp -v'
|
|
alias mv='mv -v'
|
|
alias rm='echo "Use mv ~/TRASH/ instead!"'
|
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
|
state: present
|
|
backup: yes
|
|
when: user_ling.home != ""
|
|
ignore_errors: yes |