# Summary of newly merged patches (since last update)

**URL:** <https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928>\
**Category:** Ansible Project\
**Created:** [September 26, 2012, 1:02am UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928 "2012-09-26T01:02:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 26, 2012, 1:02am UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/1 "2012-09-26T01:02:30Z")

</div>

Hi Everyone,

Everybody's been busy and it's time for another update of all of the  
cool things I've merged lately. This is all in the changelog now,  
but here's an annotated explanation!

=== THE LIST ==

\* output on failed playbook commands is now nicely split for  
stderr/stdout and syntax errors

When running a playbook, If you have a command fail and a module gave  
you three pages of output, it's nice to not have those stderr and  
stdout messages inside the JSON curly brackets. It should now be  
much more readable in those cases. (We may be doing a bit more of  
this upgrade wise, but this is a start)

\* if local\_action is not used and delegate\_to was 127.0.0.1 or  
localhost, use local connection regardless

If someone decides to use delegate\_to instead of the "local\_action"  
syntactic sugar, it should work exactly the same. This patch also  
allows you to use a variable in "delegate\_to".

\* explicit quoting around only\_if statements is no longer neccessary

No longer do you have to say:

only\_if: "'$some\_variable' == 'foo'"

You can now say:

only\_if: '$some\_variable' == 'foo'

\* is\_unset is also available in only\_if in addition to is\_set

This is now possible:

only\_if: is\_unset($some\_variable)

Just like this was already possible:

only\_if: is\_set($some\_variable)

\* negative host matching (!hosts) fixed for external inventory script usage

If you are using inventory scripts to pull inventory from OpenStack  
Nova, EC2, or Cobbler, (etc), this fixes the handling of negative  
groups.

This is like when you would say:

hosts: all:!webservers

to select all hosts that aren't webservers. This already worked  
before but there was a small bug with script based inventory data.

\* pause plugin (pause seconds=10) (pause minutes=1) (pause prompt=foo)  
action plugin

This is a cool new feature from Tim Bielawa. This allows you to  
pause at arbitrary points of your play for X minutes or seconds, or  
until a prompt is given.

When used with the "serial" keyword it will pause every N hosts,  
otherwise it's once for all hosts.

- action: pause seconds=10  
- action: pause minutes=3  
- action: pause prompt='enter something to continue'

Etc. Try it out!

\* cleaner error messages with copy if destination directory does not exist

Previously if you tried to copy into some remote directory  
/that/did/not/exist it would tell you the destination was not  
writeable. This wasn't too clear, so now it will tell you that the  
directory  
does not exist, when it in fact does not exist 🙂

\* internals: os.executable check replaced with utils function so it  
plays nice on AIX

If you're using ansible to talk to AIX nodes, this fixes a few checks  
throughout the app. Developers should use utils.is\_executable or  
module.is\_executable where you need similar  
behavior elsewhere.

\* when running a playbook, and the statement has changed, prints  
'changed:' now versus 'ok:' so it is obvious without colored mode

When running without colors enabled (NOCOLOR=1, not supporting color  
in your terminal, etc) it wasn't easy to tell when something resulted  
in a change state when running your playbook. Now when things have  
changed, it prints "changed" vs just "ok".

\* variables now usable within vars\_prompt (just not host/group vars)

This is kind of a rare thing, but if you want to define a variable  
message to prompt with in vars\_prompt, you can now do that.

\* setup module now still works if PATH is not set

Pretty much as it says, if you for some reason don't have a PATH set,  
the setup module now won't choke.

\* Debian packaging now includes ansible-pull manpage

\* magic variable 'ansible\_ssh\_host' can override the hostname (great  
for usage with tunnels)

This has been needed for a while. What if you have lots of tunnels  
and stuff? Well, you can do this!

[servers]  
alias1 ansible\_ssh\_port=1234 ansible\_ssh\_host=bastion  
alias2 ansible\_ssh\_port=1235 ansible\_ssh\_host=bastion  
alias3 ansible\_ssh\_port=1236 ansible\_ssh\_host=bastion

And now you can easily express that kind of setup in your inventory  
file. Previously you had to use resolv.conf to implement aliases.

\* service module status now correct for services with 'subsys locked' status

\* misc fixes/upgrades to the wait\_for module

\* date command usage in build scripts fixed for OS X

\* git module now expands any "~" in provided destination paths

If you do dest=~/somedir the git module now works with that data.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [September 28, 2012, 12:12pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/2 "2012-09-28T12:12:16Z")

</div>

Minor retraction for 0.8 features -- you \*do\* have to quote python  
expressions in "only\_if".

We hit a minor snag about using variables like:

only\_if: $saved\_conditional

and had to back that one out.

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 2:59pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/3 "2012-10-17T14:59:49Z")

