[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 
https://stackoverflow.com/questions/49907174/ansible-remove-change-lines-with-star-sign-in-playbook-execution-output?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa.
  
It didn't work though.

Does anyone have suggestion / fix on that.



PLAY [exabgp validation master check - 1] 


TASK [exabgp : check the exabgp in daiquiri Hosts] 
***
^CProcess WorkerProcess-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 post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9e136d84-31f1-4cfc-aaa1-581cb58593bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
> 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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8e570028-2d66-4b7d-a46a-dce495837db3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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
>
> https://stackoverflow.com/questions/49916736/how-to-properly-handle-conflicting-distutils-libraries-with-pip
>- Install the packages for just the user "pip install pywinrm --user"
>- Skip the install of requests and continue to use the distuil
>packaged version "pip install pywinrm --ignore-installed"
>
> That's what I would recommend you try
>
> Thanks
>
> Jordan
>
> --
> 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@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/17490ede-03b5-4951-82cb-01cc5eded027%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHmTTEu3BGVqtkwY5LtUwnem5%3D161PNP5juAyr-2zo_BKK5mQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b73993db-9be9-4610-8fb3-9e6ddf4b2ae1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 files 
   modification (I get it with scripts by ssh) if you can advise some 
   monitoring service that supports similar operations, please do it).

The problem is that I'm new in Ansible and can't even understand if it's 
possible to do what I want with Ansible.

There's 2 hosts in group 'test'. Let's imagine I want to ls for some file 
somewhere (ls /var/someprogram.pid) and to know who is registered now 
("who").
My attemtpts:
1.
- hosts: test
  serial: 1
  user: dmitresso

  tasks:
  - shell: who
register: response1

  - shell: ls /tmp/someprogram.pid
register: response2
- hosts: local

  tasks:
  - debug:
  var: hostvars['item']['response1']['stdout_lines']
with_items: "{{ groups['test'] }}"

Response:
dmitresso@host ~/ansible $ ansible-playbook pb.yml

PLAY [test] 


TASK [setup] 
***
ok: [host1]

TASK [command] 
*
changed: [host1]

TASK [command] 
*
changed: [host1]

PLAY [test] 


TASK [setup] 
***
ok: [host2]

TASK [command] 
*
changed: [host2]

TASK [command] 
*
changed: [host2]

PLAY [local] 
***

TASK [setup] 
***
ok: [localhost]

TASK [debug] 
***
ok: [localhost] => (item=host1) => {
"hostvars['item']['response1']['stdout_lines']": "VARIABLE IS NOT 
DEFINED!",
"item": "host1"
}
ok: [localhost] => (item=host2) => {
"hostvars['item']['response1']['stdout_lines']": "VARIABLE IS NOT 
DEFINED!",
"item": "host2"
}

PLAY RECAP 
*
host1  : ok=3changed=2unreachable=0failed=0
host2  : ok=3changed=2unreachable=0failed=0
localhost  : ok=2changed=0unreachable=0failed=0
I can iterate the group, but variables are undefined. And I don't know how 
to get "response2" even if it was defined. 

2. 
- hosts: test
  serial: 1
  user: dmitresso

  tasks:
  - shell: who
register: response1

  - shell: ls /tmp/someprogram.pid
register: response2


- hosts: local

  tasks:

  - debug:
  var: hostvars[groups['test'][0]]['response1']['stdout_lines']

  - debug:
  var: hostvars[groups['test'][0]]['response2']['stdout_lines']

  - debug:
  var: hostvars[groups['test'][1]]['response1']['stdout_lines']

  - debug:
  var: hostvars[groups['test'][1]]['response2']['stdout_lines']

Response:
dmitresso@host ~/ansible $ ansible-playbook pb.yml

PLAY [test] 


TASK [setup] 
***
ok: [host1]

TASK [command] 
*
changed: [host1]

TASK [command] 
*
changed: [host1]

PLAY [test] 


TASK [setup] 
***
ok: [host2]

TASK [command] 
*
changed: [host2]

TASK [command] 
*
changed: [host2]

PLAY [local] 
***

TASK [setup] 
***
ok: [localhost]

TASK [debug] 
***
ok: [localhost] => {
"hostvars[groups['test'][0]]['response1']['stdout_lines']": [
"dmitresso pts/0May 25 09:00 (host)"
]
}

TASK [debug] 
***
ok: [localhost] => {
"hostvars[groups['test'][0]]['response2']['stdout_lines']": [
"/tmp/someprogram.pid"
]
}

