Re: [ansible-project] Launch instances from a file

2019-03-25 Thread Sudheer Satyanarayana


On 26/03/19 9:29 AM, shyam.r...@gmail.com wrote:

Hi,

I want to launch instances from a file. The file contains the 
variables like "InstanceName", HttpPortnumber and Portnumber and I 
want to pass this file as a Input parameter to the playbook to launch 
the instances on server.


can any one help.


Example file:

InstanceName  HttpPortnumber  Portnumber

Sample1            1122                   2211
Sample2            1233                   4321
sample3             4432                   3321


Thank you,
Shyam

You can read the file contents using the lookup plugin. Once you have 
the file contents, you can then try to apply regex filter to obtain the 
pattern you need.


Is it possible to use a more structured format like JSON instead of text 
file like the one you have? That would make the task a lot easier.



--

Sudheer Satyanarayana
System Administrator And Developer
Tech Chorus - https://www.techchorus.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/2f79fb7e-1301-ed60-5513-829584548782%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible issue with Windows and Chocolatey 0.10.13

2019-03-25 Thread Guillaume Belrose
Hi, 

Thanks for the link, I wonder why I did not find it the 1st time around. 

I was initially using Ansible 2.4.x and the error message was very obscure, so 
the issue became more obvious when I tried Ansible 2.7.x.

Thanks for your help.

Guillaume. 

Sent from my iPhone

> On 25 Mar 2019, at 22:12, Jordan Borean  wrote:
> 
> This is a known issue and is due to a breaking change on Chocolatey's end in 
> the 0.10.12 release. See 
> https://github.com/ansible/ansible/issues/53860#issuecomment-473431360 for 
> more details.
> 
> Thanks
> 
> Jordan
> -- 
> 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/6_iHgmMyFnQ/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/678c9f88-14f6-4e39-a9a6-e9c32e89f95b%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/B073129D-FDAB-4D58-8527-DE4BFBA5DA1B%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Launch instances from a file

2019-03-25 Thread shyam . rpms
Hi,

I want to launch instances from a file. The file contains the variables 
like "InstanceName", HttpPortnumber and Portnumber and I want to pass this 
file as a Input parameter to the playbook to launch the instances on server.

can any one help.


Example file: 

InstanceName  HttpPortnumber  Portnumber

Sample11122   2211
Sample21233   4321
sample3 4432   3321


Thank you,
Shyam

-- 
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/bc5a2a81-bb0f-42ed-873b-ea03049b4e60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible modules copy/template errors for Linux 5 hosts using python26 ,python binding libselinux-python needed

2019-03-25 Thread iamlightsocialxen


Hello Ladies & Gentlemen, 


We have some 50 odd linux 5 hosts, and to manage that we use ansible.

Problem :- Ansible modules copy/template errors for Linux 5 hosts using 
python26 ,python binding libselinux-python needed

