Re: [ansible-project] return more than process id in ansible when i use ps in shell module! why?

2018-04-17 Thread Biswadip Dutta
Can you please elaborate about the issue in the mail body rather than the
subject? That way someone might be able to help you. :)

Regards,
Biswadip Dutta

On Tue, Apr 17, 2018 at 12:02 PM, Ghasem keshavarz haddad <
ghasemsys...@gmail.com> wrote:

> please help me :(
>
> --
> 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/437bc24f-ab6c-4147-9df3-dabacc2cd8c4%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/437bc24f-ab6c-4147-9df3-dabacc2cd8c4%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuXnbQYMhZtcT9Tv7wiV4O_pNXPJnFv%3DdiHWfS-fQ%2BJ6N7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] include not working

2018-04-17 Thread Biswadip Dutta
I understand the problem now. You are trying to include a playbook under
the tasks level which is not allowed. A file with only tasks are allowed to
be included under tasks. See here
<http://docs.ansible.com/ansible/2.3/playbooks_roles.html#task-include-files-and-encouraging-reuse>
.

Also, conditionally adding playbooks is a feature request as per this
<https://github.com/ansible/ansible/issues/34281> from what I can find.

Maybe you can restructure 2.yml a bit. Check here
<http://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#conditional-imports>
for
reference.

Regards,
Biswadip Dutta

On Tue, Apr 17, 2018 at 5:16 AM, Tcpip <juraj.pa...@gmail.com> wrote:

> Hello,
>
> I test it but still the same issue, maybe is the wrong way, the idea is if
> the value es greater then run the other playbook.
>
> thanks.
>
> On Monday, April 16, 2018 at 9:15:18 AM UTC-3, Biswadip Dutta wrote:
>>
>> Hi,
>> I believe you should use import_playbook to add a playbook in another
>> playbook. See here
>> <https://docs.ansible.com/ansible/2.4/playbooks_reuse_includes.html>.
>>
>> Regards,
>> Biswadip Dutta
>>
>> On Sat, Apr 14, 2018 at 6:12 AM, Tcpip <juraj...@gmail.com> wrote:
>>
>>> Hi all
>>>
>>> I have the following playbook
>>>
>>> !
>>> ---
>>>
>>>
>>>
>>> - hosts: lab
>>>   gather_facts: true
>>>   connection: local
>>>   vars:
>>> creds:
>>>   host: "{{ ansible_host }}"
>>>   username: cisco
>>>   password: cisco
>>>
>>>   tasks:
>>> - name: ios_facts
>>>   ios_facts:
>>>  provider: "{{ creds }}"
>>>   register: iosfacts
>>>
>>> - name: interface description
>>>   ios_config:
>>> provider: "{{ creds }}"
>>> lines:
>>>   - description test interface
>>> parents: "interface {{ item.key }}"
>>>   with_dict: "{{ iosfacts.ansible_facts.ansible_net_interfaces }}"
>>>   when: item.value.bandwidth >= 100
>>>
>>> - name: new task
>>>   include: 2.yml
>>>   with_dict: "{{ iosfacts.ansible_facts.ansible_net_interfaces }}"
>>>   when: item.value.bandwidth <= 100
>>>
>>> !!
>>> And I get this error
>>>
>>> "reason": "no action detected in task. This often indicates a
>>> misspelled module name, or incorrect module path.\n\nThe error appears to
>>> have been in '/home/playbooks/varios/2.yml': line 2, column 3, but
>>> may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe
>>> offending line appears to be:\n\n---\n- hosts: lab\n  ^ here\n\n\nThe
>>> error appears to have been in '/home/playbooks/varios/2.yml': line 2,
>>> column 3, but may\nbe elsewhere in the file depending on the exact syntax
>>> problem.\n\nThe offending line appears to be:\n\n---\n- hosts: lab\n  ^
>>> here\n"
>>>
>>> If I execute the playbook 2.yml in stand alone it works, if I add it to
>>> my other playbook i get errors.
>>>
>>> Any ideas???
>>>
>>> --
>>> 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/ms
>>> gid/ansible-project/a6e77380-cf49-472d-932a-228b2def9fe6%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/a6e77380-cf49-472d-932a-228b2def9fe6%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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/90ae3f16-7a07-4a89-9279-5af66071d019%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/90ae3f16-7a07-4a89-9279-5af66071d019%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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/CAEC%3DuXkfRtzHdtnBy%2B1F%3DLgAY5cP2KGyyx%2BoK4ZWTUpzZUnrWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] include not working

