2021-01-31 17:21:39 -06:00
|
|
|
---
|
2021-01-31 17:46:59 -06:00
|
|
|
# Create users for both desktop and server machines.
|
2020-12-31 18:13:15 -06:00
|
|
|
|
2021-02-12 06:29:10 -06:00
|
|
|
## Scheduler ##
|
2021-02-02 21:28:17 -06:00
|
|
|
- name: General | Account Management | User | Ansible
|
2020-12-21 04:50:02 -06:00
|
|
|
user:
|
2021-01-31 15:43:08 -06:00
|
|
|
name: ansible
|
2021-01-31 17:46:59 -06:00
|
|
|
comment: Ansible
|
2020-12-21 04:50:02 -06:00
|
|
|
system: yes
|
2021-01-31 18:02:37 -06:00
|
|
|
|
2020-12-21 04:50:02 -06:00
|
|
|
|
2021-02-12 06:29:10 -06:00
|
|
|
## Superuser ##
|
2021-02-02 21:28:17 -06:00
|
|
|
- name: General | Account Management | User | Hyperling
|
2021-01-31 17:46:59 -06:00
|
|
|
user:
|
|
|
|
name: ling
|
|
|
|
comment: Hyperling
|
|
|
|
groups:
|
|
|
|
- sudo
|
|
|
|
append: yes
|
2021-02-02 20:55:06 -06:00
|
|
|
shell: "{{ bash_exec.stdout }}"
|
2021-01-31 17:46:59 -06:00
|
|
|
create_home: yes
|
2021-01-31 18:02:37 -06:00
|
|
|
generate_ssh_key: yes
|
2021-02-03 21:17:48 -06:00
|
|
|
register: user_ling
|
|
|
|
|
2021-02-07 06:22:49 -06:00
|
|
|
- name: General | Account Management | User | Hyperling | TRASH Folder
|
2021-02-03 21:17:48 -06:00
|
|
|
file:
|
|
|
|
path: "{{ user_ling.home }}/TRASH"
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
2021-02-11 13:06:59 -06:00
|
|
|
become_user: ling
|
2021-02-07 06:22:49 -06:00
|
|
|
when: user_ling.home != ""
|
|
|
|
|
2021-02-11 13:06:59 -06:00
|
|
|
- name: General | Account Management | User | Hyperling | Log In
|
|
|
|
shell: "echo SUCCESS"
|
|
|
|
become_user: ling
|
|
|
|
|
2021-02-07 06:22:49 -06:00
|
|
|
- name: General | Account Management | User | Hyperling | .bashrc Entries
|
|
|
|
blockinfile:
|
|
|
|
path: "{{ user_ling.home }}/.bashrc"
|
|
|
|
block: |
|
|
|
|
alias cp='cp -v'
|
|
|
|
alias mv='mv -v'
|
2021-02-07 06:37:42 -06:00
|
|
|
alias rm='echo "Use mv ~/TRASH/ instead!"'
|
2021-02-12 06:29:10 -06:00
|
|
|
export PATH=".:~/bin:$PATH"
|
2021-02-07 06:22:49 -06:00
|
|
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
|
|
|
state: present
|
|
|
|
backup: yes
|
2021-02-11 13:06:59 -06:00
|
|
|
ignore_errors: yes
|
2021-02-12 06:29:10 -06:00
|
|
|
when: user_ling.home != ""
|
|
|
|
|
|
|
|
|
|
|
|
## Root ##
|
|
|
|
- name: General | Account Management | User | Root
|
|
|
|
user:
|
|
|
|
name: root
|
|
|
|
shell: "{{ bash_exec.stdout }}"
|
|
|
|
create_home: yes
|
|
|
|
generate_ssh_key: yes
|
|
|
|
register: root
|
|
|
|
|
|
|
|
- name: General | Account Management | User | Root | TRASH Folder
|
|
|
|
file:
|
|
|
|
path: "{{ root.home }}/TRASH"
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
when: root.home != ""
|
|
|
|
|
|
|
|
- name: General | Account Management | User | Root | .bashrc Entries
|
|
|
|
blockinfile:
|
|
|
|
path: "{{ root.home }}/.bashrc"
|
|
|
|
block: |
|
|
|
|
alias cp='cp -v'
|
|
|
|
alias mv='mv -v'
|
|
|
|
alias rm='echo "Use mv ~/TRASH/ instead!"'
|
|
|
|
export PATH=".:~/bin:$PATH"
|
|
|
|
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
|
|
|
|
state: present
|
|
|
|
create: yes
|
|
|
|
backup: yes
|
|
|
|
ignore_errors: yes
|
|
|
|
when: root.home != ""
|