My Mac sets up itself-with Ansible!
HTML-код
- Опубликовано: 11 июл 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 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 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. 😂😂
Yup, just started a playbook for my developer team. Using quite a lot of your PHP roles so THX!
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.
"Your Laptop is cattle not a pet " - Blue shirt Jeff
What a perfect introduction Jeff . Super awesome.
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.
Excellent i was thinking for mac longtime.
+1 for outtakes!
Ansible is amazing. I have done a lot with Ansible and Windows recently. Even Windows automation works great.
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!
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 😂
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!
Fantastic video. Could you please share more about how you configured your backup? Sounds great!
"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
Now this is super duper useful content, thanks
Useful video! Thank you!
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 )
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!
Funny and informative. Great video 👍
Whenever I need a boost to my mood, I re-watch the first 5 seconds of this video 😂
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
you just missed the opportunity to do 15 commandments skit when you dropped your mac mini
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!
Major kudos for referencing Hackers! Love that movie, even now.
Hack the planet!
Red Shirt Jeff pushed your heart rate to the moon 😂🤣
This is what I needed 🤩
I did something similar using pxe boot to install the os following ansible playbooks. It set up my ipa client as well.
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?
I knew that this will somehow be an ad for something 😆 However it's masterfully done 👍
just buy my book! 😜
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.
Do you have a video on the Glacier backup?
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 (
@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)?
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!
Good Job.. Salute
Every raspberry pi is sacred. Every config unique. Red Shirt Jeff loves them all.
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 !!
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
0:01 *wheeeze* JEEEEEFF!!! No wait...MAAAAAC!!!
That was SO evil and you knew that! XD
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
I would really like to see how you setup the Amazon Glacier backup 🙌🏻
That looks awesome, I wish I'd used that before reinstalling Marcos
thank you!!!!!!
Hi Jeff! what are you using for VM creation in replacement for Oracle virtualbox for M1?
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)
What are you using here for the CPU level menubar active icon?
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!
hi Jeff .. great tutorial !! what is the rack under the Mac mini full of knobs ???
That's my Symetrix voice processor
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.
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.
So as a youtuber, you must have gigs and gigs of video. Do you actually back all of that up to Amazon Glacier, or do you first prune it down, or do you only back up the final edited videos or do you just back up everything? Because even on glacier it's got to add up if you have a few TB of video files up there.
Also... fascinating idea. I have not considered wiping my system like that to clear it up. Of course, being a hackintosh user I tend to dread the thought of rebuilding my system.
Every clip, every bit of B-roll, it's all up there. I shoot in 1080p and delete all proxy and optimized transcoded media though, once a project is done.
"I just bought two new..."
*drops box*
"I just bought a new Mac..."
I'm watching a Mac commercial. Great.
I thought u could save and load your config for Stream Deck? @5:58
Hey jeff, any updates on using the HQ cam for astrophotography?
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**
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
omg now I'm really curious as to what you said in that school report XD
Imagine having backups. I don't wait for disaster to strike, I delete all my data regularly.
But the play Book only restores your Settings right ? how do you back up the Settings to your Config file from your Settings?
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.
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.
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?
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.
Can you tell us the details of your LG monitor please ?
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!
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
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.
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.
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?"
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
Jeff, which NAS do you use? Do you have any videos about them?
I'm currently using two ASUSTOR NASes (one is redundant, onsite backup). I did make a couple videos on my custom Pi NAS vs the ASUSTOR: ruclips.net/video/vBccak8f-VY/видео.html
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.
Dang, I don't know why I didn't think of using Ansible on MacOS until now!
Super video! I applauded for $10.00 👏👏👏
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.
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. 😍
Is there such an app available for windows systems?
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?
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.
Use similar on Windows subsystem for Linux running different distros.
“And do you use Linux?” Why yes I do.
/me tips hat.
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 :)
In the off chance you read this comment. Can you tell me how you are accessing your mac pro from the rack? Is it just long USB cable or HDMI cables from a dock? Or do you just use it for the terminal?
I have long cables, going from the rack under the desk up to the monitor up top.
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.
Lol at the thumbnail change
Can you share how much the glacier backup costs? The procing is a bit confusing even with the calculator, so if you could please shed some light on it, would be great!
(Or resources where it's explained well for noobs like me)
I currently have somewhere around 1.5 TB there, and I think it's like $5/month.
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!
I'm a big fan of the show.. just a quick one do you use nextcloud it's open source. Nextcloud is great, but it's a pain an absolute pain to get working outside the local network. It got so bad 😤 with SSL and port forwarding I bought a Wd mycloud. But I would love to get next cloud ☁️ working. Thanks Jeff good video.
I've been considering it, mostly because Dropbox keeps straying further and further from what it originally was (just a really good file storage/sync tool) :(
Voting for a full on blooper reel
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?
I'm interested to know why did you buy both the Air and Mini?
Mini can sustain higher performance for long periods, since it has a fan, plus built-in 10 Gbps networking means I don't need a dongle or extra card to get that feature.
Air is crazy-portable with huge battery life and performs just as well for shorter spurts.
You made sure you could use the Python 3 version shipped with macOS? Doesn't it solely ship with Python version 2? Can you elaborate / make a guide on how to use Python version 3 shipped with macOS?
jeeeeeff, this comment requires your attention :)
And so, where is all your data? Is it all on the NAS which doesn’t have to be restored every time you upgrade the clients? If so, then how do you take that data with you when you leave the house?
Do you buy a new NAS every year and do the same kind of automated of “from fresh” install on it? If so, do you just physically move the disks, or do you buy new disks and the have to sync the data?
I'm actually trying to figure out a better NAS plan for the long term. Right now all my video projects are on the main NAS backed up to a secondary NAS every week, and also up to Glacier.
I'd like to make it easier to port that data around and also grab live copies when I need to leave the house since my upload speeds are capped at 30-40 Mbps.