[ansible-project] facts module output in setup?

2015-01-14 Thread Guy Matz
Hello! Is it possible to get a fact module to be included in the output for the setup module using ansible, i.e. not from a play? Perhaps I'm not asking this question correctly . . . I would like to extend setup to retrieve info about my servers so that running 'ansible -m setup host' would

Re: [ansible-project] facts module output in setup?

2015-01-14 Thread Brian Coca
You can add a script that returns json to /etc/ansible/facts.d on the target servers, default fact gathering will read/execute these. -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

[ansible-project] Run a role once and only once

2015-01-14 Thread Matt Willsher
Hi, I have a role that's called from other roles via dependencies. I'm seeing the role run twice, as discussed at https://groups.google.com/forum/#!searchin/ansible-project/role$20dependencies$20run$20twice/ansible-project/qoC1fVKEm7I/MWDl9ALo-KoJ I've worked around this by adding the

[ansible-project] Nice alternative to 'tags' for restricting change scope in a playbook

2015-01-14 Thread Russell Briggs
Hi All First off, I LOVE ansible, its awesome! Really didn't like puppet when I tried it. Just wanted to share a nice pattern I found for making it easy to run only part of a playbook, without having to remember which tags to use with the --tags option. (apologies if something similar has

[ansible-project] Re: Attach static ip address to gce instance on launch

2015-01-14 Thread Peter Mooshammer
On Thursday, December 25, 2014 at 11:50:32 AM UTC-8, abdulrahim umar wrote: Hi , Im trying to come up with a play that will attach a previously reserved static ip address to a instance on creation by ansible.from

Re: [ansible-project] rax_cdb_user not idempotent?

2015-01-14 Thread Matt Martz
David, Thank you for the feedback. I will look into this and see if it is a limitation of the API, pyrax or where ever else. If I can find a solution I'll look into applying a fix. On Wed, Jan 14, 2015 at 11:20 AM, David Goodall da...@mysysadmin.co.uk wrote: Thank you Matt. I made the

Re: [ansible-project] facts module output in setup?

2015-01-14 Thread Guy Matz
Thanks, yeah . . . I was hoping to not have to distribute scripts out, but rather keep them in a /library dir . . . On Wed, Jan 14, 2015 at 2:33 PM, Brian Coca bc...@ansible.com wrote: You can add a script that returns json to /etc/ansible/facts.d on the target servers, default fact gathering

Re: [ansible-project] Passing variable to hosts as extra value doesn't work in Tower