Actual error :- fatal : FAILED! => {"changed": false, "msg": "Aborting, 
target uses selinux but python bindings (libselinux-python) aren't 
installed!"}

Environment:-

Ansible Master node : - EL7
Selinux enabled
libselinux-python : installed libselinux-python.x86_64 0:2.5-14.1.el7

Node :- EL 5
Selinux enabled
Using ansible_python_interpreter=/usr/bin/python26
libselinux-python : installed libselinux-python-1.33.4-5.7.el5.x86_64


Description:-

I see the problem

With default Python ...

selinux]# python
Python 2.4.3 (#1, May 5 2011, 15:12:27)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import selinux
selinux.is_selinux_enabled()
1

And with python26

[root@dev-bozo21 selinux]# python26
Python 2.6.8 (unknown, Nov 7 2012, 14:47:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import selinux
Traceback (most recent call last):
File "", line 1, in 
ImportError: No module named selinux

I tried copying

"/usr/lib64/python2.4/site-packages/selinux to 
/usr/lib64/python2.6/site-packages/selinux ( this was empty earlier)"

it throws this error

python26
Python 2.6.8 (unknown, Nov 7 2012, 14:47:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import selinux
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib64/python2.6/site-packages/selinux/init.py", line 5, in 
import _selinux
ImportError: /usr/lib64/python2.6/site-packages/selinux/_selinux.so: undefined 
symbol: Py_InitModule4

And when copying

"/usr/lib64/python2.7/site-packages/selinux/init.py" ( from different 
centos 7 node) to /usr/lib64/python2.6/site-packages/selinux/

I get below error

python2.6
Python 2.6.8 (unknown, Nov 7 2012, 14:47:45)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import selinux
Traceback (most recent call last):
File "", line 1, in 
File "/usr/lib64/python2.6/site-packages/selinux/init.py", line 26, in 
_selinux = swig_import_helper()
File "/usr/lib64/python2.6/site-packages/selinux/init.py", line 22, in 
swig_import_helper
_mod = imp.load_module('_selinux', fp, pathname, description)
ImportError: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by 
/usr/lib64/python2.6/site-packages/selinux/_selinux.so)

Any solution for this problem ?


Regards,

Prakash.

-- 
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/3ab9434c-b956-4986-b889-1711bb6c448a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Host related problem

2019-03-25 Thread Vaibhav Singh
Please check your loop properly. Possible the loop may have some logical issues.

Thanks & Regards,
Vaibhav Singh
+91-8976871109


From: ansible-project@googlegroups.com  on 
behalf of skdm...@126.com 
Sent: Tuesday, March 26, 2019 8:57:32 AM
To: Ansible Project
Subject: [ansible-project] Re: Host related problem


  *   Thank you. I'll try

skd...@126.com於 2019年3月26日星期二 UTC+8上午10時17分38秒寫道:
  Hello,
I just starte to use ansible, now there is a question , when during the 
batch execution of the playbook, some operations are performed only on one of 
the hosts. How do you avoid other hosts on a piaybook while performing these 
operations?
  For example,:
  I will perform batch execution operations on three hosts, 
A,B and C, and some of them will only be executed in A. How to do 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/15981737-9457-4919-8a92-800c8dc2f19a%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/SN1PR12MB2383991AAB7C236AD549D9EEF55F0%40SN1PR12MB2383.namprd12.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Host related problem

2019-03-25 Thread skdmeng

   
   - 
   
   Thank you. I'll try
   
skd...@126.com於 2019年3月26日星期二 UTC+8上午10時17分38秒寫道:
>
>   Hello, 
> I just starte to use ansible, now there is a question , when 
> during the batch execution of the playbook, some operations are performed 
> only on one of the hosts. How do you avoid other hosts on a piaybook while 
> performing these operations?
>   For example,:
>   I will perform batch execution operations on three 
> hosts, A,B and C, and some of them will only be executed in A. How to do 
> 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/15981737-9457-4919-8a92-800c8dc2f19a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Host related problem

2019-03-25 Thread Shankar Pentyala
You can pick only one host as below example.

[webservers]
A
B
C

You can just pick host A by using

hosts: groups[‘webservers’][0]

In your playbook.



On Mon, Mar 25, 2019 at 9:17 PM  wrote:

>   Hello,
> I just starte to use ansible, now there is a question , when
> during the batch execution of the playbook, some operations are performed
> only on one of the hosts. How do you avoid other hosts on a piaybook while
> performing these operations?
>   For example,:
>   I will perform batch execution operations on three
> hosts, A,B and C, and some of them will only be executed in A. How to do
> 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/19bfdfae-aa89-4959-af94-c71ce660c05c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Shankar Pentyala
shankarpenty...@gmail.com
(916) 755 - 9527
https://www.linkedin.com/in/codinghumble/

-- 
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/CAKLj9CKO95DJmFenAxj6PiZb_b08pr%3D13D4ATXEH_nPioWfRbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ec2_instance vs ec2 - which one to use & and is there a plan?

2019-03-25 Thread shertel
 

You can get an idempotent ec2 task using the instance_tags, exact_count, 
and count_tag options. The IP addresses are more limited because the module 
uses the old boto library which is no longer actively maintained by AWS.


I’m not aware of any plans to deprecate the ec2 module in the near future. 
The ec2_instance module is preview status as there are still some things to 
be fixed, like you’ve found.


I think the current state of things is that features can be added to 
ec2_instance, but not ec2 (we try to avoid adding more boto-dependent 
code). The ec2 module can still receive bug fixes, but since it uses the 
boto library which isn’t getting patched for its own bugs or updated with 
features there are issues that won’t be able to be resolved in that module. 
Those problems can be fixed in ec2_instance since that module uses boto3.

--
Sloane

On Monday, March 25, 2019 at 10:33:59 AM UTC-5, Dick Visser wrote:
>
> Hi
>
> While trying to debug some issues (notably trying to add several security 
> groups to an EC2 instance), I once again ran into the question about which 
> ansible module to use to for EC2 instances.
>
> From the docs it appears that both the ec2 and the ec2_instance module are 
> supported, with the latter being the newest, and they do largely the same 
> things.
> I've shuffled around the ec2_instance task into an ec2 task, and I was 
> able to get that to work with multiple security groups. 
> But now I'm having a hard time getting this new ec2 task to be idempotent, 
> and also the way that IP addresses are assigned is more limited than 
> ec2_instance.
>
> I'm wary of picking the "old" ec2 module for my tasks, or mixing the two, 
> because I suspect ec2 might get deprecated some time soon in favor of the 
> ec2_instance module.
>
> I couldn't find any statement or road map on this topic - is there a long 
> term plan or a road map wrt the two EC2 modules? If so, I can at least make 
> a sound decision on where to spend energy, also in terms of fixing issues.
>
>
> thx
>
>
> -- 
> Dick Visser
> Trust & Identity Service Operations Manager
> GÉANT
>

-- 
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/c8af610a-9ba3-48f5-b94f-8b7542f334ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Host related problem

2019-03-25 Thread skdmeng
  Hello, 
I just starte to use ansible, now there is a question , when during 
the batch execution of the playbook, some operations are performed only on 
one of the hosts. How do you avoid other hosts on a piaybook while 
performing these operations?
  For example,:
  I will perform batch execution operations on three 
hosts, A,B and C, and some of them will only be executed in A. How to do 
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/19bfdfae-aa89-4959-af94-c71ce660c05c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Random anisble failures due to tmp files not found

2019-03-25 Thread Igor Cicimov
FWIW found the reference: 

https://github.com/dw/mitogen/issues/301#issuecomment-404620821
https://github.com/ansible/ansible/issues/31617

On Friday, March 8, 2019 at 9:46:14 AM UTC+11, Igor Cicimov wrote:
>
>
>
> On Friday, March 8, 2019 at 4:12:37 AM UTC+11, Kai Stian Olstad wrote:
>>
>> On 07.03.2019 01:34, Igor Cicimov wrote: 
>> > Anyone else seeing random playbook execution failuers like this: 
>> > 
>> > Source 
>> /home/user/.ansible/tmp/ansible-tmp-1551917585.84-139567381415844/source 
>> > not found"} 
>>
>> No, you must have some issues with your setup. 
>>
>
> Maybe but highly unlikely. This happened during provisioning of 20 EC2 
> instances with same ansible config and same repository and 19 were 
> successful but 1 failed with the error. All instances autoprovision them 
> self locally and the one that failed has hundreds of tasks successfully 
> executed before the failed one.
>
> I remember seeing an issue where the OP found out that the:
>
> remote_tmp = $HOME/.ansible/tmp
>
> settings works unreliably and ansible looses the tmp path being unable to 
> resolve the $HOME env var. I tried googling it up again but can not find it 
> now :-/
>
>
>>
>> > Any idea what is causing them and how to fix it? 
>>
>> Running with - might give you some more information. 
>>
>
> That's hard since replaying the whole playbook several times after the 
> failure shows no issues at all.
>
>
>>
>> -- 
>> Kai Stian Olstad 
>>
>

-- 
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/9bfc5812-6b20-4b68-a5cd-bc2e6f1bdb90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] ansible using lambda module

2019-03-25 Thread Dick Visser
On Mon, 25 Mar 2019 at 18:20, qasim sahi  wrote:
>
> Hi,
>
> can someone please help in creating the playbook to stop/start EC2 instance 
> using lambda ?

This is a very brief question - please elaborate a bit on what/how/etc.
What have you tried already?

DIck

-- 
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/CAL8fbwO47LuyGwVzfqXa_Xfx3ijokzY7oMOr%2B27NB9_EkFcs5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Fwd: Us congress hearing of maan alsaan Money laundry قضية الكونغجرس لغسيل الأموال للمليادير معن الصانع

2019-03-25 Thread Kasem A
YouTube videos of



 U.S. Congress money laundering hearing


of

Saudi Billionaire  " Maan  Al sanea"

 with *bank of America*


and  The  owner of Saad Hospital and  Schools

 in the Eastern Province in *Saudi Arabia*



and the Chairman of the Board of Directors of Awal Bank  in *Bahrain*


With Arabic Subtitles





*موقع اليوتيوب الذي عرض جلسة استماع الكونجرس الأمريكي *

* لمتابعة نشاطات غسل الأموال ونشاطات*



*السعودي معن عبدالواحد الصانع*



*مالك مستشفى  وشركة سعد  ومدارس سعد بالمنطقة الشرقية بالسعودية   ورئيس مجلس
ادارة بنك اوال البحريني*



*مترجم باللغة العربية*



http://www.youtube.com/watch?v=mIBNnQvhU8s

-- 
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/CAM1Css9JM0VKDs%3DuFb9uMmMbRJxtyiSN7SDyf508EfmbDOdJnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] aws_s3 module fails, says Boto3 is missing when it is not - bug?

2019-03-25 Thread gigit1000
I was able to get this working by specifying the interpreter at the task 
level:

- name: downlod file from s3 with aws_s3 module aws_s3: vars: 
ansible_python_interpreter: /usr/bin/python3 bucket: kavise-launch-data 
object: jre-8u201-linux-x64.tar.gz dest: 
/home/ec2-user/updater/jre-8u201-linux-x64.tar.gz 


 





