[ansible-project] Get details of installed iis websites

2018-02-04 Thread Suporter
I am using  win_iis_website and would like to know whether it is possible 
to fetch the details of already installed websites like location, 
application pool and so on

-- 
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/87ee6541-75aa-4514-99c8-1105249d3987%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] To Login SOAP API

2018-02-04 Thread rajasekhar mutyala
Hi All,

I am trying to login and perform some taks using SOAP API with ansible. Can 
you please let me know how to call SOAP API along with examples would 
really help.

Thanks
Rajasekhar

-- 
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/c47a504c-061c-45f9-8f99-ca87ad7c7c03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Creating multiple rules on an AWS load balancer listener

2018-02-04 Thread eshan TANDON
Hi There,
Seems like the code is executing the entire block twice, ie the ELB 
creation is getting executed twice.
Here is the reference document: 
http://docs.ansible.com/ansible/latest/playbooks_loops.html

--

- name: add several users
  user:
name: "{{ item }}"
state: present
groups: "wheel"
  with_items:
 - testuser1
 - testuser2

is equivalent to:

- name: add user testuser1
  user:
name: "testuser1"
state: present
groups: "wheel"- name: add user testuser2
  user:
name: "testuser2"
state: present
groups: "wheel"







On Sunday, 4 February 2018 09:59:15 UTC-5, geo...@divirted.com wrote:
>
> Hi All,
>
> I have an application load balancer in AWS with an HTTP listener 
> configured (another tool provisioned it, not ansible). Anyway my task is to 
> add rules to its HTTP listener using Ansible by looping through a vars file.
>
> I first use Ansible's various AWS get_fact operations to discover the load 
> balancer, it's ARNs, subnetIDs etc. Then I define the load balancer using 
> Ansible's elb_application_lb module and use the facts I've previously 
> retrieved to set the properties for it's name, security groups etc. All of 
> this works beautifully well.
>
> Then under the HTTP listener properties, I define one rule using the 
> "with_items" feature. My hope would be that it'd loop through my list, 
> creating the rules I want (and it does kind of do this..), however instead 
> of appending the rules to the listener as it goes, it instead deletes the 
> existing rule then creates the next one. So when the playbook completes I'm 
> left with the ALB with just one listener rule defined (and it will be 
> whichever entry is last in my vars file). The code is below:
>
> - name: Add HTTP listener rules
>   elb_application_lb:
> state: present
> name: "{{ albinfo.load_balancer_name }}"
> subnets:
>   - "{{ albinfo.availability_zones[0].subnet_id }}"
>   - "{{ albinfo.availability_zones[1].subnet_id }}"
>   - "{{ albinfo.availability_zones[2].subnet_id }}"
> security_groups:
>   - "{{ albinfo.security_groups[0] }}"
> listeners:
>   - Protocol: HTTP
> Port: 80
> DefaultActions:
>   - Type: forward
> TargetGroupName: test
> Rules:
>   - Conditions:
>   - Field: host-header
> Values: "{{ item.url }}"
> ListenerArn: "{{ albinfo.listeners[0].listener_arn }}"
> Priority: "{{ item.priority }}"
> Actions:
>   - TargetGroupName: "{{ item.name }}"
> Type: forward
> purge_listeners: no
>   with_items: "{{ regions }}"
>
>
> And my "regions" var file looks like this:
>
> regions:
>   - name: manchester
> priority: 1
> url:
>   - manchester.example.com
>
>   - name: surrey
> priority: 2
> url:
>   - surrey.example.com
>
>
> I'm sure that this is a logic error on my part and not a bug, so could 
> anybody explain where I'm going wrong?
>

-- 
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/8bd2a400-9159-4514-8d81-eddcca83af69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: New module return type

2018-02-04 Thread Jordan Borean
Sorry was a typo that meant dict, I’m not really sure how macOS works but would 
it be better to add the dict support types to the existing module instead of 
creating a new one?

-- 
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/13b351bd-fe89-4599-884b-3c9b29ded4ca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: ansible conditions

2018-02-04 Thread eshan TANDON
Hi Sudhir,
Try logging the actual values:

- debug: var=vg_name verbosity=3

- debug: var=mtpt_size verbosity=3


Thanks,
Eshan


On Sun, Feb 4, 2018 at 3:04 PM, Sudhir Kumar 
wrote:

> Hi All,
>
> Seems like some miscommunication here. I provided code in my first comment
> :
>
> #
>   - name: Executing lvm script
> shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }}
> args:
>   chdir: /tmp/
> when: vg_name is defined
> ##
>
> And using with  jenkins + parameterized input.
>
> So, if any parameterized input present then ansible should fire above
> script . If no input is provided then it should not trigger above snippet.
>
> Hope it's clear now.
>
> Regards,
> Sidh
>
> On Sunday, February 4, 2018 at 12:20:36 PM UTC+1, Varun Chopra wrote:
>>
>> Hi Sudhir,
>>
>> You're barely making sense and it doesn't help when you don't provide any
>> code.
>>
>> Nobody can help you if they don't understand you.
>>
>> --
>> Varun
>>
>> On Thursday, February 1, 2018 at 9:11:08 PM UTC+5:30, Sudhir Kumar wrote:
>>>
>>> Hi,
>>>
>>> Below snippet sometimes working and sometimes failing. So, i am
>>> executing it with jenkins and idea is that if parameter is defined then
>>> script should run otherwise it should not run.
>>>
>>> Can anyone please enlighten me what's wrong ?
>>>
>>> #
>>>   - name: Executing lvm script
>>> shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }}
>>> args:
>>>   chdir: /tmp/
>>> when: vg_name is defined
>>> ##
>>>
>> --
> 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/706a2822-ca39-4a02-a397-941819bc819f%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Warm Regards,
Eshan Tandon

-- 
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/CAPRmaHE_q7nSgUu%2Buh9DoQudjK13sQGJu-O-9mrdja4_fUtiTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible conditions

2018-02-04 Thread Sudhir Kumar
Hi All,

Seems like some miscommunication here. I provided code in my first comment :

#
  - name: Executing lvm script 
shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }} 
args:
  chdir: /tmp/
when: vg_name is defined
##

And using with  jenkins + parameterized input. 

So, if any parameterized input present then ansible should fire above 
script . If no input is provided then it should not trigger above snippet. 

Hope it's clear now.

Regards,
Sidh

On Sunday, February 4, 2018 at 12:20:36 PM UTC+1, Varun Chopra wrote:
>
> Hi Sudhir,
>
> You're barely making sense and it doesn't help when you don't provide any 
> code.
>
> Nobody can help you if they don't understand you.
>
> --
> Varun
>
> On Thursday, February 1, 2018 at 9:11:08 PM UTC+5:30, Sudhir Kumar wrote:
>>
>> Hi,
>>
>> Below snippet sometimes working and sometimes failing. So, i am executing 
>> it with jenkins and idea is that if parameter is defined then script should 
>> run otherwise it should not run. 
>>
>> Can anyone please enlighten me what's wrong ?
>>
>> #
>>   - name: Executing lvm script 
>> shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }} 
>> args:
>>   chdir: /tmp/
>> when: vg_name is defined
>> ##
>>
>

-- 
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/706a2822-ca39-4a02-a397-941819bc819f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: New module return type

2018-02-04 Thread matzehollerbach
Thank you for your response!
Actually the osx_defaults module you are referring to is very limited in 
scope because the command it uses doesn't support nested dictionaries. My 
module manipulates these defaults in another way.
What do you mean by "rift type" ? I think I will follow you advice and 
declare the return type as string.

-- 
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/d5d0eb93-a836-45ff-ad72-29707d9cd405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] New module return type

2018-02-04 Thread Jordan Borean
I don’t meant to burst your bubble but a module to do this already exists 
http://docs.ansible.com/ansible/latest/osx_defaults_module.html. It may be good 
to look into that and see if it does what you are looking to so. For this 
issue, complex usually means a rift type, you may be better off setting the 
type as a string and say in the description the type could change depending on 
the key. Unfortunately there isn’t an easy way to do what you are looking to do 
here.

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/40886db2-f926-4694-ad03-22f21401ec97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] New module return type

