Re: [ansible-project] Execut script with Ansible

2020-01-29 Thread Karther
Hello, Yes my task is this : - name: "Execut script python" shell: ./myscript.py delegate_to: localhost I want to get statut of my command line in my script for get message error. Thanks very much Community Ansible :) Best Regards, Karther Le mardi 28 janvier 2020 17:54:58 UTC+1, Stefan

Re: [ansible-project] Execut script with Ansible

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/29/20 9:22 AM, Karther wrote: > Hello, > > Yes my task is this : > > - name: "Execut script python" >   shell: ./myscript.py >   delegate_to: localhost > > I want to get statut of my command line in my script for get message error. Please try this (untested): - name: "Execut script python

Re: [ansible-project] letsencrypt

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/28/20 10:22 PM, Mauricio Tavares wrote: > I saw there is a module[1] that you can use to create a > letsencrypt cert. How do you use it to renew said certificate? > > [1] > https://docs.ansible.com/ansible/latest/modules/acme_certificate_module.html#acme-certificate-module > You coul

Re: [ansible-project] Execut script with Ansible

2020-01-29 Thread Karther
Hello, Yes this register variable error works but i want to get status of execution of my python programme *cur.execute* : I want to know from this programme python if *cur.execute* is success execute or not ... *#!/usr/bin/python* *import pymssql* *conn = pymssql.connect(host="ihospisql02",

Re: [ansible-project] Execut script with Ansible

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/29/20 10:49 AM, Karther wrote: > Hello, > > Yes this register variable error works but i want to get status of execution > of my python programme *cur.execute* : > I want to know from this programme python if *cur.execute* is success execute > or not ... > That's up to your script, really

[ansible-project] Create module ansible

2020-01-29 Thread Karther
Hello guy !! :) I want create module for connection and execution script sql in my database MSSQL. I have create programme python : *#!/usr/bin/python* *import pymssql* *conn = pymssql.connect(host="my_host_database", user="my_user", password="my_password", database="my_database")* *cur = con

Re: [ansible-project] Re: Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-29 Thread naveen s
Hello , You can schedule a ansible playbook via ansible tower by using schedule option. By using this you can schedule the job when to run. Install aws Cli on your ansible master server and create aws credentials to communicate from ansible server to aws. Once the setup is done. If you already h

[ansible-project] Ansible WinRM dont run concurrent process

2020-01-29 Thread 'wagfeliz' via Ansible Project
Hi, We have 3 playbooks that runs concurrently winrm process on a windows server, I did notice even when I start all of then in the same time, only 1 runs, the others get stuck and wait for the first to finish, then starts. I did follow all the documentation that I could find and this is my cur

[ansible-project] Anchors to specific module parameters in the docs?

2020-01-29 Thread Dick Visser
Hi Not sure if this is the right place, but I used URLs to module documentation a lot, for instance: https://docs.ansible.com/ansible/latest/modules/docker_container_module.html But what I most of the time want, is to pinpoint to a specific parameter of a module. This isn't possible because

Re: [ansible-project] Anchors to specific module parameters in the docs?

2020-01-29 Thread 'Felix Fontein' via Ansible Project
Hi Dick, > Not sure if this is the right place, but it's probably better to create an GH issue for this. > I used URLs to module documentation a lot, for instance: > > https://docs.ansible.com/ansible/latest/modules/docker_container_module.html > > But what I most of the time want, is to p

[ansible-project] Powershell script from Ansible Playbook

2020-01-29 Thread Sai Prasha
I have .psl file i want to run that file on Ansible nodes ,So when i try to invoke the .psl file using adhoc command : *ansible win1 -m win_command -a "powershell.exe -File C:\Sample\tomeescript.ps1" , *It works fine When i try to do the same with win_command module ,its failing --- - hosts:win1

Re: [ansible-project] Powershell script from Ansible Playbook

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/29/20 1:56 PM, Sai Prasha wrote: > I have .psl file i want to run that file on Ansible nodes ,So when i try to > invoke the .psl file using adhoc command :  > *ansible win1 -m win_command -a "powershell.exe -File > C:\Sample\tomeescript.ps1" , *It works fine > When i try to do the same with

[ansible-project] Create module mssql_query Error port

2020-01-29 Thread Karther
Hello, I have create this module mssql_query.py in ansible in /library/mssql_query.py : https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py I have this error : The error was: TypeError: connect() got an unexpected keyword argument 'port' when i execut this task : -

Re: [ansible-project] Create module mssql_query Error port

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/29/20 2:36 PM, Karther wrote: > Hello, > > I have create this module mssql_query.py in ansible in > /library/mssql_query.py : > > https://github.com/melmorabity/ansible-mssql-query/blob/master/mssql_query.py > > I have this error : > > The error was: TypeError: connect() got an unexpected