On Monday, March 25, 2019 at 11:26:19 AM UTC-7, gigi...@gmail.com wrote:
>
> Thank you - the target host has Python2 and Python3 installed:
> [ec2-user@ip-10-200-2-198 ~]$ which python
> /usr/bin/python
> [ec2-user@ip-10-200-2-198 ~]$ which python3
> /usr/bin/python3
>
> Python2 is installed by default. Python3 was installed by my playbook. 
> Using your example I can see that Python2 does not have boto. Python3 does 
> have boto3 which was also installed by my playbook.
>
> My ansible cfg looks like this:
>
> [defaults]
> private_key_file=/home/ec2-user/key.pem
> ansible_python_interpreter=/usr/bin/python3
>
> I thought I could force ansible to use python3, but it did not work. I got 
> the same result.  
>
>
>
> On Saturday, March 23, 2019 at 4:51:46 AM UTC-7, Sudheer S wrote:
>>
>>
>> On 23/03/19 2:48 AM, gigi...@gmail.com wrote:
>>
>> This Play installs python3, pip3, boto3 and botocore, and trys to use 
>> aws_s3 module to download a file:
>>
>> TASK [run yum update -y using yum module] 
>> ***
>> ok: [ip-10-200-2-137.us-west-2.compute.internal]
>>
>> TASK [Install python3 and pip3] 
>> *
>> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>>
>> TASK [Install boto3 and botocore with pip3 module] 
>> **
>> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>>
>> TASK [Create a directory if it does not exist using file module] 
>> 
>> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>>
>> TASK [downlod file from s3 with aws_s3 module] 
>> **
>> fatal: [ip-10-200-2-137.us-west-2.compute.internal]: FAILED! => 
>> {"changed": false, "msg": "Python modules \"botocore\" or \"boto3\" are 
>> missing, please install both"}
>>
>> It fails because it says boto3 is missing, but it actually is not:
>>
>> From the Target host you can see that boto3 is installed:
>>
>> [ec2-user@ip-10-200-2-137 ~]$ pip3 freeze
>> boto3==1.9.120
>> botocore==1.12.120
>> docutils==0.14
>> jmespath==0.9.4
>> python-dateutil==2.8.0
>> s3transfer==0.2.0
>> six==1.12.0
>> urllib3==1.24.1
>> [ec2-user@ip-10-200-2-137 ~]
>>
>> Is this is bug? Thank you for any help 
>>
>> This is the task that fails:
>> - name: downlod file from s3 with aws_s3 module aws_s3: bucket: mybucket 
>> object: mybucket/jre-8u201-linux-x64.tar.gz dest: 
>> /home/ec2-user/updater/jre-8u201-linux-x64.tar.gz mode: get 
>> -- 
>> 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/e81f25a5-1104-4b36-b2a4-5a037610a9b9%40googlegroups.com
>>  
>> 
>> .
>>
>> This doesn't look like a bug. It looks like boto is not available via the 
>> Python interpreter Ansible is using on the target. 
>>
>> SSH on to the target, start the Python interpreter and see if you can 
>> import boto:
>>
>>
>> python
>> Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
>> [GCC 5.4.0 20160609] on linux2
>> Type "help", "copyright", "credits" or "license" for more information.
>> >>> import boto
>> >>> 
>>
>> -
>>
>> Sudheer S
>>
>

-- 
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/06fb13e0-9967-4481-bcae-0843f1618ddf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Set ansible_python_interpreter at Task level?

2019-03-25 Thread gigit1000
Got it working - I had to put the vars before the module name - thanks for 
help 

On Monday, March 25, 2019 at 2:29:13 PM UTC-7, gigi...@gmail.com wrote:
>
> Thank you - I did that and it did use the right interpreter, but written 
> this way the play has a new error:
>
> "missing required arguments: bucket, mode"}
>
> This is the new play with the interpreter var:
>
> - name: downlod file from s3 with aws_s3 module aws_s3: vars: 
> ansible_python_interpreter: /usr/bin/python3 bucket: launch-data object: 
> jre-8u201-linux-x64.tar.gz dest: 
> /home/ec2-user/updater/jre-8u201-linux-x64.tar.gz mode: get 
>
>
>
>
>
>
>
>
> Is my syntax incorrect?
>
>
> On Monday, March 25, 2019 at 12:51:58 PM UTC-7, Jordan Borean wrote:
>>
>> Yes, just do the same vars directive on the task like you have done on 
>> the play, e.g.
>>
>> - name: my task
>>   ping:
>>   vars:
>> ansible_python_interpreter: /usr/bin/python
>>
>> You would have to keep in mind variable precedence [1], task vars do beat 
>> play vars but the following will beat task vars
>>
>>- Vars added with include_vars:
>>- Vars/facts added with set_fact or register
>>- Extra vars specified by '-e' when Ansible was invoked
>>
>>
>> [1] - 
>> https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
>>
>> Thanks
>>
>> Jordan
>>
>

-- 
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/a208bd10-cd6f-45c0-a9d0-ba06ac402f91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible upgrade

2019-03-25 Thread Jonathan Lozada De La Matta
please check this document for the supported ansible to tower matrix
versions https://access.redhat.com/articles/3382771. If you run into more
issues I suggest you get with support.

On Mon, Mar 25, 2019 at 5:30 PM Sindhuja Koneru 
wrote:

>  Hello,
>
> Can some one pls answer following 2 questions.?
>
> Trying to upgrade Tower from 3.2.5 to 3.4.2.
> Installation fails with error
>
> Preflight check — require new enough ansible
>
> Msg:: “ your current version of Ansible is too old for this version of
> Ansuble Tower. Please upgrade.”
>
> Question 1: Thought ansible tower uses the ansible core (2.7.8-1)present
> in the bundle of 3.4 and installs latest.
>
> Question 2: what is the min core version needed for Tower upgrade to 3.4.2
>
> 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/109084b5-31ef-4e64-9357-88580fb89251%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Jonathan lozada de la matta

AUTOMATION PRACTICE

-- 
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/CAFYJA%2BJsbcJDRh_YD0H07MwB%3D7C8mO3upkoEAUY42MHDJhM-8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible upgrade

2019-03-25 Thread Sindhuja Koneru
 Hello, 

Can some one pls answer following 2 questions.?

Trying to upgrade Tower from 3.2.5 to 3.4.2.
Installation fails with error

Preflight check — require new enough ansible

Msg:: “ your current version of Ansible is too old for this version of Ansuble 
Tower. Please upgrade.”

Question 1: Thought ansible tower uses the ansible core (2.7.8-1)present in the 
bundle of 3.4 and installs latest.

Question 2: what is the min core version needed for Tower upgrade to 3.4.2

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/109084b5-31ef-4e64-9357-88580fb89251%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Set ansible_python_interpreter at Task level?

2019-03-25 Thread gigit1000
Thank you - I did that and it did use the right interpreter, but written 
this way the play has a new error:

"missing required arguments: bucket, mode"}

This is the new play with the interpreter var:

- name: downlod file from s3 with aws_s3 module aws_s3: vars: 
ansible_python_interpreter: /usr/bin/python3 bucket: launch-data object: 
jre-8u201-linux-x64.tar.gz dest: 
/home/ec2-user/updater/jre-8u201-linux-x64.tar.gz mode: get 








Is my syntax incorrect?


On Monday, March 25, 2019 at 12:51:58 PM UTC-7, Jordan Borean wrote:
>
> Yes, just do the same vars directive on the task like you have done on the 
> play, e.g.
>
> - name: my task
>   ping:
>   vars:
> ansible_python_interpreter: /usr/bin/python
>
> You would have to keep in mind variable precedence [1], task vars do beat 
> play vars but the following will beat task vars
>
>- Vars added with include_vars:
>- Vars/facts added with set_fact or register
>- Extra vars specified by '-e' when Ansible was invoked
>
>
> [1] - 
> https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable
>
> Thanks
>
> Jordan
>

-- 
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/280cf0bc-4f49-4b89-9125-64cb641f7894%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] man pages showing keywords?

2019-03-25 Thread Jason Amato
Is there a list of all keywords in the linux man pages somewhere ?

-- 
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/14ffd96d-20b0-4037-947c-394d53043eec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Display specific lines from cisco output

2019-03-25 Thread vincent collier
As I said , the documentation is about what your trying to do : 
https://github.com/ansible-network/network-engine/blob/devel/docs/user_guide/command_parser.md,
 
but on show interfaces with a loop, not on a specific interface.


For your example, without loop, It should be something like this (not 
tested) :

1°) playbook 

hosts: Branch
  gather_facts: false
  connection: local

  tasks:
   - name: Facts
 ios_command:
commands:
- show inter gi0/0
 register: output

   - command_parser:
file: "parser_templates/ios/show_interfaces.yaml"
content: "{{ output.stdout.0 }}"

   - debug:
   var: input_rate.matches
  
   - debug:
   var: output_rate.matches
   
2°) content of the template:
---
- name: parser meta data
  parser_metadata:
version: 1.0
command: show interfaces <>
network_os: ios

- name: match input rate 
  pattern_match:
regex: "^ 5 minute input rate ([^,]+),"
  register: input_rate
  export: yes
 
- name: match output rate 
  pattern_match:
regex: "^ 5 minute output rate ([^,]+),"
  register: output_rate
  export: yes

value registered are regex group, in (), each group is stored in matches 
dot is number.
command_parser read line by line and if the regex match, store the result 
in a var than you can use in playbook only if you use export:yes.



-- 
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/fd0ba4f2-156a-4e5a-bec7-6f46e8e9cfa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible issue with Windows and Chocolatey 0.10.13

2019-03-25 Thread Jordan Borean
This is a known issue and is due to a breaking change on Chocolatey's end 
in the 0.10.12 release. See 
https://github.com/ansible/ansible/issues/53860#issuecomment-473431360 for 
more details.

Thanks

Jordan

-- 
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/678c9f88-14f6-4e39-a9a6-e9c32e89f95b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: DEFAULT_REMOTE_TMP not working

