Advertisement
PandaAcademy

CI_CD1 Ansible 2 - Vagrantfile

Apr 6th, 2022 (edited)
457
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. VAGRANT_COMMAND = ARGV[0]
  2.  
  3. Vagrant.configure("2") do |config|
  4. config.vm.box = "bento/ubuntu-20.04"
  5.  
  6. config.vm.provider "virtualbox" do |v|
  7. v.memory = 10240
  8. v.cpus = 3
  9. end
  10. config.vm.network "private_network", ip: "192.168.44.44"
  11.  
  12. config.vm.provision "ansible_local" do |ansible|
  13. ansible.playbook = "playbooks/clone_roles.yml"
  14. ansible.extra_vars = {
  15. git_repository: "https://github.com/Panda-Academy-Core-2-0/Ansible_roles.git",
  16. git_branch: "main"
  17. }
  18. end
  19.  
  20. config.vm.provision "ansible_local" do |ansible|
  21. ansible.galaxy_role_file = 'requirements.yml'
  22. ansible.galaxy_roles_path = "/etc/ansible/roles"
  23. ansible.galaxy_command = "sudo ansible-galaxy install --role-file=%{role_file} --roles-path=%{roles_path}"
  24. ansible.playbook = "playbooks/init.yml"
  25. end
  26.  
  27. if VAGRANT_COMMAND == "ssh"
  28. config.ssh.username = 'panda'
  29. end
  30. end
  31.  
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement