[ansible-project] Using fetch in a role

2014-05-28 Thread Joost Cassee
Hi all, I am using the fetch module in a role that redistributes ssh_known_hosts by: 1) creating a snippet on every host 2) fetching those snippets 3) redistributing the concatenation I wanted to keep the snippets inside the files directory of the role, but the fetch module fetches does not use

Re: [ansible-project] Using fetch in a role

2014-05-28 Thread Joost Cassee
By the way, in the mean time I hacked around the problem by creating a custom lookup plugin: class LookupModule(object): def __init__(self, basedir=None, **kwargs): self.basedir = basedir def run(self, terms=None, inject=None, **kwargs): return [self.basedir] I'm not

[ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread pjdeelman
Trying to figure out theory filters, but no luck yet. I'm pulling a list of available tables from postgres and exclude the tables contained in the list supertables. Am i using this functionality in the correct way? Or do i need to put it in a variable first? If so, how do i do that? I'm using

Re: [ansible-project] The Zen of Ansible?

2014-05-28 Thread Michael DeHaan
No such guide. Maybe it should. I need to think about what it might say. Ultimately it's probably best to show the hack and ask how to do it better when you see the specific hack. I've also been thinking a bit about a tuning section, as I've been seeing a fair amount of people who aren't

Re: [ansible-project] Recent ansibles have issues with unicode?

2014-05-28 Thread Michael DeHaan
If you have a bug, always file the specific bug. We've *fixed* a lot of issues with Unicode, though it can be occasionally things can creep through. It would be helpful on the ticket if you can run ./hacking/test-module on the remote system to share what the setup module actually outputs, and

Re: [ansible-project] Re: New URI module from Romeo Theriault

2014-05-28 Thread Michael DeHaan
The rule in YAML is if you have a colon in the line, you must quote the whole line. In this case, the uri stuff probably needs quotes around the whole beast. You might find it easy to store the body in a vars: to make it a little easier to read. On Tue, May 27, 2014 at 5:51 PM, Guy Matz

Re: [ansible-project] Re: Specifying a variable from command line for a specific host

2014-05-28 Thread Michael DeHaan
In that sort of configuration, I'd find pretty hackish and just go ahead and write the inventory file. You can keep the variables in the inventory file itself if you like, or use hostvars/hostname files. On Tue, May 27, 2014 at 7:51 PM, Jonathan Ellithorpe jdellitho...@gmail.com wrote:

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Michael DeHaan
My thoughts would be that you set up hostX as a backup client with a backup role and backup everything...(maybe excluding certain temporary directories)... Why do you want something explicitly different for web servers/web sites? Agree. I'd configure your backup tool to indicate what paths

Re: [ansible-project] can github.com/ansible/ansible-examples/tree/master/lamp_haproxy be executed simply, using dynamic inventory?

2014-05-28 Thread Michael DeHaan
So this is true, but it's also ok, since it's just an example. If you wanted to use it on a ec2 dynamic inventory, you could just do ec2_tag_webservers instead of webservers in both places. On Tue, May 27, 2014 at 11:12 PM, Gallagher Polyn gallagher.po...@gmail.com wrote: Hey, It feels

Re: [ansible-project] Using a conditional (when) in conjunction with a loop

2014-05-28 Thread Michael DeHaan
Same question as James, but just wanted to point out the 1.6 series is now available. On Wed, May 28, 2014 at 12:21 AM, James Cammarata jcammar...@ansible.comwrote: I'm unclear why you can't do this? Is it failing with an error or some other problem? On Tue, May 27, 2014 at 4:43 PM, Alex

Re: [ansible-project] Trying to skip a task when a dict variable is not defined.

2014-05-28 Thread James Cammarata
You migh want to use set_fact on the hosts, when the dict is not defined, to give it some default value instead. As you've noticed, the when clause is applied to each item in the loop, so it's evaluated after the with_dict is parsed. On Tue, May 27, 2014 at 2:25 PM, Heath Henjum

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread Michael DeHaan
That means when a role is being deployed because of a role dependency, its template tasks could use blocks possibly provided by any role that depends on it and is included in the active dependency chain. The problem is 95% of our users including myself have trouble with this wording :) We avoid

[ansible-project] for and if in template

2014-05-28 Thread Joachim Friberg
Hi, I'm trying to get this: define hostgroup{ hostgroup_name TableswitchesSweden members dlg-prd-office-tbs01,dlg-prd-office-tbs02,dlg-prd-office- tbs03,dlg-prd-office-tbs04,dlg-prd-office-tbs05,dlg-prd-office-tbs07,dlg-prd