</div>

> Hi Everyone,
> 
> Everybody’s been busy and it’s time for another update of all of the  
> cool things I’ve merged lately. This is all in the changelog now,  
> but here’s an annotated explanation!
> 
> === THE LIST ==
> 
> - output on failed playbook commands is now nicely split for  
> stderr/stdout and syntax errors
> 
> When running a playbook, If you have a command fail and a module gave  
> you three pages of output, it’s nice to not have those stderr and  
> stdout messages inside the JSON curly brackets. It should now be  
> much more readable in those cases. (We may be doing a bit more of  
> this upgrade wise, but this is a start)
> 
> - if local\_action is not used and delegate\_to was 127.0.0.1 or  
> localhost, use local connection regardless
> 
> If someone decides to use delegate\_to instead of the “local\_action”  
> syntactic sugar, it should work exactly the same. This patch also  
> allows you to use a variable in “delegate\_to”.
> 
> - explicit quoting around only\_if statements is no longer neccessary
> 
> No longer do you have to say:
> 
> only\_if: “‘$some\_variable’ == ‘foo’”
> 
> You can now say:
> 
> only\_if: ‘$some\_variable’ == ‘foo’
> 
> - is\_unset is also available in only\_if in addition to is\_set
> 
> This is now possible:
> 
> only\_if: is\_unset($some\_variable)
> 
> Just like this was already possible:
> 
> only\_if: is\_set($some\_variable)
> 
> - negative host matching (!hosts) fixed for external inventory script usage
> 
> If you are using inventory scripts to pull inventory from OpenStack  
> Nova, EC2, or Cobbler, (etc), this fixes the handling of negative  
> groups.
> 
> This is like when you would say:
> 
> hosts: all:!webservers
> 
> to select all hosts that aren’t webservers. This already worked  
> before but there was a small bug with script based inventory data.
> 
> - pause plugin (pause seconds=10) (pause minutes=1) (pause prompt=foo)  
> action plugin
> 
> This is a cool new feature from Tim Bielawa. This allows you to  
> pause at arbitrary points of your play for X minutes or seconds, or  
> until a prompt is given.
> 
> When used with the “serial” keyword it will pause every N hosts,  
> otherwise it’s once for all hosts.
> 
> - action: pause seconds=10
> - action: pause minutes=3
> - action: pause prompt=‘enter something to continue’
> 
> Etc. Try it out!
> 
> - cleaner error messages with copy if destination directory does not exist
> 
> Previously if you tried to copy into some remote directory  
> /that/did/not/exist it would tell you the destination was not  
> writeable. This wasn’t too clear, so now it will tell you that the  
> directory  
> does not exist, when it in fact does not exist 🙂
> 
> - internals: os.executable check replaced with utils function so it  
> plays nice on AIX
> 
> If you’re using ansible to talk to AIX nodes, this fixes a few checks  
> throughout the app. Developers should use utils.is\_executable or  
> module.is\_executable where you need similar  
> behavior elsewhere.
> 
> - when running a playbook, and the statement has changed, prints  
> ‘changed:’ now versus ‘ok:’ so it is obvious without colored mode
> 
> When running without colors enabled (NOCOLOR=1, not supporting color  
> in your terminal, etc) it wasn’t easy to tell when something resulted  
> in a change state when running your playbook. Now when things have  
> changed, it prints “changed” vs just “ok”.
> 
> - variables now usable within vars\_prompt (just not host/group vars)
> 
> This is kind of a rare thing, but if you want to define a variable  
> message to prompt with in vars\_prompt, you can now do that.
> 
> - setup module now still works if PATH is not set
> 
> Pretty much as it says, if you for some reason don’t have a PATH set,  
> the setup module now won’t choke.
> 
> - Debian packaging now includes ansible-pull manpage
> 
> - magic variable ‘ansible\_ssh\_host’ can override the hostname (great  
> for usage with tunnels)
> 
> This has been needed for a while. What if you have lots of tunnels  
> and stuff? Well, you can do this!
> 
> [servers]  
> alias1 ansible\_ssh\_port=1234 ansible\_ssh\_host=bastion  
> alias2 ansible\_ssh\_port=1235 ansible\_ssh\_host=bastion  
> alias3 ansible\_ssh\_port=1236 ansible\_ssh\_host=bastion
> 
> And now you can easily express that kind of setup in your inventory  
> file. Previously you had to use resolv.conf to implement aliases.

