geerlingguy / mac-dev-playbook Goto Github PK
View Code? Open in Web Editor NEWMac setup and configuration via Ansible.
License: Other
Mac setup and configuration via Ansible.
License: Other
See related: geerlingguy/ansible-role-homebrew#36
It seems I may be able to test everything (including idempotence) via Travis! Hurrah for not having to spin up local VirtualBox environments or wipe out one of my Macs to do full testing!
the following casks have
from https://github.com/Homebrew/homebrew-dupes:
These formulae were those that duplicated software provided by macOS.
All formulae were migrated to Homebrew/homebrew-core or deleted.
from https://github.com/Homebrew/homebrew-binary
These formulae were binary installs of software that, for whatever reason, weren't available as source builds.
This tap was deprecated because Homebrew Cask handles this use-case better. All formulae were migrated to caskroom/homebrew-cask or other taps.
from https://github.com/Homebrew/homebrew-versions
These formulae provided multiple versions of existing packages or newer versions of packages that were too incompatible to go in homebrew/core.
This tap was deprecated because homebrew/core has started to support multiple versions. All widely used, buildable formulae were migrated to homebrew/core.
Learn more about this migration in the Versions documentation.
default config should probably no longer include these in the list of taps
I've been playing around with OSX travis tests lately, and I don't believe it would be overly difficult to implement into mac-dev-playbook.
I don't know if there's any reason it isn't done already as the associated roles have tests attached to them - but is there any particular reason mac-dev-playbook wasn't made with tests in mind?
I'm thinking of doing it myself to my own fork, but I wanted to hear the reasons of decisions and gather all the information before I try it.
You might want to fix up the ~/.gitconfig file somewhere here, because I've just made a commit in your repositories in your name accidentally.
Part of my bootstrap is switching to bash4 but this requires a manual command to add it to change the login shell.
if ! grep -Fxq "/usr/local/bin/bash" /etc/shells; then
echo /usr/local/bin/bash >> /etc/shells
sudo -u oxy 'chsh -s /usr/local/bin/bash'
fi
Interested in adding post_provision_scripts
? Feel free to simply close any of these suggestions–I'll use a fork either way but posting in case you're interested.
Right now the tests are running on 10.11, but I don't use it or 10.12 anymore... and tests should usually run against the latest and greatest anyways.
Hi thanks for the repo
I'm new to ansible so forgive me if this is not specific to your work.
(Also, I am using Mojave, which might be something untested?)
When installing "mac-dev-playbook" I get this error:
TASK [geerlingguy.dotfiles : Ensure dotfiles repository is cloned locally.] ********************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'NoneType' object has no attribute 'startswith'
fatal: [127.0.0.1]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/Users/jason/.ansible/tmp/ansible-tmp-1538039081.27-262465592920192/AnsiballZ_git.py\", line 113, in <module>\n _ansiballz_main()\n File \"/Users/jason/.ansible/tmp/ansible-tmp-1538039081.27-262465592920192/AnsiballZ_git.py\", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/Users/jason/.ansible/tmp/ansible-tmp-1538039081.27-262465592920192/AnsiballZ_git.py\", line 48, in invoke_module\n imp.load_module('__main__', mod, module, MOD_DESC)\n File \"/var/folders/4n/zf2p613n7411gdzvnqr631v80000gn/T/ansible_git_payload_ca528q/__main__.py\", line 1234, in <module>\n File \"/var/folders/4n/zf2p613n7411gdzvnqr631v80000gn/T/ansible_git_payload_ca528q/__main__.py\", line 1075, in main\nAttributeError: 'NoneType' object has no attribute 'startswith'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
After a little research, I have tried downgrading Ansible to 2.5.0, and also upgrading to 2.8.0.dev0 .... however neither helped
Any ideas?
thanks
Many may not know some of the homebrew packages.
So it would be helpful to have a link to each.
What are dependencies among them?
If I have time I'll complete that on my page:
https://wilsonmar.github.io/apple-mac-osx-setup/
In the README and playbook you've stated you wanted sublime to be configured.
Purely for your information, here's how I've done it - but I based mine off Drupal.org's recommended sublime configuration. (https://www.drupal.org/docs/develop/development-tools/configuring-sublime-text
)
The recommended script is here: https://github.com/enzolutions/sublime-drupal
or more directly https://raw.githubusercontent.com/enzolutions/sublime-drupal/master/SublimeDrupal.sh
.
I haven't covered all of the scripts functionality, but I've covered a lot of it.
tasks/sublime.yml
- name: Sublime | Copying configuration
copy:
src: "./files/sublime/Library/Packages/User/Preferences.sublime-settings"
dest: "{{ sublime_dir }}/{{ sublime_packages_dir }}/User/Preferences.sublime-settings"
- name: Sublime | Install Package Manager
get_url:
url: "https://packagecontrol.io/Package%20Control.sublime-package"
dest: "{{ sublime_dir }}/{{ sublime_packageman_dir }}/Package Control.sublime-package"
- name: Sublime | Install Packages
git:
repo: "{{ item.repo }}"
dest: "{{ sublime_dir }}/{{ sublime_packages_dir }}/{{ item.name }}"
clone: yes
update: yes
force: yes
accept_hostkey: yes
become: no
with_items: "{{ sublime_packages }}"
vars/main.yml
sublime_dir: ~/Library/Application Support/Sublime Text 3
sublime_packages_dir: "Packages"
sublime_packageman_dir: "Installed Packages"
sublime_packageman_file: https://packagecontrol.io/Package%20Control.sublime-package
sublime_packages:
- name: Colorsublime
repo: https://github.com/Colorsublime/Colorsublime-Plugin.git
- name: DrupalSublimeConfig
repo: https://github.com/enzolutions/drupal-sublime-config.git
- name: BracketHighlighter
repo: https://github.com/facelessuser/BracketHighlighter.git
- name: Highlighter
repo: https://github.com/bluegray/Highlighter.git
- name: ApplySyntax
repo: https://github.com/facelessuser/ApplySyntax.git
- name: PrettyYAML
repo: https://github.com/aukaost/SublimePrettyYAML.git
- name: Dracula Color Scheme
repo: https://github.com/dracula/textmate.git
- name: Darkula
repo: https://github.com/mattchanner/darkula.git
- name: DocBlockr
repo: https://github.com/spadgos/sublime-jsdocs.git
- name: Sublime-Text-2-Goto-Drupal-API
repo: https://github.com/BrianGilbert/Sublime-Text-2-Goto-Drupal-API.git
- name: DrupalSublimeSnippets
repo: https://github.com/juhasz/drupal_sublime-snippets.git
- name: DrupalCodingStandard
repo: https://github.com/rypit/DrupalCodingStandard.git
- name: sublime-text-2-goto-documentation
repo: https://github.com/kemayo/sublime-text-2-goto-documentation.git
- name: SyncedSideBar
repo: https://github.com/sobstel/SyncedSideBar.git
- name: TrailingSpaces
repo: https://github.com/SublimeText/TrailingSpaces.git
- name: st2-drupal-autocomplete
repo: https://github.com/tanc/st2-drupal-autocomplete.git
- name: sublime-find-function-definition
repo: https://github.com/timdouglas/sublime-find-function-definition.git
- name: sublime-text-2-git
repo: https://github.com/kemayo/sublime-text-2-git.git
- name: GitGutter
repo: https://github.com/jisaacks/GitGutter.git
- name: SideBarGit
repo: https://github.com/SublimeText/SideBarGit.git
- name: SublimeLinter
repo: https://github.com/SublimeLinter/SublimeLinter.git
- name: SASS
repo: https://github.com/nathos/sass-textmate-bundle.git
- name: SideBarEnhancements
repo: https://github.com/titoBouzout/SideBarEnhancements.git
- name: CssSnippets
repo: https://github.com/P233/Emmet-Css-Snippets-for-Sublime-Text-2.git
- name: JSLint
repo: https://github.com/darrenderidder/Sublime-JSLint.git
- name: MacTerminal
repo: https://github.com/afterdesign/MacTerminal.git
- name: Theme - Soda
repo: https://github.com/buymeasoda/soda-theme.git
First of all, thanks for this nice thing! It's a great idea and I want to use it as much as possible for package installation.
Eventually also for the dotfiles handling, but not yet.
The dotfile role behaves strangely IMHO.
It does, without further warning, remove a users dotfiles and replace them with yours, which is, in most cases, not very desireable.
Nobody especially wants to commit stuff to git with your own email and such.
Nobody wants his .vimrc and .bash_profile and such erased and replaced with yours without further notice
This was not all very bad in my case as I tested it on a new system. And sure people should check what they run. But the documentation could still be better and defaults set so no destruction occurs.
But still, even after setting up my own fork of a dotfiles repository and having the files committed there in what seems to be the "proper" way, this functionality behaves strangely. It seems to checkout changed but not committed files again, removing all my changes.
This might be desireable on server systems, where I do not want any manual change to hang around.
On a desktop system where sometimes such a change happens, I dont want it to be reverted, but the system telling me to commit. I've seen that warning once or twice, but in other situations files have been just reverted.
I tried to set it uop and work properly with it, but I still experience strange situations, it seems to checkout directory of the dotfiles sometimes gets deleted completely, or local commits that I have not yet pushed seem to get lost.
The dotfiles workflow should be made optional, should work in a way that no changes are reverted without asking the user, and it should be documented how it is supposed to work with it properly.
Concrete questions:
Currently, it's just making me mad, getting in my way, and breaking adjustments I made to my system , rendering me unable to do my work in the most unfavorable moments (e.g. right now, when I just wanted to quickly add a brew package, and again something strange happened, and commenting out all dotfiles stuff didn't help, but only made it even worse... )
I noticed Travis CI errors when installing dependency roles from Ansible Galaxy. The full error message:
[ERROR]: failed to download the file: Failed to validate the SSL certificate
for github.com:443. Make sure your managed systems have a valid CA certificate
installed. You can use validate_certs=False if you do not need to confirm the
servers identity but this is unsafe and not recommended. Paths checked for this
platform: /etc/ssl/certs, /etc/ansible, /usr/local/etc/openssl. The exception
msg was: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version
(_ssl.c:590).
I believe this is because GitHub/Galaxy dropped support for TLS 1.0 and MacOS's system Python relies on an old openssl
library.
I've proposed a workaround to this error here: geerlingguy/ansible-role-homebrew#91
I noticed that you are installing node and nvm with homebrew. Why not ruby/rbenv python/pip/pipenv, php/composer?
If you are installing these with another method what is it? I know you are saying that you install ansible with pip but your missing the pip installation step. Are you using the built in python/php?
Just creating an issue to track some changes... it's been a couple months since last time I ran the playbook, plus Homebrew 1.0.0 is out, so the geerlingguy.homebrew
role has changed in the way it installs Homebrew (for new installs).
I like what @abelsonlive did here: https://github.com/abelsonlive/me/blob/master/README.md
I'll build a new OS X environment in VirtualBox then take a quick screenshot of what things look like when it's complete.
Things like NFS exports and hosts updating are annoying, since they happen mid-vagrant up
and mid-vagrant destroy
. I would like to configure sudoers by adding the following to the file:
# Vagrant sudoers config
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /bin/sed -i -e /*/ d /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE, VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
Hi! Thanks for a great repo!
I launched the ansible-playbook command and left it running. I was hoping that after coming back the playbook would had finished. Instead it was stuck asking my sudo password again.
TASK: [geerlingguy.homebrew | Get list of apps installed with cask.] **********
Password:
Can this be avoided?
See: https://github.com/argon/mas
This would be nice to get even the Mac App Store stuff automated. Or maybe just a second playbook that you can run once authenticated, something like that.
I tried to install cocoapods gem, but i get the error of not writable path. Even when i try to use the user installation flag, it is ignored and the same not writable path is used. Do i have an fucked-up ruby installation here?
What do i have to do, to get the gem installed?
default.config.yml
gem_packages:
- name: cocoapods
state: present # present/absent/latest, default: present
version: "~> 1.6.2"
user_install: yes
error:
failed: [127.0.0.1] (item={'name': 'cocoapods', 'state': 'present', 'version': '~> 1.6.2', 'user_install': True}) => {"ansible_loop_var": "item", "changed": false, "cmd": "/usr/bin/gem install --version '~> 1.6.2' --no-user-install --no-document cocoapods", "item": {"name": "cocoapods", "state": "present", "user_install": true, "version": "~> 1.6.2"}, "msg": "ERROR: While executing gem ... (Gem::FilePermissionError)\n You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.", "rc": 1, "stderr": "ERROR: While executing gem ... (Gem::FilePermissionError)\n You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.\n", "stderr_lines": ["ERROR: While executing gem ... (Gem::FilePermissionError)", " You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory."], "stdout": "", "stdout_lines": []}
Add installation of this vagrant plugin (https://github.com/cogitatio/vagrant-hostsupdater) to make it simpler to set hosts for vagrant configurations.
Would you be interested in PR's for supporting installing composer with global packages, ruby gems and npm packages?
For composer we could use geerlingguy.composer
with something like:
composer_keep_updated: true
composer_add_to_path: false
composer_add_project_to_path: false
composer_home_path: '~/.composer'
composer_home_owner: "{{ ansible_env.SUDO_USER | default(ansible_env.USER, true) | default(ansible_user_id, true) }}"
composer_home_group: "staff" # @todo
composer_global_packages:
- { name: hirak/prestissimo, release: '^0.3' }
- { name: wp-cli/wp-cli, release: '^1.0' }
- { name: drush/drush, release: '^8.1' }
For NPM and gems, we could probably just rely on the user installing the brew formulas and then use the ansible package modules.
Example failed build: https://travis-ci.org/geerlingguy/mac-dev-playbook/builds/383429609#L723-L729
The command "ansible-playbook main.yml --syntax-check" exited with 0.
1.00s$ travis_wait 30 ansible-playbook --extra-vars '{"configure_sudoers":"false"}' main.yml
�ERROR! Syntax Error while loading YAML.
found unexpected ':'
The error appears to have been in '<string>': line 1, column 19, but may
be elsewhere in the file depending on the exact syntax problem.
This only happens on the run with travis_wait
(travis_wait 30 ansible-playbook --extra-vars '{"configure_sudoers":"false"}' main.yml
); it doesn't happen if running the command directly...
See build failure: https://travis-ci.org/geerlingguy/mac-dev-playbook/builds/174228609
TASK [geerlingguy.homebrew : Ensure configured homebrew packages are installed.] ***
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated
We should be able to use travis_wait to fix this.
@geerlingguy Great work on this! 👏 I've been following various "ansible provision my Mac" projects for over a year and this is the simplest, most straightforward yet.
I was digging into the various forks, I came across @siyelo's fork that has added an install.sh file that can be run via curl without having to install anything.
You might consider pulling in the install.sh and adding the Fast Install option. 😄
I was talking with Jeff Vincent from MacStadium.com, and he likes to demo using this playbook to manage cloud Mac servers—and it would be super easy to make it easier to manage other machines by just dropping this line: https://github.com/geerlingguy/mac-dev-playbook/blob/master/main.yml#L3
Instead, that connection option can be in the inventory, and I could add in the README how to configure the inventory for remote server administration (vs. the default of running on the local host).
_____________________________________________________________
/ TASK [geerlingguy.homebrew : Ensure proper homebrew folders \
\ are in place] /
-------------------------------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
ok: [localhost] => (item=Cellar)
ok: [localhost] => (item=Homebrew)
ok: [localhost] => (item=Frameworks)
changed: [localhost] => (item=Caskroom)
changed: [localhost] => (item=bin)
ok: [localhost] => (item=etc)
ok: [localhost] => (item=include)
ok: [localhost] => (item=lib)
ok: [localhost] => (item=opt)
ok: [localhost] => (item=sbin)
ok: [localhost] => (item=share)
ok: [localhost] => (item=share/zsh)
ok: [localhost] => (item=share/zsh/site-functions)
ok: [localhost] => (item=var)
See: https://travis-ci.org/geerlingguy/mac-dev-playbook/builds/370149396#L1162-L1185
I'm guessing it's a file ownership issue, something like that. This could be an upstream issue in the geerlingguy.homebrew
role, though. In any case, tests pass otherwise... it would be nice to not have to remove the idempotence test though, especially since it's just these two tiny items in one task that are causing the failure.
failed: [127.0.0.1] => {"cmd": "/usr/bin/git clone --origin origin --branch master git://github.com/Homebrew/homebrew.git /usr/local", "failed": true, "rc": 128}
stderr: fatal: destination path '/usr/local' already exists and is not an empty directory.
The following blog entry shows how we can control dock items and position with your existing homebrew role.
https://blog.vandenbrand.org/2016/01/04/how-to-automate-your-mac-os-x-setup-with-ansible/
It would be freaking awesome to control this through your role too! I'll be using it in my forks regardless, but this is a legitimate improvement which adds to the value and purpose of this role.
vars/main.yml additions
dockitems_disabled:
- Launchpad
- Mail
- Safari
- Contacts
- Notes
- Reminders
- Maps
- Photos
- Messages
- FaceTime
- iTunes
- iBooks
- App Store
- System Preferences
- Calendar
- Terminal
dockitems_enabled:
- name: Google Chrome
path: "/Applications/Google Chrome.app"
pos: 1
- name: Tower
path: "/Applications/Tower.app"
pos: 2
- name: FirefoxDeveloperEdition
path: "/Applications/FirefoxDeveloperEdition.app"
pos: 3
- name: Sublime Text
path: "/Applications/Sublime Text.app"
pos: 4
- name: iTerm
path: "/Applications/iTerm.app"
pos: 5
- name: JetBrains Toolbox
path: "/Applications/JetBrains Toolbox.app"
pos: 6
- name: TeavViewer
path: "/Applications/TeamViewer.app"
pos: 7
tasks/dockutil.yml:
- name: Dockutil | Remove all unwanted dock items
shell: dockutil --remove "{{ item }}"
ignore_errors: true
with_items: "{{ dockitems_disabled }}"
when: "{{ dockitems_disabled | length > 0 }}"
- name: Dockutil | Adding items
shell: dockutil --find "{{ item.name }}" || dockutil --add "{{ item.path }}"
with_items: "{{ dockitems_enabled }}"
when: "{{ dockitems_enabled | length > 0 }}"
- name: Dockutil | Moving items
shell: dockutil --move "{{ item.name }}" --position "{{ item.pos }}"
with_items: "{{ dockitems_enabled }}"
when: "{{ dockitems_enabled | length > 0 }}"
Currently, the tasks/osx.yml file is called as follows:
- include_tasks: tasks/osx.yml
when: configure_osx
tags: ['osx']
Since tags are not copied to child tasks when using dynamic imports, this tag essentially doesn't do anything. The tag should either be added to the child task, or the import_tasks
module should be used instead.
(Relates to ansible/galaxy#775)
I'm opening this for documentary purposes. Roles that historically had dashes in its name can no longer be downloaded with dashes. Underscores must be used instead. As of now, I have no idea if that change was intentional.
Since it could have modifications already.
Better use lineinfile module.
Now that macOS 10.12.1 includes built-in remapping for Caps Lock-to-Escape, I've ditched Karabiner Elements (since that was the only thing I used it for). See: Remapping the Caps Lock key to Escape in macOS Sierra
But I'd still like to have that setting automated so I don't have to click through the Keyboard system preferences when setting up my Mac fresh.
See: Updating modifier key mappings through defaults command tool; the setting has to be set per keyboard (in my case, I have two, an 'Apple Keyboard', and an 'Apple Internal Keyboard / Trackpad', with unique IDs. I'd have to set it up (maybe in the .osx
bash script in my dotfiles?) to add the mapping for each keyboard detected.
I have quite a hacky piece of AppleScript I use to set the default terminal theme. It was pulled from some dotfiles/setup repo but I can't remember where so I'm not able to give proper attribution to the original author. I'm not that familiar with Ansible so I can't make a proper pull request, but I'll leave it here in bash form in case you want to integrate it.
osascript <<EOD
tell application "Terminal"
local allOpenedWindows
local initialOpenedWindows
local windowID
set themeName to "Flat" (* Set the name of the theme*)
(* Store the IDs of all the open terminal windows. *)
set initialOpenedWindows to id of every window
(* Open the custom theme so that it gets added to the list
of available terminal themes (note: this will open two
additional terminal windows). *)
do shell script "open '$HOME/Desktop/" & themeName & ".terminal'"
(* Wait a little bit to ensure that the custom theme is added. *)
delay 1
(* Set the custom theme as the default terminal theme. *)
set default settings to settings set themeName
(* Get the IDs of all the currently opened terminal windows. *)
set allOpenedWindows to id of every window
repeat with windowID in allOpenedWindows
(* Close the additional windows that were opened in order
to add the custom theme to the list of terminal themes. *)
if initialOpenedWindows does not contain windowID then
close (every window whose id is windowID)
(* Change the theme for the initial opened terminal windows
to remove the need to close them in order for the custom
theme to be applied. *)
else
set current settings of tabs of (every window whose id is windowID) to settings set themeName
end if
end repeat
end tell
EOD
I just want to question how getting installed packages on the path is achieved with the default set up. I would have expected either
/usr/local/Cellar gets added to the path (i.e. in the .bash_profile)
symlinks are created in /usr/local/bin (i.e. for the homebrew module using state=linked rather than state=present)
I don't see evidence of either, so just wondering what is required to get this playbook working
There is a catch all in the README about brew issues and running brew doctor, so here is the info I see
That is how I see things at least, but I'm probably missing something so would be happy to be shown the way
If the user replaces the default BSD sed
with GNU sed
through homebrew, the path will be /usr/local/bin/sed
rather than /usr/bin/sed
, and therefore the passwordless sudo wont work.
Disclaimer:
Personally it's always been confusing to me when the default tools on macos are a) waaay outdated and b) BSD versions rather than GNU versions which I'm used to from Linux (sed flags being particularly confusing in it's BSD version). To normalize my environments I update all builtin packages and switch to GNU when possible https://github.com/oxyc/mac-dev-playbook/blob/master/config.yml#L31:L68
I'm running the playbook on a new macbook pro 10.13.1 with some apps installed. When running this playbook it initially failed on brew
. see MacOs High Sierra gives problem with Homebrew permissions #55
After I solved that issue I ran into the issue that it will never finish properly due to some overlap in apps needing to be installed and those already on the device. This seems to be related to how homebrew-cask is supposed to behave: Exit with error, if the app is already there ?
Is there an option or workaround to ignore/update apps that are already present on the device?
The issue relates to this part of the code:
homebrew_installed_packages:
# - ansible # Installed via Pip.
- autoconf
- bash-completion
- chromedriver
- doxygen
- gettext
- gifsicle
- git
- go
- gpg
- hub
- httpie
- iperf
- libevent
- sqlite
- mcrypt
- nmap
- node
- nvm
- ssh-copy-id
- cowsay
- readline
- openssl
- pv
- wget
- wrk
homebrew_taps:
- homebrew/core
- caskroom/cask
- homebrew/php
homebrew_cask_appdir: /Applications
homebrew_cask_apps:
- docker
- dropbox
# - fing # Download link keeps getting changed, d'oh!
- firefox
- google-chrome
- handbrake
- licecap
- limechat
- macvim
- sequel-pro
- skitch
- slack
- sublime-text
- transmit
- vagrant
- virtualbox
Is it still a requirement to manually install Apple's command line tools as the README suggests or was this fixed in geerlingguy/ansible-role-homebrew#53? I'm not entirely clear if it's the same command line tools as the tasks performed are very different...
I personally have a few projects I want to install that aren't available as brew formulas.
Some examples:
make install
.Not sure how to automate the installation of dmg
packages in a proper way, but I'll look into it. One idea that would make the playbook flexible enough to install my first two requirements is:
extra_git_installs:
- repo: https://github.com/chriskempson/base16-shell
destination: ~/.local/lib/base16-shell
- repo: [email protected]:oxyc/vimrc.git
destination: ~/Projects/Personal/vimrc
accept_hostkey: yes
install_command: "make install"
Thoughts? Should I just keep this in my fork or might something like this be useful for you or others?
When using a CLI like iTerm2, or similar, the "Get current Terminal profile" fails which ultimate fails the ansible playbook. We'll need to add a line to prompt which CLI the user is using.
I'm currently trying to install Java via homebrew but the task "Install configured cask applications." hangs forever and never returns when I run it on my laptop remotely.
Run:
'ansible-playbook main.yml -l macbook -i inventory --user=$USERNAME --ask-pass -K -vvvv'
With this very simple playbook:
- hosts: all
roles:
- role: geerlingguy.homebrew
homebrew_upgrade_all_packages: no
homebrew_taps: []
homebrew_installed_packages: []
homebrew_cask_apps:
- java
homebrew_use_brewfile: no
when: ansible_os_family == "Darwin"
tags: ['home-brew']
I suspect an issue related to permissions between brew and ssh, maybe it requires a password and it hangs forever.
For instance I've the following error when running the brew command directly from ssh:
ssh $USERNAME@macbook 'PATH=/usr/local/bin:$PATH && brew cask install java'
==> Caveats
This Cask makes minor modifications to the JRE to prevent issues with
packaged applications, as discussed here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
If your Java application still asks for JRE installation, you might need
to reboot or logout/login.
Installing this Cask means you have AGREED to the Oracle Binary Code
License Agreement for Java SE at
https://www.oracle.com/technetwork/java/javase/terms/license/index.html
==> Satisfying dependencies
==> Downloading http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-macosx-x64.dmg
Already downloaded: /Users/username/Library/Caches/Homebrew/Cask/java--1.8.0_144-b01,090f390dda5b47b9b721c7dfaa008135.dmg
==> Verifying checksum for Cask java
==> Installing Cask java
==> Running installer for java; your password may be necessary.
==> Package installers may write to any location; options such as --appdir are ignored.
==> sudo: no tty present and no askpass program specified
Error: Command failed to execute!
==> Failed command:
/usr/bin/sudo -E -- /usr/sbin/installer -pkg /usr/local/Caskroom/java/1.8.0_144-b01,090f390dda5b47b9b721c7dfaa008135/JDK 8 Update 144.pkg -target /
==> Standard Output of failed command:
==> Standard Error of failed command:
sudo: no tty present and no askpass program specified
==> Exit status of failed command:
#<Process::Status: pid 17126 exit 1>
Error: Install incomplete.
Any idea about this error? How could I workaround this?
The xcode9.3
build is resulting in the following error:
TASK [geerlingguy.homebrew : Install configured cask applications.] ************
ok: [localhost] => (item=firefox)
failed: [localhost] (item=macvim) => {"ansible_loop_var": "item", "changed": false, "item": "macvim", "msg": "Error: macOS Catalina or newer is required."}
See build: https://travis-ci.org/github/geerlingguy/mac-dev-playbook/jobs/668262171
The file now starts with:
---
- hosts: localhost
user: jgeerling
Should we change "jgeerling" to our my own Mac account name?
How could I use this role to install a formula that depends on certain casks?
In my case I want to install wine, which requires the cask xquartz. I imagine there could be other similar cases.
Currently the osx script is hardcoded as ~/.osx --no-restart
while I personally keep it in an .osx/
subfolder of my dotfiles repo–It would be nice if this was configurable. As you pass arguments to your script maybe just add it an osx_script
variable?
I dropped a bottle on my laptop during the night and apparently the MacBook 12" isn't as durable as it looks... Once I get my fork of this project set up, and vim configured, I can start pushing PR's for review.
Having some trouble getting a success on three casks, I'm just wondering what the standard practice on resolving this problem is? I've tried a lot of things so far and so far nothing has fixed it.
failed: [127.0.0.1] (item=adobe-creative-cloud) => {"changed": true, "cmd": ["bash", "-l", "-c", "/usr/local/bin/brew cask install adobe-creative-cloud --appdir=/Applications"], "delta": "0:00:05.343239", "end": "2016-09-25 00:36:41.952803", "failed": true, "item": "adobe-creative-cloud", "rc": 1, "start": "2016-09-25 00:36:36.609564", "stderr": "Error: Failed to eject /private/tmp/dmg.JZOyio", "stdout": "==> Downloading https://ccmdls.adobe.com/AdobeProducts/KCCC/1/osx10/CreativeCloudInstaller.dmg\n==> No checksum defined for Cask adobe-creative-cloud, skipping verification", "stdout_lines": ["==> Downloading https://ccmdls.adobe.com/AdobeProducts/KCCC/1/osx10/CreativeCloudInstaller.dmg", "==> No checksum defined for Cask adobe-creative-cloud, skipping verification"], "warnings": []}
Similar to how I do it for Drupal VM. I can have default.config.yml
, with config.yml
to allow vars to be overridden.
Been a while since I've run this playbook. But setting up a new machine today I hit a problem when running for the first time complaining about a syntax error in the inventory.
I'm not sure if this is ansible now preferring the YAML inventory syntax over INI but adding -I
to the command seems to have done the trick.
Console output:
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that
the implicit localhost does not match 'all'
PLAY [all] *********************************************************************
skipping: no hosts matched
PLAY RECAP *********************************************************************
ERROR! Syntax Error while loading YAML.
expected '<document start>', but found '<scalar>'
The error appears to be in '/Users/ryanh/Development/Projects/git/mac-dev-playbook/inventory': line 2, column 1, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
[localhost]
127.0.0.1
^ here
Not sure if I've ever thanked you for this project so thanks @geerlingguy. It's a must for setting up a new dev machine in a reproducible way.
Cheers!
Ryan
seems by default pip_install uses python2.7 - is there a way to say "install with pip3/python3" ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.