Re: [ansible-project] ios_template making changes when router config already exists

2016-05-17 Thread Luke Russell
Hi Peter,

Is there any follow up on this? Do you need anything further?


On Friday, April 15, 2016 at 10:13:07 PM UTC+10, Peter Sprygada wrote:
>
> Hi Luke, We don't actually screen scrape the configuration in this case.  
> Can you post the full playbook via a gist? (or at least the full task?)
>
> On Wed, Apr 13, 2016 at 8:45 PM, Luke Russell  > wrote:
>
>> I am using ios_template to deploy some DMVPN tunnels. For some reason it 
>> is not recognising two commands that already exist on the router - *ip 
>> nhrp map a.a.a.a b.b.b.b* and* ip nhrp nhs a.a.a.a*. I'm not really sure 
>> what is unique about these two commands to produce this affect, and it 
>> isn't currently stopping me from doing anything. It just throws a spanner 
>> in the idea of being idempotent. My guess would be a problem with the 
>> underlying regex doing the screen scraping.
>>
>> Running the playbook with -vvv option produces this output (cleaned up):
>>
>>
>> "src": 
>> !
>> interface Tunnel10
>>  description primary tunnel
>>  ip vrf forwarding VRF-A
>>  ip address 10.0.0.11 255.255.240.0
>>  no ip redirects
>>  ip mtu 1400
>>  ip nhrp authentication 10
>>  ip nhrp map multicast 172.16.0.11
>>  ip nhrp map 10.0.0.1 172.16.0.11
>>  ip nhrp network-id 10
>>  ip nhrp holdtime 360
>>  ip nhrp nhs 10.0.0.1
>>  ip nhrp shortcut
>>  ip tcp adjust-mss 1360
>>  load-interval 30
>>  delay 600
>>  qos pre-classify
>>  tunnel source Loopback1
>>  tunnel mode gre multipoint
>>  tunnel key 10
>> end
>>
>> "updates":
>> interface Tunnel10
>> ip nhrp map 10.0.0.1 172.16.0.11
>> ip nhrp ohs 10.0.0.1
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ansible-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/837e4cc8-d4cb-4091-998d-d0470f06372b%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a48934e5-099d-43de-bd73-10b1729b0b10%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Getting aws account id

2016-05-17 Thread Erick Vitor de Barros
Thanks Allen, I'll give it a try !

On Wed, May 18, 2016 at 3:32 PM, Allen Sanabria 
wrote:

> You can use a Ansible Filter Plugin.
>
> I have a repo with all of my filter plugins. Line 8 has the function you
> need.
>
> def get_account_id(region):
> client = boto3.client('iam', region_name=region)
> try:
> account_id = client.list_users()['Users'][0]['Arn'].split(':')[4]
> return account_id
> except Exception:
> raise errors.AnsibleFilterError(
> "Failed to retrieve account id"
> )
>
>
>
>
> https://github.com/linuxdynasty/ld-ansible-filters/blob/master/filter_plugins/aws.py#L8
>
>
> On Tuesday, May 17, 2016 at 8:16:26 PM UTC-7, Erick Barros wrote:
>>
>> Hi guys,
>>
>> does anyone have a good option to get the my aws account id using Ansible
>> ?
>>
>> Thanks !
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/e5d91ca1-80bf-4652-aecd-8ea0feb77d9c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKz6g-16v1ohDrJDsh4b7gpfqdx1tRW2L374EgWwLbuFmvQypg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Getting aws account id

2016-05-17 Thread Allen Sanabria
You can use a Ansible Filter Plugin. 

I have a repo with all of my filter plugins. Line 8 has the function you 
need.

def get_account_id(region):
client = boto3.client('iam', region_name=region)
try:
account_id = client.list_users()['Users'][0]['Arn'].split(':')[4]
return account_id
except Exception:
raise errors.AnsibleFilterError(
"Failed to retrieve account id"
)



https://github.com/linuxdynasty/ld-ansible-filters/blob/master/filter_plugins/aws.py#L8

On Tuesday, May 17, 2016 at 8:16:26 PM UTC-7, Erick Barros wrote:
>
> Hi guys,
>
> does anyone have a good option to get the my aws account id using Ansible ?
>
> Thanks !
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/e5d91ca1-80bf-4652-aecd-8ea0feb77d9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ho to config my network switch device?

2016-05-17 Thread aries
H Johannes:

It is white box switch. 





Johannes Kastl於 2016年5月17日星期二 UTC+8上午12時57分54秒寫道:
>
> On 16.05.16 10:01 aries wrote: 
> > Hi ian: 
>
> > Ian Cote於 2016年5月13日星期五 UTC+8上午6時10分00秒寫道: 
> >> 
> >> What make of switch?  Ansible 2.1 has support for a lot of switch 
> vendors 
>
> Maybe you get some more answers to your questions, if you ask more 
> spefically. Or if you actually answer the question, that you get 
> asked. Like the one Ian asked. 
>
> What kind of switch? Why do you have to start from scratch? Nothing 
> you can build upon? Is there an existing module that is just missing 
> some features? Stuff like that... 
>
> Johannes 
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c71e0532-5aa0-427c-a1f2-5a0fe7f345a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] newbie: Error while running Ansible API from the doc

2016-05-17 Thread Aprameya NDS
Hi,