2018-04-16 Thread Biswadip Dutta
Hi,
I believe you should use import_playbook to add a playbook in another
playbook. See here
<https://docs.ansible.com/ansible/2.4/playbooks_reuse_includes.html>.

Regards,
Biswadip Dutta

On Sat, Apr 14, 2018 at 6:12 AM, Tcpip <juraj.pa...@gmail.com> wrote:

> Hi all
>
> I have the following playbook
> !
> ---
>
>
>
> - hosts: lab
>   gather_facts: true
>   connection: local
>   vars:
> creds:
>   host: "{{ ansible_host }}"
>   username: cisco
>   password: cisco
>
>   tasks:
> - name: ios_facts
>   ios_facts:
>  provider: "{{ creds }}"
>   register: iosfacts
>
> - name: interface description
>   ios_config:
> provider: "{{ creds }}"
> lines:
>   - description test interface
> parents: "interface {{ item.key }}"
>   with_dict: "{{ iosfacts.ansible_facts.ansible_net_interfaces }}"
>   when: item.value.bandwidth >= 100
>
> - name: new task
>   include: 2.yml
>   with_dict: "{{ iosfacts.ansible_facts.ansible_net_interfaces }}"
>   when: item.value.bandwidth <= 100
>
> !!
> And I get this error
>
> "reason": "no action detected in task. This often indicates a
> misspelled module name, or incorrect module path.\n\nThe error appears to
> have been in '/home/playbooks/varios/2.yml': line 2, column 3, but
> may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe
> offending line appears to be:\n\n---\n- hosts: lab\n  ^ here\n\n\nThe
> error appears to have been in '/home/playbooks/varios/2.yml': line 2,
> column 3, but may\nbe elsewhere in the file depending on the exact syntax
> problem.\n\nThe offending line appears to be:\n\n---\n- hosts: lab\n  ^
> here\n"
>
> If I execute the playbook 2.yml in stand alone it works, if I add it to my
> other playbook i get errors.
>
> Any ideas???
>
> --
> 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/a6e77380-cf49-472d-932a-228b2def9fe6%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/a6e77380-cf49-472d-932a-228b2def9fe6%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuXnjcqy9ZzDBXYE%3DOqTyourKa4RmVW3QVpNgt2EEieR-LA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] install Ansible on Mac 2.5.0

2018-04-16 Thread Biswadip Dutta
Hi,

You have Ansible installed properly I believe. Your issue is caused by
having group name with spaces in the inventory. See This
<https://github.com/ansible/ansible/issues/13917>.

Regards,
Biswadip Dutta

On Mon, Apr 16, 2018 at 11:03 AM, Jose Julian Orjuela Lopera <
josejulianorju...@gmail.com> wrote:

> Hello guys,
>
>
> I need you help, I try the install Ansible on my Mac, but not is possible,
> I have this is error:
>
> Please,  Can someone tell me, how can I install Ansible correctly on my
> MAC?
>
> macOS Hig Sierra version 10.13.4,
>
> thanks
>
> [DEPRECATION WARNING]: ANSIBLE_HOSTS option, The variable is misleading as
> it can be a list of hosts and/or paths to inventory sources , use
> ANSIBLE_INVENTORY instead.
>
>  This feature will be removed in version 2.8. Deprecation warnings can be
> disabled by setting deprecation_warnings=False in ansible.cfg.
>
>  [WARNING]:  * Failed to parse /etc/ansible/hosts with yaml plugin: YAML
> inventory has invalid structure, it should be a dictionary, got: 
> 'ansible.parsing.yaml.objects.AnsibleSequence'>
>
>
>  [WARNING]:  * Failed to parse /etc/ansible/hosts with ini plugin: need
> more than 2 values to unpack
>
>
>  [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source
>
>
>  [WARNING]: No inventory was parsed, only implicit localhost is available
>
>
>  [WARNING]: provided hosts list is empty, only localhost is available.
> Note that the implicit localhost does not match 'all'
>
>
>  [WARNING]: Could not match supplied host pattern, ignoring: server1
>
>
>
> --
> 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/9869c597-950e-41e5-9e7e-21c03164911e%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/9869c597-950e-41e5-9e7e-21c03164911e%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuXmCOiyVffjuX0XCu3gkjtiw1VCwwEMnDJjw_P%3DFsDYsfw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to sort ansible output

2018-04-13 Thread Biswadip Dutta
Oh okay. I think I misunderstood your query.  What I was suggesting is that
you can write another script to sort the output based on your needs.
I don't think Ansible has such functionality. If there's one then I will
also like to know.

Regards,
Biswadip Dutta

On Fri, Apr 13, 2018 at 12:30 PM, The Wanderer <manfrommars...@gmail.com>
wrote:

> I know, but how?
>
> On Fri, Apr 13, 2018 at 11:49 AM, Biswadip Dutta <
> biswadipdutta...@gmail.com> wrote:
>
>> I'd suggest you do the sorting part later. I mean after you get the
>> Ansible results and then sort it.
>>
>> Regards,
>> Biswadip Dutta
>>
>> On Fri, Apr 13, 2018 at 1:12 AM, The Wanderer <manfrommars...@gmail.com>
>> wrote:
>>
>>> Hi all,
>>>
>>> I have a couple of servers that are managed via ansible. On all of them,
>>> I have got a script - free.sh - that when run, outputs just the free
>>> memory, like - 5GB. This is not the free system RAM, but a value that's
>>> obtained by complex calculations done via the script. I can call the script
>>> via ansible in this manner:
>>>
>>> ansible -bK -a "/usr/bin/free.sh" apache-servers
>>>
>>> (where apache-servers is the host-group on which I want to run the
>>> script)
>>>
>>> And here's the limitation that I'm facing - Ansible just returns results
>>> in the order the job completes. But, I want the result to be sorted
>>> according to the script's output. Is this possible?
>>>
>>> --
>>> 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/ms
>>> gid/ansible-project/2090253c-01a4-4db7-abe4-6275615ad826%40g
>>> ooglegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/2090253c-01a4-4db7-abe4-6275615ad826%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> 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/to
>> pic/ansible-project/i5uql5fjrAg/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/ms
>> gid/ansible-project/CAEC%3DuX%3Djp8ZidB7MWOaqf3%2BJ7cGTJ5Lna
>> OZh9iiisKA26mJ-Yw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAEC%3DuX%3Djp8ZidB7MWOaqf3%2BJ7cGTJ5LnaOZh9iiisKA26mJ-Yw%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> 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/CAM9iBPeQA3x9GBVRPWZb8zxH2mGf-
> dZyYh_eixwn9xCSm3zmFQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAM9iBPeQA3x9GBVRPWZb8zxH2mGf-dZyYh_eixwn9xCSm3zmFQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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/CAEC%3DuXmm%3Dk29Rqvc_6Mec%3DDXzO0f%2BL-SzM24Ax5ZePF5nZxQCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Trying to create a new user and password for server login . SSH permission denied error.

2018-04-13 Thread Biswadip Dutta
This
<https://stackoverflow.com/questions/19292899/creating-a-new-user-and-password-with-ansible>
might
be helpful for you

Regards,
Biswadip Dutta

On Fri, Apr 13, 2018 at 2:38 AM, POOJA VENKATESH <
poojavenkateshre...@gmail.com> wrote:

> Hi,
>
>
> I am trying to create a new user and password for the server login. The
> user is created in /etc/passwd and also I can see the password entry in
> /etc/shadow however when I try to ssh through the new user I cannot login
> into the server. What steps are missing in the following code?
>
>
>
> ---
> - hosts: local host
>   vars:
> username: random
>   vars_prompt:
> - name: "user_passwd"
>   prompt: "Enter a password for the user"
>   private: yes
>   tasks:
> - name: Add a new user
>   become: yes
>   user:
> name: '{{ username }}'
> shell: /bin/bash
> group: sudo
> state: present
> createhome: 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/CAAGG3SAALojkjpgNW%3DcEUt7_wi%
> 2Bdd40CGc_-3LiYJTtYUKaTPA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAAGG3SAALojkjpgNW%3DcEUt7_wi%2Bdd40CGc_-3LiYJTtYUKaTPA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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/CAEC%3DuXku1arnNc-R9L37yxrcwk-s7LbNG1OwR1pGMbDDc_4WwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to sort ansible output

2018-04-13 Thread Biswadip Dutta
I'd suggest you do the sorting part later. I mean after you get the Ansible
results and then sort it.

Regards,
Biswadip Dutta

On Fri, Apr 13, 2018 at 1:12 AM, The Wanderer <manfrommars...@gmail.com>
wrote:

> Hi all,
>
> I have a couple of servers that are managed via ansible. On all of them, I
> have got a script - free.sh - that when run, outputs just the free memory,
> like - 5GB. This is not the free system RAM, but a value that's obtained by
> complex calculations done via the script. I can call the script via ansible
> in this manner:
>
> ansible -bK -a "/usr/bin/free.sh" apache-servers
>
> (where apache-servers is the host-group on which I want to run the script)
>
> And here's the limitation that I'm facing - Ansible just returns results
> in the order the job completes. But, I want the result to be sorted
> according to the script's output. Is this possible?
>
> --
> 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/2090253c-01a4-4db7-abe4-6275615ad826%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/2090253c-01a4-4db7-abe4-6275615ad826%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuX%3Djp8ZidB7MWOaqf3%2BJ7cGTJ5LnaOZh9iiisKA26mJ-Yw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: unable to fit the piece of code in ansible

2018-04-13 Thread Biswadip Dutta
Can you please let me know which Ansible version you are using and what
error you are getting?

Regards,
Biswadip Dutta

On Thu, Apr 12, 2018 at 7:16 PM, Bishwajit Samanta <
bishwajitsamanta1...@gmail.com> wrote:

> Thanks Karl, for your reply. Problem statement ::-
>
> My job is to find out the hostname which belongs to hostclass ess, which
> in this case the answer is host002.
>
> hostinfo:
>   'host001':
> ip: 192.168.43.10
> hostclass: 'puppet'
>   'host002':
> ip: 192.168.43.11
> hostclass: 'ess'
>   'host003':
> ip: 192.168.43.21
> hostclass: 'mdb'
>
>
> i got one solution from some friend in google ansible groups only, but i
> am unable to fit it my ansible playbook.
>
>
> - debug:
> msg: "{{ hostinfo|dictsort|selectattr('1.hostclass', 'equalto', 
> 'ess')|first|first }}"
>
>
> The playbook i am writing, which is wrong but i am not able to figure out
> how to fit the code in my playbook. Can anyone help me in modifying the
> code of mine.
>
> ---
>
> - hosts: somehost
>   gather_facts: no
>   vars_files:
> file: sometext.yaml
> name: sometext
>
>   - debug:
> msg: "{{ hostinfo|dictsort|selectattr('1.hostclass', 'equalto', 
> 'ess')|first|first }}
>
>
> On Thursday, April 12, 2018 at 5:52:14 PM UTC+5:30, Karl Auer wrote:
>>
>> Can I suggest that you describe what you want to achieve. That is,
>> describe the end result that you are seeking.
>>
>> That is more likely to get a useful response.
>>
>> Regards, K.
>>
>>
>> On Thu, Apr 12, 2018 at 9:58 PM, Bishwajit Samanta <
>> bishwajits...@gmail.com> wrote:
>>
>>> Any one can suggest any idea please..
>>>
>>> On Thursday, April 12, 2018 at 8:21:32 AM UTC+5:30, Bishwajit Samanta
>>> wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I am a beginner in ansible. If anyone can help me in finding the
>>>> answer. It would be great. My problem was finding a phrase in ansible which
>>>> one of the person have helped me. But unfortunately i am not able to fit
>>>> the piece of code in my playbook.
>>>>
>>>> hostinfo:
>>>>   host001':
>>>> ip: 192.168.43.10
>>>> hostclass: 'puppet'
>>>>   'host002':
>>>> ip: 192.168.43.11
>>>> hostclass: 'ess'
>>>>   'host003':
>>>> ip: 192.168.43.21
>>>> hostclass: 'mdb'
>>>>
>>>> the code was::
>>>>
>>>> - debug:
>>>>   msg: "{{ hostinfo|dictsort|selectattr('1.hostclass', 'equalto',
>>>> 'ess')|first|first }}"
>>>>
>>>> Now i am writing the code as given below. I know in this piece of code
>>>> i am making mistakes. But since i am a beginner i am not able to understand
>>>> it. Can anyone help me?
>>>>
>>>> ---
>>>> - hosts: test
>>>>   gather_facts: no
>>>>
>>>> - debug:
>>>>   msg: "{{ hostinfo|dictsort|selectattr('1.hostclass', 'equalto',
>>>> 'ess')|first|first }}"
>>>>
>>>> --
>>> 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/ms
>>> gid/ansible-project/4431f374-65b9-4884-9acb-f709bdd658f3%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/4431f374-65b9-4884-9acb-f709bdd658f3%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Karl Auer
>>
>> Email  : ka...@2pisoftware.com
>> Website: http://2pisoftware.com
>>
>> GPG/PGP : 958A 2647 6C44 D376 3D63 86A5 FFB2 20BC 0257 5816
>> Previous: F0AB 6C70 A49D 1927 6E05 81E7 AD95 268F 2AB6 40EA
>>
> --
> 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/bacee1a5-37a0-423a-9dcf-a8625c361493%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/bacee1a5-37a0-423a-9dcf-a8625c361493%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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/CAEC%3DuX%3DgAuY8WkqJFnfoivSU8hu2-0At2WXE%3DWp5j2p%3DzZmAeQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Intermittent failures when using easy_install

2018-04-06 Thread Biswadip Dutta
I am a newbie so don't expect this to be the correct answer.  Be sure to
correct me if I am wrong.
I'll suggest using apt or yum module to install pip and then pip module to
install virtualenv and check if the problem persists. If these also fail
then we can always use the shell module to directly run ad-hoc commands.
This
<https://stackoverflow.com/questions/26402123/ansible-creating-a-virtualenv>
might
be helpful.


Regards,
Biswadip Dutta

On Fri, Apr 6, 2018 at 2:04 PM, SurferL <lawrence.cha...@gmail.com> wrote:

> Running Ansible 2.4.1.
>
> So sometimes running my task works, and other times it doesn't and I don't
> understand why this is happening...
>
> The task is:
>
> - name: mac | Install global python dependencies
>   easy_install:
> name: "{{ item }}"
> state: latest
>   become: true
>   with_items:
> - pip
> - virtualenv
>
> and it occasionally fails with:
>
> vmware-vmx: TASK [common : mac | Install global python dependencies]
> ***
> vmware-vmx: failed: [default] (item=pip) => {"changed": false, "failed":
> true, "item": "pip", "msg": "Couldn't find index page for 'pip' (maybe
> misspelled?)\nNo local packages or download links found for pip\nerror:
> Could not find suitable distribution for Requirement.parse('pip')\n"}
> vmware-vmx: failed: [default] (item=virtualenv) => {"changed": false,
> "failed": true, "item": "virtualenv", "msg": "Couldn't find index page for
> 'virtualenv' (maybe misspelled?)\nNo local packages or download links found
> for virtualenv\nerror: Could not find suitable distribution for
> Requirement.parse('virtualenv')\n"}
>
>
> But it sometimes passes?
>
> Can anyone shed any light on why this happens or what I can change to my
> task?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/8aeeef1d-909a-4cc9-aea7-c66ba2dfe187%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/8aeeef1d-909a-4cc9-aea7-c66ba2dfe187%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuXnisamBQekrDirHnmdWfZEs1jaZJ5H8B3H8GQiN-atqcw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Regarding site.yml

2018-04-06 Thread Biswadip Dutta
you may also need this
<https://www.jeffgeerling.com/blog/using-ansible-galaxy>

Regards,
Biswadip Dutta

On Fri, Apr 6, 2018 at 6:37 PM, Biswadip Dutta <biswadipdutta...@gmail.com>
wrote:

> https://galaxy.ansible.com/geerlingguy/mysql/
>
> Regards,
> Biswadip Dutta
>
> On Fri, Apr 6, 2018 at 5:56 PM, Nirmalya Paul <nirmaly...@gmail.com>
> wrote:
>
>> I am trying to install mysql in CentOs through Ansible. can anybody
>> please tell me what is the procedure to install it ?
>>
>> On Fri, Apr 6, 2018 at 5:13 PM, Dick Visser <dick.vis...@geant.org>
>> wrote:
>>
>>> On 6 April 2018 at 11:36, Nirmalya Paul <nirmaly...@gmail.com> wrote:
>>> > u just tell me to run site.yml what files i required and what exact
>>> code i
>>> > need to paste under site.yml
>>>
>>>
>>> Who is "u"? Or, who told you to "run site.yml"?
>>> And what did you actually run (as in: what commands did you type in)?
>>>
>>> Dick
>>>
>>>
>>> >
>>> > On Friday, 6 April 2018 13:27:48 UTC+5:30, Nirmalya Paul wrote:
>>> >>
>>> >> hello all I am not able to run -s site.yml..
>>> >>
>>> >> error showing that -s site.yml could not found. can you please tell
>>> me why
>>> >> its showing and how i can solve the issue ?
>>> >
>>> > --
>>> > 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/2f2906be-6
>>> 5bf-405f-ad73-40d4925682b7%40googlegroups.com.
>>> >
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> --
>>> Dick Visser
>>> Trust & Identity Service Operations Manager
>>> GÉANT
>>>
>>> GÉANT Vereniging (Association) is registered with the Chamber of
>>> Commerce in Amsterdam with registration number 40535155 and operates
>>> in the UK as a branch of GÉANT Vereniging. Registered office:
>>> Hoekenrode 3, 1102BR Amsterdam, The Netherlands
>>> <https://maps.google.com/?q=Hoekenrode+3,+1102BR+Amsterdam,+The+Netherlands=gmail=g>.
>>> UK branch address:
>>> City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
>>> <https://maps.google.com/?q=126-130+Hills+Road,+Cambridge+CB2+1PQ,+UK=gmail=g>
>>> .
>>>
>>>
>>> Want to join us? We're hiring: https://www.geant.org/jobs
>>>
>>> --
>>> 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/ms
>>> gid/ansible-project/CAL8fbwOkQufCoRXjzBqmunV1KKkU7gx0KqVn1TT
>>> 2vYz5zX9LJQ%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/ms
>> gid/ansible-project/CAJciC%3Du7WjMXB9GS%3DYnuF2v9L8xNH908K7-
>> Nh9vz0xTyCBk1xQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAJciC%3Du7WjMXB9GS%3DYnuF2v9L8xNH908K7-Nh9vz0xTyCBk1xQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> 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/CAEC%3DuXnYmXRwGn7dC_W75u6Ayd2JdrZfVhUFgnOx_3P0T8%3Dfig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Regarding site.yml

2018-04-06 Thread Biswadip Dutta
https://galaxy.ansible.com/geerlingguy/mysql/

Regards,
Biswadip Dutta

On Fri, Apr 6, 2018 at 5:56 PM, Nirmalya Paul <nirmaly...@gmail.com> wrote:

> I am trying to install mysql in CentOs through Ansible. can anybody please
> tell me what is the procedure to install it ?
>
> On Fri, Apr 6, 2018 at 5:13 PM, Dick Visser <dick.vis...@geant.org> wrote:
>
>> On 6 April 2018 at 11:36, Nirmalya Paul <nirmaly...@gmail.com> wrote:
>> > u just tell me to run site.yml what files i required and what exact
>> code i
>> > need to paste under site.yml
>>
>>
>> Who is "u"? Or, who told you to "run site.yml"?
>> And what did you actually run (as in: what commands did you type in)?
>>
>> Dick
>>
>>
>> >
>> > On Friday, 6 April 2018 13:27:48 UTC+5:30, Nirmalya Paul wrote:
>> >>
>> >> hello all I am not able to run -s site.yml..
>> >>
>> >> error showing that -s site.yml could not found. can you please tell me
>> why
>> >> its showing and how i can solve the issue ?
>> >
>> > --
>> > 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/2f2906be-
>> 65bf-405f-ad73-40d4925682b7%40googlegroups.com.
>> >
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> Dick Visser
>> Trust & Identity Service Operations Manager
>> GÉANT
>>
>> GÉANT Vereniging (Association) is registered with the Chamber of
>> Commerce in Amsterdam with registration number 40535155 and operates
>> in the UK as a branch of GÉANT Vereniging. Registered office:
>> Hoekenrode 3, 1102BR Amsterdam, The Netherlands
>> <https://maps.google.com/?q=Hoekenrode+3,+1102BR+Amsterdam,+The+Netherlands=gmail=g>.
>> UK branch address:
>> City House, 126-130 Hills Road, Cambridge CB2 1PQ, UK
>> <https://maps.google.com/?q=126-130+Hills+Road,+Cambridge+CB2+1PQ,+UK=gmail=g>
>> .
>>
>>
>> Want to join us? We're hiring: https://www.geant.org/jobs
>>
>> --
>> 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/ms
>> gid/ansible-project/CAL8fbwOkQufCoRXjzBqmunV1KKkU7gx0KqVn1TT
>> 2vYz5zX9LJQ%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/CAJciC%3Du7WjMXB9GS%3DYnuF2v9L8xNH908K7-
> Nh9vz0xTyCBk1xQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAJciC%3Du7WjMXB9GS%3DYnuF2v9L8xNH908K7-Nh9vz0xTyCBk1xQ%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> 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/CAEC%3DuXktsN9-AnqEXDq3%3DJX%2BNnNJBV%2B8cKo_Bc4HynsOuz7avA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Regarding site.yml

2018-04-06 Thread Biswadip Dutta
How are you trying to run it? That's not the way it's supposed to "run".
Read the docs please.

Regards,
Biswadip Dutta

On Fri, Apr 6, 2018 at 1:27 PM, Nirmalya Paul <nirmaly...@gmail.com> wrote:

> hello all I am not able to run -s site.yml..
>
> error showing that -s site.yml could not found. can you please tell me why
> its showing and how i can solve the issue ?
>
> --
> 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/000687ea-7aa9-4274-a5ba-44dab4879c65%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/000687ea-7aa9-4274-a5ba-44dab4879c65%40googlegroups.com?utm_medium=email_source=footer>
> .
> 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/CAEC%3DuXnQ85bSxrtMbeNP0pcbtfV5UR7i_SOMi5zfwKm6FZvqxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: ansible.parsing.yaml.objects.AnsibleUnicode error

2018-04-04 Thread Biswadip Dutta
>From the information provided, I believe you are trying to reference 
dynamically named variables. You might find this Github issue (#19356 
) useful.

On Tuesday, April 3, 2018 at 4:00:39 PM UTC+5:30, Rıdvan KARATAŞ wrote:
>
> Hi
>
> I'm using ansible 2.5.0 
>
> When I'm trying to deploy a service it gives me this error: 
>
>
> ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'ipv4
> '
>
> I couldn't find much more relevant according to this
>
> any suggestions ?
>

-- 
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/d6558b80-bb13-45e0-bb34-56124ced1ab3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Installing Jenkins plugins with their dependencies

2018-04-04 Thread Biswadip Dutta

>
> state: latest
>

Please remove this and try. Apparently this is an open issue on Github. 
#24864 
 
On Tuesday, April 3, 2018 at 5:43:45 PM UTC+5:30, JiElPe-Fr38 wrote:
>
> Dear all,
>
> I have created a jenkins role that creates a jenkins instance and add 
> plugins.
> The task related to plugins is as follows :
>
> - name: Install plugins
>   jenkins_plugin:
> group: "{{ jenkins_process_group }}"
> owner: "{{ jenkins_process_user }}"
> name: "{{ item }}"
> state: latest
> url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ 
> jenkins_url_prefix }}"
> url_username: "{{ jenkins_admin_name }}"
> url_password: "{{ jenkins_admin_password }}"
> with_dependencies: yes
>
>   with_items: "{{ jenkins_plugins }}"
>   notify: restart jenkins
>   become: True
>   become_user: "{{ jenkins_process_user }}"
>
>
> All variables being known from files in vars or defaults.
>
> Plugins listed in the {{ jenkins_plugins }} list are those I actually 
> want. No dependency is listed here as I was hoping that the 
> with_dependencies: yes clause will install them. 
>
> *It is absolutely not the case !*The listed plugins are installed (so 
> there is no access rights or credentials problem), but the dependencies are 
> not.
> When going to the WEB UI, I have a context page that suggests me to 
> install dependencies.
>
>
> I can't find a way to get rid off that... If someone could help ?
>
> Best Regards
> J-L
>