2018-02-04 Thread matzehollerbach
I'm currently developing my first ansible module 
.
 
It can read/write os x settings, since these settings can be nested the 
return type can be an integer, float, string, dict, list, etc...
When I run the *validate-modules* test on the following documentation:
RETURN = '''
value:
description: The value associated with the preference domain and key.
 Return type is a python object that maps closest to the 
data type of the macOS preference. This can be an integer, float, string, 
dict, list, etc...
returned: when action=get
type: complex
sample: "{'CustomViewStyleVersion': 1}"
'''

The test complains that I have to add the *contains* key. Because the 
output of my module differs based on which settings it reads, I can't 
specify the *contains* key.
I would be glad if someone could tell me how to solve this problem.

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-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/6b3e8463-eab6-489d-9382-73e882b8c972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] socket_path: None Win10 Linux Emulator

2018-02-04 Thread ajay reddy m

Any help in finding reason why i get error "socket_path: None" ?
COMPONENT NAME
ios_command

ANSIBLE VERSION

ansible 2.4.3.0
  config file = /mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg
  configured module search path = 
[u'/home/ajayreddy28390/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/home/ajayreddy28390/.local/lib/python2.7/site-packages/ansible
  executable location = /home/ajayreddy28390/.local/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]

CONFIGURATION

DEFAULT_HOST_LIST(/mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg) 
= [u'/mnt/c/Users/ajayr/Documents/overall_example/hosts']
DEFAULT_TIMEOUT(/mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg) = 
5
DEFAULT_TRANSPORT(/mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg) 
= paramiko
HOST_KEY_CHECKING(/mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg) 
= False

OS / ENVIRONMENT

Windows 10 Linux Emulator

SUMMARY

Ansible unable connect to hosts using SSH
STEPS TO REPRODUCE

cat ansible.cfg[defaults]transport = paramikohostfile = 
./hostshost_key_checking = falsetimeout = 
5ajayreddy28390@DESKTOP-0KSKK6B:/mnt/c/Users/ajayr/Documents/overall_example$ 
cat IOS_test.yml
---
- name: show version
  hosts: "ios-devices"
  gather_facts: false
  connection: local

  vars:
   cli:
 host: "{{ inventory_hostname }}"
 username: cisco
 password: Qazwsx12

  tasks:
- name: show version
  ios_command:
commands: show version
provider: "{{ cli }}"

  register: output

- name: show output
  debug:
var: output.stdout