Sorry to bug about this all the time. Is this feature working?

I’ve tried it with:

$ cat hosts.ini

[all]  
dev-aggregator01 ansible\_ssh\_port=60001 ansible\_ssh\_host=10.120.137.181

$ ansible all -i ./hosts.ini -m shell -a “uptime”  
dev-aggregator01 | FAILED =\> FAILED: %d format: a number is required, not str

Ok, i removed the “dev-” part and now the error turns into:

$ cat hosts.ini

[all]  
aggregator01 ansible\_ssh\_port=60001 ansible\_ssh\_host=10.120.137.181

$ ansible all -i ./hosts.ini -m shell -a “uptime”  
aggregator01 | FAILED =\> FAILED: [Errno -2] Name or service not known

Also,

$ telnet 10.120.137.181 60001  
Trying 10.120.137.181…  
Connected to 10.120.137.181.  
Escape character is ‘^]’.  
SSH-2.0-OpenSSH\_5.9p1

I’ve tried 0.6, 0.7.2 and 0.8 (devel 4abf23d34d).

What am I doing wrong here?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 3:04pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/4 "2012-10-17T15:04:21Z")

</div>

You have to put those on the same line as the host. Also host:port is an easier syntax. See the examples dir in the checkout.

– Michael

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 4:25pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/5 "2012-10-17T16:25:19Z")

</div>

> You have to put those on the same line as the host. Also host:port is an easier syntax. See the examples dir in the checkout.
> 
> – Michael

Oh, don’t know how you see the formatting, in Google Groups they show on the same line. So yeah, it’s a single line “host ansible\_ssh\_port=X ansible\_ssh\_host=Y”.

host:port would work for me only if I can set an alias which I can then use in playbooks, because my host file would look like:

[all]  
10.1.2.3:1000  
10.1.2.3:1001  
…  
10.1.2.3:someotherport

each of these being a different host.

So if I could write:

[all]  
10.1.2.3:1000 alias=host1  
…

and use “host1” in playbooks, that’d be great, but not sure if it’s possible, I’m still digging through the documentation and mailing list messages.

Cosmin

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [October 17, 2012, 4:28pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/6 "2012-10-17T16:28:43Z")

</div>

+1I don’t understand what Michael meant by “on the same line”

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 5:02pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/7 "2012-10-17T17:02:24Z")

</div>

"ansible\_ssh\_host" is that alias, exactly.

Requires 0.8.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [October 17, 2012, 5:25pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/8 "2012-10-17T17:25:38Z")

</div>

If using ssh as a transport (-c ssh) you can also setup host aliases that include the ports in your .ssh/config

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 5:33pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/9 "2012-10-17T17:33:19Z")

</div>

% ansible-playbook --version  
ansible-playbook 0.8 (devel 4abf23d34d) last updated 2012/10/17 17:46:20 (GMT +300)

% cat hosts.ini  
[all]  
10.120.137.181:60001 ansible\_ssh\_host=foobar

% cat test.yaml

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 5:36pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/10 "2012-10-17T17:36:27Z")

</div>

> If using ssh as a transport (-c ssh) you can also setup host aliases that include the ports in your .ssh/config

Yeah, I could do this, but it’s not much better than what we’re doing at work, i.e. having a custom /etc/hosts with “aliases”.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [October 17, 2012, 5:38pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/11 "2012-10-17T17:38:07Z")

</div>

As an alternate when using ssh as a transport, you can do the following in your ~/.ssh.config

Host myhostalias  
HostName 10.1.0.123  
Port 3324

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [October 17, 2012, 5:39pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/12 "2012-10-17T17:39:55Z")