-- 
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/63c5b3c2-6668-4aab-96ee-4eace386164f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Installing Jenkins plugins with their dependencies

2018-04-04 Thread Biswadip Dutta

>
> state: latest
>

Please remove this and try. 

On Tuesday, April 3, 2018 at 5:43:45 PM UTC+5:30, JiElPe-Fr38 wrote:
>
> Dear all,
>
> I have created a jenkins role that creates a jenkins instance and add 
> plugins.
> The task related to plugins is as follows :
>
> - name: Install plugins
>   jenkins_plugin:
> group: "{{ jenkins_process_group }}"
> owner: "{{ jenkins_process_user }}"
> name: "{{ item }}"
> state: latest
> url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ 
> jenkins_url_prefix }}"
> url_username: "{{ jenkins_admin_name }}"
> url_password: "{{ jenkins_admin_password }}"
> with_dependencies: yes
>
>   with_items: "{{ jenkins_plugins }}"
>   notify: restart jenkins
>   become: True
>   become_user: "{{ jenkins_process_user }}"
>
>
> All variables being known from files in vars or defaults.
>
> Plugins listed in the {{ jenkins_plugins }} list are those I actually 
> want. No dependency is listed here as I was hoping that the 
> with_dependencies: yes clause will install them. 
>
> *It is absolutely not the case !*The listed plugins are installed (so 
> there is no access rights or credentials problem), but the dependencies are 
> not.
> When going to the WEB UI, I have a context page that suggests me to 
> install dependencies.
>
>
> I can't find a way to get rid off that... If someone could help ?
>
> Best Regards
> J-L
>

-- 
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/9cd2ff4f-7f06-4393-819e-9a310d74ee52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.