Re: [ansible-project] Re: looping over set of tasks (roles?)

2014-06-27 Thread 'Petros Moisiadis' via Ansible Project
On 06/26/2014 10:22 PM, Michael DeHaan wrote: On Thu, Jun 26, 2014 at 3:10 PM, 'Petros Moisiadis' via Ansible Project ansible-project@googlegroups.com mailto:ansible-project@googlegroups.com wrote: On 06/26/14 21:06, Michael DeHaan wrote: Ansible can do this kind of loops, but

[ansible-project] Re: Best practice for recording Ansible provisioning runs

2014-06-27 Thread Craig Marvelley
Thanks guys, think each of these are exactly what I need. I'll give them a try. Thanks for the help! On Wednesday, June 4, 2014 10:42:37 AM UTC+1, Craig Marvelley wrote: Hi all, I was wondering if anyone has a strategy for recording when a playbook has been run against hosts in an

Re: [ansible-project] Jinja2 extract single value for key/value pair without looping

2014-06-27 Thread 'Petros Moisiadis' via Ansible Project
On 06/27/2014 11:27 AM, jepper wrote: I have the following defined in vars or defaults: fusemq_authentication: - { 'username':'admin', 'password’:'blah', 'groups':'admin' } - { 'username':'LOGSTASH', 'password’:'bing', 'groups':'LOGSTASH' } I want to know the password

Re: [ansible-project] Jinja2 extract single value for key/value pair without looping

2014-06-27 Thread Tomasz Kontusz
jepper jespm...@gmail.com napisał: I have the following defined in vars or defaults: fusemq_authentication: - { 'username':'admin', 'password’:'blah', 'groups':'admin' } - { 'username':'LOGSTASH', 'password’:'bing', 'groups':'LOGSTASH' } This should be a dictionary I want to

[ansible-project] How to run python setup.py develop command inside virtualenv using ansible

2014-06-27 Thread Roman Dryndik
I want to execute python setup.py develop command inside of virtualenv using ansible. How to do it? Probably could be something like this: - name: egg shell: python setup.py develop But I need to execute it inside of virtualenv. How can I do it? -- You received this message

Re: [ansible-project] include search path from a roled play

2014-06-27 Thread F.L. Jonathan Araña Cruz
On 26/06/14 17:59, Michael DeHaan wrote: Would be great to have a magic variable to obtain the path to roles tasks, to allow for things like: I feel it would be pretty esoteric and infrequently used, we tend to push back on extra magic until enough use cases for them start to appear.

Re: [ansible-project] How to run python setup.py develop command inside virtualenv using ansible

2014-06-27 Thread Michael Schultz
On Jun 27, 2014 5:08 AM, Roman Dryndik dryndikro...@gmail.com wrote: I want to execute python setup.py develop command inside of virtualenv using ansible. How to do it? Probably could be something like this: - name: egg shell: python setup.py develop You can specify the path to

Re: [ansible-project] Waiting for Elastic IP address?

2014-06-27 Thread Michael DeHaan
Apparently, waiting for state=started and port 22 to become accessible (see below) is not sufficient. Almost always, it's useful to put a pause after waiting for port 22 to become open. The reason for this is SSH isn't always ready as soon as the port is up - usually it's not. a 5 second

Re: [ansible-project] msg: Destination /usr/local/bin not writable

2014-06-27 Thread Michael DeHaan
(A) Do you have permission to write into /usr/local/bin from sudo or is it constrained? (B) What flags are you executing Ansible playbook with? Looks like you are missing sudo: True in your playbook. On Thu, Jun 26, 2014 at 5:44 PM, Nic Flores flores...@gmail.com wrote: Hi All, I'm

Re: [ansible-project] Strange bug with Synchronize module?

2014-06-27 Thread Michael DeHaan
What do you get when you run with - as it suggests? On Thu, Jun 26, 2014 at 9:02 PM, Cameron Junge macro...@gmail.com wrote: Hi, I'm testing a playbook by running it against localhost, and am getting a really bizarre error from the syncronize module. I am connecting back to localhost

