# root of hg tree?

**URL:** <https://forum.ansible.com/t/root-of-hg-tree/17119>\
**Category:** Ansible Project\
**Created:** [December 20, 2014, 5:07pm UTC](https://forum.ansible.com/t/root-of-hg-tree/17119 "2014-12-20T17:07:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roy\_Smith](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@Roy\_Smith](https://forum.ansible.com/u/Roy_Smith)\
**Post date:** [December 20, 2014, 5:07pm UTC](https://forum.ansible.com/t/root-of-hg-tree/17119/1 "2014-12-20T17:07:43Z")

</div>

I want to set a playbook variable to the root of my hg tree, i.e. capture the output of the “hg root” command run on my local host. How do I do that?

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [December 21, 2014, 2:27pm UTC](https://forum.ansible.com/t/root-of-hg-tree/17119/2 "2014-12-21T14:27:17Z")

</div>

‘register’ and perhaps ‘set\_fact’ are probably what you need - here’s an example:

`  
$ cat set\_fact.yml