- name: copy output to file
  copy: content="{{ output }}" dest=./output/{{ inventory_hostname 
}}.txt[overall_example.zip](https://github.com/ansible/ansible/files/1693025/overall_example.zip)

ACTUAL RESULTS

/mnt/c/Users/ajayr/Documents/overall_example$ ansible-playbook IOS_test.yml 
-
ansible-playbook 2.4.3.0
  config file = /mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg
  configured module search path = 
[u'/home/ajayreddy28390/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/home/ajayreddy28390/.local/lib/python2.7/site-packages/ansible
  executable location = /home/ajayreddy28390/.local/bin/ansible-playbook
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Using /mnt/c/Users/ajayr/Documents/overall_example/ansible.cfg as config file
[DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as it 
can also be a list of hosts, a directory or a list of paths . This
feature will be removed in version 2.8. Deprecation warnings can be disabled by 
setting deprecation_warnings=False in ansible.cfg.
setting up inventory plugins
Parsed /mnt/c/Users/ajayr/Documents/overall_example/hosts inventory source with 
ini plugin
Loading callback plugin default of type stdout, v2.0 from 
/home/ajayreddy28390/.local/lib/python2.7/site-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: IOS_test.yml 
***
1 plays in IOS_test.yml

PLAY [show version] 
**
META: ran handlers

TASK [show version] 
**
task path: /mnt/c/Users/ajayr/Documents/overall_example/IOS_test.yml:14
<192.168.24.250.xip.io> using connection plugin network_cli
<192.168.24.254.xip.io> using connection plugin network_cli
<192.168.24.250.xip.io> socket_path: None
fatal: [192.168.24.250.xip.io]: FAILED! => {
"changed": false,
"msg": "unable to open shell. Please see: 
https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell";
}
<192.168.24.254.xip.io> socket_path: None
fatal: [192.168.24.254.xip.io]: FAILED! => {
"changed": false,
"msg": "unable to open shell. Please see: 
https://docs.ansible.com/ansible/network_debug_troubleshooting.html#unable-to-open-shell";
}
to retry, use: --limit 
@/mnt/c/Users/ajayr/Documents/overall_example/IOS_test.retry

PLAY RECAP 
***
192.168.24.250.xip.io  : ok=0changed=0unreachable=0failed=1
192.168.24.254.xip.io  : ok=0changed=0unreachable=0failed=1

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this d

[ansible-project] Using tower for automaed patching

2018-02-04 Thread Dhaval Joshi
Hello,

I am new to tower, i have a plan to design patching as a services for automated 
patching on Linux box, i am also using satellite6 for patch information.

Does anyone have implemented it ? If you can share your ideas/docs please ?

I am aslo interested in RBAC so team2 does not have access to team2 playbooks 
inventories.

Appreciate some guidance on same.

Thanks,
D

-- 
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/538cb41f-37d4-431c-8c43-64c2de4f85f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Creating multiple rules on an AWS load balancer listener

2018-02-04 Thread george
Hi All,

I have an application load balancer in AWS with an HTTP listener configured 
(another tool provisioned it, not ansible). Anyway my task is to add rules 
to its HTTP listener using Ansible by looping through a vars file.

I first use Ansible's various AWS get_fact operations to discover the load 
balancer, it's ARNs, subnetIDs etc. Then I define the load balancer using 
Ansible's elb_application_lb module and use the facts I've previously 
retrieved to set the properties for it's name, security groups etc. All of 
this works beautifully well.

Then under the HTTP listener properties, I define one rule using the 
"with_items" feature. My hope would be that it'd loop through my list, 
creating the rules I want (and it does kind of do this..), however instead 
of appending the rules to the listener as it goes, it instead deletes the 
existing rule then creates the next one. So when the playbook completes I'm 
left with the ALB with just one listener rule defined (and it will be 
whichever entry is last in my vars file). The code is below:

- name: Add HTTP listener rules
  elb_application_lb:
state: present
name: "{{ albinfo.load_balancer_name }}"
subnets:
  - "{{ albinfo.availability_zones[0].subnet_id }}"
  - "{{ albinfo.availability_zones[1].subnet_id }}"
  - "{{ albinfo.availability_zones[2].subnet_id }}"
security_groups:
  - "{{ albinfo.security_groups[0] }}"
listeners:
  - Protocol: HTTP
Port: 80
DefaultActions:
  - Type: forward
TargetGroupName: test
Rules:
  - Conditions:
  - Field: host-header
Values: "{{ item.url }}"
ListenerArn: "{{ albinfo.listeners[0].listener_arn }}"
Priority: "{{ item.priority }}"
Actions:
  - TargetGroupName: "{{ item.name }}"
Type: forward
purge_listeners: no
  with_items: "{{ regions }}"


And my "regions" var file looks like this:

regions:
  - name: manchester
priority: 1
url:
  - manchester.example.com

  - name: surrey
priority: 2
url:
  - surrey.example.com


I'm sure that this is a logic error on my part and not a bug, so could 
anybody explain where I'm going wrong?

-- 
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/4b8263df-f506-4797-b27e-491345ab8100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Creating multiple rules for an AWS ALB listener

2018-02-04 Thread george
Hi All,

I have an application load balancer in AWS with an HTTP listener configured 
(another tool provisioned it, not ansible). Anyway my task is to add rules 
to its HTTP listener using Ansible by looping through a vars file.

I first use Ansible's various AWS get_fact operations to discover the load 
balancer, it's ARNs, subnetIDs etc. Then I define the load balancer using 
Ansible's elb_application_lb module and use the facts I've previously 
retrieved to set the properties for it's name, security groups etc. All of 
this works beautifully well.

Then under the HTTP listener properties, I define one rule using the 
"with_items" feature. My hope would be that it'd loop through my list, 
creating the rules I want (and it does kind of do this..), however instead 
of appending the rules to the listener as it goes, it instead deletes the 
existing rule then creates the next one. So when the playbook completes I'm 
left with the ALB with just one listener rule defined (and it will be 
whichever entry is last in my vars file). The code is below:

- name: Add HTTP listener rules
  elb_application_lb:
state: present
name: "{{ albinfo.load_balancer_name }}"
subnets:
  - "{{ albinfo.availability_zones[0].subnet_id }}"
  - "{{ albinfo.availability_zones[1].subnet_id }}"
  - "{{ albinfo.availability_zones[2].subnet_id }}"
security_groups:
  - "{{ albinfo.security_groups[0] }}"
listeners:
  - Protocol: HTTP
Port: 80
DefaultActions:
  - Type: forward
TargetGroupName: test
Rules:
  - Conditions:
  - Field: host-header
Values: "{{ item.url }}"
ListenerArn: "{{ albinfo.listeners[0].listener_arn }}"
Priority: "{{ item.priority }}"
Actions:
  - TargetGroupName: "{{ item.name }}"
Type: forward
purge_listeners: no
  with_items: "{{ regions }}"


And my "regions" var file looks like this:

regions:
  - name: manchester
priority: 1
url:
  - manchester.dev.noglet.panlogic.co.uk

  - name: surrey
priority: 2
url:
  - surrey.dev.noglet.panlogic.co.uk


I'm sure that this is a logic error on my part and not a bug, so could 
anybody explain where I'm going wrong?

-- 
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/3ed782cf-c736-4f4a-a3ee-b0e5a84c3933%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ssh connection doesn't work

2018-02-04 Thread jonathan . recly
really ? just that ?

I try with python installed in the managed machine  And you know what ? 
It's work :)

Thanks very much for your help. I pass two day to search on internet 
solution, and you save me with this simply response.

Have a good day and thanks again.


Le dimanche 4 février 2018 17:22:52 UTC+4, Varun Chopra a écrit :
>
> You need to have Python installed on the managed host.
>
> On Sunday, February 4, 2018 at 6:22:54 PM UTC+5:30, jonatha...@clearsys.re 
> wrote:
>>
>> Hi everybody,
>>
>> I have some problems to use ansible.
>>
>>
>> I use ansible version 2.4.3.0 i
>>
>> I testing just one host with IP and port (I have port fowarding).
>> I copying ssh pub key (ssh-copy-id).
>> I try to install Git on the target serveur. 
>> tasks:
>> - name: Installation de Git
>> apt: name=git update_cache=yes
>>
>>
>> When I lauch ansible (ansible-playbook -i hosts playbook.yml -), 
>> I have this message error : 
>>
>> OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016\r\ndebug1: 
>> Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
>> /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: 
>> Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: 
>> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
>> request forwardings: 0 local, 0 remote\r\ndebug3: 
>> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
>> entering\r\ndebug3: mux_client_request_alive: done pid = 5417\r\ndebug3: 
>> mux_client_request_session: session request sent\r\ndebug1: 
>> mux_client_request_session: master session id: 2\r\ndebug3: 
>> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
>> exit status from master 0\r\nShared connection to 165.169.240.98 
>> closed.\r\n", 
>> "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n"
>>
>>
>> But if I lauch ansible ssh command in the terminal (just copy and paste 
>> ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o 
>> ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o 
>> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
>> -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o 
>> ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), 
>> connection wil be establish normaly
>>
>>
>>
>> here the result of the -v ansible-playbook command
>> ---
>> jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - 
>> ansible-playbook 2.4.3.0
>>   config file = /etc/ansible/ansible.cfg
>>   configured module search path = 
>> [u'/home/jrecly/.ansible/plugins/modules', 
>> u'/usr/share/ansible/plugins/modules']
>>   ansible python module location = 
>> /usr/lib/python2.7/dist-packages/ansible
>>   executable location = /usr/bin/ansible-playbook
>>   python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
>> Using /etc/ansible/ansible.cfg as config file
>> setting up inventory plugins
>> Parsed /home/jrecly/ansible/hosts inventory source with ini plugin
>> Loading callback plugin default of type stdout, v2.0 from 
>> /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc
>>
>> PLAYBOOK: playbook.yml 
>> ***
>> 1 plays in playbook.yml
>>
>> PLAY [Securisation des serveurs] 
>> *
>>
>> TASK [Gathering Facts] 
>> ***
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py
>> Using module_utils file 
>> /usr/lib/python2.7/dist-packages/a

[ansible-project] Re: ssh connection doesn't work

2018-02-04 Thread Varun Chopra
You need to have Python installed on the managed host.

On Sunday, February 4, 2018 at 6:22:54 PM UTC+5:30, jonatha...@clearsys.re 
wrote:
>
> Hi everybody,
>
> I have some problems to use ansible.
>
>
> I use ansible version 2.4.3.0 i
>
> I testing just one host with IP and port (I have port fowarding).
> I copying ssh pub key (ssh-copy-id).
> I try to install Git on the target serveur. 
> tasks:
> - name: Installation de Git
> apt: name=git update_cache=yes
>
>
> When I lauch ansible (ansible-playbook -i hosts playbook.yml -), I 
> have this message error : 
>
> OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016\r\ndebug1: 
> Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
> /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: 
> Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: 
> mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
> request forwardings: 0 local, 0 remote\r\ndebug3: 
> mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
> entering\r\ndebug3: mux_client_request_alive: done pid = 5417\r\ndebug3: 
> mux_client_request_session: session request sent\r\ndebug1: 
> mux_client_request_session: master session id: 2\r\ndebug3: 
> mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
> exit status from master 0\r\nShared connection to 165.169.240.98 
> closed.\r\n", 
> "module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n"
>
>
> But if I lauch ansible ssh command in the terminal (just copy and paste 
> ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o 
> ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o 
> PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
> -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o 
> ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), 
> connection wil be establish normaly
>
>
>
> here the result of the -v ansible-playbook command
> ---
> jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - 
> ansible-playbook 2.4.3.0
>   config file = /etc/ansible/ansible.cfg
>   configured module search path = 
> [u'/home/jrecly/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.7/dist-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
> Using /etc/ansible/ansible.cfg as config file
> setting up inventory plugins
> Parsed /home/jrecly/ansible/hosts inventory source with ini plugin
> Loading callback plugin default of type stdout, v2.0 from 
> /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc
>
> PLAYBOOK: playbook.yml 
> ***
> 1 plays in playbook.yml
>
> PLAY [Securisation des serveurs] 
> *
>
> TASK [Gathering Facts] 
> ***
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/six/__init__.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/compat.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/timeout.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/collector.py
> Using module_utils file 
> /usr/lib/python2.7/dist-packages/ansible/module_utils/facts/network/freebsd.p

[ansible-project] ssh connection doesn't work

2018-02-04 Thread jonathan . recly
Hi everybody,

I have some problems to use ansible.


I use ansible version 2.4.3.0 i

I testing just one host with IP and port (I have port fowarding).
I copying ssh pub key (ssh-copy-id).
I try to install Git on the target serveur. 
tasks:
- name: Installation de Git
apt: name=git update_cache=yes


When I lauch ansible (ansible-playbook -i hosts playbook.yml -), I 
have this message error : 

OpenSSH_6.7p1 Debian-5+deb8u3, OpenSSL 1.0.1t  3 May 2016\r\ndebug1: 
Reading configuration data /etc/ssh/ssh_config\r\ndebug1: 
/etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: 
Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: 
mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: 
request forwardings: 0 local, 0 remote\r\ndebug3: 
mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: 
entering\r\ndebug3: mux_client_request_alive: done pid = 5417\r\ndebug3: 
mux_client_request_session: session request sent\r\ndebug1: 
mux_client_request_session: master session id: 2\r\ndebug3: 
mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received 
exit status from master 0\r\nShared connection to 165.169.240.98 
closed.\r\n", 
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n"


But if I lauch ansible ssh command in the terminal (just copy and paste 
ansible ssh command : ssh -vvv -C -o ControlMaster=auto -o 
ControlPersist=60s -o Port=2211 -o KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o 
ControlPath=/home/jrecly/.ansible/cp/d29cd310c0 -tt 165.169.240.98), 
connection wil be establish normaly



here the result of the -v ansible-playbook command
---
jrecly@debian:~/ansible$ ansible-playbook -i hosts playbook.yml - 
ansible-playbook 2.4.3.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = 
[u'/home/jrecly/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.9 (default, Jun 29 2016, 13:08:31) [GCC 4.9.2]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
Parsed /home/jrecly/ansible/hosts inventory source with ini plugin
Loading callback plugin default of type stdout, v2.0 from 
/usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc

PLAYBOOK: playbook.yml 
***
1 plays in playbook.yml

PLAY [Securisation des serveurs] 
*

TASK [Gathering Facts] 
***
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/basic.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/__init__.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/namespace.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/ansible_collector.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/default_collectors.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/_text.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/convert_bool.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/parsing/__init__.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/pycompat24.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/six/__init__.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/compat.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/timeout.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/collector.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/network/freebsd.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/virtual/openbsd.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/network/base.py
Using module_utils file 
/usr/lib/python2.7/dist-packages/ansible/module_utils/facts/hardware/dragonfly.py
Using mo

[ansible-project] Re: ansible conditions

2018-02-04 Thread Varun Chopra
Hi Sudhir,

You're barely making sense and it doesn't help when you don't provide any 
code.

Nobody can help you if they don't understand you.

--
Varun

On Thursday, February 1, 2018 at 9:11:08 PM UTC+5:30, Sudhir Kumar wrote:
>
> Hi,
>
> Below snippet sometimes working and sometimes failing. So, i am executing 
> it with jenkins and idea is that if parameter is defined then script should 
> run otherwise it should not run. 
>
> Can anyone please enlighten me what's wrong ?
>
> #
>   - name: Executing lvm script 
> shell: /tmp/lvm-script.sh sdb {{ vg_name }} {{ mtpt_size }} 
> args:
>   chdir: /tmp/
> when: vg_name is defined
> ##
>

-- 
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/c12969fc-c2a3-4900-bc87-f482670918fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible scans all files under host_vars when executing a playbook

2018-02-04 Thread Kai Stian Olstad
On Friday, 2 February 2018 19.06.22 CET Carl Wainwright wrote:
> I trying to understand if my setup is correct or not given the subject 
> matter.
> 
> When I run a playbook on a particular host and a host_vars file for another 
> host has a syntactical error the playbook execution fails because of the 
> broken host_vars file.
> 



> 
> The playbooks are executing using the host names only. The playbooks all 
> start with 
> 
> - hosts: dockerengines
> 
> Is this behavior normal or am I causing this by how my inventory/playbooks 
> are defined?
> 

This is by design, Ansible will read all the files in the inventory that 
includes group_vars and host_vars.


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


Re: [ansible-project] pyOpenSSL is in Python path but Ansible does not see it (Openssl_certificate module)

2018-02-04 Thread Kai Stian Olstad
On Saturday, 3 February 2018 02.16.37 CET Michael Bubb wrote:
> 
> When trying to run the Openssl_certificate module with provider=assertonly 
> I am getting 
> 
> "The python pyOpenSSL library is required"
> 
> but it looks like that is available to Python:
> 
> python -m OpenSSL.debug

>From the documentation "Requirements (on host that executes module)"
I guess you are running this on the remote host and not localhost so you need 
to install the requirement on the remote host.



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