Re: [ansible-project] ipaddr cidr_lookup

2020-06-15 Thread Scott Sturdivant
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

Re: [ansible-project] ipaddr cidr_lookup

2020-06-15 Thread Scott Sturdivant
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

Re: [ansible-project] The ipaddr filter requires python's netaddr be installed on the ansible controller"

2020-06-14 Thread Scott Sturdivant
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

Re: [ansible-project] Ansible Reboot Check

2018-10-10 Thread Scott Sturdivant
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

Re: [ansible-project] ERR : msg: src (or content) and dest are required

2016-08-05 Thread Scott Sturdivant
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

Re: [ansible-project] ec2_snapshot module - how to get snapshot id of newly created snapshot?

2016-07-14 Thread Scott Sturdivant
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

Re: [ansible-project] find command ambiguity

2015-08-04 Thread Scott Sturdivant
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

Re: [ansible-project] Getting an undefined variable error in galaxy-role geerlingguy.repo-epel

2015-07-21 Thread Scott Sturdivant
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:

Re: [ansible-project] Help me understand 'when:' conditionals. Cause I seem to fumble with them quite frequently.

2014-12-30 Thread Scott Sturdivant
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

Re: [ansible-project] ansible -m setup takes extra 2 min on Fedora 20

2014-11-03 Thread Scott Sturdivant
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

Re: [ansible-project] SIGHUP sent using ansible ?

2014-10-15 Thread Scott Sturdivant
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

Re: [ansible-project] error on change notify

2014-09-09 Thread Scott Sturdivant
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

Re: [ansible-project] for loop in template how do I avoid trailing comma on last iteration?

2014-06-26 Thread Scott Sturdivant
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

Re: [ansible-project] setting PATH in user crontab

2014-06-26 Thread Scott Sturdivant
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

Re: [ansible-project] {changed: false} on apt install, but install works fine when SSH'd in manually.

2014-06-19 Thread Scott Sturdivant
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

Re: [ansible-project] python Dynamic Inventory won't work: it is interpreted as a .ini file

2014-06-11 Thread Scott Sturdivant
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

Re: [ansible-project] Re: Remove task loop item from output

2014-06-10 Thread Scott Sturdivant
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,

Re: [ansible-project] User add playbook question - something is wrong and I don't know what

2014-05-28 Thread Scott Sturdivant
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

Re: [ansible-project] (ssh) error pinging servers

2014-04-17 Thread Scott Sturdivant
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

Re: [ansible-project] How to get the substring to the right of the last forward slash (/) of a string ?

2014-04-01 Thread Scott Sturdivant
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

Re: [ansible-project] Default value for `hosts: {{ host }}` substitution doesn't work

2014-02-21 Thread Scott Sturdivant
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

Re: [ansible-project] ValueError with pip virtualenv

2014-02-19 Thread Scott Sturdivant
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

Re: [ansible-project] Use host IP as variable in other host

2013-12-13 Thread Scott Sturdivant
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