[ansible-project] errors for unknown reasons

2018-04-03 Thread Paul Franks
Hi All - noob question - trying to create resources via ansible -> CFN and 
i get an error i can't understand

Failed to create stack pfranks-VPC: Parameter validation failed:\nUnknown 
parameter in input: \"ClientRequestToken\", must be one of: StackName, 
TemplateBody, TemplateURL, Parameters, DisableRollback, TimeoutInMinutes, 
NotificationARNs, Capabilities, ResourceTypes, RoleARN, OnFailure, 
StackPolicyBody, StackPolicyURL, Tags Parameter validation failed:\nUnknown 
parameter in input: \"ClientRequestToken\", must be one of: StackName, 
TemplateBody, TemplateURL, Parameters, DisableRollback, TimeoutInMinutes, 
NotificationARNs, Capabilities, ResourceTypes, RoleARN, OnFailure, 
StackPolicyBody, StackPolicyURL, Tags - .

of course there is no "ClientRequestToken" in my code...

any help is appreciated!!

ansible 2.5.0
  config file = None
  configured module search path = 
[u'/Users/paul.franks/.ansible/plugins/modules', 
u'/usr/share/ansible/plugins/modules']
  ansible python module location = 
/usr/local/Cellar/ansible/2.5.0/libexec/lib/python2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.14 (default, Mar 22 2018, 14:43:05) [GCC 4.2.1 
Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

-- 
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/40909484-f0b6-4232-8b0c-c6f7987a8ec5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible help regex

2018-04-03 Thread Numi
Hello, I was wondering if someone can possible help me with my Ansible 
playbook. I have a file called myfile.yml with a line that contains an 
image. Example line:

service:
blahblah
image: myoldimagename
blahblah


I want to change everything after the word "image: " with a configuration 
line, however I'm having trouble. For example, I want to replace 
"myoldimagename" with "mynewline". I don'e want to match "myoldimagename" 
explicitly because that may be different. 

- name: Configure myfile.yml
  replace:
path: /data/config/myfile.yml
regexp: "(?<=image: ).*"
replace: \1mynewline
backup: yes

-- 
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/4f2d6e8a-516c-4b34-bf30-d33670de654e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Automate VM creation with Ansible (VMware, Bind, Zabbix)

2018-04-03 Thread Vamberto Junior
Hello Will Weber,
Thank you for your answer, certainly "helps more than confuses"
I still have questions about the IP address of the VM after being created
by Ansible.
Do you have any idea how to change the IP address of the VM and later add
this new host to the Ansible inventory file?

On Sun, Apr 1, 2018 at 1:14 PM, Will Weber  wrote:

> In my experience I've wanted to separate these kinda things out into a
> couple plays, since we’re dealing with logically different
> resources(hypervisor, dns, monitoring).
>
> Full disclosure, I haven’t used any of the described modules, but I’ve
> used somewhat similar patterns with ec2, security groups, firewalld, etc.
>
> 1. Provision a machine with the vmware module, and then use a register:
> guest statement to retain some of the variables returned from the
> provisioning in a variable called guest.
>
> It looks like the vmware_guest_module has some return values, though the
> documentation doesn’t get into what sort of fields they contain:
>
> https://docs.ansible.com/ansible/latest/modules/vmware_
> guest_module.html#return-values
>
> 2. Using the nsupdate module(https://docs.ansible.
> com/ansible/2.3/nsupdate_module.html), you will likely want to pass in
> the ip address that is hopefully contained within the guest variable
> retained in the last step, and then associate it to the name that you have
> in mind.
>
> 3. It looks like theres a handful of zabbix modules to choose from here:
> https://docs.ansible.com/ansible/latest/modules/
> list_of_monitoring_modules.html#zabbix
>
> However, I’ve never used zabbix — if there’s a way that you can tell
> zabbix “monitor service-name on address: 10.0.0.1” that would be the way I
> would recommend using the abstractions that the module provides.
>
> *Note*: if you plan to do this for more than one guest, it may make sense
> to consider abstracting this process into a role, so that you can specify
> the name to provision the machines with as part of your configuration data.
>
> An admittedly rough idea of the top of my head for some role data that
> provisions a guest at 10.0.3.5 called ’newnode.example.org’ on the
> nameserver at 10.0.1.5, using a vmware host at 10.0.2.5.
>
> ---
> - tasks:
>   - name: provision and enroll guest
> include_role:
>   name: vmware-zabbix-role
> vars:
>   nameserver: ’10.0.1.5'
>   nameserver_key_secret: ‘foo_bar_baz'
>   nameserver_zone: ‘example.org'
>   nameserver_record: ’newnode’
>   vmware_host: ’10.0.2.5’
>   vmware_template: ‘base-image’
>   vmware_guest_address: ’10.0.3.5'
>
>
> Hope this helps more than confuses,
>
> -Will
>
>
> On Apr 1, 2018, at 10:08 AM, Vamberto Rocha JR 
> wrote:
>
> Hello everybody
>
> In my environment, I own VMware with vCenter, Bind as DNS server and
> Zabbix as a monitoring tool.
>
> What I would like to do with Ansible is to create a virtual machine from
> an already predefined template, add an entry in DNS, and add the VM in
> Zabbix monitoring.
>
> I know Ansible has modules for DNS, Vmware, and Zabbix, but has anyone
> done it yet?
>
> One of the many questions I have is regarding the IP address of the new
> VM, how do I change the IP address of the new VM using Ansible and already
> add in Ansible inventory?
>
> Thanks for all the 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/cf617a9c-3003-4260-a212-028d431c10b9%40googlegroups.
> com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/H2zmxuHg8oI/unsubscribe.
> To unsubscribe from this group and all its topics, 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/C59719F3-3C3C-4FC7-B04C-8B14938BEC44%40gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Att

Vamberto Rocha JR



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this 

Re: [ansible-project] Set up a check for the patching logs in the nodes

2018-04-03 Thread Kai Stian Olstad

On 03.04.2018 07:48, Shreela Roy wrote:

Hi All,

What I want to achieve here is check the log file: 12-2017PM-PATCH.log

and find for the word COMPLETED in it and return to me the output for 
each

server where I searched for the log.

What would be the syntax to put the search string in contains parameter 
and

patterns parameter. Please please help me. I tried as below, need your
guidance


I saw I wrote file module when I meant find module back in March, sorry 
about that.



---
- hosts: all
  become: true
  tasks:
- name: check the Logs to find if patching completed
  find:
paths: "/var/log"
recurse: yes
follow: True
patterns: "*PATCH.*"
#use_regex: True
contains: "*COMPLETED*"
  register: success_patch_logs
- name: print matches
  debug:
msg: "{{ success_patch_logs }}"


The contains: is regex so you need to use ".*COMPLETED.*"


--
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/b9bb1367ca8c3597eaf1b7d8b0156001%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Host lists, facts and handlers

2018-04-03 Thread Kai Stian Olstad

On 02.04.2018 17:06, Marc Haber wrote:

Hi Kai, again,

thanks for helping!

On Sun, Apr 01, 2018 at 12:14:38AM +0200, Kai Stian Olstad wrote:
After reading the documentation on add_host I don't think this is a 
but, it's just how add_host works.


The documentation says
"This module bypasses the play host loop and only runs once for all 
the hosts in the play, if you need it to iterate use a with_ 
directive."


So this is probably the case when used in handlers to, it only run 
once.


How would the code have to look like then? I am not yet proficient
enough in ansible to make immediate sense from the hint, and the
Examples only contain code building lists, not making use of them.


I would say don't use add_host it will just complicate thing for you.
You had a solution that work that you posted on this list back in 
November, why not just use that one? It didn't use add_host.



--
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/40b6bdd59a0b79b5dcf86c5b424cf481%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Host lists, facts and handlers

2018-04-03 Thread Kai Stian Olstad

On 02.04.2018 16:53, Marc Haber wrote:

On Sat, Mar 31, 2018 at 09:39:37PM +0200, Kai Stian Olstad wrote:

On Saturday, 31 March 2018 20.35.46 CEST Marc Haber wrote:
> First ansible run:
> [51/5036]mh@drop:~/git/zgansibletest (master * u+1) (crm) $ ansible-playbook 
--ask-become-pass --inventory=hosts.yml site.yml



> TASK [common : zda-sid-mc.list] 
*
> changed: [sid01]
> changed: [sid02]
>
> RUNNING HANDLER [common : apt update] 
***
> changed: [sid01]

Here is the problem, the task zda-sid-mc.list is changed on both host 
but only one of them run the handler.

Why this happen i don't know but at fist glance it looks like a bug.
What is your Ansible version?


All systems in the test setup are Debian unstable, which ansible 2.5.0.

You could also try more detailed logging to see if that gives more 
info:
  ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -vvv 
--ask-become-pass --inventory=hosts.yml site.yml


That's 98 kB, too much for this list. I have uploadd to
http://q.bofh.de/~mh/stuff/ansible-log.txt

What confuses me is that no handling of the presentsourceslistfiles
variable is logged at all.



The tasks run, but you don't see the content of the variable, you would 
need to use debug for that.
And the log show it handles both notify but only one host is added by 
add_host.



You have linked the removal of the files on the creating of 
zda-sid-mc.list, since this was created in you first run it's not 
created now, as you can see the ok status on zda-sid-mc.list task.


Have I? I don't think so. From the creation of zda-sid-mc.list, I only
notify the apt update handler which only does apt update. Building the
present/wantedsourceslistfiles is always done in the common task, and
always executed in the zzhandleapt task.

At least that's what I wanted to write. Didn't I do that?


Your task "delete source.list.d files" is on role zzhandleapt so that 
will only be run/deleted when the notify is run, and notify is on 
zda-sid-mc.list task.


If the only go is to run apt update, why don't you just notify apt 
module directly?


Create the handler as so.

  - name: apt update
apt:
  update_cache: yes

--
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/45ad3e4059d287cb0d5e4c468278e70f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Absurd run_once behavior, skipping entirely if first node fails a when test

2018-04-03 Thread James 'zofrex' Sanderson
Further note for people on older releases (2 or newer I believe, < 2.4):

You can achieve the same thing as include_tasks with include and static: 
no, like so:

- name: include for second task
  include: task.yml
  static: no
  when: inventory_hostname == 'machine-b'

Hope that helps!

On Friday, 23 March 2018 19:06:11 UTC, Alex Hunt wrote:
>
> Thank you Brian for updating the docs. That makes it much more clear.
>
> And thank you James for the workaround!!! The change to dynamic 
> include_tasks rather than the older static include statement seems to work 
> great.
>
> Note for people on older releases, you have to be running at least Ansible 
> 2.4 to have include_tasks.
>

-- 
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/5ea94eea-28ef-4956-a6c0-dcf3d198e24a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Calculate Certain Day of Month As variable

2018-04-03 Thread Gabriel Forster
Is there a way to calculate a certain day of the month and set that as a 
var?

e.g. - I need to make {{ third_tuesday }} represent the 3rd Tuesday of any 
given month.

-- 
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/67a04267-6769-4892-ba37-93e026936d23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How do you add an EC2 instance created with ec2 module to ~/.ssh/known_hosts

2018-04-03 Thread Tim Stewart
Let's say I have this ec2 task (taken from the documentation 
) in a file 
named site.yml:

