create bootstrap_vms role to run vagrant file on host, creating managed vms (dkhost03 and dkhost04)
This commit is contained in:
32
roles/bootstrap_vms/tasks/main.yml
Normal file
32
roles/bootstrap_vms/tasks/main.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
# bootstrap vms on host machine
|
||||
|
||||
# install required system packages
|
||||
- name: install system packages
|
||||
apt:
|
||||
state: present
|
||||
name: "{{item}}"
|
||||
update_cache: yes
|
||||
with_items: []
|
||||
|
||||
# copy across vagrant file
|
||||
- name: create target folder
|
||||
file:
|
||||
state: directory
|
||||
dest: "{{ vagrant_folder }}"
|
||||
|
||||
- name: copy vagrant file
|
||||
copy:
|
||||
src: Vagrantfile
|
||||
dest: "{{ vagrant_folder }}/Vagrantfile"
|
||||
|
||||
# update and run vagrant boxes
|
||||
- name: update vagrant box
|
||||
command: vagrant box update
|
||||
args:
|
||||
chdir: "{{vagrant_folder}}"
|
||||
|
||||
- name: vagrant up
|
||||
command: vagrant up
|
||||
args:
|
||||
chdir: "{{vagrant_folder}}"
|
||||
Reference in New Issue
Block a user