I\'m trying to get this task to run locally (on the machine that is running the playbook) :
- name: get the local repo\'s branch name
local_action: git branch
The format for local_action is:
local_action:
In your example, Ansible thinks you are trying to use the git module and throws an error because you don't have the correct arguments for the git module. Here is how it should look:
local_action: shell git branch | awk '/^\*/{print $2}'
Source: http://docs.ansible.com/playbooks_delegation.html#delegation