I am a newbie to the Ansible Python API thing and i am trying out to run 
the code given in the Ansible Python API documentation (Link: 
http://docs.ansible.com/ansible/developing_api.html Python API 2.0)

I get the following error:

PLAY [Ansible Cli PoC] 
*

TASK [setup] 
***
> 
/usr/lib/python2.6/site-packages/ansible/plugins/connection/ssh.py(537)_run()
-> if C.HOST_KEY_CHECKING:
(Epdb) c
fatal: [172.16.0.234]: FAILED! => {"failed": true, "msg":* "using -c ssh on 
certain older ssh versions may not support ControlPersist, set 
ANSIBLE_SSH_ARGS=\"\" (or ssh_args in [ssh_connection] section of the 
config file) before running again"}*

NO MORE HOSTS LEFT 
*
cleanup



Can you please let me know how to proceed with this?



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fb0f78d5-32f5-4035-8b72-2c91609ce56a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible reads all files in host_vars and group_vars instead of just the ones for the specified hosts

2016-05-17 Thread Andrew Martin
Okay thanks for the clarification. So there's no way to only give access to
vaulted files in host_vars or group_vars to certain users (but let other
users run playbooks that don't require a vault file)?

On 17 May 2016 at 16:13, Matt Martz  wrote:

> There is no current way.  The way ansible inventory works is that all
> inventory files, including host vars and group vars are read and parsed
> before ansible really starts doing much of anything.
>
> There also isn't any way to know whether you may try to access an vaulted
> var for another host or group, that isn't targeted by the play, which is
> often done.
>
> On Tue, May 17, 2016 at 4:11 PM, Andrew Martin 
> wrote:
>
>> Hello,
>>
>> I am running ansible 2.0.2 on Ubuntu 14.04. I have several vaulted
>> host-specific or group-specific files in host_vars or group_vars, so
>> whenever I run "ansible-playbook", I pass the "--ask-vault" option. I
>> noticed some odd behavior - if I run with "--ask-vault" and strace the
>> "ansible-playbook" process, I see that it needs to read (and thus decrypt
>> if vaulted) ALL of the files in host_vars and group_vars, not just the
>> host_vars/myhost or host_vars/mygroup specific files that apply to the
>> hosts I'm running on (as defined in the inventory file). How can I
>> configure ansible to only read the specific host_vars and group_vars files
>> that it needs, rather than this entire directory every time? Because it is
>> reading every file, it takes a lot longer (since it has to decrypt all of
>> the vault files, even ones that aren't used).
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To post to this group, send email to ansible-project@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/185eb7ef-991c-48c6-8253-ad2a0dfc4d9a%40googlegroups.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/v6o6hXxoyVs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAD8N0v956B230ZLTxecqHYM3KRXV6UpVisLJBepZfhKSvuxczg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAE%2B0DR7HU%2Bt0McWvyQjFaXhyEp5nruPx%2BySDxLohZbEfPQTJpQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible reads all files in host_vars and group_vars instead of just the ones for the specified hosts

2016-05-17 Thread Matt Martz
There is no current way.  The way ansible inventory works is that all
inventory files, including host vars and group vars are read and parsed
before ansible really starts doing much of anything.

There also isn't any way to know whether you may try to access an vaulted
var for another host or group, that isn't targeted by the play, which is
often done.

On Tue, May 17, 2016 at 4:11 PM, Andrew Martin 
wrote:

> Hello,
>
> I am running ansible 2.0.2 on Ubuntu 14.04. I have several vaulted
> host-specific or group-specific files in host_vars or group_vars, so
> whenever I run "ansible-playbook", I pass the "--ask-vault" option. I
> noticed some odd behavior - if I run with "--ask-vault" and strace the
> "ansible-playbook" process, I see that it needs to read (and thus decrypt
> if vaulted) ALL of the files in host_vars and group_vars, not just the
> host_vars/myhost or host_vars/mygroup specific files that apply to the
> hosts I'm running on (as defined in the inventory file). How can I
> configure ansible to only read the specific host_vars and group_vars files
> that it needs, rather than this entire directory every time? Because it is
> reading every file, it takes a lot longer (since it has to decrypt all of
> the vault files, even ones that aren't used).
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/185eb7ef-991c-48c6-8253-ad2a0dfc4d9a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v956B230ZLTxecqHYM3KRXV6UpVisLJBepZfhKSvuxczg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible reads all files in host_vars and group_vars instead of just the ones for the specified hosts

2016-05-17 Thread Andrew Martin
Hello,

I am running ansible 2.0.2 on Ubuntu 14.04. I have several vaulted 
host-specific or group-specific files in host_vars or group_vars, so 
whenever I run "ansible-playbook", I pass the "--ask-vault" option. I 
noticed some odd behavior - if I run with "--ask-vault" and strace the 
"ansible-playbook" process, I see that it needs to read (and thus decrypt 
if vaulted) ALL of the files in host_vars and group_vars, not just the 
host_vars/myhost or host_vars/mygroup specific files that apply to the 
hosts I'm running on (as defined in the inventory file). How can I 
configure ansible to only read the specific host_vars and group_vars files 
that it needs, rather than this entire directory every time? Because it is 
reading every file, it takes a lot longer (since it has to decrypt all of 
the vault files, even ones that aren't used).

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/185eb7ef-991c-48c6-8253-ad2a0dfc4d9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] host-pattern and wild cards

2016-05-17 Thread Matt Martz
The problem is most likely shell expansion of `*`.  You probably have some
files in your directory that have `sync` in the name.

echo *proxy*
echo *sync*

When using chars in a command that could be interpreted by the shell, you
should ensure you use quoting such as:

ansible '*sync*' -i /tmp/killthis.txt --list-hosts

On Tue, May 17, 2016 at 11:40 AM, Kenny Serrine  wrote:

> I'm using wildcards to match my hosts, and it works in one case but not in
> another.  I've figured out that if I use a regex pattern, I can get
> consistency.  But, for just simple wildcard, I'm wondering if this is a bug
> or if I'm just doing something that the command line parser wasn't designed
> to handle.  Maybe the documentation just needs to be clear about the limits
> of wildcards?
> I have version 2.0.2.0 of ansible.
>
> *Here is the example hosts file I'm using:*
>
> [root@ap01 Scripts]# cat /tmp/killthis.txt
>
> [group1]
> myproxy1.example.net
> mysync1.example.com
>
> [group2]
> myproxy2.example.net
> mysync2.example.com
>
>
> *And, here are the commands I'm using.  As you can see, *proxy* seems to
> work, but *sync* fails, and *ync* really fails*.
>
> [root@p01 Scripts]# ansible *proxy* -i /tmp/killthis.txt --list-hosts
>
>
>   hosts (2):
> myproxy1.example.net
> myproxy2.example.net
>
> [root@01 Scripts]# ansible *sync* -i /tmp/killthis.txt --list-hosts
>
>  [WARNING]: provided hosts list is empty, only localhost is available
>
>   hosts (0):
>
> [root@p01 Scripts]# ansible *ync* -i /tmp/killthis.txt --list-hosts
>
> Usage: ansible  [options]
>
> Options:
>   -a MODULE_ARGS, --args=MODULE_ARGS
> [snip]
>   --version show program's version number and exit
> ERROR! Missing target hosts
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/3f7b60c3-0dc7-4f8f-b8d6-645ea76ba17e%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v9V%2BLObPgx%3DxPAVpuqtkdAR9HptQkzcoXfFAZs_M7T-vA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible and Intersystems Cache'/Ensemble

2016-05-17 Thread tom . elmer
Has anyone in the community used Ansible with Intersystems 
Cache'/Ensemble?  If so, can you guide me to information about how to do so?

Thanks, 

Tom

FYI:  I am brand new to Ansible and any tool like it.

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/91a369f9-aefe-400d-957f-03864a7a0277%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] host-pattern and wild cards

2016-05-17 Thread Kenny Serrine
I'm using wildcards to match my hosts, and it works in one case but not in 
another.  I've figured out that if I use a regex pattern, I can get 
consistency.  But, for just simple wildcard, I'm wondering if this is a bug 
or if I'm just doing something that the command line parser wasn't designed 
to handle.  Maybe the documentation just needs to be clear about the limits 
of wildcards?
I have version 2.0.2.0 of ansible.

*Here is the example hosts file I'm using:*

[root@ap01 Scripts]# cat /tmp/killthis.txt

[group1]
myproxy1.example.net
mysync1.example.com

[group2]
myproxy2.example.net
mysync2.example.com


*And, here are the commands I'm using.  As you can see, *proxy* seems to 
work, but *sync* fails, and *ync* really fails*.

[root@p01 Scripts]# ansible *proxy* -i /tmp/killthis.txt --list-hosts


  hosts (2):
myproxy1.example.net
myproxy2.example.net

[root@01 Scripts]# ansible *sync* -i /tmp/killthis.txt --list-hosts

 [WARNING]: provided hosts list is empty, only localhost is available

  hosts (0):

[root@p01 Scripts]# ansible *ync* -i /tmp/killthis.txt --list-hosts

Usage: ansible  [options]

Options:
  -a MODULE_ARGS, --args=MODULE_ARGS
[snip]
  --version show program's version number and exit
ERROR! Missing target hosts



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3f7b60c3-0dc7-4f8f-b8d6-645ea76ba17e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running powershell script from ansible playbook

2016-05-17 Thread Matt Davis
Yeah- it's displaying on a headless winstation, not a user-interactive one 
(by Windows/WinRM design). There are various hacks to get around it, but 
none of them are foolproof (you can't make assumptions about which session 
is interactive, or which user might see it in the case of multiple). 
Microsoft will tell you "don't do it", especially for a service you don't 
own (eg, WinRM). More info at: 
https://msdn.microsoft.com/en-us/library/windows/desktop/ms683502(v=vs.85).aspx 
- 
the stuff on WTSSendMessage() might be of interest to you as a workaround, 
though you still have to figure out which user(s)/sessions you want to 
notify...


On Tuesday, May 17, 2016 at 9:34:01 AM UTC-7, skinnedknuckles wrote:
>
> Very interesting.  The process shows up in task manager for exactly 15 
> seconds just as it should but the console is nowhere to be found.  I'd like 
> to know if anyone knows a way around this.
>
> On Tuesday, May 17, 2016 at 9:57:06 AM UTC-5, skinnedknuckles wrote:
>>
>> Control node:
>>
>>- CentOS 7
>>- Ansible 2.1
>>
>> Remote node:
>>
>>- Windows 7
>>- Powershell 3.0
>>
>>
>> I have a powershell script (warning.ps1) on my remote node that runs fine 
>> when I double click on it.  I also have a copy of the powershell script in 
>> my control node playbook directory.  As I understand, the following play 
>> ought to run the powershell script
>>
>>
>>
>>
>>
>>
>>
>> * name: test warning  hosts: windows  tasks:  - name: warning
>> script: warning.ps1*
>>
>>
>> Here's what I get when I run the playbook...
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
>> -No config file found; using defaultsLoaded callback default of type 
>> stdout, v2.0PLAYBOOK: warning_powershell.yml 
>> ***1 plays in 
>> warning_powershell.ymlPLAY [test warning] 
>> TASK [warning] 
>> *task path: 
>> /etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
>> CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
>> Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
>> -Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
>> -Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
>> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
>>  
>> EXEC &  
>> 'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
>>  
>> EXEC Set-StrictMode -Version LatestRemove-Item 
>> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
>>  
>> -Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
>> {"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
>> "rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
>> *ADS-6999
>>
>> : ok=1changed=1unreachable=0failed=0  *
>>
>>
>> It seems like the script is getting copied to a temporary directory but 
>> is not executing.  I have also tried using raw: but that doesn't work 
>> either and I'd prefer to use script:
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/45df030a-3964-4f37-917a-412442045363%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How to run role with a particular tag in a playbook?

2016-05-17 Thread Brian Coca
no, that will tag all tasks in the role with 'sometag'. The functionality
does not current exist to select a tag on role import.

On Tue, May 17, 2016 at 1:36 PM, Arbab Nazar  wrote:

> I think you are looking this one:
>
> - hosts: somehost
>   remote_user: someuser
>   roles:
> - { role: somerole, tags: 'sometag' }
>
> On Tuesday, May 17, 2016 at 9:22:32 PM UTC+5, Dmitry Owl wrote:
>>
>> Hello, I need to run role in a playbook with a particular tag, *without 
>> "--tags" option. *Something like this:
>>
>>
>> - hosts: somehost
>>   remote_user: someuser
>>   roles:
>> - { role: somerole, with-tags: 'sometag' }
>>
>> I expect that role will run only with the tag "sometag".
>>
>> This functionality exists? I read docs and can't find anything like my 
>> example above.
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/16cf1980-d7df-4dc5-b51b-686e4327511a%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7cvfUs3Qe3BCEdm8_jvcc%2Bfd-U1iGEWHe-6Tf8U7cYgAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to run role with a particular tag in a playbook?

2016-05-17 Thread Arbab Nazar
I think you are looking this one:

- hosts: somehost
  remote_user: someuser 
  roles: 
- { role: somerole, tags: 'sometag' }

On Tuesday, May 17, 2016 at 9:22:32 PM UTC+5, Dmitry Owl wrote:
>
> Hello, I need to run role in a playbook with a particular tag, *without 
> "--tags" option. *Something like this:
>
>
> - hosts: somehost
>   remote_user: someuser 
>   roles: 
> - { role: somerole, with-tags: 'sometag' }
>
> I expect that role will run only with the tag "sometag".
>
> This functionality exists? I read docs and can't find anything like my 
> example above.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/16cf1980-d7df-4dc5-b51b-686e4327511a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running powershell script from ansible playbook

2016-05-17 Thread skinnedknuckles
Very interesting.  The process shows up in task manager for exactly 15 
seconds just as it should but the console is nowhere to be found.  I'd like 
to know if anyone knows a way around this.

On Tuesday, May 17, 2016 at 9:57:06 AM UTC-5, skinnedknuckles wrote:
>
> Control node:
>
>- CentOS 7
>- Ansible 2.1
>
> Remote node:
>
>- Windows 7
>- Powershell 3.0
>
>
> I have a powershell script (warning.ps1) on my remote node that runs fine 
> when I double click on it.  I also have a copy of the powershell script in 
> my control node playbook directory.  As I understand, the following play 
> ought to run the powershell script
>
>
>
>
>
>
>
> * name: test warning  hosts: windows  tasks:  - name: warning
> script: warning.ps1*
>
>
> Here's what I get when I run the playbook...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
> -No config file found; using defaultsLoaded callback default of type 
> stdout, v2.0PLAYBOOK: warning_powershell.yml 
> ***1 plays in 
> warning_powershell.ymlPLAY [test warning] 
> TASK [warning] 
> *task path: 
> /etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
> CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
> Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
> -Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
> -Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
>  
> EXEC &  
> 'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
>  
> EXEC Set-StrictMode -Version LatestRemove-Item 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
>  
> -Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
> {"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
> "rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
> *ADS-6999 
>   
> : ok=1changed=1unreachable=0failed=0  *
>
>
> It seems like the script is getting copied to a temporary directory but is 
> not executing.  I have also tried using raw: but that doesn't work either 
> and I'd prefer to use script:
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/43863081-5b36-4329-a07b-8f72e2bc7360%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible provisioner fails to apply template to second VM in Vagrant

2016-05-17 Thread Alex Willmer
I'm trying to start-up multiple VMs in Vagrant, using Ansible as the 
provisioner. However when I run vagrant up only the first VM (foo) gets the 
template applied. The second (bar) misreports that the destination file is 
already OK.

Am I missing something? 

Below are what I think is a minimal, but complete test case/example. I'm 
using Ansible 2.0.2.0, Vagrant 1.8.1, & Virtualbox 5.0.18_Ubuntur106667 - 
all on Ubuntu 16.04.

With thanks, Alex

--
willmerae@devlaptop06:~/src/foo$ cat playbook.yml 
---
- hosts: all
  sudo: true
  roles:
- base
willmerae@devlaptop06:~/src/foo$ cat roles/base/tasks/main.yml
---
- name: Replace files
  template:
src: "{{item}}"
dest: "/etc/{{item}}"
  with_items:
- virc
willmerae@devlaptop06:~/src/foo$ cat roles/base/templates/virc 
# {{ ansible_managed }}
# {{ ansible_nodename }}
# {{ ansible_hostname }}
willmerae@devlaptop06:~/src/foo$ cat Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.provider "virtualbox"
  config.vm.synced_folder '.', '/vagrant', disabled: true
  config.vm.synced_folder '.', '/home/vagrant/sync', disabled: true

  config.vm.define "foo" do |foo|
foo.vm.hostname = "foo"
foo.vm.network "private_network", ip: "192.168.50.2"
foo.vm.provision "ansible" do |ansible|
  ansible.playbook = "playbook.yml"
  #ansible.verbose = "vvv"
  #ansible.raw_arguments = ["--diff"]
end
  end

  config.vm.define "bar", primary: true do |bar|
bar.vm.hostname = "bar"
bar.vm.network "private_network", ip: "192.168.50.3"
bar.vm.provision "ansible" do |ansible|
  ansible.playbook = "playbook.yml"
  #ansible.verbose = "vvv"
  #ansible.raw_arguments = ["--diff"]
end
  end

end

# Running the above

willmerae@devlaptop06:~/src/foo$ vagrant destroy -f && vagrant up
==> bar: Forcing shutdown of VM...
==> bar: Destroying VM and associated drives...
==> foo: Forcing shutdown of VM...
==> foo: Destroying VM and associated drives...
Bringing machine 'foo' up with 'virtualbox' provider...
Bringing machine 'bar' up with 'virtualbox' provider...
==> foo: Importing base box 'centos/7'...
==> foo: Matching MAC address for NAT networking...
==> foo: Checking if box 'centos/7' is up to date...
==> foo: Setting the name of the VM: foo_foo_1463500848729_41807
==> foo: Fixed port collision for 22 => . Now on port 2201.
==> foo: Clearing any previously set network interfaces...
==> foo: Preparing network interfaces based on configuration...
foo: Adapter 1: nat
foo: Adapter 2: hostonly
==> foo: Forwarding ports...
foo: 22 (guest) => 2201 (host) (adapter 1)
==> foo: Booting VM...
==> foo: Waiting for machine to boot. This may take a few minutes...
foo: SSH address: 127.0.0.1:2201
foo: SSH username: vagrant
foo: SSH auth method: private key
foo: Warning: Remote connection disconnect. Retrying...
foo: 
foo: Vagrant insecure key detected. Vagrant will automatically replace
foo: this with a newly generated keypair for better security.
foo: 
foo: Inserting generated public key within guest...
foo: Removing insecure key from the guest if it's present...
foo: Key inserted! Disconnecting and reconnecting using new SSH key...
==> foo: Machine booted and ready!
==> foo: Checking for guest additions in VM...
foo: No guest additions were detected on the base box for this VM! Guest
foo: additions are required for forwarded ports, shared folders, host 
only
foo: networking, and more. If SSH fails on this machine, please install
foo: the guest additions and repackage the box to continue.
foo: 
foo: This is not an error message; everything may continue to work 
properly,
foo: in which case you may ignore this message.
==> foo: Setting hostname...
==> foo: Configuring and enabling network interfaces...
==> foo: Running provisioner: ansible...
foo: Running ansible-playbook...
[DEPRECATION WARNING]: Instead of sudo/sudo_user, use become/become_user 
and 
make sure become_method is 'sudo' (default).
This feature will be removed in a 
future release. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

PLAY [all] 
*

TASK [setup] 
***
ok: [foo]

TASK [base : Replace files] 

changed: [foo] => (item=virc)

PLAY RECAP 
*
foo: ok=2changed=1unreachable=0failed=0 
  

==> bar: Importing base box 'centos/7'...
==> bar: Matching MAC address for NAT networking...
==> bar: Checking if box 'centos/7' is up to date...
==> bar: Setting the name of the VM: foo_bar_1463500889039_73257
==> bar: Fixed port collision for 22 => . Now on port 2202.
==> bar: Clearing any previously set network interfaces...
==> 

[ansible-project] How to run role with a particular tag in a playbook?

2016-05-17 Thread Dmitry Owl


Hello, I need to run role in a playbook with a particular tag, *without 
"--tags" option. *Something like this:


- hosts: somehost
  remote_user: someuser 
  roles: 
- { role: somerole, with-tags: 'sometag' }

I expect that role will run only with the tag "sometag".

This functionality exists? I read docs and can't find anything like my example 
above.


-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2c18c4de-876b-4055-a7b7-7e01aa4cb681%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running powershell script from ansible playbook

2016-05-17 Thread Matt Davis
WinRM runs in an isolated session- you won't generally be able to do things 
that display stuff to an interactive user. There are ways to hack around 
it, but it's not generally accepted and Microsoft makes it harder with each 
Windows release.

On Tuesday, May 17, 2016 at 8:25:45 AM UTC-7, skinnedknuckles wrote:
>
> Warning.ps1 contains "Invoke-Item C:\Temp\warning.exe"  warning.exe is a 
> .dot net console program that just displays a warning message on the screen 
> of the computer for 15 seconds and then closes.
>
>
>
> On Tuesday, May 17, 2016 at 9:57:06 AM UTC-5, skinnedknuckles wrote:
>>
>> Control node:
>>
>>- CentOS 7
>>- Ansible 2.1
>>
>> Remote node:
>>
>>- Windows 7
>>- Powershell 3.0
>>
>>
>> I have a powershell script (warning.ps1) on my remote node that runs fine 
>> when I double click on it.  I also have a copy of the powershell script in 
>> my control node playbook directory.  As I understand, the following play 
>> ought to run the powershell script
>>
>>
>>
>>
>>
>>
>>
>> * name: test warning  hosts: windows  tasks:  - name: warning
>> script: warning.ps1*
>>
>>
>> Here's what I get when I run the playbook...
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
>> -No config file found; using defaultsLoaded callback default of type 
>> stdout, v2.0PLAYBOOK: warning_powershell.yml 
>> ***1 plays in 
>> warning_powershell.ymlPLAY [test warning] 
>> TASK [warning] 
>> *task path: 
>> /etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
>> CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
>> Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
>> -Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
>> -Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
>> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
>>  
>> EXEC &  
>> 'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
>>  
>> EXEC Set-StrictMode -Version LatestRemove-Item 
>> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
>>  
>> -Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
>> {"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
>> "rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
>> *ADS-6999
>>
>> : ok=1changed=1unreachable=0failed=0  *
>>
>>
>> It seems like the script is getting copied to a temporary directory but 
>> is not executing.  I have also tried using raw: but that doesn't work 
>> either and I'd prefer to use script:
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ef11e363-723a-4da0-8d1e-29e1cd7751e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running powershell script from ansible playbook

2016-05-17 Thread skinnedknuckles
Warning.ps1 contains "Invoke-Item C:\Temp\warning.exe"  warning.exe is a 
.dot net console program that just displays a warning message on the screen 
of the computer for 15 seconds and then closes.



On Tuesday, May 17, 2016 at 9:57:06 AM UTC-5, skinnedknuckles wrote:
>
> Control node:
>
>- CentOS 7
>- Ansible 2.1
>
> Remote node:
>
>- Windows 7
>- Powershell 3.0
>
>
> I have a powershell script (warning.ps1) on my remote node that runs fine 
> when I double click on it.  I also have a copy of the powershell script in 
> my control node playbook directory.  As I understand, the following play 
> ought to run the powershell script
>
>
>
>
>
>
>
> * name: test warning  hosts: windows  tasks:  - name: warning
> script: warning.ps1*
>
>
> Here's what I get when I run the playbook...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
> -No config file found; using defaultsLoaded callback default of type 
> stdout, v2.0PLAYBOOK: warning_powershell.yml 
> ***1 plays in 
> warning_powershell.ymlPLAY [test warning] 
> TASK [warning] 
> *task path: 
> /etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
> CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
> Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
> -Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
> -Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
>  
> EXEC &  
> 'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
>  
> EXEC Set-StrictMode -Version LatestRemove-Item 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
>  
> -Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
> {"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
> "rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
> *ADS-6999 
>   
> : ok=1changed=1unreachable=0failed=0  *
>
>
> It seems like the script is getting copied to a temporary directory but is 
> not executing.  I have also tried using raw: but that doesn't work either 
> and I'd prefer to use script:
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ccc19a18-7abf-4965-90ab-8f2c035a76a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Running powershell script from ansible playbook

2016-05-17 Thread Matt Davis
That all looks correct- I'm assuming your script has output that you're not 
seeing in stdout/stderr? What should it be doing?

On Tuesday, May 17, 2016 at 7:57:06 AM UTC-7, skinnedknuckles wrote:
>
> Control node:
>
>- CentOS 7
>- Ansible 2.1
>
> Remote node:
>
>- Windows 7
>- Powershell 3.0
>
>
> I have a powershell script (warning.ps1) on my remote node that runs fine 
> when I double click on it.  I also have a copy of the powershell script in 
> my control node playbook directory.  As I understand, the following play 
> ought to run the powershell script
>
>
>
>
>
>
>
> * name: test warning  hosts: windows  tasks:  - name: warning
> script: warning.ps1*
>
>
> Here's what I get when I run the playbook...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
> -No config file found; using defaultsLoaded callback default of type 
> stdout, v2.0PLAYBOOK: warning_powershell.yml 
> ***1 plays in 
> warning_powershell.ymlPLAY [test warning] 
> TASK [warning] 
> *task path: 
> /etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
> CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
> Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
> -Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
> -Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
>  
> EXEC &  
> 'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
>  
> EXEC Set-StrictMode -Version LatestRemove-Item 
> "C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
>  
> -Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
> {"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
> "rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
> *ADS-6999 
>   
> : ok=1changed=1unreachable=0failed=0  *
>
>
> It seems like the script is getting copied to a temporary directory but is 
> not executing.  I have also tried using raw: but that doesn't work either 
> and I'd prefer to use script:
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/993475a8-c88d-402b-a879-186473da3731%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 2.1.0 RC2 is ready for testing

2016-05-17 Thread James Pic


On Tuesday, May 17, 2016 at 3:27:00 PM UTC+2, James Pic wrote:
>
> pip install 
> https://github.com/ansible/ansible/archive/v2.1.0.0-0.1.rc1.tar.gz
> # Or install in editable mode (best):
> pip install -e git+https://github.com/ansible/ansible.git@
> v2.1.0.0-0.1.rc1 
> 
> #egg=ansible
>

Scratch the first one, it doesn't get the submodules, use the second line 
which works, don't forget to install git ;) 

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f5378952-3235-4d8d-9288-359708fdff7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible 2.1.0 RC2 is ready for testing

2016-05-17 Thread James Pic
On Tuesday, May 17, 2016 at 4:01:08 AM UTC+2, Lakshmi Balu wrote:
>
> Great news! When Ansible 2.1 will be available in pip install?
>

There are several ways to install it with pip before it's released on PyPi, 
ie.:

pip 
install https://github.com/ansible/ansible/archive/v2.1.0.0-0.1.rc1.tar.gz
# Or install in editable mode (best):
pip install -e git+https://github.com/ansible/ansible.git@
v2.1.0.0-0.1.rc1 

#egg=ansible

Also, GJ ! Awesome release, I love it !

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/84cf893b-bfba-4b0e-b6d9-39242c866479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Running powershell script from ansible playbook

2016-05-17 Thread skinnedknuckles
Control node:

   - CentOS 7
   - Ansible 2.1
   
Remote node:

   - Windows 7
   - Powershell 3.0
   

I have a powershell script (warning.ps1) on my remote node that runs fine 
when I double click on it.  I also have a copy of the powershell script in 
my control node playbook directory.  As I understand, the following play 
ought to run the powershell script







* name: test warning  hosts: windows  tasks:  - name: warning
script: warning.ps1*


Here's what I get when I run the playbook...























*[ansmgr@dhcp1-60-20 playbooks]$ ansible-playbook warning_powershell.yml 
-No config file found; using defaultsLoaded callback default of type 
stdout, v2.0PLAYBOOK: warning_powershell.yml 
***1 plays in 
warning_powershell.ymlPLAY [test warning] 
TASK [warning] 
*task path: 
/etc/ansible/playbooks/warning_powershell.yml:6 ESTABLISH WINRM 
CONNECTION FOR USER: ansibleAdmin on PORT 5985 TO ADS-6999 EXEC 
Set-StrictMode -Version Latest(New-Item -Type Directory -Path $env:temp 
-Name "ansible-tmp-1463494972.72-265383630304564").FullName | Write-Host 
-Separator ''; PUT "/etc/ansible/playbooks/warning.ps1" TO 
"C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1"
 
EXEC &  
'C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564\warning.ps1'
 
EXEC Set-StrictMode -Version LatestRemove-Item 
"C:\Users\ansibleAdmin\AppData\Local\Temp\ansible-tmp-1463494972.72-265383630304564"
 
-Force -Recurse;changed: [ADS-6999] => {"changed": true, "invocation": 
{"module_args": {"_raw_params": "warning.ps1"}, "module_name": "script"}, 
"rc": 0, "stderr": "", "stdout": "", "stdout_lines": []}PLAY RECAP 
*ADS-6999   

: ok=1changed=1unreachable=0failed=0  *


It seems like the script is getting copied to a temporary directory but is 
not executing.  I have also tried using raw: but that doesn't work either 
and I'd prefer to use script:

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e0902a5-94a3-4445-8374-15b3c7fd17a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible_facts access within a custom module

2016-05-17 Thread Brian Coca
Any required facts need to be passed in, a module normally executes on a
remote machine and we pass only the options given to the module. We do not
pass all the data that the ansible controller has, both for security and
performance reasons.


--
Brian Coca

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACVha7c8%2BSTWThM9eLUYX7RzC6ewbLj14%3DJRVqd2dE0odcO4iA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] New modules Report, 17 May 2016

2016-05-17 Thread Greg DeKoenigsberg
There are currently 180 modules waiting for inclusion in Ansible
Extras. One of them might be useful to you!

New modules this week:

Add os_recordset module
https://github.com/ansible/ansible-modules-extras/pull/2240

Create/Modify/Delete Tags for ElastiCache Clusters
https://github.com/ansible/ansible-modules-extras/pull/2233

Add influxdb_privs module
https://github.com/ansible/ansible-modules-extras/pull/2231

satellite control module
https://github.com/ansible/ansible-modules-extras/pull/2226

Ansible Module for Sending Rocket Chat Notifications
https://github.com/ansible/ansible-modules-extras/pull/

New module to manage SELinux file context mappings (semanage fcontext)
https://github.com/ansible/ansible-modules-extras/pull/2221

Added os_server_group module
https://github.com/ansible/ansible-modules-extras/pull/2211

New module ec2_vpc_nacl_facts
https://github.com/ansible/ansible-modules-extras/pull/2209

Add lxd_container module
https://github.com/ansible/ansible-modules-extras/pull/2208

Add boto3 and boto3_wait modules
https://github.com/ansible/ansible-modules-extras/pull/2205

rhev
https://github.com/ansible/ansible-modules-extras/pull/2202

The oldest unreviewed module in the queue (please give it some love this week):
Added Docker Facts module: issue #57 (588 days old)
https://github.com/ansible/ansible-modules-extras/pull/58

Full list of modules is here:
https://github.com/ansible/ansible-modules-extras/labels/new_plugin

If you think one of these modules might be useful to you, please
download it and test it.

If you've tested a module and found issues, please respond with
"needs_revision" in the pull request, with details about the revisions
you'd like to see.

If you've tested a module and it works for you, please help us by
commenting with "shipit" in the pull request.  (Please do not give a
"shipit" without actually testing the module first!)

Two "shipit" comments and no "needs_revision" comments will move it to
final review for inclusion in the next release.

For help on how to test Ansible pull requests:
http://docs.ansible.com/ansible/developing_test_pr.html

Thanks for your help in testing Ansible modules!

--g

-- 
Greg DeKoenigsberg
Ansible Community Guy

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAM1FbhE_VkqE7wUpZe6vgdenxKu3ZDB1X7PpLoqKLje5BqQ3dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Encrypt private_key_file ?

2016-05-17 Thread Gregor
I'd like to put the private key file I ssh into many of my machines with 
into my repo. When I encrypt the file with the ssh-key in it using 
ansible-vault, I can easily edit, show etc. the file with ansible-vault 
when I provide a vault_password_file in the ansible.cfg. 
However, when trying to run a playbook with the same ansible.cfg, it always 
prompts me for the password again. So the commands I run:

ansible-vault show keys/mykey.pem //works fine like that, because password 
is provided in a vault_password_file
ansible-playbook -i contrib/inventory/ec2.py myplaybook.yml //suddenly 
prompts me with 'Enter passphrase for key 'keys/mykey.pem". When I enter 
the password, it is rejected.

Anybody know what's going on there?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d0b7d0b7-b9af-4d38-a149-a9012bcfa914%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible_facts access within a custom module

2016-05-17 Thread Mona Gopal
Hi,


import exceptions
import subprocess
from ansible.module_utils.basic import *


def main():
module = AnsibleModule(argument_spec = dict(data=dict(required=False, 
default=None),),supports_check_mode = True)
dt = {"System_Details":{'Kernel_version':ansible_hostname}}
module.exit_json(ansible_facts=dt)
main()

Above is my custom module, where i am trying to access the ansible facts. 
I am getting the below error:

fatal: [172.19.3.60]: FAILED! => {"changed": false, "failed": true, 
"module_stderr": "", "module_stdout": "Traceback (most recent call 
last):\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1463490863.86-275822236207074/get_system_specific_details\",
 
line 2014, in \r\nmain()\r\n  File 
\"/root/.ansible/tmp/ansible-tmp-1463490863.86-275822236207074/get_system_specific_details\",
 
line 2011, in main\r\ndt = 
{\"System_Details\":{'Kernel_version':ansible_hostname}}\r\nNameError: 
global name 'ansible_hostname' is not defined\r\n", "msg": "MODULE 
FAILURE", "parsed": false}


Can you please help me out??

Thanks in advance,
Mona G
=

On Thursday, May 15, 2014 at 4:02:05 PM UTC+5:30, Christian Huck wrote:

> Hi,
>
> how can I access the ansible_facts within a custom module which was 
> initialized with the AnsibleModule class ?
>
> I either:
>
> a) need to pass the facts as a module parameter
>
> or
>
> b) access the facts directly inside the module
>
> Thanks in advance.
>
> Christian
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f2dea361-3563-4b46-b7a5-8151324a9631%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Anybody working on ansible modules for lxd?

2016-05-17 Thread candlerb
So it should already be usable in ansible 2.2.0 devel? Super.

Yep, just tested it. Thank you!!

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6242aa76-a19b-4a8a-8bb3-d70fc28fad3a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible_facts

2016-05-17 Thread Mona Gopal
Hi,

I am writing an inventory playbook to  fetch the system information such as 
CPU details, Network Related info, Disk space related info and system 
specific information.
Ansible already provides some of these info that i need in the setup module.
I want to customize it or rather fetch specific category of information 
from this setup module and write it to a template in json format.


I have done this using the custom module for fetching the third party 
information and fetched the information in the below format
{
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'logstash_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'mongod_version': u'NOT_INSTALLED'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'redis_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'nginx_version': u' nginx/1.8.0'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'nodejs_version': u'Not Installed'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'django_version': u'1.6'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'php_version': u'PHP 5.1.6 (cli)'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'httpd_version': u'NOT_INSTALLED'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'python_version': u'Python 2.7.3'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'psql_version': u'psql (PostgreSQL) 8.1.18'}}},
{u'changed': False, u'ansible_facts': {u'Third_party_software': 
{u'mysql_v': u'mysql Ver 14.12'}}},
}
How could I do the same with my available facts?


Thanks in advance,
Mona G



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/39f1a2ed-8774-4354-b0b8-b6228934a539%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: New install to manage Windows servers, but krb5.conf is missing

2016-05-17 Thread 'J Hawkesworth' via Ansible Project
Just to follow up, I made this pull request to update the documentation 
https://github.com/ansible/ansible/pull/15894

On Wednesday, April 27, 2016 at 3:22:02 AM UTC+1, Mike Sherrill wrote:
>
> That did it. Onward . . .
>
> Thanks.
>
> On Tuesday, April 26, 2016 at 7:44:58 PM UTC-4, J Hawkesworth wrote:
>>
>> Looking at
>>
>> https://help.ubuntu.com/lts/serverguide/kerberos.html
>>
>> I think you might need 
>>
>> krb5-user
>>
>>
>> which I guess might be the equivalent of the yum package krb5-workstation
>>
>> Please reply if this installs the /etc/krb5.conf and I will get the 
>> documentation updated.
>>
>> Hope this helps,
>>
>> Jon
>>
>> On Tuesday, April 26, 2016 at 11:41:39 PM UTC+1, Mike Sherrill wrote:
>>>
>>> I'm installing Ansible as a test. I have a mixed environment of Windows 
>>> and Ubuntu servers in an Active Directory domain. 
>>>
>>> I built a new Hyper-V virtual machine for Ansible; it's running Xubuntu 
>>> 16.04 LTS. Ansible 2.0.0.2 is installed.
>>>
>>> I've been following the steps on the Windows Support 
>>>  web page.
>>>
>>> Under the section "Configuring Kerberos", I see "Edit your 
>>> /etc/krb5.conf (which should be installed as a result of installing 
>>> packages above". But /etc/krb5.conf doesn't exist.
>>>
>>> Unless I missed something, these are all the "packages above".
>>>
>>>- 
>>>
>>>pip install "pywinrm>=0.1.1"
>>>
>>>- sudo apt-get install python-dev libkrb5-dev
>>>- 
>>>
>>>pip install kerberos
>>>
>>>
>>> What am I missing? Another package? 
>>>
>>>
>>> I installed Ansible following the instructions for Latest Releases Via 
>>> Apt 
>>> ,
>>>  
>>> but I don't seem to have the latest version. Is this a problem?
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/be2191c9-8bd2-41fe-842b-4b0e1219971d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.