Re: [ansible-project] How to verify col C is always double of Col D in ansible.

2020-07-23 Thread Jenisha T
Its the output of 
lsvg -l rootvg

used in AIX server

On Tuesday, 21 July 2020 at 19:58:19 UTC+5:30 brae...@gmail.com wrote:

> On 7/21/20 4:20 PM, T. JENISHA wrote:
> > 
> > Hi Team
> > 
> > My register variable output
> > 
> > verify_pp.png
> > 
> > 
> > Need to verify in all rows (unknown how many rows)col *LPs *are double 
> col *PPs* and col *PVS* are always 2 and col*LV
> > STATE *IS SYNCD
> > How to do it in ansible. 
>
> And the task which produces this output is?
>
> Regards
> Racke
> > 
> > 
> > Best Regards
> > Jenisha T
> > Whatsapp: +91 07598087866 <+91%2075980%2087866>
> > 
> > 
> > 
> > 
> > 
> > On Tue, 21 Jul 2020 at 19:45, Stefan Hornburg (Racke)  <mailto:ra...@linuxia.de>> wrote:
> > 
> > On 7/21/20 4:11 PM, Jenisha T wrote:
> > > Hi Team
> > >
> > > The output shown in image  is stored in the register variable. How to 
> verify the value in col C is double the value in
> > > col D and Col E value is always 2 and verify Col F is syncd
> > >
> > > https://imgur.com/rZXeHUg;>https://i.imgur.com/rZXeHUg.png; title="source: imgur.com
> > <http://imgur.com>" />
> > >
> > 
> > Please put your request in plain text.
> > 
> > Regards
> >Racke
> > 
> > > --
> > > 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  ansible-project%2bunsu...@googlegroups.com>
> > <mailto:ansible-proje...@googlegroups.com  ansible-project%2bunsu...@googlegroups.com>>.
> > > To view this discussion on the web visit
> > > 
> https://groups.google.com/d/msgid/ansible-project/43fc3a21-7900-4dca-88dd-fc284de15f7bn%40googlegroups.com
> > >
> > <
> https://groups.google.com/d/msgid/ansible-project/43fc3a21-7900-4dca-88dd-fc284de15f7bn%40googlegroups.com?utm_medium=email_source=footer
> >.
> > 
> > 
> > -- 
> > Ecommerce and Linux consulting + Perl and web application programming.
> > Debian and Sympa administration. Provisioning with Ansible.
> > 
> > -- 
> > 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/cc0NrudssXs/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to 
> ansible-proje...@googlegroups.com
> > <mailto:ansible-project%2bunsu...@googlegroups.com>.
> > To view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/ansible-project/c7bdded8-1855-e043-4f3a-145bfe0d1342%40linuxia.de
> .
> > 
> > -- 
> > 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  ansible-proje...@googlegroups.com>.
> > To view this discussion on the web visit
> > 
> https://groups.google.com/d/msgid/ansible-project/CAAGhZYiabz2G8snDZgshXkFLyNoVvR1_W%3DWWP9HoV-ZYFmgY5Q%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/ansible-project/CAAGhZYiabz2G8snDZgshXkFLyNoVvR1_W%3DWWP9HoV-ZYFmgY5Q%40mail.gmail.com?utm_medium=email_source=footer
> >.
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/044977be-0490-4878-8570-3169afefb326n%40googlegroups.com.


[ansible-project] How to verify col C is always double of Col D in ansible.

2020-07-21 Thread Jenisha T
Hi Team

The output shown in image  is stored in the register variable. How to 
verify the value in col C is double the value in col D and Col E value is 
always 2 and verify Col F is syncd

https://imgur.com/rZXeHUg;>https://i.imgur.com/rZXeHUg.png; title="source: imgur.com" />

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/43fc3a21-7900-4dca-88dd-fc284de15f7bn%40googlegroups.com.


[ansible-project] How to create function call in ansible

2020-07-21 Thread Jenisha T
Hi Team

I want to execute ls -l command twice.

1. ls -l # check if user in group
2. sudo adduser user_name new_group # If not in group add user to group 
3. ls -l # Check if user added to group

Is there a way I can write a shell module for $ ls -l once and call for 
step 1 and step 3  in ansible

Thankyou!

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55b0c249-8f63-41e6-bac3-4a9c3e90abfbn%40googlegroups.com.


[ansible-project] Ansible-lint error

2020-07-08 Thread Jenisha T
Hi Team

I get below error when I run ansible-lint. Any clue why it's throwing error

0.55s$ ansible-lint .
231Traceback (most recent call last):
232 File "/home/travis/virtualenv/python2.7.15/bin/ansible-lint", line 11, 
in 
233 sys.exit(main())
234 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/__main__.py",
 
line 187, in main
235 matches.extend(runner.run())
236 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/__init__.py",
 
line 287, in run
237 skip_list=self.skip_list))
238 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/__init__.py",
 
line 177, in run
239 matches.extend(rule.matchtasks(playbookfile, text))
240 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/__init__.py",
 
line 87, in matchtasks
241 yaml = ansiblelint.utils.append_skipped_rules(yaml, text, file['type'])
242 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/utils.py",
 
line 596, in append_skipped_rules
243 yaml_skip = _append_skipped_rules(pyyaml_data, file_text, file_type)
244 File 
"/home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansiblelint/utils.py",
 
line 635, in _append_skipped_rules
245 if pyyaml_task.get('name') != ruamel_task.get('name'):
246AttributeError: 'str' object has no attribute 'get'
247The command "ansible-lint ." exited with 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d9796b6f-f831-405e-b314-9d9a75aab0f0n%40googlegroups.com.


Re: [ansible-project] How to split value from list

2020-07-06 Thread Jenisha T
This logic works. Thankyou

On Tuesday, 7 July 2020 at 10:52:51 UTC+5:30 Karl Auer wrote:

> so what's wrong with:
>
> USR="jenisha"
> FOUND=`grep $USR /etc/passwd | cut -d: -f1`
> if [ -z "$FOUND" ] ; then
>echo "No such user: $USR"
> else
># do whatever...
> fi
>
> ?
>
> Regards, K.
>
>
> On Tue, Jul 7, 2020 at 3:11 PM T. JENISHA  wrote:
>
>> In my case cut doesn't work. I m searching for a particular user from a 
>> password.
>> $ grep anil /etc/passwd
>>
>>
>> Best Regards
>> Jenisha T
>> Whatsapp: +91 07598087866 <+91%2075980%2087866>
>>
>>
>>
>>
>>
>> On Mon, 6 Jul 2020 at 19:50, Stefan Hornburg (Racke)  
>> wrote:
>>
>>> On 7/6/20 3:32 PM, Srinivas Naram wrote:
>>> > Hello Jenisha,
>>> > 
>>> > Assuming that you are getting this value from /etc/passwd., try to 
>>> change you command
>>> > 
>>> >  tail -1 /etc/passwd | awk '{split($0,a,":"); print a[1]}'
>>> > 
>>>
>>> cut -d : -f 1 is more concise and readable than your awk command.
>>>
>>> Otherwise I would really like to know why Jenisha resorts to reading the 
>>> password file.
>>>
>>> Regards
>>>  racke
>>>
>>>
>>> > On Mon, Jul 6, 2020 at 6:35 PM Dick Visser >> <mailto:dick@geant.org>> wrote:
>>> > 
>>> > you should either use set_fact, or register. Both doesn't make 
>>> sense.
>>> > 
>>> > On Mon, 6 Jul 2020 at 13:44, Jenisha T >> joy...@gmail.com>> wrote:
>>> > >
>>> > > Hi
>>> > > Could you pls help me with the splitting value from the list. I 
>>> need to extract first value anil before ('':')
>>> > >
>>> > >  grep_atm.stdout_lines output below
>>> > >
>>> > > ok: [localhost] => {
>>> > > "msg": "anil:x:500:500:Anil:/home/anil:/bin/bash
>>> > > "
>>> > > }
>>> > >
>>> > > I tried,
>>> > > - set_fact:
>>> > >user_name: "{{ grep_atm.stdout_lines }}"
>>> > > register: user_name.split(':')[0]
>>> > >  - debug:
>>> > > var: user_name.split(':')[0]
>>> > >
>>> > > --
>>> > > 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 >> ansible-project%2bunsu...@googlegroups.com>.
>>> > > To view this discussion on the web visit
>>> > 
>>> https://groups.google.com/d/msgid/ansible-project/42fb2917-8336-42a2-979a-44573e91fd77n%40googlegroups.com
>>> .
>>> > 
>>> > 
>>> > 
>>> > -- 
>>> > 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-proje...@googlegroups.com >> ansible-project%2bunsu...@googlegroups.com>.
>>> > To view this discussion on the web visit
>>> > 
>>> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMo1%3D9XhddQY_BDaREzKLRGS_xDvZbtu1o5UCj0R1h%3Duw%40mail.gmail.com
>>> .
>>> > 
>>> > -- 
>>> > 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 >> ansible-proje...@googlegroups.com>.
>>> > To view this discussion on the web visit
>>> > 
>>> https://groups.google.com/d/msgid/ansible-project/CAG-N3P7NNjnbv7fZ5Vx0vmmTTyd9KntKpY-yOm75csqJ50cBmA%40mail.gmail.com
>>> > <
>>> https://groups.google.com/d/msgid/ansible-project/CAG-N3P7NNjnbv7fZ5Vx0vm

[ansible-project] How to split value from list

2020-07-06 Thread Jenisha T
Hi 
Could you pls help me with the splitting value from the list. I need to 
extract first value* anil *before ('':')

* grep_atm.stdout_lines* output below

ok: [localhost] => {
"msg": "*anil*:x:500:500:Anil:/home/anil:/bin/bash
"
}

I tried,
- set_fact:  
   user_name: "{{ grep_atm.stdout_lines }}"
register: user_name.split(':')[0]  
 - debug:
var: user_name.split(':')[0]

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/42fb2917-8336-42a2-979a-44573e91fd77n%40googlegroups.com.


[ansible-project] Ansible not accepting When condition

2020-07-02 Thread Jenisha T
Hi everyone,
Below is my playbook

---
- name: using multiple conditions
  gather_facts: yes
  hosts: localhost
  connection: local
  tasks:
- package:
name: httpd
state: installed
when:
  - ansible_distribution == "RedHat"
  - ansible_memfree_mb > 1512

When I run this playbook I get below error

https://pastebin.com/embed_iframe/BVRZKc5K; 
style="border:none;width:100%">



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/47b62adb-87ae-451c-b077-3cfeff5be26en%40googlegroups.com.


Re: [ansible-project] Regular Expression in ANSIBLE

2020-07-02 Thread Jenisha T

It's present in a remote server where the playbook is executed. I m facing 
the problem with extraction. Text present in register.

On Thursday, 2 July 2020 at 12:41:37 UTC+5:30 sriniva...@gmail.com wrote:

> Hello - is this log file located in the server where Ansible is installed 
> or remote server ?
>
> On Thu, Jul 2, 2020 at 5:25 AM Jenisha T  wrote:
>
>> Hi
>> I have output from log file as below. I need to extract the string shown 
>> in bold. 
>>
>>  Communication Diagnostic Report
>>
>> ---
>>
>>
>> User Name : username
>>
>> Directory : /path/to/dir
>>
>> Platform Architecture : Linux
>>
>> Version : x.0.00.x
>>
>> Host Name : abcdef1234
>>
>> Logical Name : *abcdef1234*
>>
>> Listen to Network Interface : *ANY
>>
>>
>> processes status
>>
>> ==
>>
>> Listener : *Running as root * 
>>
>>
>> How to extract the value of Logical Name : *abcdef1234 *
>>
>> from the multiline 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-proje...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/59adf33c-d9c4-4d74-83fc-2e07d2d8e5adn%40googlegroups.com.


[ansible-project] Regular Expression in ANSIBLE

2020-07-01 Thread Jenisha T
Hi
I have output from log file as below. I need to extract the string shown in 
bold. 

 Communication Diagnostic Report

---


User Name : username

Directory : /path/to/dir

Platform Architecture : Linux

Version : x.0.00.x

Host Name : abcdef1234

Logical Name : *abcdef1234*

Listen to Network Interface : *ANY


processes status

==

Listener : *Running as root * 


How to extract the value of Logical Name : *abcdef1234 *

from the multiline 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cbdb83e6-d7b4-42ec-8d23-408736d0aeb2n%40googlegroups.com.


[ansible-project] How to extract information from string

2020-07-01 Thread Jenisha T
Hello All
I have a string like this in the register.

Agent Communication Diagnostic Report
---

 Agent User Name: username
 Agent Directory: /path/to/dir
 Agent Platform Architecture: Linux
 Agent Version  : x.0.00.x
 Agent Host Name: abcdef1234
 Logical Agent Name : abcdef1234
 Listen to Network Interface: *ANY

 Agent processes status
 ==
 Agent Listener : Running as root 

How to extract the value of Logical Agent Name : *abcdef1234 *
from the multiline string. Also want to extract the value of Agent 
Listener : *Running as root* 



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d73d86a5-ddcb-41d8-b455-cd350d0a8cb0n%40googlegroups.com.


[ansible-project] Re: unsupported parameter

2020-06-25 Thread Jenisha T
Thankyou it worked.

On Thursday, 25 June 2020 at 14:59:38 UTC+5:30 Jenisha T wrote:

> My Playbook:
> ---
> - name: test
>   gather_facts: yes
>   hosts: localhost
>   connection: local
>   tasks:
> - name: install httpd
>   yum:
> name: httpd
> state: present
> when:
>   - ansible_distribution == "RedHat"
>   - ansible_memfree_mb > 1512
>
>
> I get below error
> https://pastebin.com/embed_iframe/ZA6TXeE5; 
> style="border:none;width:100%">
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5fac10e5-0dbe-4977-8ed8-a0abf432c3cdn%40googlegroups.com.


[ansible-project] unsupported parameter

2020-06-25 Thread Jenisha T
My Playbook:
---
- name: test
  gather_facts: yes
  hosts: localhost
  connection: local
  tasks:
- name: install httpd
  yum:
name: httpd
state: present
when:
  - ansible_distribution == "RedHat"
  - ansible_memfree_mb > 1512


I get below error
https://pastebin.com/embed_iframe/ZA6TXeE5; 
style="border:none;width:100%">

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9755b1d6-e340-46f0-97f0-2e2d434ef853n%40googlegroups.com.


[ansible-project] Process Monitoring in Ansible

2020-05-21 Thread Jenisha T
Is there a way in Ansible to find if process complete. I m running an 
os-copy process. How to check if the process completed. The hard way is to 
wait  for 2hrs and read logs to find the word in the log is there a 
sentence 
"OS copy success". Is there any elegant way to do it in ansible check if 
the process completes go to the next task instead of waiting for 2 hrs and 
then checking logs. 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/be671f78-0692-460c-bb49-deb36da8b311%40googlegroups.com.


[ansible-project] How to check process running time

2020-05-20 Thread Jenisha T
I need to kill a process if its older than 1 hour.  I have process id how 
to check if its older than 1 hour

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6042ef03-2a2c-48ab-b338-55aac3c9bc46%40googlegroups.com.


[ansible-project] How to check if a word is present in list

2020-05-04 Thread Jenisha T
My output from script execution is 

agent: {
 "stdout_lines": [ The network is reachable. Connected using winrm, 
executin COMPLETED  at 4/5, The file is saved at D:\  ]
}


I want to extract 'COMPLETED' from this list.

In python logic: 

listToStr = ' '.join([str(elem) for elem in agent["stdout_lines"]])
iscomp='COMPLETED' in listToStr

How to covert this into ansible.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/18189cc9-a3fa-4b72-8fd7-2da14f12efdf%40googlegroups.com.


[ansible-project] The powershell shell family is incompatible with the sudo become plugin

2020-04-30 Thread Jenisha T
Hi 

I m configuring windows host on windows 10 virtual machine. My control node 
is Redhat OS 8 virtual machine. This is for the developer testing setup. I 
get below error when I do 
$ansible -vvv  winsvr -i /etc/ansible/hosts -m win_ping

"The powershell shell family is incompatible with the sudo become plugin". 
Why do I get this error. Any help to fix this issue is appreciated

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/11d4a928-365e-4b5f-9287-44c4ef4ba745%40googlegroups.com.