[ansible-project] update /etc/cron.allow on multiple nodes diff values

2017-01-24 Thread Kiran Kumar
hello all i need to update /etc/cron.allow on many servers below is eg x oracle y db x prod ... .. === it works for a single node - name: Add a word in remote file hosts: temp remote_user: xx sudo: yes tasks: - name: edit cron.allow lineinfile: destfile:

[ansible-project] Re: Complex Loops and Conditionals (a.k.a Dude, where's my include + with_items + when)

2017-04-14 Thread Kiran Kumar
Hi Christopher, Am trying to work on something where the listdisks module can perfectly fit, do you mind sharing the code for listdisks module? On Friday, January 17, 2014 at 1:33:18 PM UTC-8, Christopher O'Connell wrote: > > Hello List, > > I understand that a decision has been made to

[ansible-project] Ansible loop variable

2017-04-25 Thread Kiran Kumar
Hello friends, Am having a challenge finding a solution to below issue. I need to generate multiple network files based on single template and the value of template should change based on the item like IP/NM/GW . Example vars: docker1ip: 1.2.3.4 docker1nm: 255.255.255.1 docker1gw:

Re: [ansible-project] Ansible loop variable

2017-04-26 Thread Kiran Kumar
{{ netmask }} GATEWAY={{ gateway }} Can you help me with this one On Wednesday, April 26, 2017 at 12:15:13 AM UTC-7, Kai Stian Olstad wrote: > > On 26.04.2017 01:19, Kiran Kumar wrote: > > Am having a challenge finding a solution to below issue. > > I need to generate multiple n

[ansible-project] Is there any better way to find if a list of packes installed

2017-05-08 Thread Kiran Kumar
Hi Friends, Is there any better way to find if a list of packes is installed or not on a linux machine. It needs to return something may be a single variable to decide if all packages are installed or any one of them missed. Assuming i need to check if below packages are installed or not and

[ansible-project] Re: Is there any better way to find if a list of packes installed

2017-05-09 Thread Kiran Kumar
trying to enable by doing a package > check ? > > > On Tuesday, 9 May 2017 04:05:30 UTC+1, Kiran Kumar wrote: >> >> Hi Friends, >> >> Is there any better way to find if a list of packes is installed or not >> on a linux machine. It needs to return something may be

Re: [ansible-project] Re: Is there any better way to find if a list of packes installed

2017-05-18 Thread Kiran Kumar
uesday, May 9, 2017 at 3:28:00 PM UTC-7, Dick Davies wrote: > > You'd probably get what you want from an Ansible dummy run then, just > pass '--check' to ansible-playbook. > > On 9 May 2017 at 20:09, Kiran Kumar <kira...@gmail.com > > wrote: > > Hi Tai Kedzi

[ansible-project] ERROR! Unexpected Exception, this is probably a bug: 'module' object has no attribute 'packages'

2020-01-06 Thread Kiran Kumar
Hello ansible temp -a uptime -vvv ansible 2.9.1 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location

Re: [ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Kiran Kumar
otad|metric|nscd|crond|snpslmd| > getpwname.pl|mysqld|rsyslogd|xinetd|sendmail|lsf|tigervnc|tightvnc|cfadm" > |egrep -ve "ps|egrep" |awk "{print \$2}"' > register: oom > when: ansible_system == 'Linux' >- debug: var=oom.stdout >- name: update the p

Re: [ansible-project] when tools status "guestToolsNotRunning" , power off the vm.

2020-04-09 Thread Kiran Kumar
rs: > jmesquery: "[?instance.guest_tools_status == > 'guestToolsNotRunning'].instance.hw_name" > > - debug: > msg: "{{ desired_vms }}" > > > On Thu, Apr 9, 2020 at 1:56 PM Abhijeet Kasurde > wrote: > >> Hi Kiran, >> >> Do you want to r

Re: [ansible-project] when tools status "guestToolsNotRunning" , power off the vm.

2020-04-09 Thread Kiran Kumar
he VMs which are > "guestToolsNotRunning" status? > > > > On Thu, Apr 9, 2020 at 12:53 PM Kiran Kumar > wrote: > >> Please suggest how can i add when clause in above, ie when tools status >> "guestToolsNotRunning" , power off the vm. >> >> >>

[ansible-project] Jason_query on setup

2020-04-10 Thread Kiran Kumar
I am looking to find vm with 4 CPUs , Please suggest what i am doing wrong --- ## This playbook is for : - name: Play with Jason Query for learning it hosts: temp gather_facts: yes remote_user: root tasks: - name: Gather facts setup: register: vm_setup - name: Get

[ansible-project] Short output from playbook like ansible -o

2020-04-10 Thread Kiran Kumar
Please suggest how can get one liner o/p eg what i get with ansible temp -b -a uptime -o , in below playbook - hosts: all gather_facts: true tasks: - debug: var: ansible_all_ipv4_addresses -- You received this message because you are subscribed to the Google Groups "Ansible

[ansible-project] with_items to get values from a shell cmd output

2020-04-09 Thread Kiran Kumar
I got this error for below code - FAILED! => {"msg": "template error while templating string: expected token 'end of print statement', got '='. String: {{ var=oom.stdout }}"} Please suggest , i am trying to get pid from shell cmd & then update it with echo - hosts: temp > gather_facts:

[ansible-project] when tools status "guestToolsNotRunning" , power off the vm.

2020-04-09 Thread Kiran Kumar
Please suggest how can i add when clause in above, ie when tools status "guestToolsNotRunning" , power off the vm. - hosts: localhost gather_facts: false connection: local vars_files: - ./vars/vmware_vars.yml vars: vm_list: - vm1 tasks: - name: Gather VM info

[ansible-project] json_query & regular expression

2020-04-11 Thread Kiran Kumar
In jason query how can i add regular expression ? eg if have vm1, vm2,vm3 below query can be adjusted ? eg query: "[?guest_name == 'vm*' ]" , seems does not work in below case https://jmespath.org/specification.html#filterexpressions i tried few things but no luck Thanks --- > -

Re: [ansible-project] json_query & regular expression

2020-04-12 Thread Kiran Kumar
"'str object' has no attribute 'guest_name'"} On Saturday, April 11, 2020 at 10:02:06 PM UTC-7, Vladimir Botka wrote: > > On Sat, 11 Apr 2020 21:26:28 -0700 (PDT) > Kiran Kumar > wrote: > > > In jason query how can i add regular expression ? eg if have vm1, >

Re: [ansible-project] json_query & regular expression

2020-04-12 Thread Kiran Kumar
[], "uuid": "xx", "vm_network": { "xx": { "ipv4": [ "xx" ], "ipv6":

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Kiran Kumar
Use https://onlineyamltools.com/validate-yaml This will help you validate the syntax On Saturday, April 18, 2020 at 2:26:10 PM UTC-7, Tony Wong wrote: > > this is what i have. but still not working > > On Sat, Apr 18, 2020 at 1:55 PM David Foley > wrote: > >> Why Aren't you using your Local

Re: [ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-19 Thread Kiran Kumar
ven VM > vmware_guest_powerstate: > validate_certs: False > hostname: '{{ vcenter_hostname }}' > username: '{{ vcenter_username }}' > password: '{{ vcenter_password }}' > folder: /Asia-Datacenter1/vm/ > name: "{{ item }}" > state: 'reboot-guest' > with_items

Re: [ansible-project] json_query & regular expression

2020-04-12 Thread Kiran Kumar
>> loop: "{{ vm_facts.virtual_machines }}" >> when: >> - item.guest_name | regex_search('^vm') >> >> >> On Sun, Apr 12, 2020 at 5:26 PM Vladimir Botka > > wrote: >> >>> On Sun, 12 Apr 2020 00:26:39 -0700 (PDT) >>

[ansible-project] Check status of VMware tools & reboot if VMware tools are not running

2020-04-17 Thread Kiran Kumar
Hi I need to check status of VMware tools on vms & if VMware tools are not running, then reboot the vm. I have below playbook which works fine to find vm name & VMware tools status. Please help on how can i extract the vm name & take action as per status. Note : i have to use the VMware

[ansible-project] Running Ansible playbook with Jenkins plugin ... now need to add git

2020-05-02 Thread Kiran Kumar
Hi, I have a ansible server, which i use mainly to manage ntp client/dns client/time zone/create users/install software etc on various linux servers.. so no development to say, just as "infrastructure as code" On same server i installed Jenkins & on Jenkins i installed ansible plugin. Now i

Re: [ansible-project] Running Ansible playbook with Jenkins plugin ... now need to add git

2020-05-05 Thread Kiran Kumar
more >> response from a support forum on Jenkins. >> >> On Sun, 3 May 2020 at 04:59, Kiran Kumar wrote: >> >>> Hi, >>> >>> I have a ansible server, which i use mainly to manage ntp client/dns >>> client/time zone/create users/install software et

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Anyways i did below 1017 21/05/20 17:47:19 yum remove python-kerberos-1.1-15.el7.x86_64 1018 21/05/20 17:49:29 rpm -qa|grep -i kerb 1019 21/05/20 17:49:43 pip install pykerberos 1020 21/05/20 17:49:55 pip install requests-kerberos 1021 21/05/20 17:50:05 ansible windows -m win_ping

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Thanks for the reply You mean : yum remove -y krb5-devel krb5-libs krb5-workstation And re-run *pip install pykerberos* On Thursday, May 21, 2020 at 5:37:40 PM UTC-7, Jordan Borean wrote: > > The issue here is the kerberos library you have installed is either too > old or

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
I used a fresh box & finally did below & wored yum install -y python3-devel pip install pykerberos Thanks @Jordan On Thursday, May 21, 2020 at 5:37:40 PM UTC-7, Jordan Borean wrote: > > The issue here is the kerberos library you have installed is either too > old or incompatible with what

[ansible-project] Re: WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Shall i do below yum remove python-kerberos-1.1-15.el7.x86_64 = Package

[ansible-project] WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given)

2020-05-21 Thread Kiran Kumar
Hi, Goal : Use Linux centos 7.8 server with ansible version 2.9.7 to manage windows 2019 server Error : WINRM CONNECTION ERROR: function takes at most 2 arguments (3 given) ### Ansible Version : ansible 2.9.7 config file = /etc/ansible/ansible.cfg

Re: [ansible-project] CIS Bencjmarks - Rhel 7

2020-09-10 Thread Kiran Kumar
I would suggest - https://galaxy.ansible.com/MindPointGroup/RHEL7-CIS/ On Thu, Sep 10, 2020 at 1:26 AM Josephsimon Arokiaraj wrote: > Hi All, > > How you doing? > > Do we have any playbooks/roles for doing audit and remediation on CIS > benchmarks for Rhel 7? > > Cheers, > Joseph > > -- > You

[ansible-project] "kerberos: HTTPSConnectionPool(host='win-xx.ca.local', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificat

2020-06-02 Thread Kiran Kumar
Hello I am getting error below "msg": "kerberos: HTTPSConnectionPool(host='win-xx.ca.local', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)'),))", Details : ansible 2.9.9

[ansible-project] Re: "kerberos: HTTPSConnectionPool(host='win-xx.ca.local', port=5986): Max retries exceeded with url: /wsman (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certif

2020-06-02 Thread Kiran Kumar
Thanks ! that was it Nice catch ... On Tuesday, June 2, 2020 at 12:49:08 AM UTC-7, Jordan Borean wrote: > > The key you want to use is ‘ansible_winrm_server_cert_validation’, you > were missing the server part >

[ansible-project] backup playbook yml files - only if chaned

2020-07-29 Thread Kiran Kumar
Hi I do not want to use GIT for version control , so i am going to backup my playbooks .. only if this is changed copy the yml file with date ... I see copy module can do it - name: Copy a new "ntp.conf file into place, backing up the original if it differs from the copied version copy:

[ansible-project] ansible foreman callback plugin

2020-08-09 Thread Kiran Kumar
Hi I have setup the plugin for forman https://raw.githubusercontent.com/theforeman/foreman_ansible/master/extras/foreman_callback.py Also install below on ansible control node yum install -y python-pip pip install requests the plugin file is updated from __future__ import

[ansible-project] Re: backup playbook yml files - only if chaned

2020-07-29 Thread Kiran Kumar
quot;msg": "A vault password or secret must be specified to decrypt /etc/ansible/playbooks/windows/local-user-add.yml"} ... copy seems does not like valuted files ... ? On Wednesday, July 29, 2020 at 7:07:24 PM UTC-7, Kiran Kumar wrote: > > Hi > > I do not want to

Re: [ansible-project] help needed to install Ansible on MacOS BigSur

2021-05-02 Thread Kiran Kumar
What is error you get ? On Sun, May 2, 2021 at 08:59 Zeynal Hajili wrote: > Hello team, > > I am very new to Ansible and i am trying to install Ansible on my MacOS > BigSur. > > I followed official guide and tried to install it with following logs. > > MacBook-Pro:*~*$* python3 -m pip install

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
with_items: - "{{ foo }}" ### {"msg": "template error while templating string: expected token 'end of print statement', got 'r'. String: {{ r.ansible_facts.ansible_distribution r.ansible_facts.ansible_distribution_version }}"} ########

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
facts.ansible_distribution_version }}" > > On Wed, Feb 24, 2021 at 3:36 PM Kiran Kumar wrote: > >> >> Setup gives : >> >> "ansible_distribution": "Ubuntu", >> "ansible_distribution_file_parsed": true, >>

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Ok this one was easy .. just did below value: "{{ r.ansible_facts.ansible_distribution }}{{ r.ansible_facts.ansible_distribution_version }}" Thanks again Abhi & Stefan Hornburg (Racke) On Wed, Feb 24, 2021 at 10:11 AM Kiran Kumar wrote: > "{{ r.ansible_fact

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Thanks Abhijit, Awesome , it worked Only issue is value: "{{ r.ansible_facts.ansible_distribution }}" when: vm_info.instance.customvalues.OS != r.ansible_facts.ansible_distribution that Just give Ubuntu ... is it possible to extract the info from setup module ie below part..

Re: [ansible-project] Re: Automate Custome Attribute Population - Vmware

2021-02-24 Thread Kiran Kumar
Wow r.ansible_facts.ansible_lsb.description did worked !!! Thanks again Abhijit On Wed, Feb 24, 2021 at 12:17 AM Kiran Kumar wrote: > Thanks Abhijit, Awesome , it worked > > Only issue is > > value: "{{ r.ansible_facts.ansible_distribution }}" > when: vm_i

Re: [ansible-project] when ansible Conditionals

2021-02-21 Thread Kiran Kumar
This playbook check OS & then run diff cmd per OS & works fine But the Debug output is not compact .. it is verbose mode kind.. if the OS is not say CentOS it gives 4 to 5 lines stating the same .. the out is not compact .. somehow is it possible to ignore that .. so mat be debug is not the way