[ansible-project] Custom facts module question - running a copy of an ansible module from the "library" dir

2018-05-24 Thread -Taida -
Hello everyone, I'm trying to understand how to write custom modules. For that, I've copied an existing ios_facts.py to a playbook library directory and renamed it to slb_facts2. I thought that just copying the module would keep it working, however it doesn't execute from the playbook because

[ansible-project] Need help to refer child group in jinja2 template file

2018-05-24 Thread Balaji
Hello All, Please help or suggest how I can solve this problem. I will pass -e group="1" when calling playbook. *Playbook* - file.yml hosts: servers_{{group}} - task: . *inventory* [servers_grp1] server1 [servers_grp2] server2 [mainservers_1:children] [servers_grp1]

[ansible-project] WSMan does not exist.

2018-05-24 Thread MKPhil
I'm trying to set up a Windows 2008R2 server using the ConfigureRemotingForAnsible.ps1 script but I get the error: dir : Cannot find drive. A drive with the name 'WSMan' does not exist. At line:98 char:3 + dir 'WSMan:\localhost\Plugin\' -Force:$force | ? { $_.name -like "$filter" } | ... +

Re: [ansible-project] Can't login Aix machine by the account that was created by Ansible user module.

2018-05-24 Thread shaolong_t
Thanks Kai very much. It work for me. Thanks Ray 在 2018年5月24日星期四 UTC+8下午1:55:54,Kai Stian Olstad写道: > > On 24.05.2018 03:52, shaol...@hotmail.com wrote: > > Thanks Werner for your quickly response, > > > > I manual create a new user "raytest" and set password to "123456". I > > don't > >

[ansible-project] Re: WSMan does not exist.

2018-05-24 Thread Jordan Borean
Are you sure you are running the same script as what is at https://github.com/ansible/ansible/blob/devel/examples/scripts/ConfigureRemotingForAnsible.ps1. Line 98 is blank and we don't run "dir 'WSMan:\localhost\Plugin\'..." at all in that script. Does WSMan appear in the list after running

[ansible-project] os_recordset module not working

2018-05-24 Thread sriman dharba
Hello I am using ansible 2.3.3.0 on openstack pike shade==1.28.0 ansible==2.3.3.0 python-designateclient==2.7.0 python-openstackclient==3.12.0 When i am trying to create a A record after instance creation, its throwing the below error. "msg": "Error creating recordset test-instance. (400)

RE: [ansible-project] Re: inventory_hostname in path to create directory with win_file grief..

2018-05-24 Thread william.dossett
Thank You Jordan. I tried first without quotes and was getting an error…I usually try without quotes… anyway, then I tried it as with double quotes and escaping the \’s and it worked… very curious will have to try without quotes at all again and see if perhaps I had some other error and

[ansible-project] Re: WSMan does not exist.

2018-05-24 Thread MKPhil
Hi Jordan, I am running the latest script. If I step through the script in Debug mode of the PowerShell ISE, it hits line 278: If (!(Get-PSSessionConfiguration -Verbose:$false) -or (!(Get-ChildItem WSMan :\localhost\Listener))) It evaluates the Get-PSSessionConfiguration part OK and then the

[ansible-project] Ho to use different answers for the same questions?

2018-05-24 Thread Рабочий Проект
Hello I use ansible 2.5.2 I have this responses section in my playbook: *(?i)Login: "admin\n\r"* *(?i)Password: "admin\n\r"* *(?i)#: "password\n\r"* *(?i)Enter new password: "admin123\n\r"* *(?i)Confirm new password: "admin123\n\r"* *(?i)#:

Re: [ansible-project] Ho to use different answers for the same questions?

2018-05-24 Thread Kai Stian Olstad
On 24.05.2018 15:42, Рабочий Проект wrote: I use ansible 2.5.2 I have this responses section in my playbook: *(?i)Login: "admin\n\r"* *(?i)Password: "admin\n\r"* *(?i)#: "password\n\r"* *(?i)Enter new password: "admin123\n\r"* *(?i)Confirm new password:

[ansible-project] Re: Nested variable

2018-05-24 Thread David Villasmil
Hey Jordan, Thanks for replying! There were "`" missing, worked beautifully after that! - set_fact: hosted_zone_id: "{{ dns_results | json_query('HostedZones[?Name==`' ~ hosted_zone_name ~ '.`].[Id]') | regex_replace('/hostedzone/', '') }}" "~" escapes it, so there's no need to do a