[ansible-project] Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-29 Thread Pawan Kumar
Hi Team, I am able to extract the selected list of installed rpms using ansible "shell" module ,But when I tried using "yum" module ,it's no success . Your help would be appreciated . The playbook which is running with "shell" module & it's output is as follows --- Playbook--- --- - hosts:

Re: [ansible-project] Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/29/20 3:05 PM, Pawan Kumar wrote: > Hi Team, > > I am able to extract the selected list of installed rpms using ansible > "shell" module ,But when I tried using "yum" > module ,it's no success .  > Your help would be appreciated . Hello Pawan, what's your yum task and the error message yo

[ansible-project] oracle_privs doesn

2020-01-29 Thread Anand Solomon
I am trying to use oracle_privs module to revoke privileges in account. Below is my playbook tasks: - name: This playbook will grant or revoke privilges in the user. oracle_privs: user: "{{user}}" password: "{{password}}" service_name: "{{sname}}" port

[ansible-project] Re: Able to extract list of installed rpm using "shell" module but not with yum module

2020-01-29 Thread Pawan Kumar
--- - hosts: localhost tasks: - name: Create a list set_fact: package_list: - zlib - strace - gawk - name: Display Lists debug: msg: - "{{ package_list }}" - name: Create an empty list variable

[ansible-project] waits for password when I don't want it to

2020-01-29 Thread Dylan Martin
Hi all. I have an environment with several hundred unreliable machines. Sometimes they're just dead, sometimes they're misconfigured. I always encounter some where the keys in my ssh-agent don't work and it prompts me to enter the password and it waits for me to hit enter a bunch of times be

[ansible-project] Re: Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-29 Thread Dylan Martin
What environment are you in? I have linux servers in a datacenter. I'd write a shell script to run the play, output to a file and copy the file to s3. Then I'd use cron to schedule the job. Of course, you'd need to use a passwordless ssh key or set up ssh-agent ahead of time to work with cro

[ansible-project] Re: Ansible WinRM dont run concurrent process

2020-01-29 Thread Dylan Martin
How are you making them concurrent? IE what does your play look like? If you have three conventional separate ansible tasks, that won't work. You'd need a single task that launches all 3 or use async. https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html If you're already

[ansible-project] Re: exporting grafana dashboards (containerised) using ansible

2020-01-29 Thread Dylan Martin
That's a pretty vague question. Could you tell us what you've done and where you are stuck? On Monday, January 27, 2020 at 7:56:59 AM UTC-8, Vishal Bobade wrote: > > Hello, > > I am looking forward to export grafana json dashboards using ansible. > Could you please help me on how can I use dock

[ansible-project] Re: Azure dynamic inventory default to SSH even for win_ping

2020-01-29 Thread Aravind Sivaraman
UPDATE: Update dynamic inventory with keyed group matching group_vars, then it picked up the winrm connection and it works fine On Tuesday, January 28, 2020 at 4:42:34 PM UTC-4, Aravind Sivaraman wrote: > > I am testing the Azure Dynamic Inventory plugin, have a windows VM in one > of the resou

[ansible-project] Upload and install file using uri module

2020-01-29 Thread Amarnatha Reddy
Hi All, I am trying to upload and installing package on remote machine using uri module. How to convert below existing method of curl to ansible uri module? Upload a package AND install curl -u admin:admin -F file=@"name of zip file" -F name="name of package" -F force=true -F

Re: [ansible-project] waits for password when I don't want it to

2020-01-29 Thread Kai Stian Olstad
On 29.01.2020 18:01, Dylan Martin wrote: Hi all. I have an environment with several hundred unreliable machines. Sometimes they're just dead, sometimes they're misconfigured. I always encounter some where the keys in my ssh-agent don't work and it prompts me to enter the password and it wa

Re: [ansible-project] Upload and install file using uri module

2020-01-29 Thread Matt Martz
The uri module does not support multipart/form-data currently. On Wed, Jan 29, 2020 at 11:32 AM Amarnatha Reddy wrote: > Hi All, > > I am trying to upload and installing package on remote machine using uri > module. > > > How to convert below existing method of curl to ansible uri module? > > Up

Re: [ansible-project] Upload and install file using uri module

2020-01-29 Thread Amarnatha Reddy
Thanks Matt, So shell/command module is the only option to achieve aboverequirement?..is there any other possible ways ?and also any idea this was consider already and future version will available(just curiosity)? My ansible 2.7.0 Amaranth -- You received this message because you are sub

[ansible-project] kerberos authentication issue with Azure Dynamic Inventory

