My Mac sets up itself-with Ansible!
HTML-код
- Опубликовано: 2 авг 2024
- Treat your Mac like cattle, not a pet!
I automate my Macs' setup and configuration with the Mac Dev Playbook: github.com/geerlingguy/mac-de...
Ansible 101 - Episode 1: www.jeffgeerling.com/blog/202...
Ansible for DevOps: www.ansiblefordevops.com
Support me on Patreon: / geerlingguy
Sponsor me on GitHub: github.com/sponsors/geerlingguy
#Mac #Apple #Ansible
Contents:
00:00 - I have a problem...
01:05 - The Mac Dev Playbook
02:04 - 3-2-1 Backup Plan
03:05 - Running the playbook
04:27 - Aftermath
05:18 - Nothing is perfect
05:58 - Advantage of automation
06:41 - What about Linux and Windows?
07:08 - Outtakes Наука
I hope when alien archeologists visit and judge humanity, they heavily weight Jeff's wholesome backup archive.
Similarly, I hope the tape files from mine have degraded by then.
@@edwardallenthree lol
I am a little concerned about that Dropbox component. I hope he’s using encrypted volumes that are then uploaded to Dropbox as opaque objects.
What is it like to be organized?
Haha, 'selective organization'-don't go look in the workshop right now, or on the shelf by my network rack!
What is this "organized" you speak of?
I wonder why not every OS have this for the average user. Android and Chromebooks yes. Windows or Mac no.
He's organized until Red Shirt Jeff comes around...
@@JeffGeerling at least you can name the places where it's a mess.. and just the two.. lol
I hope the box was empty. Otherwise, Louis Rossman gets another customer, and I don't think he has the circuit diagram for those m1 macs yet 😭
00:01 The moment you're happy that the internal storage is solid but still unhappy because it's soldered and you can't upgrade it.
@@devotee some chinese hardware hackers already managed to add ram to the m1 mac. As for the ssd, you can always use an external ssd. Don't be excited if you can't desolder the logic board, though. 😂
Also, chances are that macos will disable adding ram through the OS itself. But atleast it's not "non upgradeable" for some. 😂😂
I love that automation xkcd comic. "The word automate comes from two root words, "AUTO" meaning self, and "MATE" meaning to screw..."
Are you okay Jeff, do you need a hug ?
Don't we all?
_hugs all of you_
That was a really good video. I have a MBP I received when a previous job upgraded their hardware. I hadn't considered the clean install vs constant upgrading cycle as a possible cause of slowdowns. Thanks!
I've been doing this on my Linux laptops for the past 7 or 8 years or so and it's been really great. It does take some discipline to update the playbooks and roles when installing or removing software, which I don't always have.
So far I've only got to the bit with the drawings. Geniunely the best laugh I've had in a very long time. Reminds me SO much of me! Thank you - brilliant.
"I just bought two"... "I just bought one new mac" would have been the perfect tribute to "History of the World Pt. 1", the scene where Moses drops 5 of the 15 commandments always cracks me up :D
Please don’t drop things like Linus!! 😂😂
Omg a growtopia player how are you I play this game to
Jeff Tech Tip :)
I thought he's red shirt jeff which is using another shirt to make a video 😂
Yup, just started a playbook for my developer team. Using quite a lot of your PHP roles so THX!
"Your Laptop is cattle not a pet " - Blue shirt Jeff
What a perfect introduction Jeff . Super awesome.
Ansible is amazing. I have done a lot with Ansible and Windows recently. Even Windows automation works great.
Again a big thing from you. You started my journey with Ansible and one day I will post something bigger like you. Thanks for your hardwork and support towards open community 🙏
@Jéff Geerlíng I thought it's your number Jeff. I even saved it. Then I got it
My current iMac is at least the third generation iMac I've owned. Each new machine has been the result of a "helpful" Migration Assistant port. We're talking about an accumulation of at least 11 years of files, drivers, trial software, etc, etc, etc [aka junk].
I'm ready to do a clean install of macOS Monterey and reinstall just what I'm using presently.
I've created a VirtualBox of Monterey and got the mac-dev-playbook running in it.
I cloned the fresh install and am getting ready to build my own playbook.
This is a great resource. Thanks for posting it!
Very cool! I think that maybe the next step in the evolution of a setup like yours would be using containers only. (At least for terminal/Unix stuff you can easily achieve that with docker )
Whenever I need a boost to my mood, I re-watch the first 5 seconds of this video 😂
I had no idea you had a RUclips channel!!! This is so crazy seeing you in the flesh, your playbooks are awesome - I'd missed the one where you setup your local mac. In your video you mention that you backup to Amazon Glacier - it'd be great to see a video in detail of how you do that, and generally your backup setup
I'm planning on a full video on my backups... hopefully soon!
Wow, that was super interesting!
I will probably set something similar on my Ubuntu desktop.
But I will still treat my MacBook pro like my pet, he is gonna have his 10th birthday next week :D
Well when they reach 10 years old, you can start treating them like pets, otherwise they'll get angry and die on you suddenly!
+1 for outtakes!
Dude at the Apple Store: Would you like me to schedule you an appointment to help you set up your new mac?
Me: LOL. No.
Haha, then a day later you get the notification from Apple "Click here to view how to set up your Mac!" - X out of that!
you just missed the opportunity to do 15 commandments skit when you dropped your mac mini
Jeff, windows 10 1809+ is getting a package manager "WinGet" in the next major update cycle. You should look into it for the playbook.
Why use WinGet in a world where Chocolatey exists
@ shhh don't upset the fruit sellers.
I don't use macs but thanks for the tip. the versatility of PC suits me better. Gonna look into ansible though
Fantastic video. Could you please share more about how you configured your backup? Sounds great!
Excellent i was thinking for mac longtime.
Useful video! Thank you!
ok Jeff, you convinced me I’ll get on this ansible bandwagon. I cleared 500 GB on my harddrive by doing a clean install a month ago. so keeping that going is a good idea.
Do it!
Now this is super duper useful content, thanks
Red Shirt Jeff pushed your heart rate to the moon 😂🤣
Oh waw. Idempotent.. I always make sure my scripts are idempotent, but i never knew there was a word for it.
Thx Jeff, People at my office will now think I'm 2 times smarter. Cant wait to show up on Monday and flex this new word.
Funny and informative. Great video 👍
Major kudos for referencing Hackers! Love that movie, even now.
Hack the planet!
I knew that this will somehow be an ad for something 😆 However it's masterfully done 👍
just buy my book! 😜
Every raspberry pi is sacred. Every config unique. Red Shirt Jeff loves them all.
Jeff: "It can even do Windows, but you'll have to spend a lot more time with Powershell scrips"
My last brain cell: "Noooooooo" **Vanishes in war flashbacks**
@Jeff Geerling Automating my Linux setup (slowly*) and thinking of using packer to create an image instead of waiting for things to be pulled down ...MacOs may be tricky but are their things you can pre-bake into an image then constantly build + test (weekly/monthly)?
Thanks for the video Jeff! Curious what method you are using for your automated backups to Amazon Glacier. Possible future video idea on how you manage those and run your nighly jobs?
Great job on all the videos lately Jeff, super impressed with all the different topics you are sharing with us!
rclone, awesome little utility! I'll cover it at some point for sure
Oh Man. I switched macs just 1 month back and had to go through hell to setup all tools. Planning to get a mac mini next month, Have high hopes on this playbook
You should try Chocolaty.
I did something similar using pxe boot to install the os following ansible playbooks. It set up my ipa client as well.
This is what I needed 🤩
Ooo, this is pretty neat! Having a fresh install of apps and config is definitely the way to go instead of trying to keep an old install that's slowly falling apart alive.
Imagine having backups. I don't wait for disaster to strike, I delete all my data regularly.
Great video and playbook/ repo. I'm new to macOS and will be setting up a few machines and, from time to time, several sets of VMs. My approach has been having a centralized ansible machine. In my first run-through, I've found that the removal of Python from the newest OS versions has added a little work and a lot of time. For installing Python, maybe going with asdf is faster than an entire xcode install. Any advice?
hi Geerling, thanx for the amazing videos, we need a video explaining about the sublime text editor, especially how to configure it properly for yaml playbooks, since I tried a lot but the sublime does not show any errors in my playbook, I believe it is something related to the yamllint plugin , not sure though, thanx again and keep being AMAZING !!
Oh wow, what a serendipitous video. Just last week I decided I'm no longer making massive system backups to restore from with tons of useless junk and duplicate files and instead just use ansible playbooks. I'm even going to force myself to do clean OS installs every 6 months on my workstation machines so I don't fall into old habits again and with playbooks that shouldn't result in much more than 1~2 hrs of downtime per machine. All my important data is already synced to a NAS using either nextcloud or rsync anyways so everything else is configurations and deployment
This is the way!
You mentioned manually entering the Sublime Text license but you can automate it, see sublime text website /docs/portable_license_keys.html (had to fudge the url so spam detection doesn't kill this comment)
I have a very similar setup to yours but using shell scripts to automate 99% of my system setup rather than Ansible. It isn't _perfect_ but it gets me almost all the way to the finish line so I just deal with manually finishing a few tasks off.
Just yesterday I did an eraseinstall and had my system reinstalled and fully configured in 72 minutes 👍
Oh nice! Checking that out now.
For Windows you can use chocolatey for apps installing.
Also there is WLS ubuntu now and it can be used for additional setups :)
Wsl is a move from Microsoft (embrace,extend,extinguish) Learn Linux, personaly i use Fedora stay around redhat if proprietary isn’t sounding great.
Hi Jeff! what are you using for VM creation in replacement for Oracle virtualbox for M1?
Do you have a video on the Glacier backup?
Been using chocolatey and onedrive for a few years when I need a new machine. Using the workstation as a service is the way to go.
What are you using here for the CPU level menubar active icon?
“And do you use Linux?” Why yes I do.
/me tips hat.
"I just bought two new..."
*drops box*
"I just bought a new Mac..."
I'm a big fan of Ansible - I write all our playbooks at work, I just haven't gotten around to building out any playbooks for use at home.
My fedora 32 box is a bit more tolerant of having ancient packages from fedora 13 living on it still.
Fedora 13! That's before I started using Fedora in my testing... I believe it was around 18 or 19 before I started getting interested.
That looks awesome, I wish I'd used that before reinstalling Marcos
Automating the configuration of commercial apps seems like something there would be, umm, corporate demand for? Still working through your book on ansible and writing my playlists. For iot stuff like my raspberry pi OpenSprinkler, it is a god send.
Ya know, ya got a point with that reinstalling your mac every few years to keep it running lean and mean. And it's really annoying that you got a point because that's one of the big reasons I migrated away from windows way back when. :D
I enjoyed and learned of you when I started learning Ansible years ago and you helped shorten the learning curve learning Ansible... So thank you very much!!! I do have a question though, on my work Mac the storage on it is 256GBs and I should have install Xcode first but didn't. But now because it 30+GB's of download (thanks to iPhone/iPad (
For processes that are a mix of automated steps and manual steps I like to use the "releez" Rust crate. (...because you could really use another layer of YAML files 😂)
Throw that all inside Kubernetes, now you have YAML^3
thank you!!!!!!
I install gentoo with like 4 or 5 long command strings, sure I could automate it, but that feels pretty automated already 😂
As long as you have it stored in a text file somewhere (and not just in your brain, where you might forget it), I'll count it!
have you tried using nix on mac? you can define your entire system in nix, from setting up users (home-manager) to system level stuff (nix-darwin)
0:01 *wheeeze* JEEEEEFF!!! No wait...MAAAAAC!!!
That was SO evil and you knew that! XD
Jeff if we only have a single Mac for testing out ansible, what is an easy way to test if things are working? Possible MacOS VM in AWS or locally through Parallels maybe?
Thanks again for the great content!
No you’re not Jeff, I’m Jeff! 😳
Lots of cool unusable tech stuff Jeff. It’s fun being retired. But then again it’s still fun learning about new stuff. Just love the new M1. 😍
Dang, I don't know why I didn't think of using Ansible on MacOS until now!
Good Job.. Salute
I'm watching a Mac commercial. Great.
But the play Book only restores your Settings right ? how do you back up the Settings to your Config file from your Settings?
Jeff - "I put a joke in here, but the joke is not there. It was probably bad enough the computer automatically deleted the joke for me."
Clippy - "Do you want some help with that?"
Just for migrating from one Mac to another via time machine is what I would still prefer, but I understand why Ansible would help many people
@Jéff Geerlíng your name is changing and you are trying to imitate youtubers like thiojoe and Jeff geerling by using śíé accents.
I love that this is idempotent, might be the thing that makes me jump into Ansible. Would it be a waste of time setting this up with an existing install or should I just wait until I'm ready to start fresh?
You could slowly incorporate bits and pieces. I started the playbook just wrapping up my Homebrew casks and packages. Then I had it manage my dotfiles. Before long it did everything!
If I use pyenv to manage python versions, should I first brew install pyenv && pyenv install 3.x.x && pyenv global 3.x.x && pip install ansible before running the mac dev playbook or use the system python to run the the mac dev playbook with pyenv added to homebrew_installed_packages in config.yaml and add tasks to install python versions via pyenv?
Can you tell us the details of your LG monitor please ?
I thought u could save and load your config for Stream Deck? @5:58
Speaking of istat menus, how did you manage to hide it's icon from the dock while keeping it running?
It hides by default AFAICT; I don't think I had to change anything for that.
hi Jeff .. great tutorial !! what is the rack under the Mac mini full of knobs ???
That's my Symetrix voice processor
How's m1 for a Plex server with das?
Seems pretty overkill considering Nvidia shields do a really good job of Plex serving already
When I ran Windows I used to reinstall every winter and every summer. I did not automate it, but batched installed most things with Ninite.
Since I switched to Mac I did not feel the same need at first, so I did not do it. Now my computer have came to a crawl and I don’t know exactly what I have or need, so next reinstall will probably be a multi day process.
Is there such an app available for windows systems?
I would really like to see how you setup the Amazon Glacier backup 🙌🏻
We automated a lot of local devs laptop setup and hardening with ansible, I do find python to be its weak point and its getting more so, you can't easily guarantee the python interpreter wont have been messed around with or otherwise misconfigured before running your playbook (in addition to the dependencies). We had a few come back and the dev had ran pip as root or something and we would then need to go and manually fix python for them. In 2021 something written in go would be a cleaner design, one binary + YAMLs and that's it. Just my 2p
Abou idempotency: How did you configure your idempotency? Do you, for every install, you run an if-then? Or do you have a list you check before you run every task? I've been trying to do something like that with me data (EEG datasets) and pipelines, haven't figured out an effective way to do that yet.
Ansible does all that work for me; I just give a list of apps to install, config lines to persist, etc and Ansible sorts it all out
Does anyone here knows of a way to set or manage the 'open with application' via command line on a mac? i got pretty much everything setup automaticly now, but after a reinstall i always have to: click a document, open info dialog, picking a application to open it with and click on "change all" and finally click on "confirm' - it drives me nuts.
Does it sync files between machines?
No, for that I stick with Cloud services like Dropbox (or you could self-host something like NextCloud).
Hey jeff, any updates on using the HQ cam for astrophotography?
eye-dem-po-tent.
That's how I say it too, but who am I to argue with Merriam-Webster? 🤷♂️
I always assumed it sounded like "impotent". This is, apparently, correct in British English. I'm Canadian so I get to pick whichever I like better.
Eye always say it eye Dem Po tent, because that is how I heard it in my advanced topological spaces classes in college.
@@edwardallenthree The latin would be "ee", as determined by my almost faultless "How would Mario say it?" method, and then verified by a quick google search. So, nobody says it right.
Ive been doing this with my Linux machines for years.
Setup automation has been around since the late 1990s. It is more useful in enterprise settings that are installing hundreds if not thousands of machines at a time then when needed to have the way to reset and duplicate the setup off of a customized install of the OS. For windows cutting out what you don't want and keeping or adding on what you do want. Linux has something similar just done in a different way.
Use similar on Windows subsystem for Linux running different distros.
Real men don’t backup. They just commit and let everyone mirror.
-Linus T.
omg now I'm really curious as to what you said in that school report XD
You should look at munki to manage your devices, or even get an mdm to just boot it and let it set up all by itself :)
Super video! I applauded for $10.00 👏👏👏
Fine fine
great stuff you can program anything I marvel at sometimes, so yes I'd love your two Chennais to share but what time do spend family? Explain match.
Maybe once winget becomes a part of a standard windows installation, it'll get easier for windows PCs too
Thank you, Jeff. Did you have any issues installing software on the M1's? Any difference compared to the intel osx? Are you able to run a raspberry-os image at native speed in the new M1s?
Only a few apps (most notably Dropbox) are not native, but everything has worked perfectly, save for VirtualBox, which I'm still trying to find a suitable open source replacement for :(
I can't run Pi OS itself here, but I can recompile the kernel easy enough.
@@JeffGeerling man a vm solution for m1 would be awesome!! Been searching for one so that I can run windows vm. Bootcamp isn't supported in m1 apparently. Would love to see a video on that in future.
Thank you. One more thing, what is the app you use to display the cpu load in the top bar?
Have you looked into using the robot framework to automate the gui stuff?
Also have you looked into running something like Hashi Corp Vault to keep you secrets stored so you don't have to manually type in those passwords?
@@Mr-lq6wm is there a better tool for guis that you know of?