diff --git "a/\nhost_vars/localhost.yml" "b/\nhost_vars/localhost.yml" deleted file mode 100644 index 9186fc6..0000000 --- "a/\nhost_vars/localhost.yml" +++ /dev/null @@ -1,79 +0,0 @@ ---- - -configure_osx: true - -configure_ssh: true -ssh_path: ~/.ssh/id_rsa -ssh_size: 4096 -ssh_comment: macbook - -configure_git: yes -git_mail: user@example.com -git_name: MayNiklas -git_editor: "subl -n -w" - -configure_brew: true -homebrew_taps: - - homebrew/core - - homebrew/cask - - homebrew/cask-drivers - -homebrew_apps: - - signal - - discord - - telegram - - teamspeak-client - - whatsapp - - docker - - firefox - - chromium - - tor-browser - - adobe-creative-cloud - - jetbrains-toolbox - - github - - spotify - - vlc - - obs - - parsec - - plex - - ultimaker-cura - - sublime-text - - filebot - - cyberduck - - forklift - - balenaetcher - - cleanmymac - - synology-drive - - wacom-tablet - - yubico-authenticator - - eizo-colornavigator - - monitorcontrol - - vmware-fusion - -homebrew_packages: - - mas - - ansible - - iperf3 - - nmap - - wakeonlan - - fish - - git - - wget - - hugo - - gradle - - htop - - glances - - docker-compose - -configure_mas: true -mas_apps: - - { name: 1Password 7 - Password Manager, id: 1333542190 } - - { name: Twitter, id: 1482454543 } - - { name: WireGuard, id: 1451685025 } - - { name: Microsoft Excel, id: 462058435 } - - { name: Microsoft Remote Desktop, id: 1295203466 } - - { name: Magnet, id: 441258766 } - - { name: Parcel - Delivery Tracking, id: 639968404 } - - - diff --git a/.gitignore b/.gitignore index 46f0bc5..c7fcddd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # ---> Ansible *.retry +collections roles # ---> Vim diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..9bf9f8d --- /dev/null +++ b/.gitmodules @@ -0,0 +1,21 @@ +[submodule "roles/ansible-git"] + path = roles/ansible-git + url = https://github.com/MayNiklas/ansible-git.git +[submodule "roles/ansible-yubikey"] + path = roles/ansible-yubikey + url = https://github.com/MayNiklas/ansible-yubikey-mac.git +[submodule "roles/ansible-ssh"] + path = roles/ansible-ssh + url = https://github.com/MayNiklas/ansible-ssh.git +[submodule "roles/ansible-osx_defaults"] + path = roles/ansible-osx_defaults + url = https://github.com/MayNiklas/ansible-osx_defaults.git +[submodule "roles/ansible-homebrew"] + path = roles/ansible-homebrew + url = https://github.com/MayNiklas/ansible-homebrew.git +[submodule "roles/ansible-mas"] + path = roles/ansible-mas + url = https://github.com/MayNiklas/ansible-mas.git +[submodule "roles/ansible-shell-mac"] + path = roles/ansible-shell-mac + url = https://github.com/MayNiklas/ansible-shell-mac.git diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..3d606e0 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + "recommendations": [ + "redhat.ansible" + ] +} \ No newline at end of file diff --git a/README.md b/README.md index 1026847..293e7d8 100644 --- a/README.md +++ b/README.md @@ -3,24 +3,34 @@ [![Lines Of Code](https://tokei.rs/b1/github/MayNiklas/ansible-mac?category=code)](https://github.com/XAMPPRocky/tokei) [![Lines Of Code](https://tokei.rs/b1/github/MayNiklas/ansible-mac?category=files)](https://github.com/XAMPPRocky/tokei) -### Installing brew +### Used roles: +- https://github.com/MayNiklas/ansible-osx_defaults.git +- https://github.com/MayNiklas/ansible-shell-mac.git +- https://github.com/MayNiklas/ansible-git.git +- https://github.com/MayNiklas/ansible-yubikey-mac.git +- https://github.com/MayNiklas/ansible-homebrew.git +- https://github.com/MayNiklas/ansible-ssh.git +- https://github.com/MayNiklas/ansible-mas.git + +### how to execute the playbook ```bash +# install brew.sh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" -``` -### Installing Ansible -```bash +# clone repository +git clone --recursive https://github.com/MayNiklas/ansible-mac.git + +# install ansible brew install ansible -``` -### Configure the variables to your liking -``` -cp default.config.yml config.yml -nano config.yml -``` -### Executing playbook -```bash -ansible-playbook main.yml +# Configure the variables to your liking +nano host_vars/localhost.yml + +# Install required roles +ansible-galaxy install -r requirements.yml + +# execute playbook +ansible-playbook site.yml ``` Preperation: diff --git a/ansible.cfg b/ansible.cfg index 955fff6..d6cbffb 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,6 +1,7 @@ [defaults] nocows = True -roles_path = ./roles:/etc/ansible/roles +roles_path = ./roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles +collections_paths = ./collections:~/.ansible/collections:/usr/share/ansible/collections inventory = ./inventory.yml [privilege_escalation] diff --git a/host_vars/localhost.yml b/host_vars/localhost.yml new file mode 100644 index 0000000..4453194 --- /dev/null +++ b/host_vars/localhost.yml @@ -0,0 +1,68 @@ +--- + +configure_osx: true + +configure_yubikey: true + +configure_shell: true + +configure_ssh: false +ssh_path: ~/.ssh/id_rsa +ssh_size: 4096 +ssh_comment: macbook + +configure_git: yes +git_mail: info@niklas-steffen.de +git_name: MayNiklas + +configure_brew: true +homebrew_taps: + - homebrew/core + - homebrew/cask + - homebrew/cask-drivers + - drone/drone + +homebrew_apps: + - adobe-creative-cloud + - discord + - docker + - element + - firefox + - github + - jetbrains-toolbox + - monitorcontrol + - plex + - signal + - spotify + - sublime-text + - telegram + - vlc + - visual-studio-code + - yubico-authenticator + - zoom + +homebrew_packages: + - ansible + - asciinema + - docker-compose + - git + - hugo + - iperf3 + - mas + - nmap + - wakeonlan + - wget + +configure_mas: true +mas_apps: + - { name: 1Password 7 - Password Manager,id: 1295203466 } + - { name: Apple Configurator 2,id: 1037126344 } + - { name: Blackmagic Disk Speed Test, id: 425264550 } + - { name: Final Cut Pro,id: 424389933 } + - { name: Magnet,id: 1333542190 } + - { name: Microsoft Excel,id: 1482454543 } + - { name: Microsoft Remote Desktop,id: 639968404 } + - { name: Parcel - Delivery Tracking,id: 462058435 } + - { name: Twitter,id: 1451685025 } + - { name: WhatsApp Desktop, id: 1147396723 } + - { name: WireGuard,id: 441258766 } diff --git a/requirements.yml b/requirements.yml index ae8548b..8e7b56e 100644 --- a/requirements.yml +++ b/requirements.yml @@ -1,15 +1,27 @@ -- src: 'https://github.com/MayNiklas/ansible-git.git' - name: ansible-git - scm: git -- src: 'https://github.com/MayNiklas/ansible-ssh.git' - name: ansible-ssh - scm: git -- src: 'https://github.com/MayNiklas/ansible-osx_defaults.git' - name: ansible-osx_defaults - scm: git -- src: 'https://github.com/MayNiklas/ansible-homebrew.git' - name: ansible-homebrew - scm: git -- src: 'https://github.com/MayNiklas/ansible-mas.git' - name: ansible-mas - scm: git +--- +# roles: +# - src: 'https://github.com/MayNiklas/ansible-git.git' +# name: ansible-git +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-yubikey-mac.git' +# name: ansible-yubikey +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-ssh.git' +# name: ansible-ssh +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-osx_defaults.git' +# name: ansible-osx_defaults +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-homebrew.git' +# name: ansible-homebrew +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-mas.git' +# name: ansible-mas +# scm: git +# - src: 'https://github.com/MayNiklas/ansible-shell-mac.git' +# name: ansible-shell-mac +# scm: git + +collections: + - name: community.general + source: https://galaxy.ansible.com diff --git a/roles/ansible-git b/roles/ansible-git new file mode 160000 index 0000000..ccf42e3 --- /dev/null +++ b/roles/ansible-git @@ -0,0 +1 @@ +Subproject commit ccf42e385aa119fc171e0c98497c23b9e28a52a6 diff --git a/roles/ansible-homebrew b/roles/ansible-homebrew new file mode 160000 index 0000000..872c2f8 --- /dev/null +++ b/roles/ansible-homebrew @@ -0,0 +1 @@ +Subproject commit 872c2f8124b4d781546fe41cd0a3ca6be681d244 diff --git a/roles/ansible-mas b/roles/ansible-mas new file mode 160000 index 0000000..d2ea82b --- /dev/null +++ b/roles/ansible-mas @@ -0,0 +1 @@ +Subproject commit d2ea82b90c1ff33c266aa4ec6a1cd1f828bae905 diff --git a/roles/ansible-osx_defaults b/roles/ansible-osx_defaults new file mode 160000 index 0000000..cb975be --- /dev/null +++ b/roles/ansible-osx_defaults @@ -0,0 +1 @@ +Subproject commit cb975be6754e1395a5a673bdbe38ad695946b21b diff --git a/roles/ansible-shell-mac b/roles/ansible-shell-mac new file mode 160000 index 0000000..fddfc11 --- /dev/null +++ b/roles/ansible-shell-mac @@ -0,0 +1 @@ +Subproject commit fddfc11b44fe405e849f9936773039eab99fcb94 diff --git a/roles/ansible-ssh b/roles/ansible-ssh new file mode 160000 index 0000000..2d1a087 --- /dev/null +++ b/roles/ansible-ssh @@ -0,0 +1 @@ +Subproject commit 2d1a08779cd6c24a34c4bf0ee1d1ad1c726cac46 diff --git a/roles/ansible-yubikey b/roles/ansible-yubikey new file mode 160000 index 0000000..e069a95 --- /dev/null +++ b/roles/ansible-yubikey @@ -0,0 +1 @@ +Subproject commit e069a9527ffe85a4018d66633d879351b3c21c10 diff --git a/site.yml b/site.yml index cf20e43..cb73182 100644 --- a/site.yml +++ b/site.yml @@ -4,11 +4,15 @@ roles: - role: ansible-git when: configure_git + - role: ansible-homebrew + when: configure_brew + - role: ansible-shell-mac + when: configure_shell + - role: ansible-yubikey + when: configure_yubikey - role: ansible-ssh when: configure_ssh - role: ansible-osx_defaults when: configure_osx - - role: ansible-homebrew - when: configure_brew - role: ansible-mas when: configure_mas