[ansible-project] Unable to grant privileges using mysql_user module

2016-11-02 Thread Mona Gopal
Hi, I am trying to create a mysql user 'webaxnuser' and grant privileges to it. Below is the task to do the same. *- name: create use with all priv* * mysql_user: login_user=root login_password=pass login_host=188.16.2.3 host=% name=webaxnuser password=Webaxn@123 priv=*.*:ALL state=present*

Re: [ansible-project] Changes to when and conditionals in Ansible 2.2

2016-11-02 Thread Matt Martz
If you read a little further down, under the "Loops and Conditionals"[1] this information is present: Combining when with with_items (see Loops), be aware that the when > statement is processed separately for each item... If you need to skip the > whole task depending on the loop variable being

Re: [ansible-project] Changes to when and conditionals in Ansible 2.2

2016-11-02 Thread Dan Lang
Thanks for the info Matt. The Ansible docs, http://docs.ansible.com/ansible/playbooks_conditionals.html, indicate this is should work as before. Specifically, > > If a required variable has not been set, you can skip or fail using > Jinja2’s defined test. For example: > > tasks: > -

Re: [ansible-project] failed_when - multiple conditions

2016-11-02 Thread edrozenberg
I just hit this issue (two years after you did) and the reply to my issue was that Ansible list syntax does an implicit AND on the multiple conditions, not OR, contradicting what Michael DeHaan wrote above earlier. I'm asking the Ansible project to document this somewhere, not obvious at all.

Re: [ansible-project] Changes to when and conditionals in Ansible 2.2

2016-11-02 Thread Matt Martz
In 2.1 this would have been a deprecation warning. What you need is something like: with_items: "{{ existing_rules.files | default([]) | map(attribute='path') | list }}" That gives existing_rules.files a default of an empty list. Also off note here, is that `when` statements are processed for

[ansible-project] Changes to when and conditionals in Ansible 2.2

2016-11-02 Thread Dan Lang
I'm testing existing roles and playbooks against Ansible 2.2, and I've noticed that several roles that I have written that take advantage of "when: variable is defined" or "when: variable is undefined" in tasks no longer work. This happens when a variable is used from a previous task, but is

Re: [ansible-project] Retaining double-quotes in resulting file created from template

2016-11-02 Thread Uwe Sauter
Putting single quotes around should solve this. host_ip = '"http://{{ ansible_default_ipv4.address }}"' Regards, Uwe Am 02.11.2016 um 21:04 schrieb ZillaYT: > I have a template that does has this line > > | > host_ip ="http://{{ ansible_default_ipv4.address }}" > | > > which results

[ansible-project] Retaining double-quotes in resulting file created from template

2016-11-02 Thread ZillaYT
I have a template that does has this line host_ip = "http://{{ ansible_default_ipv4.address }}" which results into a line in the dest file that has, for example host_ip = http://10.10.10.10 However, how do modify the template so I retain the "" in the resulting file, so it looks like this

[ansible-project] Re: Escape space in Windows directory path in playbook

2016-11-02 Thread trey perrone
First check your version of Ansible as some older version may have had some bugs with spaces in paths. I'd think you need to quote around the path itself. using strict yaml i think ive done it dest: 'C:\Documents and Settings\All Users\Start Menu\Windows Update.lnk' or if you go with

Re: [ansible-project] Using ansible for software deployments – are we doing it right?

2016-11-02 Thread Dick Davies
I'd enable a profiler first (on Ansible 2.x just add [defaults] callback_whitelist = profile_tasks to ansible.cfg in the playbook directory ) With a bit of work you can really drive down play times. a few tips (obviously may not all apply to you). * use RPMs / Debs over tarballs for installs,

[ansible-project] openstack instance creation

2016-11-02 Thread Javier Rojas
Hi, this is my first playbook, so please be gentle (I'm pretty sure I've depleted my google searches for 1 month) I'm trying to create an image with the os_server module *$cat tasks/main.yml name: create instance os_server:state: presentauth: auth_url: " {{

[ansible-project] Re: Using ansible for software deployments – are we doing it right?

