Re: [ansible-project] ansible using versioned playbooks ala r10k

2016-12-08 Thread James Martin
Answer is to use requirements.yml: http://docs.ansible.com/ansible/galaxy.html#id10 On Thu, Dec 8, 2016 at 1:10 PM, Vince Skahan wrote: > Working in a puppet shop, I have to admit r10k is pretty cool. It lets us > set up 'versioned' environment definitions that we can

Re: [ansible-project] How to pass inventory information to modules

2016-03-30 Thread James Martin
Miroslav, Here is one work around -- design your inventory something like this: [routers] router1 ansible_connection=local router_user=foo router_password=bar router2 ansible_connection=local router_user=baz router_password=biz router3 ansible_connection=local router_user=fax

[ansible-project] Re: Deploying AWS infra with CloudFormation and provisioning application in same playbook

2015-12-07 Thread James Martin
I would tag the instances in your CF template, then reference those tagged hosts by the inventory groups that are created with the ec2.py dynamic inventory script. If you do this in two separate ansible-playbook runs, you won't need to do anything special, the inventory will reflect the newly

[ansible-project] Re: Ansible 2.0 os_server 404 image not found

2015-09-02 Thread James Martin
I've successfully launched servers with os_server as of today, with the latest version of shade, so I don't think the module is completely broken. I do see that a 404 is being returned in your error, which is a "page not found" status code (https://en.wikipedia.org/wiki/HTTP_404). My guess is

[ansible-project] Re: Is there something like puppet librarian or R10K for Ansible?

2015-08-29 Thread James Martin
Check this out: http://docs.ansible.com/ansible/galaxy.html#advanced-control-over-role-requirements-files On Friday, August 28, 2015 at 3:12:12 PM UTC-5, Jeffrey Lee wrote: I'm looking for a way to manage different versions of Ansible roles that I am writing when deploying applications. For

[ansible-project] Re: Missing callback hook for task_started_for_host

2015-08-29 Thread James Martin
Brian, Have you seen this project? https://github.com/jlafon/ansible-profile On Friday, August 28, 2015 at 10:58:25 PM UTC-5, Brian Swanson wrote: I'd like to know how I can get a playbook callback hook that tells me when a task has first been dispatched to a specific host. I have

[ansible-project] Re: Ansible 2.0 -- shade is required for this module

2015-08-14 Thread James Martin
If you've installed shade into a virtualenv on your ansible control machine, you may need to tell ansible to use that virtualenv in order to detect it. I've done it like so in my hosts file for other modules (like boto): localhost ansible_python_interpreter=/usr/bin/env python - James On

[ansible-project] Re: Is there a way to get OS information from ec2.py dynamic inventory script?

2015-07-20 Thread James Martin
You could modify the ec2.py script so that it checks he ec2_image_id and does some logic based around the OS associated with the ec2_image_id. On Monday, July 20, 2015 at 5:16:54 PM UTC-4, Adam R. wrote: Hello, I would like to know if it is possible to get OS information from the AWS ec2

[ansible-project] Re: Issue with os_server module

2015-06-01 Thread James Martin
The problem is that the shade module requires python 2.7 as it stands. I believe there is a PR for shade module to support python 2.6. On Monday, June 1, 2015 at 5:10:44 PM UTC-4, Goldberg Eduard wrote: Hi, I'm trying to launch an instance using os_server module Using simple playbook -

[ansible-project] Re: extra scaling events with ec2_asg module

2015-03-30 Thread James Martin
add a new option instead of overloading the meaning of lc_check. On Wednesday, March 25, 2015 at 8:02:12 AM UTC-7, James Martin wrote: Looking forward to the github issue -- make sure you take a look at the autoscale group and the ELB in the AWS console and see if it gives a description

[ansible-project] Re: ec2_asg: Duplicate subnets specified error

2015-03-22 Thread James Martin
This should be patched in 1.9 RC2. https://github.com/ansible/ansible-modules-core/issues/967 - James On Sunday, March 22, 2015 at 4:55:16 PM UTC-4, Will Vaughn wrote: I am getting the same problem. Ansible seems to be iterating over each letter in a subnet id looking for duplicate

[ansible-project] Re: Vagrant + Multiple Machines + Ansible

2015-03-12 Thread James Martin
First, see the Tips and Tricks section here about using ansible with parallel execution in Vagrant: http://docs.vagrantup.com/v2/provisioning/ansible.html. You'll need to do the provisioning this way to properly collect facts on all the machines. Let's say you had a group called cluster that

[ansible-project] Re: Custom startup scripts not working with service module

2015-03-03 Thread James Martin
Init scripts should follow the LSB standard for init scripts and return the appropriate return codes for the service module to interact with them properly: http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html. The module does provide some

[ansible-project] Re: Unarchive and move

2015-01-28 Thread James Martin
Perhaps you could just turn that zip into a package and use the yum/apt ansible module to handle the updates? Using something like fpm (https://github.com/jordansissel/fpm) could quite easily convert a zip into a package. Might make the process easier. On Tuesday, January 27, 2015 at 8:44:10

[ansible-project] Re: Wait for output of command

2015-01-28 Thread James Martin
Looks like you want to use a do-until-loop: http://docs.ansible.com/playbooks_loops.html#do-until-loops - James On Tuesday, January 27, 2015 at 2:15:56 PM UTC-5, Mark Olliver wrote: Hi, I have a command that I need to wait for a completed output from which may take an hour how can I tell

[ansible-project] Re: Saving all --extra-vars parameters in file

2015-01-28 Thread James Martin
Why not just use an extra vars file? Extra vars can be json or yaml files: --extra-vars @some_file.yml --extra-vars @some_file.json On Monday, January 26, 2015 at 5:17:59 AM UTC-5, Wojciech Korzenny wrote: Hi, What's the easiest way to get the list of all --extra-vars parameters which

[ansible-project] Re: override non-defaults role variables

2015-01-22 Thread James Martin
Antoine, Let's say for example you have your foobar role, and #defaults/main.yml foobar_port: 42 And let's say you have an inventory group called foobar which is a list of all your foobar hosts. By using the group_by module (http://docs.ansible.com/group_by_module.html) in a previous

[ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread James Martin
debug? I need the data, not the output to the screen. On Tuesday, January 20, 2015 at 5:47:12 PM UTC+2, James Martin wrote: Here's a quick sample playbook that should do what you are trying to do. Keep in mind that the ec2.py dynamic inventory script will gather the private IPs for you, you

Re: [ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-21 Thread James Martin
, Jan 21, 2015 at 4:26 PM, James Martin jma...@ansible.com javascript: wrote: Sorry, I'm not sure of a way to suppress that, outside of using a custom filter. - James On Wednesday, January 21, 2015 at 3:37:09 AM UTC-5, Tzach Livyatan wrote: Thanks James Works like

[ansible-project] Re: Pass variable to hosts: in playbook

2015-01-20 Thread James Martin
Assuming your first task returns an ip address, if you want to reference it, you'd need to use {{ ip.stdout }}. Alternately, you could use the http://docs.ansible.com/uri_module.html instead of using curl, and you could just use {{ ip }}. You'll also have to add it to the inventory before you

[ansible-project] Re: Pass variable to hosts: in playbook

2015-01-20 Thread James Martin
playbook. The variable vmname is set and contains the vmname but it won't get passed to: hosts: '{{ vmname }}' Op dinsdag 20 januari 2015 15:39:00 UTC+1 schreef James Martin: Assuming your first task returns an ip address, if you want to reference it, you'd need to use {{ ip.stdout

[ansible-project] Re: Grouping variables when using Dynamic Inventory

2015-01-20 Thread James Martin
What do you mean all of your variables are in roles? As in role defaults? If so, that's fine, use inventory variables to override them. Your 3 environment scenario is fairly typical. The approach depends on you. Here's a couple of rough approaches (hard to tell based on your

[ansible-project] Re: Attempting to combine sub_items and when for application deployment

2015-01-20 Thread James Martin
What does your group_names variable look like? On Tuesday, January 20, 2015 at 2:01:56 AM UTC-5, Lyle Dietz wrote: I'm trying to deploy specific Java EE EARs to a host based on what groups that host is in. Each EAR goes in to it's own deployable directory because we're running each

[ansible-project] Re: EC2: collect list of private-ip from on group, use it in a second group

2015-01-20 Thread James Martin
Here's a quick sample playbook that should do what you are trying to do. Keep in mind that the ec2.py dynamic inventory script will gather the private IPs for you, you shouldn't need an explicit task. - hosts: localhost tasks: - debug: msg={{ hostvars[item].ec2_private_ip_address }}

[ansible-project] How to update host variables

2015-01-18 Thread James Martin
Have you looked into using the GCE dynamic inventory? http://docs.ansible.com/guide_gce.html#gce-dynamic-inventory -- 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

[ansible-project] Re: tower callbacks

2014-11-26 Thread James Martin
Levi, Please send Tower support requests to supp...@ansible.com in the future. To answer your question, the call back request will indeed trigger an inventory sync if the host that is calling back is not found in the inventory. Thanks, James On Wednesday, November 26, 2014 9:42:00 AM

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread James Martin
this? Any suggested workarounds or fixes? Thanks, Ben On Thursday, September 11, 2014 12:54:25 PM UTC-7, Scott Anderson wrote: On Sep 11, 2014, at 3:26 PM, James Martin jma...@ansible.com wrote: I think we’re probably going to move to a system that uses a tier of proxies and two ELBs

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-11-24 Thread James Martin
/anonymous/05e99828848ee565ed33 Happy to work this in to an ansible module if you think this is useful. Or did I misunderstand the point about the health check grace period? Thanks, Ben On Monday, November 24, 2014 7:25:58 AM UTC-8, James Martin wrote: Ben, Thanks for the question

[ansible-project] Re: Some doubts / problems about ansible-playbook with ansible-vault crypted files

2014-11-24 Thread James Martin
this is the explanation I was looking for, Cheers James El viernes, 21 de noviembre de 2014 18:51:04 UTC, James Martin escribió: ansible-vault only works for structured data files (yaml, json). Also, out of curiosity, why bother encrypting public keys? - James On Friday, November 21, 2014 8:52:03

[ansible-project] Re: How to design an Ansible directory structure

2014-11-21 Thread James Martin
That is *a* way to organize (especially when first getting accustomed with Ansible), not necessarily *the* way. Ansible allows you to fully configure the inventory path, library path, role path, etc with either environment variables or using ansible.cfg If you wanted to manage your customers

[ansible-project] Re: Some doubts / problems about ansible-playbook with ansible-vault crypted files

2014-11-21 Thread James Martin
ansible-vault only works for structured data files (yaml, json). Also, out of curiosity, why bother encrypting public keys? - James On Friday, November 21, 2014 8:52:03 AM UTC-5, Ricard Clau wrote: Hi everyone I was having a problem earlier today in a playbook using vault crypted files.

[ansible-project] Re: get_url: Request failed: urlopen error (101, 'Network is unreachable')

2014-11-21 Thread James Martin
Are you using an http proxy by chance? export |grep -i proxy If so, you'll need to tell ansible to use it. Ansible won't inherit environment variables by default. Check this link to learn about using proxies with Ansible if that is the case.

Re: [ansible-project] How to define all hosts but first in a group?

2014-11-19 Thread James Martin
- hosts: webservers:!webservers[0] Should do the trick. This means include all the webservers except the first one. - James On Wednesday, November 19, 2014 4:14:35 AM UTC-5, Bohdan Sydor wrote: On Wed, Nov 19, 2014 at 9:28 AM, t goto tomoy...@gmail.com javascript: wrote: Hello,

Re: [ansible-project] How to loop over an array inside a dictionary

2014-11-19 Thread James Martin
Karl is correct. Your data structure is making things difficult. If you make your datastructure a list of dictionaries, you can use the with_subelements function, described here: http://docs.ansible.com/playbooks_loops.html#looping-over-subelements - hosts: localhost vars:

[ansible-project] Re: How to loop over an array inside a dictionary

2014-11-19 Thread James Martin
I stand corrected, it does seem you can use with_subelements with a dictionary. The following (on ansible 1.8-devel) will loop through all the installation_files - hosts: localhost vars: oracle_app_directory: /app oracle_db_homes: DB1: path: {{ oracle_app_directory

[ansible-project] Re: Templates - Create, but do NOT update

2014-11-05 Thread James Martin
You could stat the file using the stat module to see if it exists and register it's result, then run your template task conditionally, only if the file does not exist. On Wednesday, November 5, 2014 11:44:07 PM UTC-5, Akos Vandra wrote: Hello, This might be a wierd feature request at first,

[ansible-project] Re: Managing Primary/Secondary relationship in cluster

2014-11-04 Thread James Martin
If you wanted to get the ip address of the first node in the production-cluster, you could do something like this. Think of the group as a list and 0 being the first element in the list. {{ hostvars[groups['production-cluster'][0]]['ansible_eth0']['ipv4']['address'] }} as far as your second

[ansible-project] Re: Managing Primary/Secondary relationship in cluster

2014-11-04 Thread James Martin
': AnsibleUndefinedVariable: One or more undefined variables: 'partner' is undefined, 'failed': True} in inventory/host_vars/server1.domain there is 'partner: server2.domain' On Tuesday, November 4, 2014 6:08:23 AM UTC-8, James Martin wrote: If you wanted to get the ip address of the first node

[ansible-project] Re: Managing Primary/Secondary relationship in cluster

2014-11-04 Thread James Martin
Ah, I didn't see that last line. Do a: - debug: var=partner Just to make sure you have your variables loading properly. On Tuesday, November 4, 2014 5:15:51 PM UTC-5, James Martin wrote: That indicates you haven't defined partner properly. Make sure it's listed in the right pace in your

[ansible-project] Re: register variables and use these as role name

2014-10-16 Thread James Martin
Why create a role that is specific to the environment? And why make it variable? Seems like you'd just use the same role, but give each host group different group inventory variables to override the role defaults. On Wednesday, October 15, 2014 2:14:58 AM UTC-4, Denis J. Cirulis wrote:

[ansible-project] Re: elastic search snapshot management

2014-10-16 Thread James Martin
1) You can create a bucket, take a look at the examples here: http://docs.ansible.com/s3_module.html 2) There are no such things as folders in S3. Everything is an object or bucket: http://docs.aws.amazon.com/AmazonS3/latest/UG/FolderOperations.html 3) Don't understand the last question. -

[ansible-project] Re: Determine if on internal LAN

2014-10-15 Thread James Martin
Rishi, Let's assume you have an inventory group called datacenter that holds all of your datacenter machines and an inventory group named inhouse that holds all of your in-house machines. You would then have a group_var file called inventory/group_var/inhouse that would contain: url:

Re: [ansible-project] Cloudformation - What Does This Mean?

2014-10-15 Thread James Martin
Ben is correct. The change is determined by AWS CloudFormation API endpoint, not by Ansible itself. Changes to resources, parameters, outputs, etc would indicate a change according to the Cloudformation API, not to timestamp alone. On Wednesday, October 15, 2014 5:00:37 AM UTC-4, Ben Symonds

[ansible-project] Re: Dependencies between tasks possible?

2014-10-13 Thread James Martin
If the task that copies the shell script fails, then the following tasks (in this case the cron job task) will not execute for that host. - James On Monday, October 13, 2014 4:00:27 AM UTC-4, berndad...@googlemail.com wrote: Hi All! Just want to say hello to all first since this is my

Re: [ansible-project] Re: How to fetch a file from remote server without creating additional subfolders

2014-10-08 Thread James Martin
Please file a bug report on github.com for this issue. On Wednesday, October 8, 2014 11:02:40 AM UTC-4, Samnang Sen wrote: I meant to reply to my original thread and say flat didn't change anything. On Oct 8, 2014 10:59 AM, James Martin jma...@ansible.com javascript: wrote

[ansible-project] Re: Reading a JSON file, adding to it and then saving it

2014-10-07 Thread James Martin
Mark G., The to_json (or to_nice_json) filter and a template will do the magic you want. Given this playbook: - hosts: localhost connection: local vars: log_paths: - /logs/access.log - /logs/error.log tasks: - name: create config file template: src=logstash.json.j2

[ansible-project] Re: Parsing ansible_hostname

2014-09-22 Thread James Martin
I believe you'd want to use an inventory pattern here: - hosts: *-apache-* roles: - apache See this link for more information: http://docs.ansible.com/intro_patterns.html - James On Sunday, September 21, 2014 11:27:51 PM UTC-4, Matt Wells wrote: Hi all, I hope somebody can offer me a

[ansible-project] Re: Re: Rolling Restart an Elasticsearch Cluster with Ansible

2014-09-18 Thread James Martin
I think a more ansiblish approach would be: - name: wait node {{ansible_hostname}}-{{service}} uri: url=http://localhost:9200/_cat/nodes?h=name timeout=120 return_content=yes register: result until: (ansible_hostname + '-' + service) in result.content retries:

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread James Martin
@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/D5B502F2-C5E4-4399-970E-E0B22FEC6736%40gmail.com . For more options, visit https://groups.google.com/d/optout. -- James Martin Solutions Architect Ansible, Inc. -- You received

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-11 Thread James Martin
rollbacks. That's cool, care to share? -- James Martin Solutions Architect Ansible, Inc. -- 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 ansible-project

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-10 Thread James Martin
Just wanted to note that this code has now been merged into ec2_asg in Ansible 1.8 devel branch, and the docs are updated with examples. Thanks, James On Mon, Sep 8, 2014 at 1:21 PM, Michael DeHaan mich...@ansible.com wrote: On Sun, Sep 7, 2014 at 5:48 PM, James Martin jmar...@ansible.com

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
PM, Michael DeHaan mich...@ansible.com wrote: Hi, James Martin is working on a 2-3 part blog post on *exactly* this subject, which I believe we're going to be posting this week, which shows a couple of ways to do it. I've included him on this mailing list thread if he wants to share some

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
-east-1++ On Sun, Sep 7, 2014 at 2:49 PM, James Martin jmar...@ansible.com wrote: Dan, I've been tinkering with this process for quite a while and have made a pull request to ansible core that I believe does what you are looking for: https://github.com/ansible/ansible/pull/8901 As Michael

Re: [ansible-project] EC2 Rolling Deploy with an ASG

2014-09-07 Thread James Martin
Daniel, Yep, Option 2 is designed to work with replace_batch_size. Currently it's mutually exclusive with replace_instances, but I think if we decide to go with Option 2, I could make replace_instances work. I think it might be desirable to replace all instances or just a few, but still have

[ansible-project] Re: Overriding role defaults with an external file

2014-08-07 Thread James Martin
I encountered this recently. I solved it with group_vars and a simple trick in my hosts file: #hostsfile localhost ansible_python_interpreter=/usr/bin/env python ansible_connection=local [fancyapp-blue] localhost [fancyapp-violet] localhost ##end hostsfile Then, in my

[ansible-project] Re: Overriding role defaults with an external file

2014-08-07 Thread James Martin
for fancyapp-blue will override the role defaults for asg. On Thursday, August 7, 2014 11:56:18 AM UTC-7, James Martin wrote: I encountered this recently. I solved it with group_vars and a simple trick in my hosts file: #hostsfile localhost ansible_python_interpreter=/usr/bin/env python

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread James Martin
Instead of baking the Tower callback script into the AMI, it also can be baked into the ASG's Launch Config User Data. That may be a bitter easier to manage. - James On Thursday, July 24, 2014 11:26:39 AM UTC-4, Michael DeHaan wrote: Tower provisioning callbacks embedded into the image are

Re: [ansible-project] Need to avoid using a hosts or inventory file using Ansible

2014-05-22 Thread James Martin
On Thu, May 22, 2014 at 1:08 PM, Scott Anderson scottanderso...@gmail.com wrote: Dynamic inventory scripts are not appropriate if the IP does not exist yet, as in the case of creating a new VM. Regards, -scott On Wednesday, May 21, 2014 6:08:20 PM UTC-4, James Martin wrote: Use a dynamic

Re: [ansible-project] Need to avoid using a hosts or inventory file using Ansible

2014-05-21 Thread James Martin
Use a dynamic inventory script if you don't know the IP. That is what it is designed for. If you want to pass ssh usernames and passwords (extremely extremely insecure, please use SSH Keys), you can do that with ansible_ssh_user and ansible_ssh_pass inventory variables. You will need to have

[ansible-project] Re: yum enablerepo won't do multiple repositories

2014-04-25 Thread James Martin
Mark, Thanks for digging into the issue. Would you mind updating the github ticket with this new information? Thanks! James On Thursday, April 24, 2014 12:17:19 PM UTC-4, mto...@go2uti.com wrote: I saved the tmp file on a target server and looked through it to try to see what is

[ansible-project] Re: Another way to set the mysql root password

2014-04-04 Thread James Martin
In case you weren't aware, there is a pretty full featured mysql role on Ansible Galaxy. That may give you some hints. https://galaxy.ansible.com/list#/roles/1 - James On Tuesday, April 1, 2014 11:49:36 AM UTC-4, Patrick Ogenstad wrote: I've just gotten started with Ansible. I must say it's

Re: [ansible-project] Unable to make my idempotent MySQL playbook to work

2014-03-11 Thread James Martin
Might be worth taking a look at the mysql role in Ansible galaxy. On Jan 5, 2014 1:54 PM, Sjors Buitenhuis sjorsbuitenh...@gmail.com wrote: Hi, I'm having a very hard time making my MySQL playbook idemptotent on my vagrant dev machine. I came across two posts from Lorin Hochstein, but

Re: [ansible-project] Trigger restart of service only when certain files exist?

2014-03-09 Thread James Martin
Why not deploy the service prior to the upstart script? Or why not bundle them into a package? There seems to be something I'm not understanding in the flow of your playbook. - James On Sat, Mar 8, 2014 at 9:00 PM, Grayson Koonce grayson.koo...@gmail.comwrote: Hi there, I have a playbook

Re: [ansible-project] CloudFormation Ansible

2014-03-07 Thread James Martin
You've got the idea. Define CloudForamtion templates as you normally would, defining all of your AWS resources, but leaving out the configuration of the servers. Use Ansible to launch the template and let Ansible configure your servers after the CloudFormation stack is created. When that module

Re: [ansible-project] Selecting hosts based on variable

2014-03-07 Thread James Martin
You can create dynamic groups by using the group_by module: - name: Create groups based on location group_by: key={{ location }} then use something to similar to what Brian had said earlier in the play: ansible-playbook all your other options -e 'mylocation=room1' playbook should contain:

Re: [ansible-project] Ansible mysql module does not work with enterprise version mysql

2014-03-05 Thread James Martin
I think providing an example of how it's not working would benefit the list. Though I don't think it makes any guarantees to do so to begin with. - James On Wed, Mar 5, 2014 at 12:30 PM, jack jackma1...@gmail.com wrote: Hi All: Does anyone have any experience for the mysql module to work

Re: [ansible-project] Firewall Module?

2014-03-04 Thread James Martin
On Tue, Mar 4, 2014 at 11:51 AM, Aaron Hunter aaron.hunt...@gmail.comwrote: A chinstrap role that James mentions could work but it has no way of knowing that a change has taken place (ie., a new snippet was added, changed, or removed). At least none that I know of. The alternative is simply

Re: [ansible-project] Serving files from a central asset server

2014-02-28 Thread James Martin
Sounds like you'd have an asset server role that gets executed against the asset server that collects all the assets, followed by a role that gets executed against target host. Take a look at the get_url module for getting files from the web to your asset server, and get_url or synchronize

Re: [ansible-project] Large or small roles?

2014-02-25 Thread James Martin
If you never plan to reuse those individual components, then you don't need to separate them out as roles. If the need ever arises for separate roles for those things, it's easy enough to re-write it to support that when the time comes. - James On Tue, Feb 25, 2014 at 9:44 AM,

[ansible-project] ansible-galaxy Readme formatting

2014-02-12 Thread James Martin
I spent a fair amount of time writing up documentation for my role(s), only to find that Galaxy doesn't like Markdown's table syntax. For example this is how it looks on github: https://github.com/basho/ansible-riak/blob/master/README.md Unfortunately, when that is sucked into Galaxy, it

[ansible-project] galaxy and playbooks

2014-02-11 Thread James Martin
I'm putting some finishing touches on a number of riak related roles. Since riak is a distributed system, these roles really don't shine unless they are used on a number of hosts. I'd like to provide some example playbooks with the roles that show how to do this, but it seems there is no

[ansible-project] common roles on ansible galaxy

2014-02-11 Thread James Martin
As I noted on an early message -- I'm working on some riak related roles for galaxy -- a number of the roles do some similar operations -- setting up some repositories, doing some simple configurations, etc. Is it better to contain those common operations in a common role and have the other roles

Re: [ansible-project] Handlers and failures

2014-02-08 Thread James Martin
I wonder if ansible's retry feature could be made smart enough to note the handlers that were notified but not executed. Then on the subsequent run, those handlers would get executed. - James On Fri, Feb 7, 2014 at 12:51 PM, Nadav Samet thesa...@gmail.com wrote: Hey, I have a play where I

[ansible-project] handlers and role dependencies

2014-02-06 Thread James Martin
Let's say I have a role called haproxy which does basic installation and configuration of haproxy. I'd also have haproxy-riak haproxy-riakcs roles, which would lay down a configuration file that is tuned for riak and riakcs. These roles would be dependent on haproxy. Is this a good way to use

Re: [ansible-project] Ansible vagrant - refuses to use vagrant user

2013-12-23 Thread James Martin
This is how I do it: export ANSIBLE_REMOTE_USER=vagrant export ANSIBLE_PRIVATE_KEY_FILE=$HOME/.vagrant.d/insecure_private_key ssh-add $ANSIBLE_PRIVATE_KEY_FILE - James On Mon, Dec 23, 2013 at 9:24 AM, bryan hunt picsolvebr...@gmail.com wrote: Hi, I have been trying to get Ansible working

Re: [ansible-project] Copying whole directory from amazon S3 using ansible

2013-12-20 Thread James Martin
The s3 module does not support directory uploads, or any recursion. For this tasks, I'd recommend using s3cmd --sync or a similar tool and launching it with the command module. - James On Thu, Dec 19, 2013 at 11:16 PM, Rohan Deshpande rohan.deshpa...@permeance.com.au wrote: I have a script that

[ansible-project] getting the fqdns of all the hosts in a group

2013-12-17 Thread James Martin
I have a command that needs the fqdn's of all servers within an inventory group as input. - name: run special command command: mycommand foo.host bar.host baz.host Is there a simple way to create such a string without having to write out a template, cat it, register it, and using the

Re: [ansible-project] Re: Role to encapsulate several OS specific sub-roles

2013-12-12 Thread James Martin
Here's what I do -- Prior to all my roles, I do a role called bootstrap across all of my nodes. That role performs a group_by task: - name: Create groups based on distribution group_by: key={{ ansible_distribution }} then I execute my other roles -- first I execute the OS specific

Re: [ansible-project] roles an funky playbooks

2013-12-12 Thread James Martin
Dmitry, Can you explain what you mean in more detail if prior to call to B/install tasks I call B tasks - foo gets populated with /roles/B/vars/main.yml, otherwise it picks up /group_vars/all. Examples of playbooks on github would be helpful. Thanks, James On Thu, Dec 12, 2013 at 12:26 AM,

Re: [ansible-project] How to run an action for a dynamically–templated host group

2013-12-12 Thread James Martin
Josh, Hosts are evaluated before var files, so putting it in var files won't work. You can use the -e option, which can ever slurp up the contents of a file our output of a script with your tag name. If typing the '-e' option is cumbersome, then create a script wrapper or command alias around

Re: [ansible-project] roles an funky playbooks

2013-12-11 Thread James Martin
I'd say use tags. That's what they are for. You could also divide your roles up, so instead of 2 roles, you have four. A/ config/ tasks/main.yml install/ tasks/main.yml B/ config/ tasks/main.yml install/ tasks/main.yml install.yml: - hosts: Ahosts roles:

Re: [ansible-project] Example of multi-datacenter deployments using Ansible

2013-12-06 Thread James Martin
Joel, This is untested, but might work (depending on what your playbooks are doing). Try using multiple groups and parent groups with children. Assuming your playbooks ran against the webservers or lbserver goup: if you wanted updated only dc1 : ansible-playbook myplabook.yml --limit dc1 if

Re: [ansible-project] Example of multi-datacenter deployments using Ansible

2013-12-06 Thread James Martin
the webservers in dc1. On Friday, December 6, 2013 12:38:47 PM UTC-5, James Martin wrote: Joel, It would be: - hosts: lbservers In theory, the --limit dc1 would limit the playbook to the lbservers in dc1. Just make sure you don't forget to limit! - James On Fri, Dec 6, 2013 at 12:32 PM

Re: [ansible-project] group_vars best practices

2013-12-05 Thread James Martin
Brian, That's interesting -- so if !!merge was specified somewhere down the line that var would get merged versus replaced? I like it! - James On Thu, Dec 5, 2013 at 4:58 PM, Brian Coca brianc...@gmail.com wrote: this is easy to implement using yaml tags/directives, but would look a bit

[ansible-project] group_vars best practices

2013-12-04 Thread James Martin
Is it considered bad practice to have variables in group_vars defined as such: ntp: server: server.foo.com setting: foo myapp: database: bar option: baz instead of : ntp_server: server.foo.com ntp_setting: foo myapp_database: bar myapp_option: baz It seems the first option is

Re: [ansible-project] group_vars best practices

2013-12-04 Thread James Martin
in ansible.cfg (which is not the standard option). As a result, people shouldn't really write roles for sharing that rely on that in many cases. On Wed, Dec 4, 2013 at 2:05 PM, James Martin jmar...@basho.com wrote: Is it considered bad practice to have variables in group_vars defined

Re: [ansible-project] using assemble to build iptables rules

2013-11-26 Thread James Martin
This is great stuff, thanks! On Tue, Nov 26, 2013 at 5:02 AM, Nick Groenen n...@travelbird.nl wrote: On Mon, Nov 25, 2013 at 11:04 PM, James Martin jmar...@basho.com wrote: Does this sound kosher? Yes it does, this is almost the same approach I've taken. There's a few gotcha's to be aware

Re: [ansible-project] ufw or iptables module

2013-11-25 Thread James Martin
I have been using a home-grown ufw module for a while. Just today I decided to submit a pull request to get it pulled in to ansible: https://github.com/ansible/ansible/pull/5048 Please test, comment, add feature requests, etc. - James On Fri, Nov 22, 2013 at 9:32 PM, David Reagan

[ansible-project] using assemble to build iptables rules

2013-11-25 Thread James Martin
So I've been thinking through a clean way to build iptables rules sets with some re-use between debian/ubuntu/redhat/centos world, and this is the strategy I've come up with in pseudo code: in a common bootstrap role: create /etc/syconfig/iptables.d in a debian/ubuntu bootstrap role: install