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*
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
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:
> -
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.
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
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
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
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
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
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,
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: " {{
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
>
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 :
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
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
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
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
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
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
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
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.
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]",
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
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
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
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
26 matches
Mail list logo