Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

docs:virtualizacion:vagrant:inicio [2018/03/22 20:04]
127.0.0.1 editor externo
docs:virtualizacion:vagrant:inicio [2018/10/01 21:33] (actual)
rodolfo [Vagrant]
Línea 2: Línea 2:
  
   * [[Vagrant Cheat Sheet]]   * [[Vagrant Cheat Sheet]]
 +
 +===== Ansible provisioning =====
 +
 +Vagrantfile
 +
 +<​code>​
 +  config.vm.provision "​ansible_local"​ do |ansible|
 +    ansible.playbook = "​playbook.yml"​
 +    ansible.compatibility_mode = "​2.0"​
 +  end
 +</​code>​
 +
 +playbook.yml
 +
 +<​code>​
 +- hosts: all
 +  become: true
 +
 +  tasks:
 +  - name: ensure repository key is installed
 +    apt_key:
 +      id: "​58118E89F3A912897C070ADBF76221572C52609D"​
 +      keyserver: "​hkp://​p80.pool.sks-keyservers.net:​80"​
 +      state: present
 +  ​
 +  - name: ensure docker registry is available
 +    # For Ubuntu 16.04 LTS
 +    apt_repository:​ repo='​deb https://​apt.dockerproject.org/​repo ubuntu-xenial main' state=present
 +  ​
 +  - name: ensure docker and dependencies are installed
 +    apt: name={{ item }} update_cache=yes
 +    with_items:
 +      - docker-engine
 +      - docker-compose
 +  ​
 +  - name: add vagrant to docker group
 +    user: name=vagrant groups=docker append=yes
 +  ​
 +  - service: name=docker state=restarted
 +</​code>​
  
 ===== Herramientas ===== ===== Herramientas =====