# Basic provisioning example
- ec2:
  key_name: mykey
  instance_type: t2.micro
  image: ami-123456
  wait: yes
  group: webserver
  count: 3
  vpc_subnet_id: subnet-29e63245
  assign_public_ip: yes

Assuming I register the ec2 module result into a variable named 
ec2_instances, what would I do to add that single ec2 instance to my 
~/.ssh/known_hosts file so that I can easily ssh into the new instance?

I've looked at the known_hosts 
 
module and its example is:

- name: tell the host about our servers it might want to ssh to
  known_hosts:
  path: /etc/ssh/ssh_known_hosts
  name: foo.com.invalid
  key: "{{ lookup('file', 'pubkeys/foo.com.invalid') }}"

Every property makes sense to me except for the key property.  Regarding 
the lookup plugin, I don't have any file containing public keys for my new 
instance (that I know of).  What should I provide for the key property?

The documentation for the key property is:

The SSH public host key, as a string (required if state=present, optional 
> when state=absent, in which case all keys for the host are removed). The 
> key must be in the right format for ssh (see sshd(8), section 
> "SSH_KNOWN_HOSTS FILE FORMAT")


I have looked into the sshd(8) manual entry 
 and here are 
the relevant paragraphs (emphasis mine):


Each line in these files contains the following fields: markers (optional), 
hostnames, keytype, base64-encoded key, comment. The fields are separated 
by spaces.

