Installation sous macOS#
Utilisez le Terminal macOS pour toutes les commandes. WSL ne concerne pas ce parcours.
1. Identifier le processeur#
uname -marm64 désigne un Mac Apple Silicon. x86_64 désigne un Mac Intel.
2. Installer les outils Apple et Homebrew#
xcode-select --installInstallez ensuite Homebrew avec la commande affichée sur son site officiel.
Sur Apple Silicon, chargez Homebrew dans le terminal courant :
eval "$(/opt/homebrew/bin/brew shellenv)"3. Installer VirtualBox, Vagrant, Git et Python#
Installez VirtualBox :
brew install --cask virtualboxInstallez Vagrant depuis le dépôt officiel HashiCorp :
brew tap hashicorp/tapbrew install hashicorp/tap/hashicorp-vagrantInstallez Git :
brew install gitInstallez Python :
brew install python@3.12macOS peut demander d’autoriser le logiciel système Oracle dans Réglages Système > Confidentialité et sécurité. Autorisez-le, puis redémarrez si macOS le demande.
Ouvrez VirtualBox une première fois, vérifiez que sa fenêtre s’affiche, puis fermez-la.
4. Vérifier les outils locaux#
VBoxManage --versionvagrant versiongit --versionpython3.12 --versionSur Apple Silicon, si vagrant up échoue au démarrage du BIOS, exécutez la correction indiquée par le tutoriel Vagrant :
VBoxManage setextradata global "VBoxInternal/Devices/pcbios/0/Config/DebugLevel"5. Forker et cloner le TP#
Créez votre fork de https://gitlab.com/cloud_com-devops/tp-ansible-voting-app dans GitLab.
cd ~/DocumentsRemplacez VOTRE_IDENTIFIANT :
git clone https://gitlab.com/VOTRE_IDENTIFIANT/tp-ansible-voting-app.gitcd tp-ansible-voting-appgit remote -v6. Installer Ansible#
python3.12 -m venv ~/.venvs/cloud-com-devopssource ~/.venvs/cloud-com-devops/bin/activatepython -m pip install --upgrade pippython -m pip install "ansible-core>=2.17,<2.18"cd ~/Documents/tp-ansible-voting-app/ansibleexport ANSIBLE_CONFIG="$PWD/ansible.cfg"ansible-galaxy collection install -r requirements.ymlansible --version7. Installer Terraform#
brew install hashicorp/tap/terraformterraform version8. Installer AWS CLI v2#
cd /tmpcurl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o AWSCLIV2.pkgsudo installer -pkg AWSCLIV2.pkg -target /rm AWSCLIV2.pkgwhich awsaws --version9. Contrôle final macOS#
VBoxManage --versionvagrant versiongit --versionsource ~/.venvs/cloud-com-devops/bin/activatecd ~/Documents/tp-ansible-voting-app/ansibleexport ANSIBLE_CONFIG="$PWD/ansible.cfg"ansible --versionterraform versionwhich awsaws --versionNe commencez pas le déploiement tant qu’une commande de ce contrôle échoue.