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
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
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
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
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
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
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
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
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
-
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
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
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
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
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
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
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
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
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
, 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
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
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
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
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
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 }}
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
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
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
/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
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
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-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.
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.
- 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,
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:
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
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,
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
': 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
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
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:
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.
-
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:
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
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
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
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
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
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:
@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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
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,
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
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
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
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
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
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
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
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
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
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,
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
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:
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
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
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
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
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
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
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
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
89 matches
Mail list logo