Modified git rev-parse module

Hi, I want to perform the following task as a possible task in order to output the last commit id to local:

  - name: get latest git commit id
    local_action: "command git rev-parse HEAD"
    register: git_commit_id

but I get a warning because I use command. Since it gitis the indispensable core of the module: http://docs.ansible.com/ansible/git_module.html

How can I accomplish this with the git module?

+4
source share
1 answer

You can try, if in your case, the implementation of an indispensable local task in the remote playbook is applied, using delegation and the module : shell

local_action: <module_name> <arguments>
# in your case
local_action: shell git rev-parse HEAD
0
source

All Articles