Re: [ansible-project] Python Annoying error when connecting to target machines

2017-05-02 Thread Anthony Youssef
Hi, yeah, but is it possible to execute ansible on remote hosts using python located on a shared location , python should be installed on these remote hosts? I am asking thia to prevent install python on this big number of machines.. On Tuesday, May 2, 2017 at 10:09:40 PM UTC+3, Dick Davies wro

[ansible-project] Using lookup plugin to check SHA512 password hash

2017-05-02 Thread The Gripmaster
In my Ansible git repo, I have a var file with contents like this vault_users: alex: password: $1$zMcbvpnN$DxP/LRsINODRkBxG0Kz4.1 danny: password: $1$zMcbvpnN$DxP/LRsINODRkBxG0Kz4.1 gary: password: $1$zMcbvpnN$DxP/LRsINODRkBxG0Kz4.1 Now, I want to check if the password hashes fr

Re: [ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread Suporter
The error was: 'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'path'\ On Wednesday, May 3, 2017 at 8:32:23 AM UTC+5:30, Suporter wrote: > > and i need to call item.filename and item.path? i tried it , but it does > not work > > On Wednesday, May 3, 2017 at 5:22:07 AM UTC+

Re: [ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread Suporter
and i need to call item.filename and item.path? i tried it , but it does not work On Wednesday, May 3, 2017 at 5:22:07 AM UTC+5:30, Matt Martz wrote: > > It may be enough to do: > > with_items: "{{ exepath.results|map(attribute='files') }}" > > > On Tue, May 2, 2017 at 4:40 PM 'J Hawkesworth' vi

Re: [ansible-project] Re: NOOB needs help with small ansible script.

2017-05-02 Thread Paul Markham
Your indentation is still all over the place. Try: --- - hosts: all tasks: - name: Installs splunk action: shell wget -O /tmp/splunk.rpm http://example.com/file - name: change file ownership file: path=/tmp/splunk.rpm owner=root mode=0700 -- You receiv

Re: [ansible-project] Re: NOOB needs help with small ansible script.

2017-05-02 Thread Paul Markham
Your indentation is still all over the place. Try: --- - hosts: all tasks: - name: Installs splunk action: shell wget -O /tmp/splunk.rpm http://example.com/file - name: change file ownership file: path=/tmp/splunk.rpm owner=root mode=0700 -- You received

Re: [ansible-project] Re: NOOB needs help with small ansible script.

2017-05-02 Thread Paul Markham
Your indentation is still all over the place. Try: --- - hosts: all tasks: - name: Installs splunk action: shell wget -O /tmp/splunk.rpm http://example.com/file - name: change file ownership file: path=/tmp/splunk.rpm owner=root mode=0700 -- You recei

Re: [ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread Matt Martz
It may be enough to do: with_items: "{{ exepath.results|map(attribute='files') }}" On Tue, May 2, 2017 at 4:40 PM 'J Hawkesworth' via Ansible Project < ansible-project@googlegroups.com> wrote: > It would be worth showing the tasks in your playbook too, as well as the > output. > > Worth experim

Re: [ansible-project] Ansible asks for SSH passphrase if private key is encrypted by vault

2017-05-02 Thread Matt Martz
Ansible has no current support for connecting to hosts with a vault encrypted ssh key. See the following PR where support may potentially be added: https://github.com/ansible/ansible/pull/22764 On Tue, May 2, 2017 at 5:41 PM Anthony Cheng wrote: > Anyone using ansible vault to encrypt ssh priva

[ansible-project] Ansible asks for SSH passphrase if private key is encrypted by vault

2017-05-02 Thread Anthony Cheng
Anyone using ansible vault to encrypt ssh private key? Seems like it will always prompt for passphrase if the key file is encrypted. If the key is not encrypted by vault then it works as is; ansible.cfg has the configuration for the vault passphrase file. Also in my case the ssh file does not h

[ansible-project] win_acl and Windows domain accounts

2017-05-02 Thread 'J Hawkesworth' via Ansible Project
Try user: DEV.LOCAL\ansible Instead of the ansible@DEV.LOCAL syntax. If that doesn't work, ugly workaround is to use win_shell to run icacls.exe If i recall there are some fixes for this module (although not necessarily for the issue you describe) on github, so if you have the capacity to test

[ansible-project] Re: Not able to connect to windows machine using Ansible.

2017-05-02 Thread Jordan Borean
>From the error message it seems like the WinRM endpoint is not enabled on the remote server hence the Failed to establish a new connection error. Try and use this script to set up the WinRM endpoint on your server https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/Configu

[ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread 'J Hawkesworth' via Ansible Project
It would be worth showing the tasks in your playbook too, as well as the output. Worth experimenting with debug. Also it might be worth trying the json_path filter (see the Filters page on the documentation site) as this can reduce complex json into simpler structures. Hope this helps, Jon --

Re: [ansible-project] Whats your favourite YAML/YML editor

2017-05-02 Thread 'J Hawkesworth' via Ansible Project
Bash on windows's vi (basically Ubuntu) does yaml syntax highlighting out of the box, althoughi find it a lot easier to read if you change the text to black and the background to white. Notepad++ also yaml aware. Sometimes I use yamllint.com too. Jon -- You received this message because you a

[ansible-project] "kerberos: (u'http', u'Bad HTTP response returned from server. Code 500'), plaintext: the specified credentials were rejected by the server"

2017-05-02 Thread 'J Hawkesworth' via Ansible Project
Id suggest switching to port 5986 which is the https winrm listener port too. If you have run the configure for remoting script successfully that should work. Also, use ansible 2.3 as it has built in support for acquiring Kerberos (active directory) tickets. You still need to configure your krb

[ansible-project] Re: How to install exe file on windows using ansible , e.g. firefox.exe

2017-05-02 Thread 'J Hawkesworth' via Ansible Project
I suggest you try to find any command line options that log the installation to a file. That way maybe you can find out what point the installer has stopped working. Some installers expect to have the windows graphical user interface available, so it is worth checking to see if there is a /quie

[ansible-project] "kerberos: (u'http', u'Bad HTTP response returned from server. Code 500'), plaintext: the specified credentials were rejected by the server"

2017-05-02 Thread Jordan Borean
WinRM is an annoying mechanism with very unhelpful error messages so this could potentially be a few things that could be causing your issue. The first thing is that pywinrm doesn't play nice wth HTTP end points unless you disable the majority of the security configurations like AllowUnencrypt

Re: [ansible-project] get value from command line in playbook

2017-05-02 Thread Jordan Borean
Add a variable in your group vars for the environment you are targeting, e.g. Have a structure like group_vars/ prd.yml - variables for your production environment uat.yml - variables for your uat environment sit.yml - variables for your sit environment app.yml - application varia

Re: [ansible-project] Common group_by's or include a setup play before running playbook

2017-05-02 Thread Brian Coca
Soon, first need to merge this https://github.com/ansible/ansible/pull/23001, which then makes this possible https://github.com/ansible/ansible/pull/23374 (but you'll need fact caching enabled). -- Brian Coca -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] get value from command line in playbook

2017-05-02 Thread Dick Davies
There probably is a way to hack it (e.g. inventory_file minus inventory_dir , see http://stackoverflow.com/questions/18839509/where-can-i-get-a-list-of-ansible-pre-defined-variables ) but I've done this myself by just setting a common variable in inv/*/group_vars/all and referencing that.

Re: [ansible-project] Python Annoying error when connecting to target machines

2017-05-02 Thread Dick Davies
It looks like your install of Python isn't complete, or you're missing some required env. vars. Back to your UNIX team? On 2 May 2017 at 18:24, Anthony Youssef wrote: > Hi, > > > i am facing an error that is blocking my work on ansible. i am trying to > connect from my control machine to a big n

Re: [ansible-project] "hash_behaviour = merge" issue

2017-05-02 Thread Kai Stian Olstad
On 02. mai 2017 16:01, Tim Clark wrote: Hi, I would like to build up a variable from defaults, group_vars and host_vars - but hash_behaviour doesn't seem to be working as I'd expect it to. The plan is to have a default config (in this case haproxy) and then allow additional frontends to be defi

[ansible-project] Common group_by's or include a setup play before running playbook

2017-05-02 Thread Fredrik Rambris
I want to have a way to globally define OS dependent variables. I currently am doing this with something like this at the top of my playbooks - name: Gather facts hosts: the_hosts_we_are_applying_playbook_on tags: always tasks: - group_by: key: os_family_{{ ansible_os_family | l

[ansible-project] "hash_behaviour = merge" issue

2017-05-02 Thread Tim Clark
Hi, I would like to build up a variable from defaults, group_vars and host_vars - but hash_behaviour doesn't seem to be working as I'd expect it to. The plan is to have a default config (in this case haproxy) and then allow additional frontends to be defined at group and host_var level. I've

[ansible-project] win_chocolatey fails to install software

2017-05-02 Thread Thorin Oakenshield
Hello, i'm very new to ansible. I have been trying to install software with chocolatey and am having no luck. The very basic task I have is just - win_chocolatey: name: git name: git and throws this error fatal: [x.x.x.x]: FAILED! => { "changed": false, "choco_error_cmd": "

[ansible-project] Python Annoying error when connecting to target machines

2017-05-02 Thread Anthony Youssef
Hi, i am facing an error that is blocking my work on ansible. i am trying to connect from my control machine to a big number of hosts to execute remote commands (around 1000 hosts). some of these target hosts didn't have python2.6 installed under /usr/bin/python, thus i was not able to conn

[ansible-project] "kerberos: (u'http', u'Bad HTTP response returned from server. Code 500'), plaintext: the specified credentials were rejected by the server"

2017-05-02 Thread Allen Fisher
Hi All-- I'm running into an issue connecting from an Ubuntu 16.04 system to a Windows 2012 Server on a domain: afisher@ubuntu:~/Projects/build-utils/ansible-playbooks$ ansible windows -i > inventory.yml -m win_ping - > Using /etc/ansible/ansible.cfg as config file > Loading callback plugin

[ansible-project] Re: yaml syntax is extremely annoying

2017-05-02 Thread Allen Fisher
The your directory operations would each be their own play. - name install jdk #stuff - name: remove kafka src directory shell: -name: create kafka src directory file: ... etc. Ansible plays do one thing at a time. On Tuesday, May 2, 2017 at 10:58:44 AM UTC-5, madha...@gmail.com wrote:

[ansible-project] get value from command line in playbook

2017-05-02 Thread 'Anand Dasari' via Ansible Project
Hi is there anyway i can get value from command line arguments for eg., my command line is ansible-playbook -i inv/sit1 playbooks/sit1/test.yml in test.yml i want to capture the value from inv/sit1 as sit1, -- You received this message because you are subscribed to the Google Groups

Re: [ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread Matt Martz
It would be best to show the tasks you have that are failing, otherwise we are just guessing Also using the debug module on your registered variable can help you determine the structure. On Tue, May 2, 2017 at 1:13 PM Suporter wrote: > this is seriously annoying, i keep getting different error

[ansible-project] Re: How to use results of find and win_find

2017-05-02 Thread Suporter
this is seriously annoying, i keep getting different errors every time {"failed": true, "msg": "'list object' has no attribute 'files'"} How do we pick the right attribute from win_find On Tuesday, May 2, 2017 at 7:13:33 PM UTC+5:30, Suporter wrote: > > Hello, >How to use results of find and

Re: [ansible-project] Whats your favourite YAML/YML editor

2017-05-02 Thread Rajesh Martha
I use Microsoft Visual Studio Code, https://code.visualstudio.com/ On Monday, May 1, 2017 at 3:58:32 PM UTC-5, Josh Smift wrote: > > I use Emacs, and recently found https://github.com/yoshiki/yaml-mode; it > seems pretty good. > > -Josh (j...@care.com ) >

Re: [ansible-project] Re: yaml syntax is extremely annoying

2017-05-02 Thread Brian Coca
The - is the indicate for a task, tasks: is a 'list of tasks', - is 'list item', you do NOT have multiple modules/actions per task, you have 1 per task. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe fr

Re: [ansible-project] Re: yaml syntax is extremely annoying

2017-05-02 Thread madhan0618
Splitting it seems to work. thanks a ton. I have other playbooks where i call more than one module from a task and wonder how that works here is another play book that works - name: get list of zookeeper hostnames hosts: zookeeperServers tasks: #- debug: msg="{{ inventory_hostname }}" #-

Re: [ansible-project] Re: yaml syntax is extremely annoying

2017-05-02 Thread Matt Martz
A task can only include a call to a single module. They have a 1 to 1 relationship. You would need to break up `Install kafka` up into 4 tasks, 1 for each: shell, file, copy, command On Tue, May 2, 2017 at 11:49 AM, wrote: > Accodring to online yaml validator, the below passes syntax validati

[ansible-project] Re: yaml syntax is extremely annoying

2017-05-02 Thread madhan0618
Accodring to online yaml validator, the below passes syntax validation and yet ansible throws an error. - name: Install jdk become: yes become_method: sudo become_user: root shell: rm -rf /tmp/kafka-src file: path=/tmp/kafka-src state=directory copy: src={{ BuildSrvPkgLo

[ansible-project] yaml syntax is extremely annoying

2017-05-02 Thread madhan0618
i had a play like this - name: Install jdk become: yes become_method: sudo become_user: root command: rpm -ivf /tmp/kafka-src/{{ jdkInstaller }} when: "'oraclejdk' not in is_jdkInstalled.stdout" i wanted to add directory delete, directory create and file copy - name: Ins

[ansible-project] How to use results of find and win_find

2017-05-02 Thread Suporter
Hello, How to use results of find and win_find, i am registering the output of this to some variable, but should i trigger a task based on this var | changed? or some other condition? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To un

[ansible-project] Why does vmware_guest_facts require a datacenter parameter?

2017-05-02 Thread MKPhil
As per http://docs.ansible.com/ansible/vmware_guest_facts_module.html (and my own testing) the vmware_guest_facts module requires a "datacenter" parameter, however, the example given on that page does not include it. To me, it doesn't seem necessary given either the name or uuid of the VM. Ev

Re: [ansible-project] how to make cron module for running ansible playbooks

2017-05-02 Thread Paul Tötterman
> > I was able to see the job by typing "crontab -e".But it is not working.Is > the job which i gave there is in the right way > Have you tried: crontab -l -u root Try changing the user. Which remote_user are you using? Cheers, Paul -- You received this message because you are subscribe

Re: [ansible-project] New to Ansible - need to pull hostname and ip from facts for template.

2017-05-02 Thread Dick Davies
You can iterate over the group and access hostvars['server name']. Assuming your backends are in a group called 'backends' something like this should work: {% for host in groups['backends'] %} {% set h = hostvars[host] %} server name {{ h.name }} {{ h.ip }} check {% endfor %} On 1 May 2017 at

Re: [ansible-project] how to make cron module for running ansible playbooks

2017-05-02 Thread acharya tejaswi indurthi
I was able to see the job by typing "crontab -e".But it is not working.Is the job which i gave there is in the right way. On Monday, May 1, 2017 at 6:50:35 PM UTC+5:30, Dick Davies wrote: > > If you can see the job, then Ansible has done its bit. You need to look > at the job itself now. > > On

Re: [ansible-project] I want auto script,but something error

2017-05-02 Thread Dick Davies
The error is probably because of this line: remote_user" chtadm But you should turn off the remote_user: root in the vault if you don't want to SSH directly as root. On 27 April 2017 at 04:57, 王慧勳 wrote: > my centos deny remoteroot login and how can i improve > it my code > - hosts: 192.168.3