TASK [debug] 
***
ok: [localhost] => {
"hostvars[groups['test'][1]]['response1']['stdout_lines']": [
"dmitresso pts/0May 25 09:00 (host)"
]
}

TASK [debug] 
*

[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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3da4fc5c-fc0b-42d8-876a-3825cc36de5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4158ca0a-52e8-4c6c-a68f-d420b7196ecc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 (Caused by 
ConnectTimeoutError(, 'Connection to 110.144.x119 timed out. (connect 
timeout=30)'))",
"unreachable": true,
"changed": false


-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b6f8b578-c8ff-44d4-b3ca-0b5020740654%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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: secret
state: absent
pool: my-pool
partition: Common
host: "{{ ansible_default_ipv4['address'] }}"
port: 80
  delegate_to: localhost

If I try the below code with state - present , It throws errors saying Access 
Denied: user (ansible) does not have create access to object (pool_member)

- name: Remove pool member from pool
  bigip_pool_member:
server: lb.mydomain.com
user: admin
password: secret
state: present 
pool: my-pool
partition: Common
host: "{{ ansible_default_ipv4['address'] }}"
port: 80
  delegate_to: localhost

I tried from Big IP browser using the same user and I am able to disable the 
pool member.

I am using ansible version 2.4.1

Any ideas?

Cheers,

Simon J






-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/467f66d3-2e85-4d97-9ed2-4b5887d1e09f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
   
https://stackoverflow.com/questions/49916736/how-to-properly-handle-conflicting-distutils-libraries-with-pip
   - Install the packages for just the user "pip install pywinrm --user"
   - Skip the install of requests and continue to use the distuil packaged 
   version "pip install pywinrm --ignore-installed"

That's what I would recommend you try

Thanks

Jordan

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/17490ede-03b5-4951-82cb-01cc5eded027%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 project and thus 
we cannot accurately determine which files belong to it which would lead
to only a partial uninstall.



On Thursday, May 24, 2018 at 2:32:31 PM UTC-7, Jordan Borean wrote:
>
> 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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/15d8eb6f-8b19-4ff5-a5be-72c7e3e093e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8bf0fe58-ee7d-45c7-9895-c50d02f9b8f8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
quickconfig"
Output:
WinRM service is already running on this machine.
WinRM is already set up for remote management on this computer.

whats wrong now? :(

On Thursday, May 24, 2018 at 1:32:21 PM UTC-7, Jordan Borean wrote:
>
> 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 WIndows host
>- Use ansible_port instead of ansible_ssh_port
>- When connecting to WIndows hosts use win_ module, like win_ping 
>instead of ping
>- Your error is because you are trying to run win_ping over the local 
>connection where PowerShell isn't installed
>
> Thanks
>
> Jordan
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/0371610f-76ab-4925-bae2-8f96037d62a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dbdee3d2-0ddc-4827-9ccb-d2d2b657170f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cfb3c380-03c0-428c-96be-e10bfea5b833%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/eb1891d7-d116-41d5-a9a0-b3645bf99c5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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" 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8537abc2-7d0b-4da5-b753-9fd4b9aec628%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 WIndows host
   - Use ansible_port instead of ansible_ssh_port
   - When connecting to WIndows hosts use win_ module, like win_ping 
   instead of ping
   - Your error is because you are trying to run win_ping over the local 
   connection where PowerShell isn't installed

Thanks

Jordan

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/926b8dfd-ad8d-4b0e-90ce-7ad50149783e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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. If your target host is windows then 
> change the module to wing_ping instead of ping.
>
> See this link to see if it resolves your issue 
> https://github.com/ansible/ansible/issues/35437
>
> On Thursday, May 24, 2018 at 11:43:30 AM UTC-7, Nojan Sheybani wrote:
>>
>> 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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/dc6e5caf-dc3f-4e7a-9719-f545eedca669%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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. If your target host is windows then 
> change the module to wing_ping instead of ping.
>
> See this link to see if it resolves your issue 
> https://github.com/ansible/ansible/issues/35437
>
> On Thursday, May 24, 2018 at 11:43:30 AM UTC-7, Nojan Sheybani wrote:
>>
>> 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?
>>>
>>>
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 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. If your target host is windows then 
> change the module to wing_ping instead of ping.
>
> See this link to see if it resolves your issue 
> https://github.com/ansible/ansible/issues/35437
>
> On Thursday, May 24, 2018 at 11:43:30 AM UTC-7, Nojan Sheybani wrote:
>>
>> 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?
>>>
>>>
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 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. If your target host is windows then 
> change the module to wing_ping instead of ping.
>
> See this link to see if it resolves your issue 
> https://github.com/ansible/ansible/issues/35437
>
> On Thursday, May 24, 2018 at 11:43:30 AM UTC-7, Nojan Sheybani wrote:
>>
>> 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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/07e2b05e-3f06-46ad-9ea5-3397002cb566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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. If your target host is windows then 
change the module to wing_ping instead of ping.

See this link to see if it resolves your issue 
https://github.com/ansible/ansible/issues/35437

On Thursday, May 24, 2018 at 11:43:30 AM UTC-7, Nojan Sheybani wrote:
>
> 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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4d62124b-461b-48a0-a999-8b3b43a0493a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 Thursday, May 24, 2018 at 11:03:24 AM UTC-7, ansible...@gmail.com wrote:
>
> Hello, I am facing some problems in setting up patch automation in my 
> organization.
> For a quick walk through: We have 5 domains for the purpose of Production, 
> Staging, Testing and Application.
> I am working on machines in Test domain that has windows machines.
> I have my Ansible server setup in UAT(staging) domain.
>
> Ansible Jumpstation: RHEL 6 (64 bit)
> Windows Hosts: Windows Server 2012 R2, 2008 R2.
>
> Power Shell version 3.0
>
>  
>
>
> I have used following reference sources:
> Setting up a Windows Host 
>  
>
> Unable to run ConfigureRemotingForAnsible.ps1 
> 
>  on windows hosts. The Power Shell window closes after some execution.
>
> Checked services on machine: winrm service running.
>
> According to Sys. Admin: Ansible machine has no firewall restrictions (can 
> communicate to any and listen from any) 
>
>  
>
> I am using following fashion to definemy Hosts file:
>  
> #Window's Servers
> [abctst-win]
> abc012.abctst.lcl ansible_connection=local ansible_host= ip address
>
> [abctst-win:vars]
> ansible_ssh_port= 5985
> ansible_connection= winrm
>
>
> Output 1:
>
> [root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m win_ping
>
> abc012.abctst.lcl | FAILED! => {
> "changed": false,
> "module_stderr": "/bin/sh: powershell: command not found\n",
> "module_stdout": "",
> "msg": "MODULE FAILURE",
> "rc": 127
> }
>
> Output 2:
>
> [root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m ping
>
> abc012.abctst.lcl | SUCCESS => {
> "changed": false,
> "ping": "pong"
> }
>
>
> Question:
> Where am I doing wrong?
> What is that I am doing wrong?
> Is my way of defining host file correct? Am I passing all required 
> information in hosts file correct?
> Is there something I did wrong in setting up windows machine?
>
>
> Can I get a help here in this? I have to automate windows and linux 
> patching and I am stuck at start.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a9692351-3179-4838-b051-a20f9e9d7dab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/057250f1-c156-455b-a3af-dcfa11c178ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 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, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5e387cb8-9f81-4e46-8695-595d5f3287a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c9f588ca-297f-4917-bcd4-acc55bc511b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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",
"aws:cloudformation:stack-id": 
"arn:aws:cloudformation:us-east-1:123456789012:stack/test-db-system-2/0115v0a0-5d44-17e8-a024-503ama4a5qd1",
"aws:cloudformation:stack-name": "test-db-system-2",
"dbsystem:stack": "test-db-system-2",
"dbsystem:type": "db"
}


I am trying to remove the all "aws:cloudformation" tags  using below filter:

"{{ get_ec2_id.instances[0].tags | reject('search','aws:') }}"


I am getting the below result:

ok: [10.52.8.101] => {
"instances_tags": [
"dbsystem:type",
"dbsystem:stack",
"Name"
]
}


but I am expected below result :

 "instances_tags": [
"dbsystem:stack": "test-db-system-2",
"dbsystem:type": "db"
"Name" : "test-db-system-2",
]
  }


Help me to solve the issue.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f58ee0d4-4108-4e7d-88ec-5d7f581aee7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2018-05-24 Thread ansible4windows
Hello, I am facing some problems in setting up patch automation in my 
organization.
For a quick walk through: We have 5 domains for the purpose of Production, 
Staging, Testing and Application.
I am working on machines in Test domain that has windows machines.
I have my Ansible server setup in UAT(staging) domain.

Ansible Jumpstation: RHEL 6 (64 bit)
Windows Hosts: Windows Server 2012 R2, 2008 R2.

Power Shell version 3.0

 


I have used following reference sources:
Setting up a Windows Host 
 

Unable to run ConfigureRemotingForAnsible.ps1 

 on windows hosts. The Power Shell window closes after some execution.

Checked services on machine: winrm service running.

According to Sys. Admin: Ansible machine has no firewall restrictions (can 
communicate to any and listen from any) 

 

I am using following fashion to definemy Hosts file:
 
#Window's Servers
[abctst-win]
abc012.abctst.lcl ansible_connection=local ansible_host= ip address

[abctst-win:vars]
ansible_ssh_port= 5985
ansible_connection= winrm


Output 1:

[root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m win_ping

abc012.abctst.lcl | FAILED! => {
"changed": false,
"module_stderr": "/bin/sh: powershell: command not found\n",
"module_stdout": "",
"msg": "MODULE FAILURE",
"rc": 127
}

Output 2:

[root@ansiblejmpst ansible]# ansible abctst-win -i hosts -m ping

abc012.abctst.lcl | SUCCESS => {
"changed": false,
"ping": "pong"
}


Question:
Where am I doing wrong?
What is that I am doing wrong?
Is my way of defining host file correct? Am I passing all required 
information in hosts file correct?
Is there something I did wrong in setting up windows machine?


Can I get a help here in this? I have to automate windows and linux 
patching and I am stuck at start.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/242f24e8-fbda-43fc-a112-357666392793%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 to use it in my playbook, like so:
>
>   # >> Get the ZoneID for the hosted_zone
>   - name: Getting Route53 hosted zone ID
> route53_facts:
>   query: hosted_zone
> register: dns_results
> environment: "{{ aws_{{ account }} }}"
>
>
> I would then launch it with something like:
>
> ansible-playbook mybook.yml -e 'account=740'
>
>
> Would this be possible?
>
> --
> 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@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/10d3fcd6-5437-41fd-94db-2cfcdcb05ea7%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Matt Martz
@sivel
sivel.net

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAD8N0v8SYnhWXLDuvULsgJFuNvZLojcgquJ4XHGo9CWnybmw8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 to use it in my playbook, like so:

  # >> Get the ZoneID for the hosted_zone
  - name: Getting Route53 hosted zone ID
route53_facts:
  query: hosted_zone
register: dns_results
environment: "{{ aws_{{ account }} }}"


I would then launch it with something like:

ansible-playbook mybook.yml -e 'account=740'


Would this be possible?

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/10d3fcd6-5437-41fd-94db-2cfcdcb05ea7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 lookup, works nice

Thanks!

On Thursday, May 24, 2018 at 3:11:32 AM UTC+2, Jordan Borean wrote:
>
> Try this
>
> - set_fact:
> hosted_zone_id: "{{ dns_results | json_query('HostedZones[?Name==' ~ 
> lookup('vars', hosted_zone_name) ~ '].[Id]') | 
> regex_replace('/hostedzone/', '') }}"
>
> You need to escape outside of the quoted arg of json_query and then run 
> the lookup. Note I haven't tested this
>
> Thanks
>
> Jordan
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7797e526-6149-4a39-8100-9bc1c772e8e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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: "admin123\n\r"*
*(?i)#: "logout\n\r"*

As you can see, I use two different answers with same question "#".
But it is not working:


But the answers as a list under the same question.



found a duplicate dict key ((?i)#).

Using last defined value only.



As I understood, you promise to add that
functionality:
https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4

Or I made a mistake with my playbook?


As the documentation say
"If the response is a list, successive matches return successive 
responses. List functionality is new in 2.1."


  (?i)#:
- "password\n\r"
- "logout\n\r"


--
Kai Stian Olstad

--
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3eb71ff3c20a83fb6b67c1b06cb28b1b%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


[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)#: "logout\n\r"*

As you can see, I use two different answers with same question "#".
But it is not working:

found a duplicate dict key ((?i)#).
> Using last defined value only.


As I understood, you promise to add that 
functionality: 
https://groups.google.com/forum/#!topic/ansible-project/850sYU11aO4

Or I made a mistake with my playbook?

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6282b992-5484-4d71-9911-272dae2e1e83%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 was misinterpreting it as it is my first 
time using system variables in anger.  

 

Bill

 

From: ansible-project@googlegroups.com  On 
Behalf Of Jordan Borean
Sent: Wednesday, May 23, 2018 4:08 PM
To: Ansible Project 
Subject: [ansible-project] Re: inventory_hostname in path to create directory 
with win_file grief..

 

Hi

 

You seem to be close, one thing to remember when dealing with Windows paths in 
double quotes is that you needs to properly escape the backslashes. E.g. your 
path could be one of the following (they all are the same after yaml parsing)

 

# when not using quotes, no need to escape anything
path: C:\working\{{ inventory_hostname }}

# when using single quotes, you don't need to escape backslashes
path: 'C:\working\{{ inventory_hostname }}'

# when using double quotes, you need to escape backslashes, e.g. \n is newline 
with \\n   is "\n" as text
path: "C:\\working\\{{ inventory_hostname }}"

 

We have some guides around this here 
https://docs.ansible.com/ansible/latest/user_guide/windows_usage.html#path-formatting-for-windows
 but ultimately I try to avoid quotes if possiible and if I need to use them, 
then I favor single quotes.

 

Thanks

 

Jordan

-- 
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@googlegroups.com 
 .
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/54b57262-6739-4488-8c83-4203640849dd%40googlegroups.com
 

 .
For more options, visit https://groups.google.com/d/optout.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/391701d3f363%2444b5bfb0%24ce213f10%24%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 ISE opens 
Microsoft.WSMan.Management.psd1 [Read Only] and then the error is thrown.


WSMan isn't in the Get-PSDrive list:
PS C:\Windows\system32> get-psdrive


Name   Used (GB) Free (GB) Provider  Root   
CurrentLocation
   - -      
---
Alias  Alias
C  35.09  4.81 FileSystemC:\   
Windows\system32
Cert   Certificate   \
D  49.58   .41 FileSystemD:\
EnvEnvironment
Function   Function
HKCU   Registry  HKEY_CURRENT_USER
HKLM   Registry  HKEY_LOCAL_MACHINE
P  15.71  1.28 FileSystemP:\
Variable   Variable

I'm thinking WinRM is corrupt on this server - any ideas how to fix that?


On Thursday, 24 May 2018 11:13:08 UTC+1, Jordan Borean wrote:
>
> 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 
> "Get-PSDrive"?
>
> Thanks
>
> Jordan
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b6493cdc-bcae-449c-b815-81b21effda31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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) Client Error for url:
https://os-designate.hq.acme-corp.com:9001/v2/zones/qatest.hq.acme-corp.com./recordsets
"}


- name: 'Creating a private ip'
  os_recordset:
cloud: "{{cloud_name}}"
state: present
zone: qatest.hq.acme-corp.com.
name: "{{item.name}}"
recordset_type: A
records: ["{{item['private_v4']}}"]
description: 'test recordset'
ttl: 3600
  with_items: "{{openstack_servers}}"

Thanks
Sree

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAF9AceEHvqcMk4cHD0jDuTgKON4sOcF0k2iCVmvH2ukOG0xcGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 
"Get-PSDrive"?

Thanks

Jordan

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b5fd72b4-a33b-4e1c-bb4d-60873d5a95b5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 
> > find the crypted password of the new user match the format that you 
> > mention. Do you help find the crypt method? Thanks. 
> > 
> > The below is the crypted password string in /etc/security/passwd file. 
> > raytest: 
> > password = bo8Dqpvt3wnb. 
> > lastupdate = 1527172932 
> > flags = ADMCHG 
>
> It's using the inferior des and not sha-512 
>
> $ echo 123456 | mkpasswd -m des -S bo -s 
> bo8Dqpvt3wnb. 
>
>
> -- 
> Kai Stian Olstad 
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/42f79750-33ea-4e77-a115-7837d46ffef4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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" } | ...
+   
+ CategoryInfo  : ObjectNotFound: (WSMan:String) 
[Get-ChildItem], DriveNotFoundException
+ FullyQualifiedErrorId : 
DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand


   - PowerShell 4.0 is installed
   - The script is being run as Administrator
   - If I run winrm qc is says WinRM is already set up
   

The same script has worked on over 4000 other servers without a problem but 
I am stuck on this one!  What am I missing?




-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/83ce7233-ae54-4425-b70c-f3a3398de31e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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]
[servers_grp2]
[servers_grp3]
[servers_grp4]

[mainservers_2:children]  
[servers_grp5]
[servers_grp6]
[servers_grp7]
[servers_grp8]

In Jinja2 template file, I am trying to assign a value to variable 
"pod_num". But I am unable to get this

If (servers_grp1) is in mainservers_1
then 
pod_num = 2
else 
pod_num = 4



I tried a couple of things but did not work out.

{% if hosts is in groups[mainservers_1]
{% set pod_num = 2 %}

{% else %}
{% set pod_num = 4 %}


Thanks for helping and guiding.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5deef216-51bc-4ae2-b1f0-375074e1de9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.