Re: [ansible-project] include search path from a roled play

2014-06-27 Thread Michael DeHaan
For example, a munin role may ask apache role to create a virtualhost, if it finds apache is available. Role dependencies can include when statements. The conditionals will be applied to each task in the role, so the parameters would need to be loaded first, i.e in your role dependencies: {

[ansible-project] behavior of changing apt_repository is to add a new line and preserving the old data

2014-06-27 Thread zhong ming wu
I had the following - name: add my repository apt_repository: repo=deb http://repo.local.example.com/apt/u14 abcd main Then I changed it to - name: add my repository apt_repository: repo=deb http://repo.local.example.com/apt/u14 xyz main Ansible just add a new line to the existing file

[ansible-project] using ec2-create module output as variable

2014-06-27 Thread Serkan C.
Hi, I would like to use ec2-create module outputs as variable and pass it to other roles, this is playbook structure; --- - name: deploy project (staging) ( v:{{ version }} ) hosts: localhost vars_files: - ../vars.yml roles: - { role: ec2-create, aws_region: {{ staging_aws_region

Re: [ansible-project] include search path from a roled play

2014-06-27 Thread F.L. Jonathan Araña Cruz
On 27/06/14 13:49, Michael DeHaan wrote: For example, a munin role may ask apache role to create a virtualhost, if it finds apache is available. Role dependencies can include when statements. The conditionals will be applied to each task in the role, so the parameters would need to be

Re: [ansible-project] behavior of changing apt_repository is to add a new line and preserving the old data

2014-06-27 Thread Enrique Paredes
if you only want to add a file in /apt/sour On 27/06/2014, at 12:50, zhong ming wu mr.z.m...@gmail.com wrote: I had the following - name: add my repository apt_repository: repo=deb http://repo.local.example.com/apt/u14 abcd main Then I changed it to - name: add my repository

Re: [ansible-project] behavior of changing apt_repository is to add a new line and preserving the old data

2014-06-27 Thread Enrique Paredes
if you want to add a file in apt/sources.d use the copy module instead. I don't know any other uses to add-apt-repository than adding ppas. (sorry for the trucated previous message) On 27/06/2014, at 12:50, zhong ming wu mr.z.m...@gmail.com wrote: I had the following - name: add my

Re: [ansible-project] Re: looping over set of tasks (roles?)

2014-06-27 Thread Brian Coca
we have a do/until already -- Brian Coca Stultorum infinitus est numerus 0111011100100110010101101110001001110111011000010110011101010010011100110110110101110111001001110111 Pedo mellon a minno -- You received this message because you are subscribed to the

[ansible-project] Re: Waiting for Elastic IP address?

2014-06-27 Thread Slim Slam
It's still not working. I even made the pause 10 seconds (see below). SSH still doesn't work until maybe 30 seconds later. I'm launching an m3large instance and I'm only using the Amazon Linux base (no customization). AMI: ami-7c807d14 Any ideas? J - name: Tie elastic IP to the

Re: [ansible-project] Re: Waiting for Elastic IP address?

2014-06-27 Thread Michael DeHaan
Perhaps it's taking longer because an EIP is involved, apologies as my previous info-sharing was based on general SSH experiments. Could it be that the EIP itself is not yet ready? On Fri, Jun 27, 2014 at 11:29 AM, Slim Slam slimands...@gmail.com wrote: It's still not working. I even made

[ansible-project] Re: Waiting for Elastic IP address?

2014-06-27 Thread Slim Slam
Quite probably it's the EIP since it worked ok before I added it. On the documentation page for the ansible ec2-eip module, it says: There may be a delay between the time the Elastic IP is assigned and when the cloud instance is reachable via the new address. Use wait_for and pause to delay

[ansible-project] How to replicate local user account to remote system?

2014-06-27 Thread Marc Abramowitz
I feel like this probably comes up a lot and is a solved problem, but my Google-fu is failing me. I'm using Ansible with vagrant to create development virtual machines. The one thing that bugs me a little (and this was true with our previous Chef-based solution as well to be fair) is that I

[ansible-project] How do I remove host-group all

2014-06-27 Thread Eric Wedaa
For assorted reasons I want to remove or rename the host-group all. I've googled this already and couldn't find it. Can somebody tell me what file(s) to edit? (I grep'd the tree but can't find a reasonable place to start). Failing this, then I guess I have to write a wrapper script which I'd

Re: [ansible-project] How to replicate local user account to remote system?

2014-06-27 Thread Michael DeHaan
This is of course all solvable by copying my dotfiles over; I could even create an account with my name. I haven't bothered to do this, because I'm lazy to do this manually Write a playbook? :) Most people would keep their dotfiles as a repo, managed centrally, rather than trying to discover

Re: [ansible-project] How do I remove host-group all

2014-06-27 Thread Brian Coca
this is hardcoded into ansible, that and 'ungrouped'​ are both part of the inventory api. -- 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] How do I remove host-group all

2014-06-27 Thread Eric Wedaa
Because there's a certain level of paranoia where I am. If we HAVE to specify an existing group, then that at least slows down somebody from running a command against ALL our servers. On Friday, June 27, 2014 12:15:18 PM UTC-4, Michael DeHaan wrote: May I ask why? Perhaps you speak a

Re: [ansible-project] How do I remove host-group all

2014-06-27 Thread Brian Coca
split your inventory into discrete groups, even if they run all, it will only include the specific inventory. also, for that kind of fine grained access control, you might want to look at tower. -- Brian Coca Stultorum infinitus est numerus

Re: [ansible-project] How to replicate local user account to remote system?

2014-06-27 Thread Marc Abramowitz
On Friday, June 27, 2014 9:12:52 AM UTC-7, Michael DeHaan wrote: This is of course all solvable by copying my dotfiles over; I could even create an account with my name. I haven't bothered to do this, because I'm lazy to do this manually Write a playbook? :) Yes. I would like to do

[ansible-project] Dynamic list variable

2014-06-27 Thread mmccarthy
Hi All, I am attempting to create an AWS VPC and AWS DB subnet group within an Ansible play. My problem is that I need to know the subnet ids in order to create a DB subnet group. I have registered the results of the ec2_vpc module. This gives me access to the subnets and their ids but does

Re: [ansible-project] Jinja2 extract single value for key/value pair without looping

2014-06-27 Thread Timothy Appnel
Theoretically in Jinja 2.8 when it's released you could perform this operation with something like this: {{ fusemq_auth|selectattr('username','equalto','LOGSTASH')|map(attribute='password')|first }} selectattr and map are new to version 2.7. The 'equalto' test is the problem you'll run in

[ansible-project] A problem with using the virt module output as a registered variable for looping

2014-06-27 Thread zperry
I have the following simple task include file: --- - name: List info of all available KVM guests on the host virt: command=info register: vminfo - name: Put all running host into a group add_host: name=hostname='{{ item.key }}' groupname=running_vms with_dict: vminfo when:

Re: [ansible-project] A problem with using the virt module output as a registered variable for looping

2014-06-27 Thread Dustin C. Hatch
On 06/27/2014 07:47 PM, zperry wrote: I have the following simple task include file: ... All vms were skipped. I believe this is cased by the extra u added in front of each key and value. Is there a way to prevent this or strip the u character? There's a nested dictionary inside the

Re: [ansible-project] A problem with using the virt module output as a registered variable for looping

2014-06-27 Thread zperry
HI Dustin, You are 100% right. Why I missed the obvious? :( Time for more coffee :) Thanks! -- Zack On Friday, June 27, 2014 6:07:51 PM UTC-7, Dustin C. Hatch wrote: On 06/27/2014 07:47 PM, zperry wrote: I have the following simple task include file: ... All vms were

[ansible-project] facter on CentOS 6.5

2014-06-27 Thread David Reagan
As far as I can tell, I need to add the EPEL repositories in order to install facter on CentOS. Am I right? So far, the only way to install the EPEL repo I have found is to download the rpm for it, and then use rpm to install it. Not something I really want to do every time I run my