</div>

Shouldn’t this be

foobar ansible\_ssh\_host=[10.120.137.181:60001](http://10.120.137.181:60001)

?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 5:48pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/13 "2012-10-17T17:48:34Z")

</div>

Nope, does not work like that currently

– Michael

---

<div class="post-metadata">

**Author:** ![Daniel\_Hokka\_Zakriss](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Daniel\_Hokka\_Zakriss](https://forum.ansible.com/u/Daniel_Hokka_Zakriss)\
**Post date:** [October 17, 2012, 5:56pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/14 "2012-10-17T17:56:46Z")

</div>

Cosmin Luță wrote:

> > "ansible\_ssh\_host" is that alias, exactly.
> > 
> > Requires 0.8.
> 
> % ansible-playbook --version  
> ansible-playbook 0.8 (devel 4abf23d34d) last updated 2012/10/17 17:46:20  
> (GMT +300)
> 
> % cat hosts.ini  
> [all]  
> 10.120.137.181:60001 ansible\_ssh\_host=foobar

No, you want  
foobar ansible\_ssh\_host=10.120.137.181 ansible\_ssh\_port=60001

Daniel

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 6:06pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/15 "2012-10-17T18:06:18Z")

</div>

The colon is just another way of passing the port, in other words

-- Michael

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 6:11pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/16 "2012-10-17T18:11:27Z")

</div>

> Cosmin Luță wrote:
> 
> > > “ansible\_ssh\_host” is that alias, exactly.
> > > 
> > > Requires 0.8.
> > 
> > % ansible-playbook --version  
> > ansible-playbook 0.8 (devel 4abf23d34d) last updated 2012/10/17 17:46:20  
> > (GMT +300)
> > 
> > % cat hosts.ini  
> > [all]  
> > [10.120.137.181:60001](http://10.120.137.181:60001) ansible\_ssh\_host=foobar
> 
> No, you want  
> foobar ansible\_ssh\_host=10.120.137.181 ansible\_ssh\_port=60001
> 
> Daniel

Yeah, I thought so too, but if you check my first reply in this thread, you’ll see that I’ve already tried this and it’s not working ☹

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 6:29pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/17 "2012-10-17T18:29:39Z")

</div>

It works, tested last night.

– Michael

---

<div class="post-metadata">

**Author:** ![Cosmin\_Luta](https://avatars.discourse-cdn.com/v4/letter/c/8e8cbc/32.png) [@Cosmin\_Luta](https://forum.ansible.com/u/Cosmin_Luta)\
**Post date:** [October 17, 2012, 7:51pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/18 "2012-10-17T19:51:07Z")

</div>

I’ve tried with a clean checkout (whole session here [http://pastebin.com/jCt1auAq](http://pastebin.com/jCt1auAq) ) and still doesn’t do the right thing.  
Could you point me to a commit-id where this is functional ?  
Otherwise, I’ll just drop it and consider this one of those things that work for everyone else but you :))

> It works, tested last night.
> 
> – Michael

> 

Could you point me to a commit-id where this works?

---

<div class="post-metadata">

**Author:** ![Daniel\_Hokka\_Zakriss](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Daniel\_Hokka\_Zakriss](https://forum.ansible.com/u/Daniel_Hokka_Zakriss)\
**Post date:** [October 17, 2012, 8:50pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/19 "2012-10-17T20:50:01Z")

</div>

Cosmin Luță wrote:

> I've tried with a clean checkout (whole session here  
> [http://pastebin.com/jCt1auAq](http://pastebin.com/jCt1auAq) ) and still doesn't do the right thing.  
> Could you point me to a commit-id where this is functional ?  
> Otherwise, I'll just drop it and consider this one of those things that  
> work for everyone else but you :))

It was broken recently. I've submitted a PR to fix it, but  
339c05bb88a2ab6d3585c45c7a61812ed8e0af5b~1 will work until that is merged.

Daniel

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [October 17, 2012, 9:06pm UTC](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928/20 "2012-10-17T21:06:44Z")

</div>

Your pull request breaks some other behaviors that are important with  
delegated hosts, I'll review it and see what changes I may want to  
make.

[Next page](https://forum.ansible.com/t/summary-of-newly-merged-patches-since-last-update/11928.md?page=2)