2019-03-25 Thread Jordan Borean
The remote tmp was changed around this version to become a shell plugin 
option and not a global option. You can see the 'remote_tmp' option at 
https://docs.ansible.com/ansible/latest/plugins/shell/sh.html, it's defined 
using the same ini, env, and vars it's just used by the shell plugin 
instead and made sense moving it there.

The DEFAULT_LOCAL_TMP is still global though but that's not really what you 
should be doing.

As for looking up the value you are probably going at this the wrong way. 
If you want to rely on creating the tmp dir with your own permissions then 
it is better to set your own dir as a fact/var so you ensure that the 
directory is being used for that host, e.g.

- hosts: my host
  vars:
ansible_remote_tmp: ~/.ansible-custom/tmp

  tasks:
  - name: Create remote_tmp for it used by another module
file:
  path: "{{ ansible_remote_tmp }}"
  state: directory
  mode: 0700

This way you are not stuck if the internal option name changes and you are 
now following the contracted interface which should be stable across 
versions.

Thanks

Jordan

-- 
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/7297d764-bda6-41ec-9d05-296c28fde142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Set ansible_python_interpreter at Task level?

2019-03-25 Thread Jordan Borean
Yes, just do the same vars directive on the task like you have done on the 
play, e.g.

- name: my task
  ping:
  vars:
ansible_python_interpreter: /usr/bin/python

You would have to keep in mind variable precedence [1], task vars do beat 
play vars but the following will beat task vars

   - Vars added with include_vars:
   - Vars/facts added with set_fact or register
   - Extra vars specified by '-e' when Ansible was invoked
   

[1] - 
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

Thanks

Jordan

-- 
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/a77fcc89-1357-4a8f-a722-dc891eeda4e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible issue with Windows and Chocolatey 0.10.13

2019-03-25 Thread Guillaume Belrose
Hi all, 

I use Ansible to deploy Chocolatey packages on Windows Server 2016 machines 
(hosted on Amazon EC2). Yesterday, I re-created a brand new cluster for 
training purposes and I attempted to re-deploy my applications on it from 
scratch.

I've done this process countless times but yesterday it started to fail 
even though the playbooks had not changed in a while. After a fair amount 
of debugging, I found out that the error is caused by Chocolatey version 
*0.10.13*. 

Because the EC2 instances were created yesterday (24/03/2019), version 
0.10.13 is the version that Ansible installed when it invoked the 
win_chocolatey command the 1st time around. 

A playbook as simple as: 
---
- hosts: app_servers
 tasks:
 - name: ensure Google Chrome is installed
   win_chocolatey:
 name: googlechrome


would then fail with the following error:

PLAY [app_servers] 
*

TASK [Gathering Facts] 
*
ok: [training-app.vatit.io]

TASK [ensure Google Chrome is installed] 
***
fatal: [training-app.vatit.io]: FAILED! => {"changed": false, "command": 
"C:\\ProgramData\\chocolatey\\bin\\choco.exe list --local-only --exact 
--limit-output googlechrome", "msg": "Error checking installation status 
for the package 'googlechrome'", "rc": 2, "stderr": "", "stderr_lines": [], 
"stdout": "", "stdout_lines": []}
to retry, use: --limit @/ansible/app_server.retry

PLAY RECAP 
*
training-app.vatit.io  : ok=1changed=0unreachable=0failed=1

It turns out when you run the command directly on the Windows server

C:\ProgramData\chocolatey\bin\choco.exe list --local-only --exact 
--limit-output googlechrome

then it fails with an error code. But it *does not* with earlier versions 
of chocolatey.

In order for me to get the playbook to work again, I've uninstalled the 
latest version of Chocolatey, and installed a specific version (I find that 
version *0.10.11* works for me) by following the instructions 
from 
https://chocolatey.org/docs/installation#installing-a-particular-version-of-chocolatey.
 