2016-11-02 Thread Vince Skahan
On Wednesday, November 2, 2016 at 8:52:54 AM UTC-7, fredsted wrote: > The whole process when deploying new code takes around 10 minutes, which > my coworkers think is really *slow*. (obviously, on each node, it pulls > down code from git, installs all the dependencies every time as well as >

[ansible-project] Patch Recap -- Can we access the PLAY RECAP data?

2016-11-02 Thread johhue
Hello, I am running a playbook and would like to know the name of the object where I can access the PLAY RECAP statuses/return code. For example here: PLAY RECAP * host1 : ok=10 changed=3unreachable=0failed=0 host2 :

[ansible-project] Re: Using ansible for software deployments – are we doing it right?

2016-11-02 Thread Dan Lang
Have you profiled, https://github.com/jlafon/ansible-profile, your Ansible executions to find out where the largest bottlenecks are? I would start there. Once you know where your process is slowest and why, you can better attack the problem You might be able to speed up the process by having

Re: [ansible-project] Re: How to get fetch files from non-inventory servers ?

2016-11-02 Thread Brian Coca
You can use fetch module with delegate_to that server, you might also need to set other connection parameters on that task. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop

[ansible-project] Re: A question about the S3 Lifecyle module

2016-11-02 Thread Bryan Hiestand
Unless things have changed recently, AWS S3 lifecycle policies do not support arbitrary exclude rules. So the lifecycle module will not be able to provide this functionality. Lifecycle policies can match dates and prefixes. To make use of lifecycles policies, you should use prefixes in a way

[ansible-project] Re: How to get fetch files from non-inventory servers ?

2016-11-02 Thread kapil
Could have done this, but simple sftp doesnt work with password provided over command line. needs another layer of ssh-pass / expect-send I am missing scp with username/password. Last thing I can try discussing with end users is instead of user/password ... gather all public keys of

[ansible-project] Issues with 'when' filter on with_items loop

2016-11-02 Thread Jon Langemak
Hi All, been tearing my hair out this AM on this one so I think Im just doing something wrong. Long story short, I have two lists in my playbook. One that contains a set of commands from a device and another that contains the set of commands I wish to configure. What I'd like to do is diff

[ansible-project] Escape space in Windows directory path in playbook

2016-11-02 Thread Tim
Hi, I want to copy some files to the Startup folder using "win_copy". The problem is, that the destination directory is "dest=C:/ProgramData/Microsoft/Windows/Start Menu/Programs/StartUp/link.lnk" which has a space between "Start" and "Menu". I tried to escape that with quotation marks, but

[ansible-project] Using ansible for software deployments – are we doing it right?

2016-11-02 Thread fredsted
Hi, We are using ansible to provision new servers, as well as deploy new code on those servers. We run the same playbook when provisioning a new server and deploying code (we just run it on all servers) The whole process when deploying new code takes around 10 minutes, which my coworkers

[ansible-project] Re: Long running install task sometimes fails with ssh broken pipe issue

2016-11-02 Thread prathyush r
HI , Please check if you have any firewall or selinux enabled on the target On Wednesday, 2 November 2016 17:02:47 UTC+5:30, Deepa Yr wrote: > > Hi > > I have a task which installs my product. Installation takes couple > of hours to complete. Sometimes the task completes fine.

[ansible-project] How to ignore a variable if it's not defined

2016-11-02 Thread Sam Sen
I have a var file with mount points that should be mounted. A common entry for /home goes on all servers. Some servers (e.g. web and perl) have their own set of mount points. I'm using Ansible pull and I build the element dynamically. So for webs, I reach in by using "aws_mounts[nfs_group]",

[ansible-project] Re: Ansible and PCI DSS Compliance

2016-11-02 Thread Simon Young
Thanks Duncan. That's pretty much the way we have our setup at the moment. There's an ssh key, and a sudo su command, and another ssh key passphrase to get past before anyone can run any playbooks. So I think that satisfies the two-factor authentication requirement for CDEs. The problem I can

[ansible-project] Re: How to get fetch files from non-inventory servers ?

2016-11-02 Thread Mehdi B
You can use shell/command modules to make an sftp. What's the issue here? You can do another dirty trick use delegate to switch server but that would require the server already in inventory. So I would use shell module and run my scp the old way. M B On Wednesday, November 2, 2016 at 3:10:17

[ansible-project] Re: Ansible 2.2.0 Final has been released!

2016-11-02 Thread Mehdi B
Awesome to see role_include. I had to do that in a dirty mode including the main task and the vars from the role I wanted to include in another role. Great to see ansible 2.2.0 released. M B On Tuesday, November 1, 2016 at 2:55:28 PM UTC+1, James Cammarata wrote: > > Hi all, we're very happy

Re: [ansible-project] How to get fetch files from non-inventory servers ?

2016-11-02 Thread Dick Davies
There'd be no harm in putting the server in the inventory ( with ansible_ssh_user set to the restricted user) if you want to take advantage of the built-in mechanisms. Nothing says everything in the inventory has to be actively managed by Ansible. Pull the file locally at the start of the play