Re: [ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread Michael DeHaan
I think you might have been skimming this one a bit fast, James :) I don't believe it's true that filters always return strings. A simple example other than this is fileglob which returns a list. I also don't understand why a when statement, when executed inside the loop, would have anything to

Re: [ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread Michael DeHaan
So implication is it didn't take a *set* ? (If so, that's fixable) On Wed, May 28, 2014 at 8:13 AM, Brian Coca brianc...@gmail.com wrote: have you tried?: with_items: almatables | difference(supertables)| list ​ -- You received this message because you are subscribed to the Google

Re: [ansible-project] Synchronize module and with_first_found

2014-05-28 Thread Carlos A. Carnero Delgado
Seems like you'd want the trailing slash here, since synchronize is in fact just a thin wrapper around local_action: rsync ... I knew that the synchronize module was a wrapper over rsync. What's new to me is that it is a local_action. I even seem to remember synchronize failing when the

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 15:04, Michael DeHaan wrote: That means when a role is being deployed because of a role dependency, its template tasks could use blocks possibly provided by any role that depends on it and is included in the active dependency chain. The problem is 95% of our users including

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 15:13, James Cammarata wrote: Absolutely. Role dependencies are more like package dependencies - if package A depends on package B, it means you need to install package B first. In no circumstances should package B include files that package A is going to overwrite. It would

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread Michael DeHaan
Ok so it's still not inheritance (this is an uneducated misuse of the term by Jinja, it's encapsulation, quite a different concept), ansible roles themselves are definitely not inheritance. (I've also written a lot in Django) Ultimately the problem is we have an irresolveable communication gap

Re: [ansible-project] Using fetch in a role

2014-05-28 Thread Joost Cassee
2014-05-28 14:07 GMT+02:00 Michael DeHaan mich...@ansible.com: Usually filing up the roles directory would be a non-standard place to put things, and would probably result in data accidentally going into source control, and that content should drop outside of your playbook directly. [...] I

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Michael Peters
On Wed, May 28, 2014 at 7:58 AM, Michael DeHaan mich...@ansible.com wrote: I'd configure your backup tool to indicate what paths should be backed up. That's actually his initial question. Apache knows where to serve sites from based on that role's (or groups) variables. Now his backup tool

[ansible-project] Combine multiple inventory sources?

2014-05-28 Thread Joost Cassee
Hi all, [Sorry for the barrage of mails, I am restructuring my Ansible layout and running into several things at once.] I thought it was possible to combine inventory sources like this: hosts/static1 --- [group1] host1 hosts/static2 --- [group2] host1 test.yml --- - hosts: all connection:

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

2014-05-28 Thread Brian Dunbar
I have a playbook, the task consistently flags one user as 'ok' and one user as 'changed'. See this gist: https://gist.github.com/bdunbar/ec35fb02d4147ad1f5b5 Why is this? Clearly the user already exists, so it _should_ be 'ok' and not 'changed'. I'm doing something wrong, and I'd like to

Re: [ansible-project] Hipchat module not compatible with hipchat API v2?

2014-05-28 Thread Lars Sommer
I will work on it more today but you could receive a 401 if you were using a notification API token that is assigned to a particular room and you were trying to use it to authenticate anywhere else that was a valid URL. My main concern was how the URL string got assembled by the module parameters.

Re: [ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread pjdeelman
Oops, sorry Brian, i replied to you personally :) Yes it did the trick! PLAY [pdetest2] *** GATHERING FACTS *** ok: [pdetest2] TASK: [dump data into csv]

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 16:50, Adam Morris wrote: For the specific example given: apache role and wsgi role there may be a simple, elegant, solution. Apache can include other configuration files, I don't know if it can include directories. If so include a directory. If not use the assemble module to

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 17:59, 'Petros Moisiadis' via Ansible Project wrote: On 05/28/14 16:50, Adam Morris wrote: For the specific example given: apache role and wsgi role there may be a simple, elegant, solution. Apache can include other configuration files, I don't know if it can include

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread Maciej Delmanowski
Sorry, replying from phone. 28 maj 2014 16:59 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com napisał(a): On 05/28/14 16:50, Adam Morris wrote: For the specific example given: apache role and wsgi role there may be a simple, elegant, solution. Apache can include

[ansible-project] Re: New URI module from Romeo Theriault

2014-05-28 Thread Guy Matz
darned yaml/json . . . the space in my body was the problem! I had body='{rclass: local}' . . . needed to be body='{rclass:local}' Thanks all! -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Michael DeHaan
That's actually his initial question. Just put it in the configuration file for the backup tool/script. No need to sprinkle this throughout the playbook IMHO. It could even use variables to conditionally include things {% if x in groups['webservers'] %} ... {% endif %} {% if x in

Re: [ansible-project] Combine multiple inventory sources?

2014-05-28 Thread Michael DeHaan
I am confused why you have group definitions inside a file that seems to describe a host. Should the hosts/ directory just be named inventory ? Anyway, yes, if you feed -i a path to a directory, it will load all inventory sources therein. It is however true there are some unmerged things that

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

2014-05-28 Thread Michael DeHaan
How are the systems different? On Wed, May 28, 2014 at 9:57 AM, Brian Dunbar brian.dun...@gmail.comwrote: I have a playbook, the task consistently flags one user as 'ok' and one user as 'changed'. See this gist: https://gist.github.com/bdunbar/ec35fb02d4147ad1f5b5 Why is this? Clearly

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 18:17, Maciej Delmanowski wrote: Sorry, replying from phone. 28 maj 2014 16:59 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com mailto:ansible-project@googlegroups.com napisał(a): On 05/28/14 16:50, Adam Morris wrote: For the specific example given:

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

2014-05-28 Thread Brian Dunbar
I'm running the playbook against the same host, 'sftp' each time. 'aws-stage-sftp' is Ubuntu 12.04.4 LTS # inventory.yml (snip) aws-stage-sftp ansible_ssh_host=11.11.11.11 (snip) [sftp] aws-stage-sftp On Wednesday, May 28, 2014 10:49:22 AM UTC-5, Michael DeHaan wrote: How are the

Re: [ansible-project] Combine multiple inventory sources?

2014-05-28 Thread Serge van Ginderachter
​Joost,​ hosts/static1 --- [group1] host1 hosts/static2 --- [group2] host1 test.yml --- - hosts: all connection: local gather_facts: no tasks: - debug: var=hostvars It looks like group1 is somehow masking group2 during limiting: $ ansible-playbook test.yml -i hosts

[ansible-project] Users - passwords - not getting it

2014-05-28 Thread Brian Dunbar
I want to create an account, and a password. Then tell the user what that password is. see here https://gist.github.com/bdunbar/6b60d8a14e5ef2af8ebe I have the same problem when I use this shell: mkpasswd --method=SHA-512 The thing I'm not getting - and I'm sure this is a mental block, or

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Brice Burgess
On Wednesday, May 28, 2014 10:46:52 AM UTC-5, Michael DeHaan wrote: Just put it in the configuration file for the backup tool/script. No need to sprinkle this throughout the playbook IMHO. My backup role ensures the backup tools and remote storage points (via the s3ql service role). It

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Maciej Delmanowski
Is there a reason no to backup, say, /etc, /home, /srv and /var/www? Maciej 28 maj 2014 18:38 Brice Burgess briceb...@gmail.com napisał(a): On Wednesday, May 28, 2014 10:46:52 AM UTC-5, Michael DeHaan wrote: Just put it in the configuration file for the backup tool/script. No need to

Re: [ansible-project] Users - passwords - not getting it

2014-05-28 Thread Adam Heath
On 05/28/2014 11:32 AM, Brian Dunbar wrote: mkpasswd --method=SHA-512 That runs mkpasswd with stdin unattached. If you run it manually, you'll see it prompting for a password. If you run it multiple times, and keep hitting enter(simulating a disconnected stdin), then you'll get different

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] Template/File path for dependencies