2015-01-14 Thread Matt Martz
For tower related inquiries you will want to reach out to supp...@ansible.com On Wed, Jan 14, 2015 at 11:32 AM, David Goodall da...@mysysadmin.co.uk wrote: Hi, I am trying to select hosts for a play based on a variable passed at job launch time in Tower: hosts: {{ project_name

[ansible-project] facter module: specific alternate facter location?

2015-01-14 Thread Thomas Willert
Hi, is it possible to specify another location for the facter binary when using the facter module? From this error message I gather that the module is relying on /usr/bin/env to find the facter binary: # ansible -m facter | FAILED { cmd: /usr/bin/env facter --json,

Re: [ansible-project] facter module: specific alternate facter location?

2015-01-14 Thread Brian Coca
you can add this to your task: environment: PATH: /opt/puppet/bin -- Brian Coca -- 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 to

Re: [ansible-project] no_log: True being ignored

2015-01-14 Thread Tom Bamford
Thanks, I think the docs could perhaps be clarified a little in this regard. From http://docs.ansible.com/faq.html#how-do-i-keep-secret-data-in-my-playbook - “if you have a task that you don’t want to show the results or command given to it when using -v (verbose) mode, the following task or

Re: [ansible-project] facts module output in setup?

2015-01-14 Thread Brian Coca
you can do that but it would be it's own module, you would have to execute it instead of setup. -- Brian Coca -- 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] Feature: User-defined modules as yaml task lists?

2015-01-14 Thread Tom Bamford
Hi Jan In terms of unified package management, I believe this is a direction that the Ansible project decided not to go in. I think the cleanest way from a playbook perspective would be to write your own module. But think about how much this might involve, noting that apt, yum, pacman et al don't

[ansible-project] Can I do yum localinstall with the yum module?

2015-01-14 Thread Jim McMahon
With the Ansible yum module, can I install an RPM that is local to the server that I'm deploying to? In other words, can I do something like this using ansible, but using the yum module? - name: locally install mysql-community-release rpm (configures yum) sudo: true shell: yum localinstall

Re: [ansible-project] Fetch error: unable to calculate the md5 sum of the remote file

2015-01-14 Thread Toshio Kuratomi
In ansible 1.7.x and below, ansible looked for a program on the remote machine to do an md5sum of the file for integrity checking. As of 1.8.0, ansible uses python itself to create a sha1 hash for integrity checking. What this means is that on ansible-1.7.x and older you needed to have

[ansible-project] Fetch error: unable to calculate the md5 sum of the remote file

2015-01-14 Thread Kevin Lasenby
When trying to fetch a file from a Synology NAS to my Ansible server (Ubuntu, using SSH keys) I get the error unable to calculate the md5 sum of the remote file. I don't get this error fetching from any other server and can't find any information on what's causing it. Any ideas? Kevin --

[ansible-project] Can Role Dependencies be overridden?

2015-01-14 Thread junkmailtrapenator
Let's say I install a role from Ansible Galaxy: $ ansible-galaxy install SomeUser.role1 Now this role is great and does exactly what I want except it has a role dependency on 'SomeUser.role2 which I don't need or want because I'm doing the equivalent of what it does in a different way. So what

Re: [ansible-project] Re: apt: upgrade=dist play hangs

2015-01-14 Thread Bob Tanner
On Wednesday, January 14, 2015 at 12:03:27 PM UTC-6, Brian Coca wrote: ok, so what happens when you run apt-get dist-upgrade , both these commands are what ansible is running for you with those arguments to the module. Works as expected. Oddly if I --limit www.X.com it also works.

[ansible-project] IndexError: list index out of range for GCE dynamic inventory

2015-01-14 Thread abdulrahim umar
When running the dynamic inventory script against a gce deployment , some nodes with external ips some without (running connecting through NAT ) i encounter this error when running list: sh-3.2# ./inventory/gce/gce.py --list Traceback (most recent call last): File ./inventory/gce/gce.py, line

Re: [ansible-project] Re: apt: upgrade=dist play hangs

2015-01-14 Thread Bob Tanner
I think I found the problem and I think it's a bug. I have an inventory file that looks like this: [web-servers] www.domain1.com www.domain2.com www.one-off.com www.domain3.com www.domain4.com Once ansible hits the www.one-off.com every www.domainX.com after that has sudo

Re: [ansible-project] Fetch error: unable to calculate the md5 sum of the remote file

2015-01-14 Thread Kevin Lasenby
Thanks for the reply. Looks like md5sum/md5 isn't available for Synology, at least I know why its failing and can work around the issue. Kevin On Wednesday, January 14, 2015 at 6:53:36 PM UTC-5, tkuratomi wrote: In ansible 1.7.x and below, ansible looked for a program on the remote

[ansible-project] Re: Add EC2 security group - only if it not already exists

2015-01-14 Thread Tzach Livyatan
On Wednesday, January 14, 2015 at 9:49:05 PM UTC+2, Dan Vaida wrote: What is the error that you get when it fails? 400 Bad Request Full capture below $ ansible-playbook configure-security-group.yaml -e key_name=$EC2_KEY_NAME PLAY [Provision Cassandra cluster security group]

[ansible-project] Linking between hosts

2015-01-14 Thread louis gueye
Hi all, First I would like to thank Ansible creators and its great community because this tool really simplifies my day to day life. I have the following workflow and I want a piece of advice on *Step 3*: - Step 1: create n nodes with a cloud provider (lb, app-1, app-2, index,

Re: [ansible-project] rax_cdb_user not idempotent?

2015-01-14 Thread Matt Martz
I have been unable to duplicate this issue. The code in place in rax_cdb_user tries to perform a `instance.get_user` on the username. If the username exists the user object is returned. If an Exception is raised, the function returns False and the module attempts to create the user. In your

Re: [ansible-project] Re: Variables in when statement

2015-01-14 Thread Dan Vaida
Hi, I got what you said. However, I must repeat myself: passing tags to the include task will tag all tasks in the included file, it will NOT call ONLY the tasks that have that specific tag. On 14 January 2015 at 16:35, Wojciech Korzenny wkorze...@gmail.com wrote: Cheers Dan for your answer.

Re: [ansible-project] Re: apt: upgrade=dist play hangs

2015-01-14 Thread Brian Coca
ok, so what happens when you run apt-get dist-upgrade , both these commands are what ansible is running for you with those arguments to the module. -- Brian Coca -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this

Re: [ansible-project] rax_cdb_user not idempotent?

2015-01-14 Thread David Goodall
Thank you Matt. I made the change you suggested but still get the same result with no extra information. I then tried a db username with no special characters and it works fine - sorry, I should have tried this first. Here is the db username that doesn't work: S+%{r.46Z?f_*JuB The module can

[ansible-project] Passing variable to hosts as extra value doesn't work in Tower

2015-01-14 Thread David Goodall
Hi, I am trying to select hosts for a play based on a variable passed at job launch time in Tower: hosts: {{ project_name }}-masters:{{ project_name }}-slaves This will allow me to create and administer different stacks separately within the same Rackspace account. I have read elsewhere that

[ansible-project] ansible-playbook error using --su

2015-01-14 Thread Kessia Pinheiro
I'm trying to run a simple playbook (actually it's another one, but I created that for tests), but it keep giving me the error below in any server I've tried: --- - hosts: ideia3 tasks: - shell: whoami $ ansible-playbook test.yml -i production/inventory --user=inadmin --ask-pass --su

[ansible-project] Re: Iterate over inventory group

2015-01-14 Thread Laurent Goussard
That would be a fallback solution, but I'd prefer not to use group nor host vars for defining such iterator. That would lead on errors and that not very elegant, in my opinion.. Le mercredi 14 janvier 2015 12:23:07 UTC+1, Dan Vaida a écrit : Isn't it feasible for you to simply do - hosts:

Re: [ansible-project] Iterate over inventory group

2015-01-14 Thread Laurent Goussard
Thank you Matt ! That's definitely what I needed. There is a lot of useful gems hidden in the footer or subnotes of the documentation ! Le mercredi 14 janvier 2015 13:31:56 UTC+1, Matt Martz a écrit : Take a look at with_indexed_items:

Re: [ansible-project] Re: apt: upgrade=dist play hangs

2015-01-14 Thread Bob Tanner
I should have posted that info in the first place. Thanks for asking. Things work fine when apt-get update from the command line. On Wednesday, January 14, 2015 at 6:36:16 AM UTC-6, Brian Coca wrote: what happens when you manually run 'apt-get update' on the same machine? -- Brian Coca

[ansible-project] Re: Iterate over inventory group

2015-01-14 Thread Laurent Goussard
Thanks, but as I said, I tried to loop over the group list, but I cannot get any iteration key. I try to loop over a hosts group and getting an index of the current iteration in order to set a cron task at midnight for the first host, 01am for the second, 02am for the third, etc... Le mardi

[ansible-project] Re: Iterate over inventory group

2015-01-14 Thread Dan Vaida
Isn't it feasible for you to simply do - hosts: mysql sudo: yes tasks: - cron: name=database backup hour={{ hour }} user=root job= backup_db.sh cron_file=database_backup and then in your host_vars/member_of_mysql_group, you would have hour: 01 and so on? On Wednesday, 14 January 2015

Re: [ansible-project] Feature: User-defined modules as yaml task lists?

2015-01-14 Thread jang
On Tue, 13 Jan 2015, Tom Bamford wrote: If you want greater control of when your common tasks get executed, I would be more inclined to use rules and have verbose playbooks with the execution order explicitly specified. Perhaps if you could give a better idea of what your common tasks are

Re: [ansible-project] Intersection of group variables inside a Jinja template.

2015-01-14 Thread Mark Maas
Hi Michael, Could you elaborate a bit on how to use this? You see, i'm trying to do the same thing: ``` # Cluster connection URL {# set mysql_hosts = groups[tag_type_mysql] | intersect(groups[tag_environment_dev]) #} wsrep_cluster_address=gcomm://{% for host in mysql_hosts %}{{

[ansible-project] How to run Ansible from web server?

2015-01-14 Thread Valeriy Solovyov
Hello I use apache2 + cgi. I enabled sudo for all users. But when I try run ansible throw apache2 cgi and I got: { dark: { 127.0.0.1: { msg: Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory.

[ansible-project] Add EC2 security group - only if it not already exists

2015-01-14 Thread Tzach Livyatan
newbie Ansible ec2 question: I'm successfully using ec2_group_module [1] to create EC2 security group. However, the operation fail if the group is already there What is the idiomatic to conditionally skip it if the group is already there? Thanks [1]

[ansible-project] Collecting a list of internal IPs from EC2

2015-01-14 Thread Tzach Livyatan
Another newbie questions (second and last for today, I promise) I have two groups for EC2 instances: - Test servers - Loader servers each with a different tag. I would like to get the list of the internal_ip of the Test group, and use it to run a command on the Loaders group. Any pointer will

Re: [ansible-project] Iterate over inventory group

2015-01-14 Thread Matt Martz
Take a look at with_indexed_items: http://docs.ansible.com/playbooks_loops.html#looping-over-a-list-with-an-index On Wednesday, January 14, 2015, Laurent Goussard laure...@gmail.com wrote: Thanks, but as I said, I tried to loop over the group list, but I cannot get any iteration key. I try

Re: [ansible-project] Intersection of group variables inside a Jinja template.

2015-01-14 Thread Matt Martz
I think there was a typo, instead of using {# #} you should probably be using {% %} The {# #} characters indicate a jinja2 comment. On Wednesday, January 14, 2015, Mark Maas m...@maas-martin.nl wrote: Gents, Could you elaborate a bit on how to use this? You see, i’m trying to do the same

Re: [ansible-project] Intersection of group variables inside a Jinja template.

2015-01-14 Thread Mark Maas
Gents, Could you elaborate a bit on how to use this? You see, i’m trying to do the same thing: # Cluster connection URL {# set mysql_hosts = groups[tag_type_mysql] | intersect(groups[tag_environment_dev]) #} wsrep_cluster_address=gcomm://{% for host in mysql_hosts %}{{

Re: [ansible-project] Re: apt: upgrade=dist play hangs

2015-01-14 Thread Brian Coca
what happens when you manually run 'apt-get update' on the same machine? -- Brian Coca -- 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 to