--- tags: - Scirpts - Desktop --- Copy this to a local sh (shell) file. ``` #!/bin/bash install_on_fedora() { sudo dnf install -y ansible } install_on_ubuntu() { sudo apt-get update sudo apt-get install -y ansible } install_on_mac() { brew install ansible } OS="$(uname -s)" case "${OS}" in Linux*) if [ -f /etc/fedora-release ]; then install_on_fedora elif [ -f /etc/lsb-release ]; then install_on_ubuntu else echo "Unsupported Linux distribution" exit 1 fi ;; Darwin*) install_on_mac ;; *) echo "Unsupported operating system: ${OS}" exit 1 ;; esac # ansible-playbook ~/.bootstrap/setup.yml --ask-become-pass ansible-playbook -i ~/.bootstrap/inventory ~/.bootstrap/install-all-apps.yaml --ask-become-pass echo "Ansible installation complete." ```