Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
listing hosts affected by a play before actually running it
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael DeHaan  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 9:52 pm
From: Michael DeHaan <michael.deh...@gmail.com>
Date: Thu, 16 Aug 2012 21:52:31 -0400
Local: Thurs, Aug 16 2012 9:52 pm
Subject: listing hosts affected by a play before actually running it
Seth Vidal has added a very nice --list-hosts to /usr/bin/ansible-playbook.

When using this, it will show what hosts ansible would have talked to in each play, without actually talking to them.

This is a great way to check your patterns before actually running commands.

Try it in the latest git version.

--Michael


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seth Vidal  
View profile  
 More options Aug 17 2012, 12:36 am
From: Seth Vidal <skvi...@fedoraproject.org>
Date: Fri, 17 Aug 2012 00:36:49 -0400 (EDT)
Local: Fri, Aug 17 2012 12:36 am
Subject: Re: [ansible-project] listing hosts affected by a play before actually running it

On Thu, 16 Aug 2012, Michael DeHaan wrote:
> Seth Vidal has added a very nice --list-hosts to /usr/bin/ansible-playbook.

> When using this, it will show what hosts ansible would have talked to in each play, without actually talking to them.

> This is a great way to check your patterns before actually running commands.

> Try it in the latest git version.

If anyone wants to work on enhancing this - I'd love for it to take a
playbooks path and look for any other playbook referencing this playbook
and traversing those for hosts as well.

I just want to be able to have admins on the team I'm on be able to know
what they are going to impact before running it.

-sv


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael DeHaan  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 7:48 am
From: Michael DeHaan <michael.deh...@gmail.com>
Date: Fri, 17 Aug 2012 07:48:46 -0400
Local: Fri, Aug 17 2012 7:48 am
Subject: Re: [ansible-project] listing hosts affected by a play before actually running it

> If anyone wants to work on enhancing this - I'd love for it to take a
> playbooks path and look for any other playbook referencing this playbook
> and traversing those for hosts as well.

I actually don't think that should be in core that way, but could be another script on top that calls this as is, yeah.

You could list the playbook files in the git diff, find all the playbook files in the diff, and run ansible-playbook --list-hosts on all of them, I'd think.

You would want to make sure something was a playbook and not a task list or it might not work great though.   This might need be a bit of a fuzzy match, unless you have the convention of putting all your tasks and handler file includes in a "tasks/" directory or something (which is a good idea anyway).

> I just want to be able to have admins on the team I'm on be able to know
> what they are going to impact before running it.

Totally.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Seth Vidal  
View profile  
 More options Aug 17 2012, 9:38 am
From: Seth Vidal <skvi...@fedoraproject.org>
Date: Fri, 17 Aug 2012 09:38:09 -0400 (EDT)
Local: Fri, Aug 17 2012 9:38 am
Subject: Re: [ansible-project] listing hosts affected by a play before actually running it

On Fri, 17 Aug 2012, Michael DeHaan wrote:

>> If anyone wants to work on enhancing this - I'd love for it to take a
>> playbooks path and look for any other playbook referencing this playbook
>> and traversing those for hosts as well.

> I actually don't think that should be in core that way, but could be
> another script on top that calls this as is, yeah.

I agree.

> You could list the playbook files in the git diff, find all the playbook
> files in the diff, and run ansible-playbook --list-hosts on all of them,
> I'd think.

> You would want to make sure something was a playbook and not a task list
> or it might not work great though.  This might need be a bit of a fuzzy
> match, unless you have the convention of putting all your tasks and
> handler file includes in a "tasks/" directory or something (which is a
> good idea anyway).

I was thinking of parsing the playbook into 'plays' then saying 'if this
play has no hosts: section then it is only included by other playbooks'

and then go looking for that filename in a tree of playbooks.

I think that would work.... not sure.

-sv


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael DeHaan  
View profile   Translate to Translated (View Original)
 More options Aug 17 2012, 9:51 am
From: Michael DeHaan <michael.deh...@gmail.com>
Date: Fri, 17 Aug 2012 09:51:19 -0400
Local: Fri, Aug 17 2012 9:51 am
Subject: Re: [ansible-project] listing hosts affected by a play before actually running it

> I was thinking of parsing the playbook into 'plays' then saying 'if this
> play has no hosts: section then it is only included by other playbooks'

Yeah, sort of -- if a playbook A includes playbook B, each play in
playbook B must still define a "hosts:" section.

However, if there's no element in there with a "hosts:" line in the
YAML, it's not a playbook.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »