[ansible-project] Re: Cloned Ansible from github, now ad-hoc fails with the error: 'module' object has no attribute 'COLOR_ERROR'

2016-03-01 Thread Arthur Reyes
, March 1, 2016 at 4:14:03 PM UTC-6, Joanna Delaporte wrote: > > That sounds like a bug, then. Do you know where to report it? > > On Tuesday, March 1, 2016 at 4:10:25 PM UTC-6, Arthur Reyes wrote: >> >> To be clear, in /ansible/lib/ansible/plugins/callback/minimal

Re: [ansible-project] Ansible 2 multiple extra vars files

2016-03-01 Thread Arthur Reyes
I have been experimenting with using multiple instances of extra-vars at the command line and I have observed that last in from the command line is the value used at execution time. ansible-playbook --extra-vars "foo='Yes'" --extra-vars "foo='No'" would pass foo='No' to your playbook. The name

[ansible-project] Re: extra-vars behavior

2016-03-01 Thread Arthur Reyes
can use singles > inside the doubles. > > The following is how I have frequently used extra-vars: > > ansible-playbook playbook.yml --extra-vars "hosts=hosts-group > user=ansible-user var2=27" > > > Joanna > > > On Tuesday, March 1, 2016 at 3:33

[ansible-project] Re: Cloned Ansible from github, now ad-hoc fails with the error: 'module' object has no attribute 'COLOR_ERROR'

2016-03-01 Thread Arthur Reyes
I noticed that this module isn't importing this module: from ansible.utils.color import colorize, hostcolor On Tuesday, March 1, 2016 at 3:54:51 PM UTC-6, Joanna Delaporte wrote: > > Fixed the typo in the subject. The ad-hoc commands are failing instantly > after this error. > > On Tuesday,

[ansible-project] extra-vars behavior

2016-03-01 Thread Arthur Reyes
I didn't see it listed in Issues, so I thought I would ask here if a recent discovery was actually a bug. I'm working on some shell wrappers for the ansible-playbook and wanted to maintain a certain level of pedantry. It appears that ansible-playbook will except multiple --extra-vars options

[ansible-project] Re: Cloned Ansible from github, now ad-hoc fails with the error: 'module' object has no attribute 'COLOR_ERROR'

2016-03-01 Thread Arthur Reyes
constants as C class CallbackModule(CallbackBase): On Tuesday, March 1, 2016 at 4:08:14 PM UTC-6, Arthur Reyes wrote: > > I noticed that this module isn't importing this module: > > from ansible.utils.color import colorize, hostcolor > > > On Tuesday, March 1, 2016 at 3:5

[ansible-project] Re: How to force creating a new ssh connection

2016-03-18 Thread Arthur Reyes
Take a look at asynchronous actions: http://docs.ansible.com/ansible/playbooks_async.html On Friday, March 18, 2016 at 12:39:28 PM UTC-5, jan.w...@codilime.com wrote: > > Hello, > > by default Ansible uses SSH's ControlPersist feature to reuse one ssh > connection for running multiple tasks.

[ansible-project] My first "role" isn't running

2016-03-18 Thread Arthur Reyes
Just a thought. Did you export ANSIBLE_INVENTORY? And is it equal to the path and name of your inventory file? -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [ansible-project] When conditional can be used with variables??

2016-03-19 Thread Arthur Reyes
I might be misinformed but I believe that syntax will be deprecated soon and the best way to write that conditional is: when: '{{ was }}' == 'jboss' On Thursday, March 17, 2016 at 5:08:52 PM UTC-5, Brian Coca wrote: > > you are writing your conditionals wrong, vars don't need {{}} and strings

Re: [ansible-project] How to retrieve a specific result from multiple command registered to a variable

2016-03-19 Thread Arthur Reyes
You aren't wrong. But having spent a number of years sharing systems with Perl developers who also had sudo priviledges, makes me loathed to make changes to global packages. It's just been better, in my experience, to isolate your environment when your needs start to diverge from the standard

[ansible-project] Re: My first "role" isn't running