[ansible-project] Re: powershell: not found

2018-05-24 Thread ansible4windows
I am too getting same error now.. On Thursday, May 24, 2018 at 11:40:59 AM UTC-7, Nojan Sheybani wrote: > > I keep getting this error whenever I try to run a

[ansible-project] Re: powershell: not found

2018-05-24 Thread ansible4windows
Hi Tony, Please take a look at my inventory and my work at this post. https://groups.google.com/forum/#!topic/ansible-project/p6Ye0VKNOT8 On Thursday, May 24, 2018 at 11:58:29 AM UTC-7, Tony Chia wrote: > > Without looking at your playbook and your inventory it's hard to say. > > However I will

[ansible-project] Ansible Json filter

2018-05-24 Thread Ankur Gupta
Hello All, I have a situation where i am trying to remove key: value from json output. but i am not getting expected result. Please help me what I am doing wrong here? "get_ec2_id.instances[0].tags": { "Name": "test-db-system-2", "aws:cloudformation:logical-id": "DBInstance",

[ansible-project] Re: powershell: not found

2018-05-24 Thread Nojan Sheybani
I was accidentally doing win_ping instead of ping, so you are correct. Thank you so so much! On Thursday, May 24, 2018 at 11:58:29 AM UTC-7, Tony Chia wrote: > > Without looking at your playbook and your inventory it's hard to say. > > However I will throw an educated guess that you are running

[ansible-project] How to set environment dynamically

2018-05-24 Thread David Villasmil
Hello Guys, So, i have a vars file with something like this: --- aws_740: AWS_ACCESS_KEY_ID: "MY_KEY" AWS_SECRET_ACCESS_KEY: "MY_SECRET" AWS_DEFAULT_REGION: us-east-1 aws_756: AWS_ACCESS_KEY_ID: "MY_KEY" AWS_SECRET_ACCESS_KEY: "MY_SECRET" AWS_DEFAULT_REGION: us-east-1 And I want

Re: [ansible-project] How to set environment dynamically

2018-05-24 Thread Matt Martz
The easiest thing for you to do would be to nest aws_740 and aws_756 under a parent key, maybe called "aws_env". Then you can use: environment: "{{ aws_env[account] }}" On Thu, May 24, 2018 at 12:35 PM, David Villasmil < david.villasmil.w...@gmail.com> wrote: > Hello Guys, > > So, i have a

[ansible-project] Re: powershell: not found

2018-05-24 Thread Nojan Sheybani
Also, I'm running Ubuntu 18.04 On Thursday, May 24, 2018 at 11:40:59 AM UTC-7, Nojan Sheybani wrote: > > I keep getting this error whenever I try to run a playbook. I haven't been > able to find a solution to this, can anyone help? > > -- You received this message because you are subscribed to

[ansible-project] powershell: not found

2018-05-24 Thread Nojan Sheybani
I keep getting this error whenever I try to run a playbook. I haven't been able to find a solution to this, can anyone help? -- 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,

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread ansible4windows
Any help on this post please. On

[ansible-project] Re: powershell: not found

2018-05-24 Thread Tony Chia
Without looking at your playbook and your inventory it's hard to say. However I will throw an educated guess that you are running the ping linux module which using a winrm connection. If your target host is really linux and you want to run ping then switch your connection to ssh or paramiko.

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread Jordan Borean
Hey Here are some brief notes - Your host inventory defined ansible_connection twice, once as ansible_connection=local and the other as ansible_connection=winrm. Use local if you want to run things on the Ansible controller and use winrm when you want to run something on the

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread ansible4windows
- Removed ansible_connection = local - Corrected to ansible_port=5985 Following error occured abc012.abctst.lcl | FAILED! => { "msg": "winrm or requests is not installed: No module named winrm" } But if i check on windows machine (abc012.abctst.lcl) run command "winrm

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread ansible4windows
after i ran the "pip install pywinrm" i am getting following error: Installing collected packages: requests, ntlm-auth, pycparser, cffi, enum34, asn1crypto, cryptography, requests-ntlm, pywinrm Found existing installation: requests 2.6.0 Cannot uninstall 'requests'. It is a distutils installed

Re: [ansible-project] Re: inventory_hostname in path to create directory with win_file grief..

2018-05-24 Thread Jordan Borean
If you start with a jinja2 block or have ": " (with the leading space) in the value then you have to quote the whole line, otherwise you usually can get away with it. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this

Re: [ansible-project] Re: inventory_hostname in path to create directory with win_file grief..

2018-05-24 Thread Jordan Borean
s/leading/trailing/ -- 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] Re: Nested variable