2020-01-29 Thread Aravind Sivaraman
I am testing Azure Dynamic Inventory Plugin against my windows VM using Kerberos authentication it fails with the error. The dynamic inventory works fine when authentication is set to ‘basic’ and when testing with static inventory both “basic and Kerberos” works fine. I have verified the

[ansible-project] Help with "vmware_guest_snapshot"

2020-01-29 Thread KJoubert1966
I am not a programmer and very new to Ansible, but I have written a playbook that allows me to create snapshots of all the VMs on a Vcenter... --- - name: prepare for snapshots hosts: PROD_local_vmware_vcenter gather_facts: false vars_prompt: - name: "vcname" prompt: "Enter VCent

[ansible-project] Need help in installing windows service pack

2020-01-29 Thread Ases
Hello there, Have a dependency installing an agent on windows. If the agent installer is run manually into the server, it prompts for the need of service to be installed and complete it subsequently after agreeing. But, im unable to install the service pack via ansible win_updates module. Tr

[ansible-project] Re: Quick question- how to run ansible playbook on Saturday night at 12 PM and save the output in amazon s3 bucket

2020-01-29 Thread Work-Hard
I am in Ubuntu. Can you share template of your shell script {output to a file and copy the file to s3}. I can't use ssh-agent as it involves windows workstations on-premises (outside aws). I tried to use it before but it's a lot of overhead/un-reliable process. On Wednesday, January 29, 2020 at

[ansible-project] Re: Help with "vmware_guest_snapshot"

2020-01-29 Thread KJoubert1966
Is there by any chance a way to reference an Inventory group from /etc/ansible/hosts and pass that to a variable that "vmware_guest_snapshot" can use? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop r

[ansible-project] ansible-playbook 2.7.10 + Packer + winrm + windows 2012r2 ssl: HTTPSConnectionPool(host='localhost', port=5986): Max retries exceeded with url: /wsman

2020-01-29 Thread John Roh
Hi I'm trying to build Windows 2012r2 ec2 windows AMI that I can provisioned Powershell over winrm but I'm getting SSL exception error as below. Running Ansible playbook ping verified and win command getting the hostname, however, running local command to get the hostname fails. ssl: HTTPSCon

[ansible-project] Run a command only on hosts that have low CPU usage

2020-01-29 Thread Eric S
Hi Folks, I am looking for a simple way to have Ansible perform the following automation for me: 1. From a set of N hosts, find out which host has the lowest CPU usage at the moment 2. Run a command on *only that host*. This pattern could be extended to a general case of: Run a comman

Re: [ansible-project] Error using state: absent in oracle_grant module

2020-01-29 Thread Anand Solomon
Thanks very much. On Tuesday, January 28, 2020 at 11:03:26 AM UTC-5, Dick Visser wrote: > > Hi Anand > > As I told you (twice) before, those oracle modules are NOT part of the > ansible distribution. Please get support with the authors of those modules. > I see that you’ve done that: > > https://

[ansible-project] Rename of Folder on Windows using Playbook

2020-01-29 Thread Sai Prasha
I want to rename the folder using ansible playbook , But i could not find any module . I found a solution in stackover flow but it did't work. Any solutions are workaround please - *name*: rename the file *win_command*: "cmd.exe /c rename {{C:\Program Files\apache-tomee-plus-8.0.0}}\\{{apa

Re: [ansible-project] ansible-playbook 2.7.10 + Packer + winrm + windows 2012r2 ssl: HTTPSConnectionPool(host='localhost', port=5986): Max retries exceeded with url: /wsman

2020-01-29 Thread John Roh
I have figured this out now that it works with packer 1.5.2-dev (will be released) and ansible 2.7.16. On Wed, Jan 29, 2020 at 3:00 PM John Roh wrote: > Hi I'm trying to build Windows 2012r2 ec2 windows AMI that I can > provisioned Powershell over winrm but I'm getting SSL exception error as > b

Re: [ansible-project] Run a command only on hosts that have low CPU usage

2020-01-29 Thread Stefan Hornburg (Racke)
On 1/30/20 1:48 AM, Eric S wrote: > Hi Folks, > I am looking for a simple way to have Ansible perform the following > automation for me: > > 1. From a set of N hosts, find out which host has the lowest CPU usage at > the moment > 2. Run a command on *only that host*. > > This pattern could be

Re: [ansible-project] Re: Help with "vmware_guest_snapshot"

2020-01-29 Thread Kai Stian Olstad
On 29.01.2020 22:48, KJoubert1966 wrote: Is there by any chance a way to reference an Inventory group from /etc/ansible/hosts and pass that to a variable that "vmware_guest_snapshot" can use? You mean something like groups['mygroup'] which is a list of all hosts in the group mygroup? https