I am trying to configure a vagrant machine to deploy a grails war file onto tomcat 7. This error comes up when I try and run the playbook:
TASK [Build application] ******************************************************* fatal: [vagrant]: FAILED! => {"changed": true, "cmd": ["sh", "/home/vagrant/src/grailsw", "war"], "delta": "0:00:00.110227", "end": "2017-03-23 12:12:07.728096", "failed": true, "rc": 1, "start": "2017-03-23 12:12:07.617869", "stderr": "Error: Could not find or load main class org.grails.wrapper.GrailsWrapper", "stdout": "", "stdout_lines": [], "warnings": []} to retry, use: --limit @/home/user/work/scratch/vagrant/petclinic_ansible/playbook.retry
If I try and create the war file by sshing into the machine, it is created, but I can't create it using ansible. This si my vagrant file:
Vagrant.configure("2") do |config|
  config.vm.define "vagrant" do |config|
      config.vm.box = "bento/ubuntu-16.04"
      config.vm.network :private_network, ip: "192.168.10.10"
      config.vm.provision "ansible" do  |ansible|
          ansible.playbook = "playbook.yml"
      end
  end
  config.vm.provider  "virtualbox" do  |vb|
      vb.memory = "1024"
      vb.customize ["modifyvm", :id, "--cableconnected1", "on"]
  end
 end
playbook.yml
- hosts: all
become: true
  roles:
      - java
      - servers
tasks:
    - name: Make sure src directory doesn't exist
      file:
        path: /home/vagrant/src
        state: absent
        force: yes
    - name: Pull repository
      git:
        repo: https://github.com/Rcsuax/grails-petclinic.git
        dest: /home/vagrant/src
        version: master
    - name: Build application
      become: true
      command: ./home/vagrant/src/grailsw war