2018-05-24 Thread Jordan Borean
ahh yes I should have seen you just wanted a nested var, just an FYI ~ is similar to + but coerces the variable to a string so you don't have to do that yourself. Usually + works but ~ is safer. Thanks Jordan -- You received this message because you are subscribed to the Google Groups

[ansible-project] Re: WSMan does not exist.

2018-05-24 Thread Jordan Borean
Thanks for the info, should have realised it was in one of the cmdlets called. Sounds like WSMan is hosed if the WSMan provider isn't listed as a PSDrive, I've never come across this before so not sure what the fix would be, usually I would just rebuild a new server. Thanks Jordan -- You

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread Jordan Borean
pywinrm is not installed on the controller, run "pip install pywinrm" on the Ansible host to install that. -- 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] Re: windows host not reachable

2018-05-24 Thread Jordan Borean
Have you enabled WinRM on the Windows server, it doesn't seem like you have as there's no response on the WinRM port. -- 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

[ansible-project] Re: windows host not reachable

2018-05-24 Thread Jordan Borean
Having the service running may not be enough, have a look through https://docs.ansible.com/ansible/devel/user_guide/windows_setup.html#winrm-setup and verify a listener is configured on the port you specified. It also contains a few other troubleshooting tips. Thanks Jordan -- You received

[ansible-project] Re: windows host not reachable

2018-05-24 Thread doppalapudi saikumar
port 5985 for http is open. when i did telnet windowshost 5985 it says connected. but from ansible tower it says this error. On Thursday, May 24, 2018 at 10:11:53 PM UTC-5, Jordan Borean wrote: > > Having the service running may not be enough, have a look through >

[ansible-project] Re: windows host not reachable

2018-05-24 Thread doppalapudi saikumar
I enabled. I have even checked in services. its running. On Thursday, May 24, 2018 at 9:17:32 PM UTC-5, Jordan Borean wrote: > > Have you enabled WinRM on the Windows server, it doesn't seem like you > have as there's no response on the WinRM port. > -- You received this message because you

[ansible-project] windows host not reachable

2018-05-24 Thread doppalapudi saikumar
Hi, I have installed ansible tower on rhel. I could ping my windows host from that server. But when i configured a job template it has error of connection timeout. Error message: "msg": "plaintext: HTTPConnectionPool(host='110.x..119', port=5985): Max retries exceeded with url: /wsman

[ansible-project] Pass several shells results from multiple hosts to localhost (write to file or pass to script)

2018-05-24 Thread Dmitresso
Hello. I have a task to collect some information from 100+ hosts and want to organize it in a table. I want to use: 1. Ansible for collecting information; 2. CGI script to generate HTML page with collected information (the information is some users last date login, last time of some

Re: [ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread Kanhaiya Ashtekar
I have installed and created Virtualenv. Installed pywinrm and this time with no errors. I will get back over this to report how things worked ahead later. I feel blessed reaching out here! On Thu, May 24, 2018 at 3:20 PM Jordan Borean wrote: > There is a conflict between

[ansible-project] Re: Ansible windows patch trouble: Need help for Win Patch Automation using Ansible

2018-05-24 Thread Jordan Borean
There is a conflict between a system package and pip trying to install another package which in Pip 10 it doesn't handle properly. You can do either of the following - Use a virtualenv and run Ansible from there

[ansible-project] Disabling F5 Big IP pool member from the pool list

2018-05-24 Thread Josephsimon Arokiaraj
Hi All, I have been trying the below code with state - absent . it ran successffully without changing the state from enabled to disabled. I cant see any Access denied error. - name: Remove pool member from pool bigip_pool_member: server: lb.mydomain.com user: admin password:

[ansible-project] How to supress the * in the anisble playbook output

2018-05-24 Thread Venkatsm V
When we execute the ansible playbook, We have * in screen. I would like to remove for my environment. HOw to do that ?. I tried the callback plugin suggested in