The *keytype* and base64-encoded *key* are taken directly from the host 
key; they can be obtained, for example, from /etc/ssh/ssh_host_rsa_key.pub. 
The optional comment field continues to the end of the line, and is not 
used.


How do I get the key I need to add to the file?  This sounds like a common 
task so before I put forth potentially unnecessary effort to build my own 
solution, I thought I'd check to see if I was just missing something.

Thanks! 

-- 
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/8613a235-3942-49c7-92dd-b47eae6f6642%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] having a ssh connection failure between visual studio and ansible server. But playbook works fine between to two servers

2018-04-03 Thread workarea448
*Can any provide me what should i provide and modify in ansible server. 
even though i have given RUN PLAYBOOK details in vsts getting below error. 
please help me*

2018-03-28T23:20:19.5242922Z ##[section]Starting: Run playbook
2018-03-28T23:20:19.5305085Z 
==
2018-03-28T23:20:19.5317829Z Task : Ansible
2018-03-28T23:20:19.5330240Z Description  : This task executes an Ansible 
playbook using a specified inventory via command line interface
2018-03-28T23:20:19.5342361Z Version  : 0.0.3
2018-03-28T23:20:19.5354218Z Author   : Microsoft Corporation
2018-03-28T23:20:19.5366219Z Help : [More 
Information](https://go.microsoft.com/fwlink/?linkid=853835)
2018-03-28T23:20:19.5378646Z 
==
2018-03-28T23:20:20.0919054Z Trying to setup SSH connection to 
@10.130.2.185:22
2018-03-28T23:20:21.0208605Z 
2018-03-28T23:20:21.0222595Z PLAY [all] 
*
2018-03-28T23:20:21.0229878Z 
2018-03-28T23:20:21.0277000Z 
2018-03-28T23:20:21.0289919Z TASK [Create directories] 
**
2018-03-28T23:20:21.0296942Z 
2018-03-28T23:20:21.2567280Z failed: [10.130.2.10] 
(item=/home//myagent/) => {"item": "/home//myagent/", 
"msg": "Failed to connect to the host via ssh: Permission denied 
(publickey,password).\r\n", "unreachable": true}
2018-03-28T23:20:21.2574812Z 
2018-03-28T23:20:21.4028975Z failed: [10.130.2.10] 
(item=/home//mywork/) => {"item": "/home//mywork/", "msg": 
"Failed to connect to the host via ssh: Permission denied 
(publickey,password).\r\n", "unreachable": true}
2018-03-28T23:20:21.4036185Z 
2018-03-28T23:20:21.4051930Z fatal: [10.130.2.10]: UNREACHABLE! => 
{"changed": false, "msg": "All items completed", "results": 
[{"_ansible_ignore_errors": null, "_ansible_item_result": true, "item": 
"/home//myagent/", "msg": "Failed to connect to the host via ssh: 
Permission denied (publickey,password).\r\n", "unreachable": true}, 
{"_ansible_ignore_errors": null, "_ansible_item_result": true, "item": 
"/home//mywork/", "msg": "Failed to connect to the host via ssh: 
Permission denied (publickey,password).\r\n", "unreachable": true}]}
2018-03-28T23:20:21.4060080Z 
2018-03-28T23:20:21.4075357Z to retry, use: --limit 
@/tmp/Infrax/Agent_config.retry
2018-03-28T23:20:21.4085058Z 
2018-03-28T23:20:21.4090994Z 
2018-03-28T23:20:21.4103193Z PLAY RECAP 
*
2018-03-28T23:20:21.4109584Z 
2018-03-28T23:20:21.4121654Z 10.130.2.10: ok=0
changed=0unreachable=1failed=0   
2018-03-28T23:20:21.4127823Z 
2018-03-28T23:20:21.4133727Z 
2018-03-28T23:20:21.4139532Z 
2018-03-28T23:20:21.4531768Z ##[error]Command ansible-playbook -i 
"10.130.2.10," /tmp/Infrax/Agent_config.yaml  exited with code 4.
2018-03-28T23:20:21.5425832Z ##[section]Finishing: Run 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/ee70ed42-5d78-4020-b428-ad9a72a0678b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Installing Jenkins plugins with their dependencies

2018-04-03 Thread JiElPe-Fr38
Dear all,

I have created a jenkins role that creates a jenkins instance and add 
plugins.
The task related to plugins is as follows :

- name: Install plugins
  jenkins_plugin:
group: "{{ jenkins_process_group }}"
owner: "{{ jenkins_process_user }}"
name: "{{ item }}"
state: latest
url: "http://{{ jenkins_hostname }}:{{ jenkins_http_port }}{{ 
jenkins_url_prefix }}"
url_username: "{{ jenkins_admin_name }}"
url_password: "{{ jenkins_admin_password }}"
with_dependencies: yes

  with_items: "{{ jenkins_plugins }}"
  notify: restart jenkins
  become: True
  become_user: "{{ jenkins_process_user }}"


All variables being known from files in vars or defaults.

Plugins listed in the {{ jenkins_plugins }} list are those I actually want. 
No dependency is listed here as I was hoping that the 
with_dependencies: yes clause will install them. 

*It is absolutely not the case !*The listed plugins are installed (so there 
is no access rights or credentials problem), but the dependencies are not.
When going to the WEB UI, I have a context page that suggests me to install 
dependencies.


I can't find a way to get rid off that... If someone could help ?

Best Regards
J-L

-- 
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/7bb0d591-7110-437c-a9c5-7aa95e39a1b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible command-line like verbose > 3 using python API 2.0

2018-04-03 Thread Suren Baskaran
Hi

So when we run a ansible playbook in command line with -vvv [ verbosity=3] 
we get all these below information like "Task path" , "using module" and 
the internals of how each hosts gets connectivity established.



TASK [SHOW THE LAST 10 ALERTS ] 
**
task path: 
Using module file 
/usr/lib/python2.7/site-packages/ansible/modules/commands/command.py
 ESTABLISH SSH CONNECTION FOR USER: 
 SSH: EXEC ssh -C -o ControlMaster=auto -o 
ControlPersist=60s -o KbdInteractiveAuthentication=no -o 
PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey 
-o PasswordAuthentication=no -o User=tpeng -o ConnectTimeout=10 -o 
ControlPath=XX '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
 (255, '', 'ssh: connect to host XX port 22: 
Connection timed out\r\n')
fatal: [gmcrou07.uk.db.com]: UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: ssh: connect to 
host  port 22: Connection timed out\r\n",
"unreachable": true
}


Whereas when I set the same verbosity using the python API , I just an 
detailed info why the SSH failed to connect  like below


Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  
26 Jan 2017\r\ndebug1: Reading configuration data 
/etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 1: Applying options 
for *\r\ndebug1: /etc/ssh/ssh_config line 4: Deprecated option 
\"rhostsauthentication\"\r\ndebug1: /etc/ssh/ssh_config line 8: Deprecated 
option \"fallbacktorsh\"\r\ndebug1: /etc/ssh/ssh_config line 9: Deprecated 
option \"usersh\"\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: 
Control socket \"/home/eqops_dev/.ansible/cp/26dab4b3e8\" does not 
exist\r\ndebug2: resolving \"X\" port 22\r\ndebug2: 
ssh_connect_direct: needpriv 0\r\ndebug1: Connecting to gmcrou07.uk.db.com 
[10.236.110.107] port 22.\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug1: 
connect to address Xx port 22: Connection timed out\r\nssh: connect to 
host XX port 22: Connection timed out



but not the other details , not sure if am missing any callback settings.

ideally m thinking of a way to get the command line like verbose [ Ansible 
versions , config files , task path etc... ] with the Python API

Appreciate some help here

-- 
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/dbbf07ab-734b-4bf1-b08d-4f8edea4ae23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] ansible.parsing.yaml.objects.AnsibleUnicode error

2018-04-03 Thread Rıdvan KARATAŞ
Hi

I'm using ansible 2.5.0 

When I'm trying to deploy a service it gives me this error: 


ansible.parsing.yaml.objects.AnsibleUnicode object' has no attribute 'ipv4'

I couldn't find much more relevant according to this

any suggestions ?

-- 
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/6071a45f-df61-42c8-9b7a-04766048642d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: EOF occurred in violation of protocol

2018-04-03 Thread chanond
This is my verbose output

TASK [Gathering Facts] 
**
task path: /mnt/c/ansible/test.yml:1
Using module file 
/home/xx/.local/lib/python2.7/site-packages/ansible/modules/windows/setup.ps1
<192.168.6.1> ESTABLISH WINRM CONNECTION FOR USER:  on PORT 5986 TO 
192.168.6.1
checking if winrm_host 192.168.6.1 is an IPv6 address
<192.168.6.1> WINRM CONNECT: transport=ssl 
endpoint=https://192.168.6.1:5986/wsman
<192.168.6.1> WINRM CONNECTION ERROR: 
HTTPSConnectionPool(host='192.168.6.1', port=5986): Max retries exceeded 
with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF occurred in 
violation of protocol (_ssl.c:590)'),))
Traceback (most recent call last):
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/ansible/plugins/connection/winrm.py",
 
line 345, in _winrm_connect
self.shell_id = protocol.open_shell(codepage=65001)  # UTF-8
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/winrm/protocol.py", line 
157, in open_shell
res = self.send_message(xmltodict.unparse(req))
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/winrm/protocol.py", line 
234, in send_message
resp = self.transport.send_message(message)
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/winrm/transport.py", 
line 256, in send_message
response = self._send_message_request(prepared_request, message)
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/winrm/transport.py", 
line 261, in _send_message_request
response = self.session.send(prepared_request, 
timeout=self.read_timeout_sec)
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/requests/sessions.py", 
line 618, in send
r = adapter.send(request, **kwargs)
  File 
"/home/chanondw/.local/lib/python2.7/site-packages/requests/adapters.py", 
line 506, in send
raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='192.168.6.1', port=5986): Max retries 
exceeded with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF occurred 
in violation of protocol (_ssl.c:590)'),))



On Tuesday, April 3, 2018 at 3:06:07 PM UTC+7, cha...@salweensolutions.com 
wrote:
>
> I am setting up ansible on a new device using the following step.
>
> Machine setup: Windows 10 with WSL enabled
>
> sudo apt-get-y install python-pip python-dev libffi-dev libssl-dev
> pip install ansible --user
> echo `PATH=$HOME/.local/bin:$PATH` >> ~/.bashrc
> pip install "pywinrm>=0.2.2"
>
> I wrote a simple win_ping module with the correct username and password. 
> It is returning this error
>
> fatal: [192.168.6.1]: UNREACHABLE! => {
>>
>>"changed": false,
>>
>>"msg": "ssl: HTTPSConnectionPool(host='192.168.6.1', port=5986): Max 
>>> retries exceeded with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF 
>>> occurred in violation of protocol (_ssl.c:590)'),))",
>>
>>"unreachable": true
>>
>> }
>>
>>
> I'm not sure what I'm doing wrong. My other machine which I also setup 
> using the same credentials with similar steps is currently working fine. 
> Please 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/f632817e-5f99-4d14-afce-40a3bbde085c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] EOF occurred in violation of protocol

2018-04-03 Thread chanond
I am setting up ansible on a new device using the following step.

Machine setup: Windows 10 with WSL enabled

sudo apt-get-y install python-pip python-dev libffi-dev libssl-dev
pip install ansible --user
echo `PATH=$HOME/.local/bin:$PATH` >> ~/.bashrc
pip install "pywinrm>=0.2.2"

I wrote a simple win_ping module with the correct username and password. It 
is returning this error

fatal: [192.168.6.1]: UNREACHABLE! => {
>
>"changed": false,
>
>"msg": "ssl: HTTPSConnectionPool(host='192.168.6.1', port=5986): Max 
>> retries exceeded with url: /wsman (Caused by SSLError(SSLEOFError(8, u'EOF 
>> occurred in violation of protocol (_ssl.c:590)'),))",
>
>"unreachable": true
>
> }
>
>
I'm not sure what I'm doing wrong. My other machine which I also setup 
using the same credentials with similar steps is currently working fine. 
Please 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/4f557d22-0e8a-462a-8def-48166c570f97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.