Compare commits
13
Commits
ba98477576
...
425abcff73
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
425abcff73 | ||
|
|
502cec92f3 | ||
|
|
18a875e842 | ||
|
|
d272730ced | ||
|
|
6178c56838 | ||
|
|
e38d86015f | ||
|
|
463a5fc4af | ||
|
|
a266189b38 | ||
|
|
eddc73850f | ||
|
|
8297204c9c | ||
|
|
d4b3c57cc9 | ||
|
|
50b67ed0cc | ||
|
|
4cb5e89fe9 |
No files matched your search
+4
-2
@@ -1,15 +1,15 @@
|
|||||||
# .ansible-lint
|
# .ansible-lint
|
||||||
---
|
---
|
||||||
skip_list:
|
skip_list:
|
||||||
- fqcn[action-core]
|
|
||||||
- command-instead-of-shell
|
- command-instead-of-shell
|
||||||
- key-order[task]
|
- key-order[task]
|
||||||
- yaml[line-length]
|
- yaml[line-length]
|
||||||
- yaml[colons]
|
- yaml[colons]
|
||||||
- jinja[spacing]
|
- jinja[spacing]
|
||||||
- fqcn[action]
|
|
||||||
- name[missing]
|
- name[missing]
|
||||||
- yaml[comments]
|
- yaml[comments]
|
||||||
|
- yaml[commas]
|
||||||
|
- var-naming[pattern]
|
||||||
|
|
||||||
warn_list:
|
warn_list:
|
||||||
- literal-compare
|
- literal-compare
|
||||||
@@ -18,3 +18,5 @@ warn_list:
|
|||||||
- yaml[indentation]
|
- yaml[indentation]
|
||||||
- risky-file-permissions
|
- risky-file-permissions
|
||||||
- risky-shell-pipe
|
- risky-shell-pipe
|
||||||
|
- fqcn[action-core]
|
||||||
|
- fqcn[action]
|
||||||
@@ -91,9 +91,11 @@
|
|||||||
|
|
||||||
- include_tasks: tasks/general/software/swap.yml
|
- include_tasks: tasks/general/software/swap.yml
|
||||||
- include_tasks: tasks/general/software/packages.yml
|
- include_tasks: tasks/general/software/packages.yml
|
||||||
|
when: internet
|
||||||
- include_tasks: tasks/general/software/services.yml
|
- include_tasks: tasks/general/software/services.yml
|
||||||
- include_tasks: tasks/general/software/sendmail.yml
|
- include_tasks: tasks/general/software/sendmail.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/aur.yml
|
- include_tasks: tasks/general/software/aur.yml
|
||||||
when: internet and ansible_pkg_mgr == "pacman"
|
when: internet and ansible_pkg_mgr == "pacman"
|
||||||
@@ -107,6 +109,10 @@
|
|||||||
- include_tasks: tasks/general/acct_mgmt/users.yml
|
- include_tasks: tasks/general/acct_mgmt/users.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
- include_tasks: tasks/general/acct_mgmt/sudo.yml
|
||||||
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
- include_tasks: tasks/general/acct_mgmt/doas.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
|
- include_tasks: tasks/general/software/env-shared.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
- include_tasks: tasks/general/scripts/root.yml
|
- include_tasks: tasks/general/scripts/root.yml
|
||||||
- include_tasks: tasks/general/scripts/user.yml
|
- include_tasks: tasks/general/scripts/user.yml
|
||||||
@@ -119,6 +125,7 @@
|
|||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/metasploit.yml
|
- include_tasks: tasks/general/software/metasploit.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
when: provision
|
when: provision
|
||||||
|
|
||||||
@@ -132,15 +139,20 @@
|
|||||||
|
|
||||||
## Desktop Environments ##
|
## Desktop Environments ##
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
- include_tasks: tasks/workstation/freebsd/software/gpu.yml
|
||||||
when: ansible_system == "FreeBSD" and bsd_gpu
|
when: ansible_system == "FreeBSD"
|
||||||
|
and bsd_gpu
|
||||||
|
and internet
|
||||||
|
|
||||||
# Window Managers without true Desktop Environments #
|
# Window Managers without true Desktop Environments #
|
||||||
- include_tasks: tasks/workstation/shared/software/dwm.yml
|
- include_tasks: tasks/workstation/shared/software/dwm.yml
|
||||||
|
when: internet
|
||||||
- include_tasks: tasks/workstation/shared/software/i3.yml
|
- include_tasks: tasks/workstation/shared/software/i3.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
# Polished Desktop Environments #
|
# Polished Desktop Environments #
|
||||||
- include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
- include_tasks: tasks/workstation/freebsd/software/gnome.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
- name: Main | Workstation | Fancy Desktop Environments
|
- name: Main | Workstation | Fancy Desktop Environments
|
||||||
block:
|
block:
|
||||||
@@ -149,6 +161,7 @@
|
|||||||
- include_tasks: tasks/workstation/linux/software/cinnamon.yml
|
- include_tasks: tasks/workstation/linux/software/cinnamon.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/lxqt.yml
|
- include_tasks: tasks/workstation/linux/software/lxqt.yml
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
and internet
|
||||||
# TBD: Implement this: and extra_desktops
|
# TBD: Implement this: and extra_desktops
|
||||||
|
|
||||||
## Software Tasks ##
|
## Software Tasks ##
|
||||||
@@ -165,12 +178,15 @@
|
|||||||
- include_tasks: tasks/workstation/linux/software/brave.yml
|
- include_tasks: tasks/workstation/linux/software/brave.yml
|
||||||
when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile
|
when: ansible_pkg_mgr in ("apt", "dnf", "zypper") and not mobile
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
and internet
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/freebsd/software/packages.yml
|
- include_tasks: tasks/workstation/freebsd/software/packages.yml
|
||||||
when: ansible_system == "FreeBSD"
|
when: ansible_system == "FreeBSD"
|
||||||
|
and internet
|
||||||
|
|
||||||
- include_tasks: tasks/workstation/mac-os/software/brew.yml
|
- include_tasks: tasks/workstation/mac-os/software/brew.yml
|
||||||
when: ansible_system == "Darwin"
|
when: ansible_system == "Darwin"
|
||||||
|
and internet
|
||||||
|
|
||||||
## Configuration Tasks ##
|
## Configuration Tasks ##
|
||||||
- name: Main | Workstation Setup | Configuration
|
- name: Main | Workstation Setup | Configuration
|
||||||
@@ -203,6 +219,7 @@
|
|||||||
- include_tasks: tasks/workstation/linux/software/flutter.yml
|
- include_tasks: tasks/workstation/linux/software/flutter.yml
|
||||||
- include_tasks: tasks/workstation/linux/software/android.yml
|
- include_tasks: tasks/workstation/linux/software/android.yml
|
||||||
when: ansible_system == "Linux"
|
when: ansible_system == "Linux"
|
||||||
|
and internet
|
||||||
|
|
||||||
when: workstation
|
when: workstation
|
||||||
|
|
||||||
@@ -283,6 +300,7 @@
|
|||||||
block:
|
block:
|
||||||
|
|
||||||
- include_tasks: tasks/general/software/telegraf.yml
|
- include_tasks: tasks/general/software/telegraf.yml
|
||||||
|
when: internet
|
||||||
|
|
||||||
- include_tasks: tasks/general/tests/services.yml
|
- include_tasks: tasks/general/tests/services.yml
|
||||||
- include_tasks: tasks/general/tests/lynis.yml
|
- include_tasks: tasks/general/tests/lynis.yml
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Install and configure doas.
|
# Install and configure doas.
|
||||||
|
|
||||||
- name: General | Software | DoAs | Facts
|
- name: General | Software | DoAs | Facts
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
doas_config: |
|
doas_config: |
|
||||||
permit persist :wheel as root
|
permit persist :wheel as root
|
||||||
permit persist :admin as root
|
permit persist :admin as root
|
||||||
@@ -11,14 +11,14 @@
|
|||||||
doas_conf_file_bsd: /usr/local/etc/doas.conf
|
doas_conf_file_bsd: /usr/local/etc/doas.conf
|
||||||
|
|
||||||
- name: General | Software | DoAs | Install
|
- name: General | Software | DoAs | Install
|
||||||
package:
|
ansible.builtin.package:
|
||||||
name:
|
name:
|
||||||
- doas
|
- doas
|
||||||
register: doas_install
|
register: doas_install
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [Linux]
|
- name: General | Software | DoAs | Configure [Linux]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ doas_conf_file_linux }}"
|
path: "{{ doas_conf_file_linux }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
@@ -26,10 +26,11 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: true
|
backup: true
|
||||||
|
mode: "644"
|
||||||
when: not doas_install.failed and ansible_system in ("Linux")
|
when: not doas_install.failed and ansible_system in ("Linux")
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [BSD]
|
- name: General | Software | DoAs | Configure [BSD]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ doas_conf_file_linux }}"
|
path: "{{ doas_conf_file_linux }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
@@ -37,10 +38,11 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: true
|
backup: true
|
||||||
|
mode: "644"
|
||||||
when: not doas_install.failed and ansible_system in ("FreeBSD")
|
when: not doas_install.failed and ansible_system in ("FreeBSD")
|
||||||
|
|
||||||
- name: General | Software | DoAs | Configure [Other]
|
- name: General | Software | DoAs | Configure [Other]
|
||||||
blockinfile:
|
ansible.builtin.blockinfile:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
block: |
|
block: |
|
||||||
{{ doas_config }}
|
{{ doas_config }}
|
||||||
@@ -48,6 +50,7 @@
|
|||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: true
|
backup: true
|
||||||
|
mode: "644"
|
||||||
loop:
|
loop:
|
||||||
- "{{ doas_conf_file_linux }}"
|
- "{{ doas_conf_file_linux }}"
|
||||||
- "{{ doas_conf_file_bsd }}"
|
- "{{ doas_conf_file_bsd }}"
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
# Create and manage permissions for notify log.
|
# Create and manage permissions for notify log.
|
||||||
|
|
||||||
- name: General | Notify | Update File
|
- name: General | Notify | Update File
|
||||||
shell: "{{ item }}"
|
ansible.builtin.shell: "{{ item }}"
|
||||||
loop:
|
loop:
|
||||||
- touch "{{ notify_log_file }}"
|
- touch "{{ notify_log_file }}"
|
||||||
- chmod 777 "{{ notify_log_file }}"
|
- chmod 777 "{{ notify_log_file }}"
|
||||||
register: shell_check
|
register: shell_check
|
||||||
changed_when: shell_check.rc != 0
|
changed_when: shell_check.rc == 0
|
||||||
|
|
||||||
- name: General | Notify | Add Message
|
- name: General | Notify | Add Message
|
||||||
shell : echo "'Ansible' '{{ notify_message }} @ `date`'" >> "{{ notify_log_file }}"
|
ansible.builtin.shell : echo "'Ansible' '{{ notify_message }} @ `date`'" >> "{{ notify_log_file }}"
|
||||||
register: shell_check
|
register: shell_check
|
||||||
changed_when: shell_check.rc != 0
|
changed_when: shell_check.rc == 0
|
||||||
@@ -2,32 +2,33 @@
|
|||||||
# Ensure the proper users have sudo access.
|
# Ensure the proper users have sudo access.
|
||||||
|
|
||||||
- name: General | Account Management | Sudo | Copy Ansible
|
- name: General | Account Management | Sudo | Copy Ansible
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: sudo/sudoers_ansible
|
src: sudo/sudoers_ansible
|
||||||
dest: "{{ sudoers_install_dir }}"
|
dest: "{{ sudoers_install_dir }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0440
|
mode: "0440"
|
||||||
|
|
||||||
- name: General | Account Management | Sudo | Copy Sudo Group
|
- name: General | Account Management | Sudo | Copy Sudo Group
|
||||||
copy:
|
ansible.builtin.copy:
|
||||||
src: sudo/sudoers_sudo
|
src: sudo/sudoers_sudo
|
||||||
dest: "{{ sudoers_install_dir }}"
|
dest: "{{ sudoers_install_dir }}"
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ root_group }}"
|
group: "{{ root_group }}"
|
||||||
mode: 0440
|
mode: "0440"
|
||||||
|
|
||||||
# Disable these two lines in openSUSE default configuration.
|
# Disable these two lines in openSUSE default configuration.
|
||||||
#Defaults targetpw # ask for the password of the target user i.e. root
|
#Defaults targetpw # ask for the password of the target user i.e. root
|
||||||
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
|
#ALL ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!
|
||||||
- name: General | Account Management | Sudo | Disable openSUSE Root PW Prompt
|
- name: General | Account Management | Sudo | Disable openSUSE Root PW Prompt
|
||||||
lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: "{{ sudoers_config }}"
|
path: "{{ sudoers_config }}"
|
||||||
regexp: '{{ item.key }}'
|
regexp: '{{ item.key }}'
|
||||||
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
line: '{{ item.value }} # MANAGED BY ANSIBLE'
|
||||||
state: present
|
state: present
|
||||||
create: true
|
create: true
|
||||||
backup: true
|
backup: true
|
||||||
|
mode: "644"
|
||||||
loop:
|
loop:
|
||||||
- { "key": '^[\#]?Defaults targetpw', "value": '#Defaults targetpw'}
|
- { "key": '^[\#]?Defaults targetpw', "value": '#Defaults targetpw'}
|
||||||
- { "key": '^[\#]?ALL ALL\=\(ALL\) ALL', "value": '#ALL ALL=(ALL) ALL'}
|
- { "key": '^[\#]?ALL ALL\=\(ALL\) ALL', "value": '#ALL ALL=(ALL) ALL'}
|
||||||
@@ -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,65 +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"
|
||||||
|
|
||||||
|
|
||||||
# Shared Environment Setup #
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | env-shared | Download / Update
|
|
||||||
git:
|
|
||||||
repo: https://git.hyperling.com/me/env-shared
|
|
||||||
version: "{{ branch }}"
|
|
||||||
dest: "{{ shared_rc_install_dir }}"
|
|
||||||
clone: true
|
|
||||||
force: true
|
|
||||||
update: true
|
|
||||||
#ignore_errors: true
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | env-shared | Install | .rc_shared
|
|
||||||
copy:
|
|
||||||
src: "{{ shared_rc_install_dir }}/rc_shared.sh"
|
|
||||||
dest: "{{ item }}/.rc_shared"
|
|
||||||
owner: root
|
|
||||||
group: "{{ root_group }}"
|
|
||||||
mode: 0755
|
|
||||||
loop:
|
|
||||||
- "{{ user_root.home }}"
|
|
||||||
- "{{ user_user.home }}"
|
|
||||||
#ignore_errors: true
|
|
||||||
when: user_root.home != "" and user_user.home != ""
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | env-shared | Install | .vimrc
|
|
||||||
copy:
|
|
||||||
src: "{{ shared_rc_install_dir }}/vimrc.vim"
|
|
||||||
dest: "{{ item }}/.vimrc"
|
|
||||||
owner: root
|
|
||||||
group: "{{ root_group }}"
|
|
||||||
mode: 0755
|
|
||||||
loop:
|
|
||||||
- "{{ user_root.home }}"
|
|
||||||
- "{{ user_user.home }}"
|
|
||||||
#ignore_errors: true
|
|
||||||
when: user_root.home != "" and user_user.home != ""
|
|
||||||
|
|
||||||
- name: General | Account Management | Users | env-shared | Permissions
|
|
||||||
file:
|
|
||||||
path: "{{ user_user.home }}/{{ item }}"
|
|
||||||
owner: "{{ user }}"
|
|
||||||
group: "{{ user }}"
|
|
||||||
mode: '0755'
|
|
||||||
loop:
|
|
||||||
- .rc_shared
|
|
||||||
- .vimrc
|
|
||||||
#ignore_errors: true
|
|
||||||
@@ -8,13 +8,37 @@
|
|||||||
# $RANDOM / 100 can be up to about 320 seconds, or ~5 minutes.
|
# $RANDOM / 100 can be up to about 320 seconds, or ~5 minutes.
|
||||||
# This prevents multiple systems from hitting it at the exact same time.
|
# This prevents multiple systems from hitting it at the exact same time.
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Facts
|
- name: General | Cron | Ansible | Facts 01
|
||||||
set_fact:
|
ansible.builtin.set_fact:
|
||||||
#ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.`date +'%Y%m%d-%H%M%S'`.log"
|
#ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.`date +'%Y%m%d-%H%M%S'`.log"
|
||||||
ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.log"
|
ansible_cron_log: "~/{{ ansible_hostname }}.ansible-pull.log"
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Facts 02
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
ansible_cron_log_old: "{{ ansible_cron_log }}.old"
|
||||||
|
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Delete Old
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ ansible_cron_log_old }}"
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Check
|
||||||
|
ansible.builtin.stat:
|
||||||
|
path: "{{ ansible_cron_log }}"
|
||||||
|
register: ansible_cron_log_check
|
||||||
|
|
||||||
|
- name: General | Cron | Ansible | Log | Rename [if >1MB]
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "{{ ansible_cron_log }}"
|
||||||
|
dest: "{{ ansible_cron_log_old }}"
|
||||||
|
mode: "0755"
|
||||||
|
when: ansible_cron_log_check.stat.exists
|
||||||
|
and ansible_cron_log_check.stat.size > 1000000
|
||||||
|
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Create Subscriber Job
|
- name: General | Cron | Ansible | Create Subscriber Job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Ansible Sync"
|
name: "Ansible Sync"
|
||||||
minute: "*/30"
|
minute: "*/30"
|
||||||
@@ -23,7 +47,7 @@
|
|||||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||||
|
|
||||||
- name: General | Cron | Ansible | Create Forced Weekly Subscriber Job
|
- name: General | Cron | Ansible | Create Forced Weekly Subscriber Job
|
||||||
cron:
|
ansible.builtin.cron:
|
||||||
user: ansible
|
user: ansible
|
||||||
name: "Ansible Weekly Forced Sync"
|
name: "Ansible Weekly Forced Sync"
|
||||||
special_time: weekly
|
special_time: weekly
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
---
|
||||||
|
# 20261002 - Hyperling
|
||||||
|
# Move internet requiring code out of users.yml.
|
||||||
|
|
||||||
|
# Shared Environment Setup #
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Download / Update
|
||||||
|
git:
|
||||||
|
repo: https://git.hyperling.com/me/env-shared
|
||||||
|
version: "{{ branch }}"
|
||||||
|
dest: "{{ shared_rc_install_dir }}"
|
||||||
|
clone: true
|
||||||
|
force: true
|
||||||
|
update: true
|
||||||
|
#ignore_errors: true
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Install | .rc_shared
|
||||||
|
copy:
|
||||||
|
src: "{{ shared_rc_install_dir }}/rc_shared.sh"
|
||||||
|
dest: "{{ item }}/.rc_shared"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- "{{ user_root.home }}"
|
||||||
|
- "{{ user_user.home }}"
|
||||||
|
#ignore_errors: true
|
||||||
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Install | .vimrc
|
||||||
|
copy:
|
||||||
|
src: "{{ shared_rc_install_dir }}/vimrc.vim"
|
||||||
|
dest: "{{ item }}/.vimrc"
|
||||||
|
owner: root
|
||||||
|
group: "{{ root_group }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- "{{ user_root.home }}"
|
||||||
|
- "{{ user_user.home }}"
|
||||||
|
#ignore_errors: true
|
||||||
|
when: user_root.home != "" and user_user.home != ""
|
||||||
|
|
||||||
|
- name: General | Account Management | Users | env-shared | Permissions
|
||||||
|
file:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
owner: "{{ user }}"
|
||||||
|
group: "{{ user }}"
|
||||||
|
mode: "0755"
|
||||||
|
loop:
|
||||||
|
- .rc_shared
|
||||||
|
- .vimrc
|
||||||
|
#ignore_errors: true
|
||||||
@@ -2,18 +2,31 @@
|
|||||||
# 20261002 - Hyperling
|
# 20261002 - Hyperling
|
||||||
# Check whether we're connected to the internet and skip certain playbooks if not.
|
# Check whether we're connected to the internet and skip certain playbooks if not.
|
||||||
|
|
||||||
- name: General | Tests | Internet | Facts
|
- name: General | Tests | Internet | Facts 01
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
internet: true
|
internet: true
|
||||||
|
internet_time: 10
|
||||||
|
|
||||||
- name: General | Tests | Internet | Check
|
- name: General | Tests | Internet | Check
|
||||||
ansible.builtin.wait_for:
|
ansible.builtin.wait_for:
|
||||||
host: archlinux.org.com
|
host: archlinux.org
|
||||||
port: 443
|
port: 443
|
||||||
state: started
|
state: started
|
||||||
timeout: 15
|
timeout: "{{ internet_time }}"
|
||||||
register: internet_check
|
register: internet_check
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
- name: General | Tests | Internet | Facts
|
- name: General | Tests | Internet | Facts 02
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
internet: "{{ internet_check is success }}"
|
internet: "{{ internet_check is success }}"
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Message
|
||||||
|
ansible.builtin.debug:
|
||||||
|
msg: "WARNING: Not connected to the Internet, only running for offline playbooks."
|
||||||
|
when: not internet
|
||||||
|
|
||||||
|
- name: General | Tests | Internet | Sleep
|
||||||
|
ansible.builtin.command: "sleep {{ internet_time }}"
|
||||||
|
register: shell_check
|
||||||
|
changed_when: shell_check.rc == 0
|
||||||
|
when: not internet
|
||||||
Reference in new issue
Block a user