diff --git a/conf/vagrant/Vagrantfile b/conf/vagrant/Vagrantfile index 4c53db7..a50bdd4 100644 --- a/conf/vagrant/Vagrantfile +++ b/conf/vagrant/Vagrantfile @@ -17,6 +17,7 @@ ansible_https_enabled = @ansible_https_enabled@ ansible_project_web_root = "@ansible_project_web_root@" ansible_timezone = "America/Chicago" ansible_system_packages = [] +ansible_custom_playbook = "@ansible_custom_playbook@" # end tunables Vagrant.configure(2) do |config| @@ -48,7 +49,7 @@ Vagrant.configure(2) do |config| box.ssh.forward_agent = true end - config.vm.provision "ansible" do |ansible| + config.vm.provision "the-vagrant", type: "ansible" do |ansible| ansible.playbook = "@playbook@" ansible.groups = { @@ -66,6 +67,12 @@ Vagrant.configure(2) do |config| } end + config.vm.provision "@projectname@-provision", type: "ansible" do |ansible| + if (defined?(ansible_custom_playbook) && !ansible_custom_playbook.empty?) + ansible.playbook = ansible_custom_playbook + end + end + config.trigger.before [:up, :reload] do run "composer install --ignore-platform-reqs" end diff --git a/conf/vagrant/provisioning-template/project.yml b/conf/vagrant/provisioning-template/project.yml new file mode 100644 index 0000000..bb11146 --- /dev/null +++ b/conf/vagrant/provisioning-template/project.yml @@ -0,0 +1,6 @@ +--- +- hosts: all + vars: + example_var: "This is a stub project-specific playbook." + roles: + - { role: main } diff --git a/conf/vagrant/provisioning-template/roles/main/tasks/main.yml b/conf/vagrant/provisioning-template/roles/main/tasks/main.yml new file mode 100644 index 0000000..fca7bf0 --- /dev/null +++ b/conf/vagrant/provisioning-template/roles/main/tasks/main.yml @@ -0,0 +1,4 @@ +--- +- name: Main | Example project-specific role + debug: + msg: "{{ example_var }}" diff --git a/tasks/vagrant.xml b/tasks/vagrant.xml index f682334..9f99232 100644 --- a/tasks/vagrant.xml +++ b/tasks/vagrant.xml @@ -10,21 +10,36 @@ + + + + + + + + + + + + + + + @@ -41,6 +56,21 @@ + + + + + + + + + + + + + + + @@ -77,6 +107,7 @@ +