[ansible-devel] Need to execute complex unix commands
Hi All, I need to execute complex shell commands on remote or local hosts. What is the best way to this? I tried multiple ways. Either it is not passing Ansible syntax, or shell script syntax Example: Suppose I want to execute this command echo "ps -ef|grep data"|sed 's~[^[:alnum:]/]\+~~g'|sed "s/$/$(date +"%d_%m_%Y_%H_%M_%S")/" It gives following output on shell : psefgrepdata09_04_2018_12_08_55 But somehow I am not able to execute. Urgent help please ? Thanks, Akash -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-devel] [Urgent help] Running a task every x seconds till y seconds
Hi All, I there a way to run a task every x seconds, store the output. The task should run till y second. Example, I would like to run a task every 10 seconds , get the output , till 300 seconds. So the task would be run 30 times and all 30 outputs are avilable Thanks, Akash -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-devel] Custom module to get list of open linux ports and running services
Hi All, Is there a custom module/role already present to get list fo open ports and linux running services? If not, then I have to use command module. How do i parse the returned netstat output and conevert to a JSON document. Thanks, Akash -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-devel] Pause and Resume Ansible Playbooks without editing the YAML playbook
Hi All, Our team have been trying to develop some GUI for the ansible execution and I wanted to know if there is some way to pause and resume the execution of the playbook midway with just command line argument. I am familiar with the Pause option but that needs to be added in the YAML, we don't want that. I am also familiar with the --step argument passed on the CLI, that's close to what we want but not specifically. Thanks, Akash -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-devel] Re: [Urgent help] Ansible for fetching and comparing windows OS configuration, performance stats
Hi All, I want to store the data collected by Ansible from remote machines and then use the data for real time analysis, for Machine learning algorithms, etc. What data storage mechanism should I be using? Examples can be MongoDB , etc ? Thanks, Akash On 20 March 2018 at 10:17, Akash Agarwal <akashag...@gmail.com> wrote: > Thanks a lot. > > On 16 March 2018 at 15:09, 'jhawkesworth' via Ansible Development < > ansible-devel@googlegroups.com> wrote: > >> Hi, some suggestions below... >> >> On Friday, March 9, 2018 at 4:35:42 AM UTC, Akash Agarwal wrote: >>> >>> Hi All, >>> >>> Is there a way to use Ansible to fetch Windows OS specific configuration >>> using Ansible on demand ? >>> >> >> run or re-run the ansible `setup` module, which will gather lots of facts >> about your windows hosts. >> >> >>> Is there a way to fetch OS updates, Open Ports, Windows Running Services >>> list? >>> >> >> win_updates module for OS updates. >> >> You can use win_command or win_shell modules to run powershell to get a >> lot of this kind of information >> >> get active network connections like this >> ansible windows_hosts -m win_command -a 'netstat -ano' >> >> get running processes (visible to user you have connected as like this) >> >> ansible windows_hosts -m win_shell -a "Get-Process" >> >> >> get installed hotfixes like this: >> >> ansible windows_hosts -m win_shell -a "Get-Hotfix" >> >> Is there a way to monitor Windows Performance Counters for a duration of >>> time ? >>> >> >> Not tried, but you could probably make use of these powershell functions >> to export performance data to graphite https://github.com/Ma >> ttHodge/Graphite-PowerShell-Functions/tree/v1.1.0 - described here >> https://hodgkins.io/using-powershell-to-send-metrics-graphite >> >> I'd recommend having a look at what you can do using powershell, at lot >> of useful administrative information is available via powershell, and its >> relatively easy to get at it using powershell. >> >> If you need to process the raw results within ansible I'd recomend having >> a look at creating your own modules - once you have the powershell command >> to get the right information, its not much more work to turn it into an >> ansible module - you only really need to handle any module parameters and >> build up the information that it makes sense to return, and create a module >> documentation file. >> >> >> Hope this helps, >> >> Jon >> >> >>> Thanks, >>> Akash >>> >>> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Ansible Development" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/to >> pic/ansible-devel/9PWEHdxUjgM/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> ansible-devel+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Akash Agarwal > -- Akash Agarwal -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [ansible-devel] Re: [Urgent help] Ansible for fetching and comparing windows OS configuration, performance stats
Thanks a lot. On 16 March 2018 at 15:09, 'jhawkesworth' via Ansible Development < ansible-devel@googlegroups.com> wrote: > Hi, some suggestions below... > > On Friday, March 9, 2018 at 4:35:42 AM UTC, Akash Agarwal wrote: >> >> Hi All, >> >> Is there a way to use Ansible to fetch Windows OS specific configuration >> using Ansible on demand ? >> > > run or re-run the ansible `setup` module, which will gather lots of facts > about your windows hosts. > > >> Is there a way to fetch OS updates, Open Ports, Windows Running Services >> list? >> > > win_updates module for OS updates. > > You can use win_command or win_shell modules to run powershell to get a > lot of this kind of information > > get active network connections like this > ansible windows_hosts -m win_command -a 'netstat -ano' > > get running processes (visible to user you have connected as like this) > > ansible windows_hosts -m win_shell -a "Get-Process" > > > get installed hotfixes like this: > > ansible windows_hosts -m win_shell -a "Get-Hotfix" > > Is there a way to monitor Windows Performance Counters for a duration of >> time ? >> > > Not tried, but you could probably make use of these powershell functions > to export performance data to graphite https://github.com/ > MattHodge/Graphite-PowerShell-Functions/tree/v1.1.0 - described here > https://hodgkins.io/using-powershell-to-send-metrics-graphite > > I'd recommend having a look at what you can do using powershell, at lot of > useful administrative information is available via powershell, and its > relatively easy to get at it using powershell. > > If you need to process the raw results within ansible I'd recomend having > a look at creating your own modules - once you have the powershell command > to get the right information, its not much more work to turn it into an > ansible module - you only really need to handle any module parameters and > build up the information that it makes sense to return, and create a module > documentation file. > > > Hope this helps, > > Jon > > >> Thanks, >> Akash >> >> -- > You received this message because you are subscribed to a topic in the > Google Groups "Ansible Development" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/ansible-devel/9PWEHdxUjgM/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > ansible-devel+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Akash Agarwal -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-devel] Re: [Urgent help] Ansible for fetching and comparing windows OS configuration, performance stats
Any answers to this would help a lot On Friday, 9 March 2018 10:05:42 UTC+5:30, Akash Agarwal wrote: > > Hi All, > > Is there a way to use Ansible to fetch Windows OS specific configuration > using Ansible on demand ? > Is there a way to fetch OS updates, Open Ports, Windows Running Services > list? > Is there a way to monitor Windows Performance Counters for a duration of > time ? > > Thanks, > Akash > > -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[ansible-devel] [Urgent help] Ansible for fetching and comparing windows OS configuration, performance stats
Hi All, Is there a way to use Ansible to fetch Windows OS specific configuration using Ansible on demand ? Is there a way to fetch OS updates, Open Ports, Windows Running Services list? Is there a way to monitor Windows Performance Counters for a duration of time ? Thanks, Akash -- You received this message because you are subscribed to the Google Groups "Ansible Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-devel+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.