2016-03-19 Thread Arthur Reyes
It looks like your directory structure isn't quite right. app_install should be a sub directory under roles, which might explain why your playbook never finds vars/main.yml. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe

Re: [ansible-project] How to retrieve a specific result from multiple command registered to a variable

2016-03-19 Thread Arthur Reyes
I think that's the clue I was looking for. I'll post a result tomorrow for others who come here looking for the same answer. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it,

[ansible-project] Re: variable for list of targetted hosts

2016-03-20 Thread Arthur Reyes
$ ansible -i INVENTORY all -m setup --limit vm04 --list-hosts On Friday, March 18, 2016 at 3:00:15 PM UTC-5, jocelyn gibart wrote: > > Hello dear Ansible wizards > > Is there a way to get the list of targetted hosts for a playbook or for a > role ? > > I didnt find any variable or any way to

[ansible-project] How to retrieve a specific result from multiple command registered to a variable

2016-03-19 Thread Arthur Reyes
I have a series of commands registered to the same var - shell: ls -alh'{{ item }}' register:cmd_output with_items: - '/home/1' - '/home/2' For some plays, I only need to evaluate a specific stdout. Assuming I want to the results of 'ls -alh /home/2', my current method is to loop through

Re: [ansible-project] When conditional can be used with variables??

2016-03-19 Thread Arthur Reyes
Rereading the porting to 2.0 guide, there are a number of instances where bare variables do produce warnings of future deprecation, but when conditions are not mentioned there. Apologies for any confusion I may have caused. -- You received this message because you are subscribed to the

Re: [ansible-project] How to retrieve a specific result from multiple command registered to a variable

2016-03-19 Thread Arthur Reyes
For anyone looking for a solution. Given this code - shell: ls -alh'{{ item }}' register:cmd_output with_items: - '/home/1' - '/home/2' I can retrieve the stdout of a specific command without looping through cmd_output, like so: - debug: msg: '{{ cmd_output.results | selectattr("cmd",

[ansible-project] Re: Aliases for hosts

2017-03-20 Thread Arthur Reyes
Listing aliases for servers in your inventory file can cause a race condition in some plays when executed multiple times per host. Avoid this. On Monday, March 20, 2017 at 12:38:19 PM UTC-5, Gabriel Forster wrote: > > I have certain servers that are called various things by different > members

[ansible-project] Re: Ansible template not substituting if any variable not defined

2017-03-20 Thread Arthur Reyes
Use defaults, to handle undefined variables without ignoring errors: ServerAlias: {{ foo | default('bar') }} On Saturday, March 18, 2017 at 12:50:02 PM UTC-5, John Gateley wrote: > > HI y'all, > > I switched to a new computer, so this is a clean installation of ansible > etc. > One of my

[ansible-project] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Arthur Reyes
oof approach. > > Il giorno martedì 13 febbraio 2018 16:48:53 UTC, Arthur Reyes ha scritto: >> >> You should run your playbook in check mode until you're certain that your >> regular expression is precise. >> >> On Tuesday, February 13, 2018 at 10:45:57 AM UTC-6, Nico

[ansible-project] library/module_utils functionality question

2018-02-13 Thread Arthur Reyes
Follow-up. I tested copying a module from core into the playbook library. Modifying the content, without altering the module name and observed that ansible.library picked up the local module first. -- You received this message because you are subscribed to the Google Groups "Ansible Project"

[ansible-project] library/module_utils functionality question

2018-02-13 Thread Arthur Reyes
If a module with the same name as a core module exists in the ./library or ./module_utils directory of the plabyook, which module will be get invoked when I reference it in my playbook? I have a need to modify the functionality of a core module. I could refactor/rename it to [module]_internal

[ansible-project] Re: What's the safest way to do grep-like searches in files?

2018-02-13 Thread Arthur Reyes
You should run your playbook in check mode until you're certain that your regular expression is precise. On Tuesday, February 13, 2018 at 10:45:57 AM UTC-6, Nico Sabbi wrote: > > HI, > I need to do a grep-like search in a file without using shell commands and > in a check_mode compatible way. >