I think what you're asking for can be found by looking at the example for "By
specifying a network range as a query, you can check if a given value is in
that range:" in the docs.
An example playbook:
---
- hosts: localhost
connection: local
tasks:
- debug:
msg: belongs
Hi,
There are some great examples on the ipaddr filter's documentation page:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html#playbooks-filters-ipaddr
Yes, one of the things you can do is check to see if an IP belongs to a
subnet.
On Mon, Jun 15, 2020 at 5:27 PM
Yes, you must have the netaddr python library installed on your controller.
Read the first few sentences here:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html
On Sun, Jun 14, 2020 at 12:13 PM Tony Wong wrote:
> any idea what this error is?
>
>
> TASK
The 'check if reboot is required' tasks were both skipped, resulting in
'reboot_required' not being defined.
On Wed, Oct 10, 2018 at 1:56 PM 'Chris Bidwell - NOAA Federal' via Ansible
Project wrote:
> Hey all,
>
> take a look at this and lemme know where I'm hosed at. The errors are a
> bit
dest:/etc/... --> dest=/etc/...
On Fri, Aug 5, 2016 at 7:12 AM Kiran Patil
wrote:
>
> Hello,
>
> Can someone help on this ?
>
>
> I am getting err
>
>
> failed: [xxx01] => {"failed": true}
> msg: src (or content) and dest are required
>
> FATAL: all hosts have
Sounds like an indentation issue. It should be at the same level as
'ec2_snapshot', not the keys underneath it.
On Thu, Jul 14, 2016 at 12:53 PM Joanna Delaporte
wrote:
> I am using the ec2_snapshot module to make a snapshot of a volume. In the
> next task, I want to
It means that the task will run if it does find the string 'reboot' in the
stdout of the registered reboot_hint variable. It's just calling this:
https://docs.python.org/2/library/string.html#string.find
On Tue, Aug 4, 2015 at 6:44 AM Arbab Nazar arbabna...@gmail.com wrote:
Hi Everyone, I have
What's the output of python -c 'import platform; print platform.dist()'
executed on the target (ec2-54-237-72-83.compute-1.amazonaws.com)?
On Tue, Jul 21, 2015 at 10:26 AM Bob Brown b...@timevest.com wrote:
Thanks.
Logged an Issue a few days ago at:
As with Tom, I too use the 'in' keyword for substring compares. That said,
the reason why your 'when' is failing is because .find(str) is returning
the index into the string where the match (if found) begins. In your case,
it should be returning 20 for a successful match. For no match, it will
Do you have a valid FQDN entry in /etc/hosts? Without that, the setup
module slows down considerably.
On Mon, Nov 3, 2014 at 7:24 AM, Michael DeHaan mich...@ansible.com wrote:
Hmm, that's quite curious and not something I've heard reported much.
There's also not much logic to get stuck in a
FWIW, I too saw SIGHUPs as noted in this issue:
https://github.com/ansible/ansible/issues/3063
My resolution? I just patched supervisord to handle it better (now fixed
in later releases), so your best bet may to find a workaround.
On Wed, Oct 15, 2014 at 8:03 AM, John Favorite
You want when: restart_supervisor|changed. See:
http://docs.ansible.com/playbooks_variables.html#filters-often-used-with-conditionals
However, by registering the variable each time, you're not going to get the
behavior you're after. If the first task changes, but the second two do
not, I don't
You may want something like this (untested):
{% for host in groups['fusemq'] %} tcp://{{ host }}{% if not loop.last %},
{% endif %}{% endfor %}
On Thu, Jun 26, 2014 at 9:43 AM, jepper jespm...@gmail.com wrote:
Will that not generate a list as follows
fusemq01, fusemq02
it does not take
In my application, I create a user specific crontab entry in
/etc/cron.d/user. I then use the lineinfile module to set HOME=/tmp
(insertbefore=BOF). From there on out, when using the cron module, I
specify cron_file=/etc/cron.d/user.
I think that'd work for your case...
On Thu, Jun 26, 2014
Well, for starters, you're talking about installing openjdk-7, but your
playbook is targeting openjdk-6... Typo?
On Thu, Jun 19, 2014 at 9:05 AM, Patrick S noyb...@gmail.com wrote:
Hi,
I'm trying to install openjdk-7-jdk on Ubuntu 14.04, however I'm running
into a problem:
When I run my
Similarly, don't forget the shebang line at the top of your inventory
script. e.g. '#!/usr/bin/env python`
On Wed, Jun 11, 2014 at 12:45 PM, Serge van Ginderachter
se...@vanginderachter.be wrote:
Sounds like you forgot to
chmod +x hosts.py
On 11 June 2014 20:13, Pierre Masci
This is something I'd be quite interested in as well. All of our private
data is stored via ansible-vault, but then it winds up being displayed in
plain text as the playbook executes. In a slightly contrived example, I've
got an encrypted users.yml file that has user passwords. In my playbook,
Just a guess, but since both users are pointing at the same home dir, but
have different UID/GIDs, is it possible that ansible is chowning
'/home/sftp' ? Although if that were the case, I'd expect both the tasks
in subsequent runs to report as 'changed'...
On Wed, May 28, 2014 at 9:56 AM, Brian
Is SSH running on port 2200? The output is showing that the connection is
refused, implying that it's not.
On Thu, Apr 17, 2014 at 9:23 AM, Daniel Charbonneau
novo.charbonnea...@gmail.com wrote:
Hi, I'm trying to do perform a very basic hello world with a server, and
I'm receiving an error
Is the 'basename' filter what you're looking for?
http://docs.ansible.com/playbooks_variables.html#other-useful-filters
On Tue, Apr 1, 2014 at 1:53 PM, hindenburg sharrukinjoseph...@gmail.comwrote:
I'm parsing a variable and am trying to see if it's possible to get the
substring to the right
Change to default('localhost').
On Fri, Feb 21, 2014 at 12:56 PM, anatoly techtonik techto...@gmail.comwrote:
I try to set default value for hosts field in playbook with Jinja2 filter,
but it doesn't work:
---
- hosts: {{ host | default(localhost) }}
tasks:
- name: show OS version
Kesten,
Have you tried 'extra_args=--upgrade --no-use-wheel' ?
On Tue, Feb 18, 2014 at 3:16 PM, Michael DeHaan mich...@ansible.com wrote:
Can you please file a github ticket on this?
Thanks!
On Tue, Feb 18, 2014 at 5:14 PM, Kesten Broughton
solarmobiletrail...@gmail.com wrote:
This
See the FAQ about accessing information about other hosts:
http://www.ansibleworks.com/docs/playbooks_variables.html#id22
On Fri, Dec 13, 2013 at 7:53 AM, Мишка Карташов flash...@gmail.com wrote:
Hello!
I have two servers. For example, srv1 and srv2.
I need to provide IP address srv1 in
23 matches
Mail list logo