Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Paradi committed Nov 13, 2018
1 parent b5efb0b commit 6fcd9b4
Show file tree
Hide file tree
Showing 131 changed files with 1,323 additions and 1,153 deletions.
53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
Andrew's .files
===
# Andrew's .files

**Ansible provisioning of macOS and Linux with security in mind**

[![Build Status](https://travis-ci.org/adrw/.files.svg?branch=master)](https://travis-ci.org/adrw/.files)

Linux
===
# Linux

1. Installs .adrw-aliases, .adrw-functions, bash & zsh powerline themes

```Bash
$ curl -s https://raw.githubusercontent.com/adrw/.files/master/bootstrap.sh | bash -s
```

2. fin.

Mac
===
# Mac

1. Reboot with `option` into Recovery parition on a USB
1. Erase `Macintosh HD` and install latest macOS from bootable USB
1. Reboot and setup primary user account
1. Login and enable Filevault full disk encryption
1. Provision with command below in Terminal for interactive mode

```Bash
$ curl -s https://raw.githubusercontent.com/adrw/.files/master/bootstrap.sh | bash -s
```

OR provision with command below including any custom arguments in Terminal

```Bash
$ cd ${HOME}/; curl -sO https://raw.githubusercontent.com/adrw/.files/master/bootstrap.sh; chmod +x ${HOME}/bootstrap.sh; ${HOME}/bootstrap.sh; rm ${HOME}/bootstrap.sh
```

5. Reboot (sometimes required) and fin.

Options
===
# Options

Run `bootstrap.sh -h` for latest manual of options and arguments which include:

```
-b Change homebrew prefix / install path
-d Change where .files is installed
Expand All @@ -47,9 +54,10 @@ Run `bootstrap.sh -h` for latest manual of options and arguments which include:
-v Run tasks that include Ansible Vault
```

Included Playbooks
===
Change which is run with `-p {play}` flag in the `bootstrap.sh` script
# Included Playbooks

Change which is run with `-p {play}` flag in the `bootstrap.sh` script

- `mac_core` full mac setup
- `mac_dev` includes `mac_terminal` and installs dev related apps
- `mac_dock` do dock customizations
Expand All @@ -60,8 +68,8 @@ Change which is run with `-p {play}` flag in the `bootstrap.sh` script
- `mac_terminal` setup custom terminal with themes, aliases, and functions
- `mac_vault` run ansible tasks that require Ansible Vault decryption

FAQ / Non-Automated Setup Tasks
---
## FAQ / Non-Automated Setup Tasks

- Enable `System Integrity Protection`
- Check status with `csrutil status`
- Reboot into Recovery OS: reboot holding Cmd+R
Expand All @@ -73,7 +81,7 @@ FAQ / Non-Automated Setup Tasks
- Add SSH key to GitHub? `pbcopy < ~/.ssh/id_rsa.pub` -> [GitHub.com/settings/keys](https://github.com/settings/keys)
- `Privoxy` not working? Check that proxy `127.0.0.1:8118` was added to HTTP and HTTPS sections in Airport and Ethernet
- Want to remove `admin` privileges from a user?
- Use function `chmod_admin {username}` found in `.ap-functions` which safely implements the steps below.
- Use function `chmod_admin {username}` found in `.ap-functions` which safely implements the steps below.
- Reversible in System Preferences / Users by logging in with `admin` account and adding privileges back to another user.
1. Find `GeneratedUID` of account with `$ dscl . -read /Users/<username> GeneratedUID`
2. Remove from admin with `$ sudo dscl . -delete /Groups/admin GroupMembers <GeneratedUID>`
Expand All @@ -82,20 +90,19 @@ FAQ / Non-Automated Setup Tasks
- Calling function again on a hidden user, restores user to both login and Finder.
1. Hide from login screen `$ sudo dscl . create /Users/hiddenuser IsHidden 1`
2. Hide home directory and share point
```Bash
$ sudo mv /Users/hiddenuser /var/hiddenuser
$ sudo dscl . -create /Users/hiddenuser NFSHomeDirectory /var/hiddenuser
$ sudo dscl . -delete "/SharePoints/Hidden User's Public Folder"
```
```Bash
$ sudo mv /Users/hiddenuser /var/hiddenuser
$ sudo dscl . -create /Users/hiddenuser NFSHomeDirectory /var/hiddenuser
$ sudo dscl . -delete "/SharePoints/Hidden User's Public Folder"
```
- Syncthing? Installed at `https://127.0.0.1:8384/`
- Auto-launch Syncthing? [Syncthing docs](https://github.com/syncthing/syncthing/tree/master/etc/macosx-launchd)
1. Find Syncthing in brew folder (usually '~/.homebrew/Cellar/syncthing')
1. Copy the `syncthing.plist` file to `~/Library/LaunchAgents`.
1. Log out and in again, or run `launchctl load
~/Library/LaunchAgents/syncthing.plist`.
1. Log out and in again, or run `launchctl load ~/Library/LaunchAgents/syncthing.plist`.

## Resources

Resources
---
- [Ansible docs](https://docs.ansible.com/ansible/) very thorough spec for all standard Ansible modules and functionality
- [macOS-Security-and-Privacy-Guide](https://github.com/drduh/macOS-Security-and-Privacy-Guide) - [@drduh](https://github.com/drduh) consolidates best practices from enterprise IT and government to secure macOS from many standard threat models
- [SpoofMAC](https://github.com/feross/SpoofMAC) - [@feross](https://github.com/feross) Python and nodeJS script for new randomized MAC address each boot to reduce tracking of your computer across networks. Find in `ansible/roles/spoof-mac`.
Expand Down
2 changes: 0 additions & 2 deletions ansible/inventories/macbox/group_vars/macbox.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
---

roles_dir: "{{ home }}/.files/ansible/roles"
homebrew_cask_appdir: /Applications
1 change: 0 additions & 1 deletion ansible/plays/provision.yml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
---
4 changes: 1 addition & 3 deletions ansible/plays/provision/mac_core.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- import_playbook: mac_dev.yml
- import_playbook: mac_secure.yml

Expand Down Expand Up @@ -49,4 +47,4 @@
path: /Applications/System Preferences.app
pos: 10

dockitems_to_remove:
dockitems_to_remove:
2 changes: 0 additions & 2 deletions ansible/plays/provision/mac_dev.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- import_playbook: mac_terminal.yml

- hosts: macbox
Expand Down
2 changes: 0 additions & 2 deletions ansible/plays/provision/mac_etchosts.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand Down
2 changes: 0 additions & 2 deletions ansible/plays/provision/mac_jekyll.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand Down
4 changes: 0 additions & 4 deletions ansible/plays/provision/mac_secure.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand All @@ -14,5 +12,3 @@
become_method: sudo
ignore_errors: true
vars:


5 changes: 2 additions & 3 deletions ansible/plays/provision/mac_square.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- import_playbook: mac_dev.yml

- hosts: macbox
Expand All @@ -13,6 +11,7 @@
ignore_errors: true
vars:
install_homebrew_apps_password: "{{ become }}"
install_homebrew_fonts: true
dockitems_to_persist:
- name: Slack
path: "/Applications/Slack.app"
Expand All @@ -39,4 +38,4 @@
path: /Applications/System Preferences.app
pos: 8

dockitems_to_remove:
dockitems_to_remove:
4 changes: 1 addition & 3 deletions ansible/plays/provision/mac_terminal.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand All @@ -21,4 +19,4 @@
ignore_errors: true
vars:
install_homebrew_packages: true
install_homebrew_fonts: true
install_homebrew_fonts: true
3 changes: 0 additions & 3 deletions ansible/plays/provision/mac_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand Down Expand Up @@ -32,4 +30,3 @@
become_method: sudo
ignore_errors: true
vars:

4 changes: 1 addition & 3 deletions ansible/plays/provision/mac_test_homebrew.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- hosts: macbox
connection: local
roles:
Expand All @@ -14,4 +12,4 @@
install_homebrew_apps_password: true
install_homebrew_apps_productivity: true
install_homebrew_apps_tools: true
install_homebrew_fonts: true
install_homebrew_fonts: true
3 changes: 0 additions & 3 deletions ansible/plays/provision/mac_test_password.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---

- hosts: macbox
connection: local
roles:
- oh-my-zsh
become_method: sudo
ignore_errors: true
vars:

5 changes: 1 addition & 4 deletions ansible/plays/provision/mac_vault.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
---

- hosts: macbox
connection: local
roles:
- role: ssh-keys #id_rsa key generation
- role: ssh-keys #id_rsa key generation
become_method: sudo
ignore_errors: true
vars:

4 changes: 1 addition & 3 deletions ansible/roles/adrw-shell/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---

adrw_shell__aliases: .adrw-aliases
adrw_shell__functions: .adrw-functions
adrw_shell__source: "source {{ home }}/{{ adrw_shell__aliases }}
\nsource {{ home }}/{{ adrw_shell__functions }}"
\nsource {{ home }}/{{ adrw_shell__functions }}"
13 changes: 6 additions & 7 deletions ansible/roles/adrw-shell/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
galaxy_info:
author: Andrew Paradi
company:
company:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Darwin
versions:
- trusty
- vivid
- xenial
- name: Darwin
versions:
- trusty
- vivid
- xenial
dependencies: []
3 changes: 0 additions & 3 deletions ansible/roles/adrw-shell/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- file:
src: "{{ roles_dir }}/adrw-shell/files/{{ adrw_shell__aliases }}"
dest: "{{ home }}/{{ adrw_shell__aliases }}"
Expand All @@ -26,4 +24,3 @@
marker: "### {mark} ADRW Shell"
content: "{{ adrw_shell__source }}"
create: true

2 changes: 0 additions & 2 deletions ansible/roles/anaconda/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
---

anaconda__path: export PATH=/Users/me/.homebrew/anaconda3/bin:"$PATH"
13 changes: 6 additions & 7 deletions ansible/roles/anaconda/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
galaxy_info:
author: Andrew Paradi
company:
company:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Darwin
versions:
- trusty
- vivid
- xenial
- name: Darwin
versions:
- trusty
- vivid
- xenial
dependencies: []
2 changes: 0 additions & 2 deletions ansible/roles/anaconda/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- name: Install Anaconda
homebrew_cask:
name: anaconda
Expand Down
1 change: 0 additions & 1 deletion ansible/roles/atom/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
---
13 changes: 6 additions & 7 deletions ansible/roles/atom/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
galaxy_info:
author: Andrew Paradi
company:
company:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Darwin
versions:
- trusty
- vivid
- xenial
- name: Darwin
versions:
- trusty
- vivid
- xenial
dependencies: []
2 changes: 0 additions & 2 deletions ansible/roles/atom/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- name: Include atom vars files
include_vars:
dir: ../vars/
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/atom/vars/atom_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ atom_packages:
- markdown-scroll-sync
- markdown-writer
- multi-cursor
- remote-sync
- remote-sync
3 changes: 1 addition & 2 deletions ansible/roles/automator-workflows/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
---
aliases__source: 'source {{ home }}/.ap-aliases'
aliases__source: "source {{ home }}/.ap-aliases"
13 changes: 6 additions & 7 deletions ansible/roles/automator-workflows/meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
galaxy_info:
author: Andrew Paradi
company:
company:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Darwin
versions:
- trusty
- vivid
- xenial
- name: Darwin
versions:
- trusty
- vivid
- xenial
dependencies: []
2 changes: 0 additions & 2 deletions ansible/roles/automator-workflows/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
---

- unarchive:
src: "{{ roles_dir }}/automator-workflows/files/CombinePDF20.zip"
dest: "{{ home }}/Library/Services/"
Expand Down
4 changes: 1 addition & 3 deletions ansible/roles/bash/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---

bash__powerline_div: "### Theme"
bash__powerline_source: 'source {{ home }}/.adrw-bash-powerline.sh'
bash__powerline_source: "source {{ home }}/.adrw-bash-powerline.sh"
bash__powerline_url: https://raw.githubusercontent.com/riobard/bash-powerline/master/bash-powerline.sh
bash__powerline_file: .bash-powerline.sh
bash__powerline_adrw_file: .adrw-bash-powerline.sh
Loading

0 comments on commit 6fcd9b4

Please sign in to comment.