108 lines
2.6 KiB
YAML
Raw Normal View History

---
# Create users for both desktop and server machines.
## Scheduler ##
2021-02-02 21:28:17 -06:00
- name: General | Account Management | User | Ansible
user:
name: ansible
comment: Ansible
system: yes
## Superuser ##
- name: General | Account Management | User | use BASH (Default)
set_fact:
ling_shell: "{{ bash_exec.stdout }}"
- name: General | Account Management | User | Use ZSH (Arch+Manjaro)
set_fact:
ling_shell: "{{ zsh_exec.stdout }}"
when: ansible_distribution == "Archlinux"
2021-02-02 21:28:17 -06:00
- name: General | Account Management | User | Hyperling
user:
name: ling
comment: Hyperling
groups:
- sudo
2021-02-14 18:32:50 -06:00
- video
- render
append: yes
shell: "{{ ling_shell }}"
create_home: yes
generate_ssh_key: yes
register: user_ling
- name: General | Account Management | User | Hyperling | bin Folder
file:
path: "{{ user_ling.home }}/bin"
state: directory
mode: '0755'
become_user: ling
when: user_ling.home != ""
2021-02-07 06:22:49 -06:00
- name: General | Account Management | User | Hyperling | TRASH Folder
file:
path: "{{ user_ling.home }}/TRASH"
state: directory
mode: '0755'
become_user: ling
2021-02-07 06:22:49 -06:00
when: user_ling.home != ""
- 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!"'
export PATH=".:~/bin:$PATH"
2021-02-07 06:22:49 -06:00
marker: '# {mark} MANAGED BY ANSIBLE | Aliases'
state: present
backup: yes
ignore_errors: yes
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: user_root
- name: General | Account Management | User | Root | bin Folder
file:
path: "{{ user_root.home }}/bin"
state: directory
mode: '0755'
when: user_root.home != ""
- name: General | Account Management | User | Root | TRASH Folder
file:
path: "{{ user_root.home }}/TRASH"
state: directory
mode: '0755'
when: user_root.home != ""
- name: General | Account Management | User | Root | .bashrc Entries
blockinfile:
path: "{{ user_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: user_root.home != ""