I am using a Ubuntu 16.04 host with Vagrant installed on it. I would like to log the start time and end time of a set of tasks. These tasks are defined as roles. I created a role host_test role to ensure that I am able to touch
a file on my host using local_action
. But I believe as this playbook is being provisioned via Vagrant, by the time host_test role is played by ansible, Its control is inside the vagrant box rather than outside of it (my intention is to log in the host). So the file is not created on the host.
My directory structure looks like:
goal
├── playbook.yml
├── README.md
├── roles
│ ├── apache
│ │ ├── tasks
│ │ │ └── main.yml
│ │ └── templates
│ │ └── index.html
│ ├── host_test
│ │ └── main.yml
│ ├── mysql
│ │ └── tasks
│ │ └── main.yml
│ ├── package
│ │ └── tasks
│ │ └── main.yml
│ ├── php5
│ │ └── tasks
│ │ └── main.yml
│ └── vim
│ └── tasks
│ └── main.yml
└── Vagrantfile
the playbook under consideration can be found at https://github.com/srihas619/vagrant-ansible