From 164d847d9d54c0def39ab7151351a307dbc30c80 Mon Sep 17 00:00:00 2001 From: jkito Date: Sun, 20 Nov 2022 16:12:06 +0530 Subject: [build] Add README for macos build env setup playbook --- scripts/ansible/macos/README.md | 48 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 scripts/ansible/macos/README.md diff --git a/scripts/ansible/macos/README.md b/scripts/ansible/macos/README.md new file mode 100644 index 0000000..740bc6e --- /dev/null +++ b/scripts/ansible/macos/README.md @@ -0,0 +1,48 @@ +## Ansible playbook to setup Dev env for Bitmask VPN development + +### Prerequisites on the target macOS host + +Although the playbook should work for any macOS version >= 10.15 (Catalina), it has been tested on macOS versions 10.15 and 12.6. + +- SSH is enabled, go to **System Settings > Sharing** and tick **Remote Login** +- Ansible user for the host should be a sudoer +- Public key authentication for SSH is setup + +### Playbook organisation + +``` +├── inventory.yaml # Example inventory file +├── requirements.yaml # Collection and roles the playbook uses +├── site.yaml # Playbook +``` + +It currently installs Homebrew and Qt Installer FW on the target host apart from the various development tools installed from Homebrew. +All the dependencies from homebrew are defined using the `homebrew_installed_packages` variable + +For installing Homebrew and packages from it we make use of the `geerlingguy.mac.homebrew` role from the [mac ansible collection.](https://galaxy.ansible.com/geerlingguy/mac) +The included `inventory` file is just an example file for easy testing during development + +> **NOTE:** The playbook doesn't add Qt, QtIFW and Golang `bin` directories to `PATH` on some macOS versions. +This needs to be set by the user before running the `make` targets. +To get the needed filepath for Qt and Golang `bin` directories, use `brew info `. +QtIFW gets installed to a directory named _Qt_ in the user's home folder, filepath to add to `PATH` is `~/Qt/QtIFW-4.4.2/bin`. + +### How to run the playbook + +Install the required collections and modules from ansible-galaxy: + +``` +$ ansible-galaxy collection install -r requirements.yaml +$ ansible-galaxy role install -r requirements.yaml +``` + +Make sure you have a valid inventory file, update the provided `inventory.yaml` file with your VM or remote host's IP address and run: + +``` +$ ansible-playbook -i inventory.yaml site.yaml --private-key= --ask-become-pass +``` +Or to target the localhost run: + +``` +$ ansible-playbook --connection=local --ask-become-pass site.yaml +``` -- cgit v1.2.3