users, fix to current lint standards.
This commit is contained in:
@@ -4,11 +4,11 @@
|
|||||||
## Variables ##
|
## Variables ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Use BASH (Default)
|
- name: General | Account Management | Users | Use BASH (Default)
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
user_shell: "{{ bash_exec.stdout }}"
|
user_shell: "{{ bash_exec.stdout }}"
|
||||||
|
|
||||||
- name: General | Account Management | Users | Allow BASH (Arch)
|
- name: General | Account Management | Users | Allow BASH (Arch)
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/shells
|
path: /etc/shells
|
||||||
regexp: "{{ bash_exec.stdout }}"
|
regexp: "{{ bash_exec.stdout }}"
|
||||||
line: "{{ bash_exec.stdout }}"
|
line: "{{ bash_exec.stdout }}"
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
## Root ##
|
## Root ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Root
|
- name: General | Account Management | Users | Root
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: root
|
name: root
|
||||||
shell: "{{ bash_exec.stdout }}"
|
shell: "{{ bash_exec.stdout }}"
|
||||||
create_home: true
|
create_home: true
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
## Scheduler ##
|
## Scheduler ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Ansible
|
- name: General | Account Management | Users | Ansible
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: ansible
|
name: ansible
|
||||||
comment: Ansible
|
comment: Ansible
|
||||||
system: true
|
system: true
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
## Superuser ##
|
## Superuser ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | User
|
- name: General | Account Management | Users | User
|
||||||
user:
|
ansible.builtin.user:
|
||||||
name: "{{ user }}"
|
name: "{{ user }}"
|
||||||
comment: "{{ user_desc }}"
|
comment: "{{ user_desc }}"
|
||||||
groups:
|
groups:
|
||||||
@@ -74,17 +74,19 @@
|
|||||||
register: user_user
|
register: user_user
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Test Logging In
|
- name: General | Account Management | Users | User | Test Logging In
|
||||||
shell: "echo SUCCESS"
|
ansible.builtin.shell: "echo SUCCESS"
|
||||||
args:
|
args:
|
||||||
executable: "{{ user_shell }}"
|
executable: "{{ user_shell }}"
|
||||||
become: true
|
become: true
|
||||||
become_user: "{{ user }}"
|
become_user: "{{ user }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
|
||||||
## Folders ##
|
## Folders ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Root | Create Folders
|
- name: General | Account Management | Users | Root | Create Folders
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -95,7 +97,7 @@
|
|||||||
when: user_root.home != ""
|
when: user_root.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Create Folders
|
- name: General | Account Management | Users | User | Create Folders
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -111,7 +113,7 @@
|
|||||||
when: user_user.home != ""
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | User | Create Folders | Coding
|
- name: General | Account Management | Users | User | Create Folders | Coding
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -122,13 +124,15 @@
|
|||||||
when: user_user.home != "" and coding
|
when: user_user.home != "" and coding
|
||||||
|
|
||||||
- name: General | Account Management | Users | Home Permissions
|
- name: General | Account Management | Users | Home Permissions
|
||||||
shell: "chmod 700 {{ user_user.home }}/../*"
|
ansible.builtin.shell: "chmod 700 {{ user_user.home }}/../*"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
|
|
||||||
## Files ##
|
## Files ##
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Profile Variables
|
- name: General | Account Management | Users | Files | Profile Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
export_path_additions: export PATH="$HOME/bin:{{ shared_rc_bin }}:$PATH:{{ global_bin }}"
|
export_path_additions: export PATH="$HOME/bin:{{ shared_rc_bin }}:$PATH:{{ global_bin }}"
|
||||||
export_path_sbin: export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
export_path_sbin: export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
|
||||||
#export_terminal: export TERMINAL="alacritty" # colors look weird.
|
#export_terminal: export TERMINAL="alacritty" # colors look weird.
|
||||||
@@ -151,7 +155,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | RC Variables
|
- name: General | Account Management | Users | Files | RC Variables
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
alias_cp: alias cp='cp -v'
|
alias_cp: alias cp='cp -v'
|
||||||
alias_mv: alias mv='mv -v'
|
alias_mv: alias mv='mv -v'
|
||||||
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
alias_rm: alias rm='echo "Use mv ~/TRASH/ instead!"'
|
||||||
@@ -1225,7 +1229,7 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Common Variable
|
- name: General | Account Management | Users | Files | Common Variable
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
profile_common: |
|
profile_common: |
|
||||||
{{ export_path_additions }}
|
{{ export_path_additions }}
|
||||||
{{ export_path_sbin }}
|
{{ export_path_sbin }}
|
||||||
@@ -1315,7 +1319,7 @@
|
|||||||
{{ function_reset_android_studio }}
|
{{ function_reset_android_studio }}
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .profile + .xsessionrc
|
- name: General | Account Management | Users | Files | .profile + .xsessionrc
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
block: |
|
block: |
|
||||||
{{ profile_common }}
|
{{ profile_common }}
|
||||||
@@ -1326,6 +1330,7 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: false
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- ".profile"
|
- ".profile"
|
||||||
- ".xprofile"
|
- ".xprofile"
|
||||||
@@ -1333,7 +1338,7 @@
|
|||||||
when: user_user.home != ""
|
when: user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .bashrc
|
- name: General | Account Management | Users | Files | .bashrc
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.bashrc"
|
path: "{{ item }}/.bashrc"
|
||||||
block: |
|
block: |
|
||||||
{{ rc_common }}
|
{{ rc_common }}
|
||||||
@@ -1347,13 +1352,14 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: false
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
when: user_root.home != "" and user_user.home != ""
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | .zshrc
|
- name: General | Account Management | Users | Files | .zshrc
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}/.zshrc"
|
path: "{{ item }}/.zshrc"
|
||||||
block: |
|
block: |
|
||||||
{{ rc_common }}
|
{{ rc_common }}
|
||||||
@@ -1363,13 +1369,14 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: false
|
backup: false
|
||||||
|
mode: "0755"
|
||||||
loop:
|
loop:
|
||||||
- "{{ user_root.home }}"
|
- "{{ user_root.home }}"
|
||||||
- "{{ user_user.home }}"
|
- "{{ user_user.home }}"
|
||||||
when: user_root.home != "" and user_user.home != ""
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Ownership
|
- name: General | Account Management | Users | Files | Ownership
|
||||||
file:
|
ansible.builtin.file:
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
owner: "{{ user }}"
|
owner: "{{ user }}"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
@@ -1382,15 +1389,17 @@
|
|||||||
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
- name: General | Account Management | Users | Files | Helper Functions (Reset)
|
||||||
shell: "rm -v {{ global_bin }}/*.function"
|
ansible.builtin.shell: "rm -v {{ global_bin }}/*.function"
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
- name: General | Account Management | Users | Files | Helper Functions
|
- name: General | Account Management | Users | Files | Helper Functions
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ global_bin }}"
|
dest: "{{ global_bin }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0755
|
mode: "0755"
|
||||||
with_fileglob:
|
with_fileglob:
|
||||||
- "functions/*.function"
|
- "functions/*.function"
|
||||||
|
|||||||
Reference in New Issue
Block a user