I also tried the following role 
(https://galaxy.ansible.com/deekayen/chocolatey) which helps to install a 
specific version. 

I don't know if this is an Ansible bug, a Chocolatey bug or something in 
between. In my mind, Chocolatey should not return an error when checking if 
a package is already installed. 

I did spend a fair amount of time debugging this issue, so I hope it is 
useful to someone in the same situation as me. 

Cheers, 

Guillaume.





-- 
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/c4838a54-e0ca-43bb-83b3-1226ee6de984%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Looking for easy way to filter out windows versions below Server 2016

2019-03-25 Thread Jordan Borean
- name: skip using the manually gathered OS version var
  debug:
msg: World
  when: (os_version.stdout | trim) is version_compare('10.0', '>=')

Minor edit to the last tasks' when condition.

-- 
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/86b324be-bfe0-4019-a004-51dc692d0d73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Looking for easy way to filter out windows versions below Server 2016

2019-03-25 Thread Jordan Borean
You can do this if fact gathering is enabled with the 
'ansible_distribution_version' factor but if you don't have that you could 
just gather that info like;

- name: skip using the built in facts
  debug:
msg: Hello
  when: ansible_distribution_version is version_compare('10.0', '>=')

- name: get OS version manually
  win_shell: (Get-Item -LiteralPath C:\Windows\System32\kernel32.dll).
VersionInfo.ProductVersion
  changed_when: False
  register: os_version

- name: skip using the manually gathered OS version var
  debug:
msg: World
  when: os_version | trim is version_compare('10.0', '>=')

Both examples hinge on using the version_compare (or version) test [1]. 
This allows you to compare version numbers and check if it is less, equal, 
greater, etc, than the one you specify. For Windows 10 or Server 2016 you 
want to test if it's greater than 10.0. Here is a brief list of version 
numbers for Windows;


   - Server 2008 - 6.0
   - Server 2008 R2/Windows 7 - 6.1
   - Server 2012 - 6.2
   - Server 2012 R2/Windows 8.1 - 6.3
   - Server 2016/Windows 10 - 10.0
   

[1] 
https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#version-comparison

Thanks

Jordan

-- 
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/ac38c7f7-a1f4-4a0c-82d4-03d74f6c376f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Set ansible_python_interpreter at Task level?

2019-03-25 Thread gigit1000


Is there a way to do this? I have a playbook with two tasks. The first task 
uses Yum module (and python 2 interpreter). The next task uses aws_s3 
module (and python3 interpreter), but fails because the playbook is still 
trying to use python2 interpreter. (the error is: can't find boto3...)

I tested this by using two separate Playbooks and declaring the appropriate 
python interpreter at the Playbook level:
- hosts: ec2lin remote_user: ec2-user become: yes become_user: root vars: 
ansible_python_interpreter: /usr/bin/python3








Each task worked in a separate playbook. but I would rather use a single 
playbook for both Tasks.


Is it possible to set the "ansible_python_interpreter" at the Task level - 
 With a keyword or variable or something? 

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/c2ddf028-d91c-45dd-bd83-058b5afa8960%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Changing the network and ip of th virtual machine after creation using vmware_guest module

2019-03-25 Thread Sahar
Hi,

I'm trying to change the network and ip/netmask of a vm after creation in 
vmware using the below playbook:



  - vmware_guest:
  hostname: '{{ }}'
  username: '{{ }}'
  password:  '{{ }}'
  validate_certs: no
  datacenter:  '{{ }}'
  name: FW_Test2
  template: FW_Test2
  networks:
- name: 'dvPG-MGMT'
  ip: 0.0.0.0
  netmask: 0.0.0.0
  customization:
ip: '172.17.42.9'
netmask: 255.255.254.0
gateway: '172.17.42.1'
delegate_to: localhost


and getting the below error:

fatal: [localhost -> localhost]: FAILED! => {"changed": true, "msg": "The 
operation is not supported on the object."}



Anyidea what this error means or why I get 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/150bb064-7c56-4eea-a445-253738cc8038%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Certificate invalid error while accessing the Ansible Tower URL from a Windows Server - internet explorer

2019-03-25 Thread Jonathan Lozada De La Matta
https://docs.ansible.com/ansible-tower/latest/html/installandreference/install_notes_reqs.html#installation-notes

On Mon, Mar 25, 2019 at 2:32 PM Mauricio Tavares 
wrote:

> On Mon, Mar 25, 2019 at 1:12 PM Jonathan Lozada De La Matta
>  wrote:
> >
> > Ansible Tower creates a self signed cert automatically. You need to
> accept the certificate. It varies by browser on how you do it.
> >
>   Can you feed it a (non-self signed) cert you created (using
> letsencrypt or  a commercial solution)?
>
> > On Mon, Mar 25, 2019 at 1:11 PM Muthu R D  wrote:
> >>
> >> Certificate invalid error while accessing the Ansible Tower URL from a
> Windows Server - internet explorer.
> >>
> >>
> >> Ansible Tower own support edition installed on RHEL 7.3.
> >> Trying to access the Tower Server URL from a windows machine and got
> the error 'Certificate Invalid"
> >> Please help, What I suppose to do???
> >>
> >> --
> >> 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/43719b40-cafc-4d6e-b48c-04b347f7fa3f%40googlegroups.com
> .
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> > --
> >
> > Jonathan lozada de la matta
> >
> > AUTOMATION PRACTICE
> >
> >
> >
> >
> >
> > --
> > 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/CAFYJA%2BJGSVxFWE2PbMAm_M1m%2BJvhFvdFuA4ANKO5wpmKp%2B%3D0Ng%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/CAHEKYV630o6ft2PYjdNbUp1nm5Um9ke75WJh7trQMUcBGnm0bw%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Jonathan lozada de la matta

AUTOMATION PRACTICE

-- 
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/CAFYJA%2B%2BNgg01wU%3DYtmoHSETM6hFAbWMijSRJEojuAHV%2Bm-i9FA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Certificate invalid error while accessing the Ansible Tower URL from a Windows Server - internet explorer

2019-03-25 Thread Mauricio Tavares
On Mon, Mar 25, 2019 at 1:12 PM Jonathan Lozada De La Matta
 wrote:
>
> Ansible Tower creates a self signed cert automatically. You need to accept 
> the certificate. It varies by browser on how you do it.
>
  Can you feed it a (non-self signed) cert you created (using
letsencrypt or  a commercial solution)?

> On Mon, Mar 25, 2019 at 1:11 PM Muthu R D  wrote:
>>
>> Certificate invalid error while accessing the Ansible Tower URL from a 
>> Windows Server - internet explorer.
>>
>>
>> Ansible Tower own support edition installed on RHEL 7.3.
>> Trying to access the Tower Server URL from a windows machine and got the 
>> error 'Certificate Invalid"
>> Please help, What I suppose to do???
>>
>> --
>> 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/43719b40-cafc-4d6e-b48c-04b347f7fa3f%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Jonathan lozada de la matta
>
> AUTOMATION PRACTICE
>
>
>
>
>
> --
> 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/CAFYJA%2BJGSVxFWE2PbMAm_M1m%2BJvhFvdFuA4ANKO5wpmKp%2B%3D0Ng%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/CAHEKYV630o6ft2PYjdNbUp1nm5Um9ke75WJh7trQMUcBGnm0bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] aws_s3 module fails, says Boto3 is missing when it is not - bug?

2019-03-25 Thread gigit1000
Thank you - the target host has Python2 and Python3 installed:
[ec2-user@ip-10-200-2-198 ~]$ which python
/usr/bin/python
[ec2-user@ip-10-200-2-198 ~]$ which python3
/usr/bin/python3

Python2 is installed by default. Python3 was installed by my playbook. 
Using your example I can see that Python2 does not have boto. Python3 does 
have boto3 which was also installed by my playbook.

My ansible cfg looks like this:

[defaults]
private_key_file=/home/ec2-user/key.pem
ansible_python_interpreter=/usr/bin/python3

I thought I could force ansible to use python3, but it did not work. I got 
the same result.  



On Saturday, March 23, 2019 at 4:51:46 AM UTC-7, Sudheer S wrote:
>
>
> On 23/03/19 2:48 AM, gigi...@gmail.com  wrote:
>
> This Play installs python3, pip3, boto3 and botocore, and trys to use 
> aws_s3 module to download a file:
>
> TASK [run yum update -y using yum module] 
> ***
> ok: [ip-10-200-2-137.us-west-2.compute.internal]
>
> TASK [Install python3 and pip3] 
> *
> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>
> TASK [Install boto3 and botocore with pip3 module] 
> **
> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>
> TASK [Create a directory if it does not exist using file module] 
> 
> changed: [ip-10-200-2-137.us-west-2.compute.internal]
>
> TASK [downlod file from s3 with aws_s3 module] 
> **
> fatal: [ip-10-200-2-137.us-west-2.compute.internal]: FAILED! => 
> {"changed": false, "msg": "Python modules \"botocore\" or \"boto3\" are 
> missing, please install both"}
>
> It fails because it says boto3 is missing, but it actually is not:
>
> From the Target host you can see that boto3 is installed:
>
> [ec2-user@ip-10-200-2-137 ~]$ pip3 freeze
> boto3==1.9.120
> botocore==1.12.120
> docutils==0.14
> jmespath==0.9.4
> python-dateutil==2.8.0
> s3transfer==0.2.0
> six==1.12.0
> urllib3==1.24.1
> [ec2-user@ip-10-200-2-137 ~]
>
> Is this is bug? Thank you for any help 
>
> This is the task that fails:
> - name: downlod file from s3 with aws_s3 module aws_s3: bucket: mybucket 
> object: mybucket/jre-8u201-linux-x64.tar.gz dest: 
> /home/ec2-user/updater/jre-8u201-linux-x64.tar.gz mode: get 
> -- 
> 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/e81f25a5-1104-4b36-b2a4-5a037610a9b9%40googlegroups.com
>  
> 
> .
>
> This doesn't look like a bug. It looks like boto is not available via the 
> Python interpreter Ansible is using on the target. 
>
> SSH on to the target, start the Python interpreter and see if you can 
> import boto:
>
>
> python
> Python 2.7.12 (default, Nov 12 2018, 14:36:49) 
> [GCC 5.4.0 20160609] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import boto
> >>> 
>
> -
>
> Sudheer S
>

-- 
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/acbf3765-a866-4c8e-9636-ee6e35637735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] K8s module with Custom Resource Definition always changed

2019-03-25 Thread Thms Hmm
Hi, not Chris but Thomas, anyway, some more information

ansible 2.7.9
openshift-0.8.6

The task:
- name: create resource
  k8s:
host: "{{ k8s_url }}"
api_key: "{{ k8s_token }}"
verify_ssl: no
definition: "{{ lookup('template', 'my-cr.yaml') }}"
The Template:
apiVersion: someapi.org/v1alpha1
kind: MyCrd
metadata:
  name: example-obj
  namespace: "myproject"
spec:
  parallelity: 2

Thanks

Am Sonntag, 24. März 2019 23:52:26 UTC+1 schrieb Kylix3511:
>
> Hi Chris, 
>
> I think, I seen this error. How is your play looks like ?  Paste the play 
> or playbook … I will review it and let me know. 
>
> Thanks. 
>
> Regards,
> kylix3511 
>
>
> Email : ...@gmail.com  
>
> Sent from  iPhone 
>
>
>
>
> On Mar 24, 2019, at 3:14 PM, Thms Hmm > 
> wrote:
>
> Hi,
>
> when I use the k8s module to patch a CRD object the task is always marked 
> as "changed: true" even if there are no changes to the object.
>
> ok: [localhost] => {
> "msg": {
> "changed": true,
> "diff": [
> [
> "change",
> "metadata.resourceVersion",
> [
> "124413",
> "124360"
> ]
> ]
> ],
> "failed": false,
> "method": "patch",
> "result": { ... }
> ...
>
> From the output you can see that the resourceVersion is responsible for 
> the change.
>
> Any other non CRD objects work just fine. Did anyone experience the same?
>
> Thanks in advance.
>
> -- 
> 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/ea01c353-ff7d-48c7-80b3-2020a5ed8576%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/f2c784b5-23f1-4e2f-827c-6b4a82b6c114%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] String concatenation whith stdout under with_items

2019-03-25 Thread Vino B
Hi All,

  Request your help with string concatenation whith stdout under with_items.

  - name: _List Name 
shell: (sysls -l)
register: sys_list
ignore_errors: true

  - name: check System Type
shell: (systype -t {{item.s}}|awk '{if ($3 == "not")  {print "FAILED 
:{{item.s}} is not set"} else {print "OK :{{item.s}} is set"}}')
 with_items:
  - { s:  "{{ sys_list.stdout_lines + [\"t1.dev.com\"] }}" }
  - { s:  "{{ sys_list.stdout_lines + [\"t1.dev.s1.com\"] }}" }

Note:
sys_list.stdout_lines : contains the string  "axe"
systype -t axe.t1.dev.com |awk '{if ($3 == "not")  {print "FAILED 
:{{item.s}} is not set"} else {print "OK :{{item.s}} is set"}}'
systype -t axe.t1.dev.s1.com |awk '{if ($3 == "not")  {print "FAILED 
:{{item.s}} is not set"} else {print "OK :{{item.s}} is set"}}'

Issue:

The above code is interpreting as below with square bracket and considering 
as 2 separate variables as below

V1: [axe]   V2: t1.dev.com
V1:[axe]V2: 1.dev.s1.com

systype -t [axe],'t1.dev.com' |awk '{if ($3 == "not")  {print "FAILED 
:{{item.s}} is not set"} else {print "OK :{{item.s}} is set"}}'
systype -t [axe],'t1.dev.s1.com' |awk '{if ($3 == "not")  {print "FAILED 
:{{item.s}} is not set"} else {print "OK :{{item.s}} is set"}}'

From,
Vino.B

-- 
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/a7ff18ae-b3d6-4480-834d-1baca11ae38f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] loop using only the top items in a data structure.

2019-03-25 Thread Kai Stian Olstad
On 25.03.2019 16:24, Steve Button wrote:
> Hi,
> 
> Bit of a confusing one, and perhaps I'm barking up the wrong tree (which is
> why I've turned here after some research) .
> 
> I'm trying to create a bunch of kubernetes namespaces using a template,
> have got that working fine, but now I want to add in different default
> limit and request values for each namesapce.
> 
> Initially, I just had a list along these lines :-
> 
> namespaces:
>- si
>- qa
>- dev
>- build
>- core-qa
>- core-si
> 
> But now, I've tried to be clever and add some defaults below the build
> namespace :-
> 
> namespaces:
>- si
>- qa
>- dev
>- build:
>  spec:
>  limits:
>  - default:
>  cpu: 100m
>  memory: 256Mi
>defaultRequest:
>  cpu: 50m
>  memory: 128Mi
>- core-qa
>- core-si

You need to be consistent, either have a list, list of dict or a dict.
Easiest way is to use a list of dict.

namespaces:
  - name: si
  - name: qa
  - name: dev
  - name: build
spec: 
limits:
  default:
cpu: 100m
memory: 256Mi
  defaultRequest:
cpu: 50m
memory: 128Mi
  - name: core-qa
  - name: core-si

Then you can loop like this

- name: Env Namespaces | create template in /tmp
  tags: namespaces
  template:
src: namespace.j2
dest: /tmp/{{ item.name }}.yaml
  loop: "{{ namespaces }}"


-- 
Kai Stian Olstad

-- 
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/7b451163-0694-8781-e89e-279e3e20c9ed%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Nmcli module static routes

2019-03-25 Thread anil kumar
Hi, 

Dont see any documentation regarding adding static routes using nmcli modules. 
Is it feasible to add static routes, if yes please let me know and sample 
example would help.

-- 
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/fa80ea78-df5f-400f-81a3-daca9c3e67ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] debug statement not working

2019-03-25 Thread Jerry Seven
I found this link which works:

https://ansiblemaster.wordpress.com/2017/02/24/debug-properly-data-registered-with-a-loop/


I just dont understand why it works:

- debug:
  msg: "{{ echo.results|map(attribute='stdout_lines')|list }}"




On Mon, Mar 25, 2019 at 1:12 PM Jerry Seven  wrote:

> So I update debug to:
>
>   register: pkg
>
> - debug:
> msg: "{{ pkg.results }}"
>
>
> and stdout is printed:
>
> ok: [hostname] => {
> "msg": [
> {
> "_ansible_ignore_errors": null,
> "_ansible_item_result": true,
> "_ansible_no_log": false,
> "_ansible_parsed": true,
> "changed": true,
> "cmd": "rpm -q TaniumClient",
> "delta": "0:00:00.024756",
> "end": "2019-03-25 13:10:34.751439",
> "failed": false,
> "invocation": {
> "module_args": {
> "_raw_params": "rpm -q TaniumClient",
> "_uses_shell": true,
> "chdir": null,
> "creates": null,
> "executable": null,
> "removes": null,
> "stdin": null,
> "warn": true
> }
> },
> "item": "TaniumClient",
> "rc": 0,
> "start": "2019-03-25 13:10:34.726683",
> "stderr": "",
> "stderr_lines": [],
> "stdout": "TaniumClient-6.0.314.1442-1.rhe7.x86_64",
> "stdout_lines": [
> "TaniumClient-6.0.314.1442-1.rhe7.x86_64"
> ]
> },
>
>
> but
>
> - debug:
> msg: "{{ pkg.results.stdout }}"
>
> fails.  Seems like I should be able to print that.
>
> On Fri, Mar 22, 2019 at 4:03 PM 'Felix Fontein' via Ansible Project <
> ansible-project@googlegroups.com> wrote:
>
>> Hi,
>>
>> > I cant figure out why
>> >
>> > ---
>> > - hosts: misc
>> >   become: false
>> >   gather_facts: yes
>> >   tasks:
>> > - name: get package version
>> >   shell: rpm -q {{ item }}
>> >   with_items:
>> > - "package1"
>> > - "package2"
>> > - "package3"
>> >   register: pkg
>> >
>> > - debug:
>> > msg: "{{ pkg.stdout }}"
>> >
>> >
>> > FAILED! => {"msg": "The task includes an option with an undefined
>> > variable. The error was: 'dict object' has no attribute
>> > 'stdout'\n\nThe error appears to have been in '/opt/ansible/foo.yml':
>> > line 14, column 7, but may\nbe elsewhere in the file depending on the
>> > exact syntax problem.\n\nThe offending line appears to be:\n\n\n-
>> > debug:\n  ^ here\n\nexception type: > > 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object'
>> > has no attribute 'stdout'"}
>>
>> note that you're using a loop for the "get package version" task. The
>> structure of pkg is different because of that; in particular, pkg has
>> no attribute stdout (as the error message tells you). You could output
>> the whole content of pkg with debug to see that.
>>
>> Cheers,
>> Felix
>>
>> --
>> 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/20190322210249.6c01a2ab%40rovaniemi
>> .
>> 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/CAPUfQdeQKN12Gd7RK7R3MN6fpd1%2BPngFdAc4t7EQfcRrm3%2B_4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible using lambda module

2019-03-25 Thread qasim sahi
Hi, 

can someone please help in creating the playbook to stop/start EC2 instance 
using lambda ?

-- 
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/572c098e-03e6-49a1-a8fb-c9dd30ed282b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Certificate invalid error while accessing the Ansible Tower URL from a Windows Server - internet explorer

2019-03-25 Thread Jonathan Lozada De La Matta
Ansible Tower creates a self signed cert automatically. You need to accept
the certificate. It varies by browser on how you do it.

On Mon, Mar 25, 2019 at 1:11 PM Muthu R D  wrote:

> Certificate invalid error while accessing the Ansible Tower URL from a
> Windows Server - internet explorer.
>
>
> Ansible Tower own support edition installed on RHEL 7.3.
> Trying to access the Tower Server URL from a windows machine and got the
> error 'Certificate Invalid"
> Please help, What I suppose to do???
>
> --
> 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/43719b40-cafc-4d6e-b48c-04b347f7fa3f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Jonathan lozada de la matta

AUTOMATION PRACTICE

-- 
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/CAFYJA%2BJGSVxFWE2PbMAm_M1m%2BJvhFvdFuA4ANKO5wpmKp%2B%3D0Ng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] debug statement not working

2019-03-25 Thread Jerry Seven
So I update debug to:

  register: pkg

- debug:
msg: "{{ pkg.results }}"


and stdout is printed:

ok: [hostname] => {
"msg": [
{
"_ansible_ignore_errors": null,
"_ansible_item_result": true,
"_ansible_no_log": false,
"_ansible_parsed": true,
"changed": true,
"cmd": "rpm -q TaniumClient",
"delta": "0:00:00.024756",
"end": "2019-03-25 13:10:34.751439",
"failed": false,
"invocation": {
"module_args": {
"_raw_params": "rpm -q TaniumClient",
"_uses_shell": true,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"warn": true
}
},
"item": "TaniumClient",
"rc": 0,
"start": "2019-03-25 13:10:34.726683",
"stderr": "",
"stderr_lines": [],
"stdout": "TaniumClient-6.0.314.1442-1.rhe7.x86_64",
"stdout_lines": [
"TaniumClient-6.0.314.1442-1.rhe7.x86_64"
]
},


but

- debug:
msg: "{{ pkg.results.stdout }}"

fails.  Seems like I should be able to print that.

On Fri, Mar 22, 2019 at 4:03 PM 'Felix Fontein' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> Hi,
>
> > I cant figure out why
> >
> > ---
> > - hosts: misc
> >   become: false
> >   gather_facts: yes
> >   tasks:
> > - name: get package version
> >   shell: rpm -q {{ item }}
> >   with_items:
> > - "package1"
> > - "package2"
> > - "package3"
> >   register: pkg
> >
> > - debug:
> > msg: "{{ pkg.stdout }}"
> >
> >
> > FAILED! => {"msg": "The task includes an option with an undefined
> > variable. The error was: 'dict object' has no attribute
> > 'stdout'\n\nThe error appears to have been in '/opt/ansible/foo.yml':
> > line 14, column 7, but may\nbe elsewhere in the file depending on the
> > exact syntax problem.\n\nThe offending line appears to be:\n\n\n-
> > debug:\n  ^ here\n\nexception type:  > 'ansible.errors.AnsibleUndefinedVariable'>\nexception: 'dict object'
> > has no attribute 'stdout'"}
>
> note that you're using a loop for the "get package version" task. The
> structure of pkg is different because of that; in particular, pkg has
> no attribute stdout (as the error message tells you). You could output
> the whole content of pkg with debug to see that.
>
> Cheers,
> Felix
>
> --
> 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/20190322210249.6c01a2ab%40rovaniemi
> .
> 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/CAPUfQdcVnEXmEMd%2B-Sudj3Tir%3Dm%2BodC41FvdhQXfdcNYH_HNdg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Certificate invalid error while accessing the Ansible Tower URL from a Windows Server - internet explorer

2019-03-25 Thread Muthu R D
Certificate invalid error while accessing the Ansible Tower URL from a 
Windows Server - internet explorer.


Ansible Tower own support edition installed on RHEL 7.3.
Trying to access the Tower Server URL from a windows machine and got the 
error 'Certificate Invalid"
Please help, What I suppose to do???

-- 
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/43719b40-cafc-4d6e-b48c-04b347f7fa3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ec2_instance vs ec2 - which one to use & and is there a plan?

2019-03-25 Thread Dick Visser
Hi

While trying to debug some issues (notably trying to add several security
groups to an EC2 instance), I once again ran into the question about which
ansible module to use to for EC2 instances.

>From the docs it appears that both the ec2 and the ec2_instance module are
supported, with the latter being the newest, and they do largely the same
things.
I've shuffled around the ec2_instance task into an ec2 task, and I was able
to get that to work with multiple security groups.
But now I'm having a hard time getting this new ec2 task to be idempotent,
and also the way that IP addresses are assigned is more limited than
ec2_instance.

I'm wary of picking the "old" ec2 module for my tasks, or mixing the two,
because I suspect ec2 might get deprecated some time soon in favor of the
ec2_instance module.

I couldn't find any statement or road map on this topic - is there a long
term plan or a road map wrt the two EC2 modules? If so, I can at least make
a sound decision on where to spend energy, also in terms of fixing issues.


thx


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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/CAL8fbwME8fdQ-L0NpeNBAjPkRR6wJ6rBYEHH732b%2BtkiTLJQ-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] loop using only the top items in a data structure.

2019-03-25 Thread Steve Button
Hi,

Bit of a confusing one, and perhaps I'm barking up the wrong tree (which is 
why I've turned here after some research) .

I'm trying to create a bunch of kubernetes namespaces using a template, 
have got that working fine, but now I want to add in different default 
limit and request values for each namesapce. 

Initially, I just had a list along these lines :-

namespaces:
  - si
  - qa
  - dev
  - build
  - core-qa
  - core-si

But now, I've tried to be clever and add some defaults below the build 
namespace :-

namespaces:
  - si
  - qa
  - dev
  - build:
spec:
limits:
- default:
cpu: 100m
memory: 256Mi
  defaultRequest:
cpu: 50m
memory: 128Mi
  - core-qa
  - core-si

these get used later on in my playbook (not able to test that bit yet)

Here's where I simply create a tmp file for use later on...

- name: Env Namespaces | create template in /tmp
  tags: namespaces
  template:
src: namespace.j2
dest: /tmp/{{ item }}.yaml
  loop: "{{ namespaces }}"

However this breaks badly, as it tries to use the whole data structure for 
the filename, including the default cpu, memory, request, etc. 

I want something like this...

- name: Env Namespaces | create template in /tmp
  tags: namespaces
  template:
src: namespace.j2
dest: /tmp/{{ item[top_level_only_here] }}.yaml
  loop: "{{ namespaces }}"

Is Ansible able to handle this for me??

Once I've got that working, I'll need to get it to only set the limits for 
certain namespaces and leave others without any limits. Scratching my head 
how to achieve that as well!?

Thanks,

Steve


-- 
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/573a9551-d22d-4306-9306-7e2860c142e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible inventory organization

2019-03-25 Thread Sascha Andres
Hi,

thanks Steve, this is what I was looking for. I have found intersection in 
the configs now.

Thanks again,
Sascha

On Monday, March 25, 2019 at 1:47:28 PM UTC+1, Steve R wrote:
>
> If you want an intersection, try: 
>
> ansible-playbook --limit production:\&www 
>
> Or if you just want to run on "servera" and "serverb", you can do it like 
> this: 
>
> ansible-playbook --limit ~server[ab] 
>
> --Steve 
>
> On Mon, Mar 25, 2019 at 7:24 AM Sascha Andres  > wrote: 
> > 
> > Hi, 
> > 
> > maybe to be clearer: I want the intersection of production & www. 
> > 
> > Kind regards, 
> > Sascha 
> > 
> > -- 
> > 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/8f849cde-abf8-40a5-b80b-fddfef02149b%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/2737a8b3-20b3-4e07-95a2-7dd24f729d95%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Display specific lines from cisco output

2019-03-25 Thread Raheel Khilji
Can you please explain me in detail because i have tried the solution but 
failed. Please help me

On Monday, 25 March 2019 16:48:33 UTC+5, vincent collier wrote:
>
> You could use ansible-network.network-engine's command_parser. The example 
> is on show interfaces.
>
> I published more example on my github: 
> https://github.com/kvernNC/cisco_config_parser/blob/master/README.md
>

-- 
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/875aa9d9-482c-468d-9b6f-a260fd85c7a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible inventory organization

2019-03-25 Thread S C Rigler
If you want an intersection, try:

ansible-playbook --limit production:\&www

Or if you just want to run on "servera" and "serverb", you can do it like this:

ansible-playbook --limit ~server[ab]

--Steve

On Mon, Mar 25, 2019 at 7:24 AM Sascha Andres  wrote:
>
> Hi,
>
> maybe to be clearer: I want the intersection of production & www.
>
> Kind regards,
> Sascha
>
> --
> 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/8f849cde-abf8-40a5-b80b-fddfef02149b%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/CAFbiokdpNqO9E4AhKSv--0er8Ls-GwRxhrvStb_PYMU1ntPv8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible inventory organization

2019-03-25 Thread Kai Stian Olstad

On 25.03.2019 13:20, Sascha Andres wrote:

Hi,

I have servers that are organized into environment (such as staging,
production, test, etc.) and into function (www, db, etc)

My idea was to have a group 'production' with a list of servers, and a
group www with a list of servers. Just like this:


production:
  hosts:
servera
serverb

test:
  hosts:
serverc
serverd

www:
  hosts:
servera
serverb
serverc
serverd

Not I want something like
ansible-playbook --limit production,www

and I want it applied only to servera and serverb. Not sure how to get
there. Can anyone give a hint?


https://docs.ansible.com/ansible/latest/user_guide/intro_patterns.html


--
Kai Stian Olstad

--
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/4f53c755ab1f8ca4848937557f876b87%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible inventory organization

2019-03-25 Thread Sudheer S



On 25/03/19 5:50 PM, Sascha Andres wrote:

Hi,

I have servers that are organized into environment (such as staging, 
production, test, etc.) and into function (www, db, etc)


My idea was to have a group 'production' with a list of servers, and a 
group www with a list of servers. Just like this:



    production:
      hosts:
        servera
        serverb

    test:
      hosts:
        serverc
        serverd

    www:
      hosts:
        servera
        serverb
        serverc
        serverd

Not I want something like
    ansible-playbook --limit production,www

and I want it applied only to servera and serverb. Not sure how to get 
there. Can anyone give a hint?




I recommend this layout:

environments/production/hosts

environment/staging/hosts

environment/test/hosts

Each hosts file should have list of servers.

all:
  hosts:
    placeholder
  children:
    db:
  hosts:
    dbserver1

    www:

 hosts:

   wwwserver1

You could execute playbook like:
ansible-playbook -i environments/production/ webservers.yml
-
Sudheer S

--
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/2b1b-d36d-9a9b-8def-3ebb12612f67%40techchorus.net.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Ansible inventory organization

2019-03-25 Thread Sascha Andres
Hi,

maybe to be clearer: I want the intersection of production & www.

Kind regards,
Sascha

-- 
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/8f849cde-abf8-40a5-b80b-fddfef02149b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible inventory organization

2019-03-25 Thread Sascha Andres
Hi,

I have servers that are organized into environment (such as staging, 
production, test, etc.) and into function (www, db, etc)

My idea was to have a group 'production' with a list of servers, and a 
group www with a list of servers. Just like this:


production:
  hosts:
servera
serverb

test:
  hosts:
serverc
serverd

www:
  hosts:
servera
serverb
serverc
serverd

Not I want something like
ansible-playbook --limit production,www 

and I want it applied only to servera and serverb. Not sure how to get 
there. Can anyone give a hint?

Kind regards,
Sascha

-- 
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/0221cb0a-8b85-478d-b55b-615799542735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Display specific lines from cisco output

2019-03-25 Thread vincent collier
You could use ansible-network.network-engine's command_parser. The example is 
on show interfaces.

I published more example on my github: 
https://github.com/kvernNC/cisco_config_parser/blob/master/README.md

-- 
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/531c6831-5bdc-44bd-b0bd-7be688e6137a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Display specific lines from cisco output

2019-03-25 Thread Raheel Khilji
I have a situation my script is 

hosts: Branch
  gather_facts: false
  connection: local

  tasks:
   - name: Facts
 ios_command:
commands:
- show inter gi0/0
 register: output

   - debug:
   msg: "{{ output.stdout_lines }}"
 
## The output is like
"GigabitEthernet0/0 is up, line protocol is up ",
"  Hardware is CN Gigabit Ethernet, address is d8b1.
"  Description: ***LAN***",
"  MTU 1500 bytes, BW 10 Kbit/sec, DLY 100 usec, ",
" reliability 255/255, txload 1/255, rxload 1/255",
"  Encapsulation 802.1Q Virtual LAN, Vlan ID  1., loopback not 
set",
"  Keepalive set (10 sec)",
"  Full Duplex, 100Mbps, media type is RJ45",
"  output flow-control is unsupported, input flow-control is 
unsupported",
"  ARP type: ARPA, ARP Timeout 04:00:00",
"  Last input 00:00:00, output 00:00:00, output hang never",
"  Last clearing of \"show interface\" counters never",
"  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output 
drops: 0",
"  Queueing strategy: fifo",
"  Output queue: 0/40 (size/max)",
"  5 minute input rate 64000 bits/sec, 46 packets/sec",
"  5 minute output rate 81000 bits/sec, 38 packets/sec",
" 64022727 packets input, 3777167804 bytes, 0 no buffer",
" Received 7566193 broadcasts (0 IP multicasts)",
" 0 runts, 0 giants, 0 throttles ",
" 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored",
" 0 watchdog, 904385 multicast, 0 pause input",
" 60376363 packets output, 1696679415 bytes, 0 underruns",
" 0 output errors, 0 collisions, 0 interface resets",
" 115659 unknown protocol drops",
" 0 babbles, 0 late collision, 0 deferred",
" 0 lost carrier, 0 no carrier, 0 pause output",
" 0 output buffer failures, 0 output buffers swapped out"

*But how can i display an specific line rather then whole output as i want 
the lines starts with "5 minute"*

Please Help

-- 
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/090c08cf-5519-4a6c-b356-be1a36ae2aa5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible synchronize database sql

2019-03-25 Thread ryad9200000
Hi Keif Gwinn,

Thanks for answer, i will go try command SQL with powershell command in 
ansible ;)

Regards,

Le vendredi 22 mars 2019 18:17:28 UTC+1, Keif Gwinn a écrit :
>
> Not really an ansible question, but you can always execute powershell 
> commands a windows host with access to the database server and this command
>
>
> https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/resume-an-availability-database-sql-server?view=sql-server-2017#PowerShellProcedure
>
>
> On Fri, 22 Mar 2019 at 16:33, > wrote:
>
>> New question,
>>
>> Can i execute line command SQL in ansible ?
>>
>> How can i do it please ??
>>
>> Thanks
>>
>> Regards,
>>
>> Le vendredi 22 mars 2019 16:48:13 UTC+1, ryad9...@gmail.com a écrit :
>>>
>>> Hi all,
>>>
>>> *"* Data synchronization can be resumed by right-clicking on the 
>>> database and choosing "Resume data movement ...". *"*
>>>
>>>
>>> [image: Resume_data_movement_of_sql_server.png]
>>>
>>> I want know if in ansible its possible to realize the same thing as on 
>>> the image.
>>> That is to resynchronize a database?
>>>
>>> I see module database of ansible but without success.
>>>
>>> Someone have an idea please ?
>>>
>>> Thanks community ansible !! ;)
>>>
>>> Regards,
>>>
>>>
>>> -- 
>> 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/6b91b4d9-7e93-408a-a579-8f3ddd0a42cf%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/74033936-e1af-4ca6-95f0-18c58caa0bd3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] host patterns doesn't work in group inventory

2019-03-25 Thread Oliver markey
I got a predefined group `monitor` with many monitoring parameters that 
will be used in prometheus/alertmanager/node-exporter.

inventory/hosts
`
[monitor]
10.1.1.1
10.2.2.2
10.3.3.3
`

group_vars/monitor.yml
`
prometheus_version: xxx
prometheus_port: xxx
`

playbooks/monitor.yml
`
- hosts: monitor
  roles:
- {role: prometheus}
`

There was a problem when using dynamic inventory. No hosts were selected 
when using host patterns in group inventory.
`
[monitor]
us-west:!tags_k8s*:!tags_win*
`


-- 
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/1a273f52-2a94-44f5-ad4a-9c515594033b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.