2014-05-28 Thread Maciej Delmanowski
2014-05-28 17:55 GMT+02:00 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com: On 05/28/14 18:17, Maciej Delmanowski wrote: It is true that software that has support for include directories can help, but it become less helpful as you add more levels in ther hierarchy

Re: [ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread Michael DeHaan
I'd rather have the code just make it work -- less to remember for everyone. On Wed, May 28, 2014 at 10:41 AM, pjdeel...@gmail.com wrote: Oops, sorry Brian, i replied to you personally :) Yes it did the trick! PLAY [pdetest2]

Re: [ansible-project] Combine multiple inventory sources?

2014-05-28 Thread Joost Cassee
2014-05-28 17:48 GMT+02:00 Michael DeHaan mich...@ansible.com: I am confused why you have group definitions inside a file that seems to describe a host. Should the hosts/ directory just be named inventory ? Yes, it should be named inventory. 2014-05-28 18:00 GMT+02:00 Serge van Ginderachter

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread 'Petros Moisiadis' via Ansible Project
On 05/28/14 20:55, Maciej Delmanowski wrote: 2014-05-28 17:55 GMT+02:00 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com mailto:ansible-project@googlegroups.com: On 05/28/14 18:17, Maciej Delmanowski wrote: It is true that software that has support for

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread Maciej Delmanowski
2014-05-28 21:42 GMT+02:00 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com: But it seems you do have some specialized functionality embedded in your nginx role. For example you do fastcgi stuff. By fastcgi stuff I mean things such as configuration sections, structures

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Brice Burgess
On Wednesday, May 28, 2014 12:16:00 PM UTC-5, Maciej Delmanowski wrote: Is there a reason no to backup, say, /etc, /home, /srv and /var/www? Maciej Hey Maciej. That scenario (backing up entire directores) is totally supported as well via the backup role and feeding it a list of

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread C. Morgan Hamill
For what it's worth, I simply follow this rule: if data needs to be accessed from outside a role, then it should go in inventory somewhere (e.g., group_vars/foo or group_vars/all/foo). My 2¢. -- Morgan Hamill -- You received this message because you are subscribed to the Google Groups Ansible

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Maciej Delmanowski
28 maj 2014 22:18 C. Morgan Hamill cham...@wesleyan.edu napisał(a): For what it's worth, I simply follow this rule: if data needs to be accessed from outside a role, then it should go in inventory somewhere (e.g., group_vars/foo or group_vars/all/foo). My 2¢. This is very good solution too

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Brice Burgess
On 05/28/2014 03:24 PM, Maciej Delmanowski wrote: 28 maj 2014 22:18 C. Morgan Hamill cham...@wesleyan.edu mailto:cham...@wesleyan.edu napisał(a): For what it's worth, I simply follow this rule: if data needs to be accessed from outside a role, then it should go in inventory somewhere

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread ramon
Hi All, The inheritance discussion keeps popping up, appearantly there's value in there somewhere.. I'd like to add my 2ct, but just with regards to using galaxy roles. First: it's obviously not inheritance, I'd like to say override (like variables override eachother according to precedence),

Re: [ansible-project] Combine multiple inventory sources?

2014-05-28 Thread Serge van Ginderachter
On 28 May 2014 21:08, Joost Cassee jo...@cassee.net wrote: Great, thank for reproducing! Do you have an idea of when those changes will land in devel? ​No, I believe it's planned for review in this release cycle, but they're tackling higher priority tickets first.​ -- You received this

Re: [ansible-project] Template/File path for dependencies

2014-05-28 Thread Adam Morris
On Wednesday, May 28, 2014 12:42:52 PM UTC-7, Ernest0x wrote: dependency. I am not sure if that can be done (easily and cleanly) with an ngix type of include mechanism. Also, keep in mind that there are systems that they do NOT provide such an include mechanism at all. And yet it

Re: [ansible-project] Re: Issue with extra variables in 1.5.4

2014-05-28 Thread Stephen Gargan
Hi, I've finally had a chance to circle back around to verifying this is fixed and I noticed there was a bug in my gist. The all file should be in a group_vars folder. When I move the vars file there the failure returns. It seems as you suspected that the cluster_name from there is still being

Re: [ansible-project] theory filters troubles (with_items expects a list)

2014-05-28 Thread Brian Coca
The issue is the {{ }} tends to convert output to strings so | list might be a requirement when no more 'templetizing' occurs​ -- 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,

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-28 Thread Brice Burgess
On Wednesday, May 28, 2014 6:58:55 AM UTC-5, Michael DeHaan wrote: Otherwise you are backing up only the things that ansible has known it changed, which doesn't include things that the software could have changed by itself (databases) or users logging in. Right -- that's assuming the

[ansible-project] Apache 2.4 failing to install from ports in FreeBSD

2014-05-28 Thread Francisco Reyes
I have tried - name: Install apache from ports portinstall: name=apache24 and - name: Install apache from ports portinstall: name=www/apache24 And every time it crashes with: -- error fatal: [test1] = failed to parse: Traceback (most recent call last): File

[ansible-project] Re: Apache 2.4 failing to install from ports in FreeBSD

2014-05-28 Thread Francisco Reyes
On Thursday, May 29, 2014 1:42:45 AM UTC-4, Francisco Reyes wrote: I have tried - name: Install apache from ports portinstall: name=apache24 Adding higher levels of verbosity: TASK: [freebsd-django | Install apache from ports] 162.242.223.246 ESTABLISH CONNECTION