Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document running playbook against local macOS VM for testing #160

Open
geerlingguy opened this issue Jul 29, 2022 · 3 comments
Open

Document running playbook against local macOS VM for testing #160

geerlingguy opened this issue Jul 29, 2022 · 3 comments
Labels

Comments

@geerlingguy
Copy link
Owner

I recently had some time to play around with virtualization options on M1, and thought I'd document some tests I'm doing with this playbook against different macOS instances running inside VMs.

For now, I'm looking at Tart and UTM.

@geerlingguy
Copy link
Owner Author

geerlingguy commented Jul 29, 2022

Tart installation is simple:

brew install cirruslabs/cli/tart
tart clone ghcr.io/cirruslabs/macos-monterey-base:latest monterey-base
tart run monterey-base

A VM is brought up with the default login admin/admin, with Remote Login on, and an IP address (at least in my case) of 192.168.64.2. It looks like the VM framework sets up a bridge100 network on the host (found using ifconfig).

Screen Shot 2022-07-29 at 11 43 51 AM

I can ssh into the VM with ssh [email protected].

To run mac-dev-playbook against the VM from my Mac, I cloned this project, then changed the inventory file:

[all]
192.168.64.2  ansible_user=admin

Then I ran the playbook:

ansible-playbook main.yml --ask-pass

(To use a password instead of an SSH key I installed brew install hudochenkov/sshpass/sshpass.)

Everything worked great!

Screen Shot 2022-07-29 at 11 50 17 AM

Now I'm considering whether it would be simpler to set up a VM in CI too, so the test rig would be identical between GitHub Actions and local!

@archae0pteryx
Copy link

@geerlingguy this is great! Doing a quick scan here i didn't see any obvious hits, but i wonder if you've ever laid out how to do this on an intel chip. I've done a bit of googling but finding the os x images is a pain. I wish there were something like tart that just "handled" it. Do you have some resources you might share that would cut down on the google guff?

@geerlingguy
Copy link
Owner Author

@archae0pteryx - I used to use https://github.com/geerlingguy/macos-virtualbox-vm but it was getting a bit complicated to try to set up a VM on Intel macOS :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants