Re: [ansible-project] Setting host vars programmatically with dynamic inventory

2014-09-12 Thread Ches Martin
On Friday, September 12, 2014 6:31:37 AM UTC+7, Michael DeHaan wrote: > > Can you elaborate on what "map values to a particular host var name" would > mean? > > If I may guess at the question, group_vars/ does in fact work > with dynamic groups, if you want everything in ec2_tag_the_key_name_I_w

[ansible-project] multiple multi-line parsing regressions

2014-09-12 Thread Abhijit Menon-Sen
Hi. I have a vars/foo.yml file that contains: foo: | --- foo bar --- And then I have tasks that look like this: - name: Load foo include_vars: foo.yml - name: Write out foo copy: content="{{ foo }}" dest=/foo … With Ansible 1.6.8, this d

Re: [ansible-project] debconf, can't get it to conf

2014-09-12 Thread Alainkr
Okay thanks for your reply. But what is the use case for debconf with locales as illustrated in the http://docs.ansible.com/debconf_module.html Once a use debconf what's next ? Thanks Alain Le jeudi 11 septembre 2014 19:53:30 UTC+2, Karl Jorgensen a écrit : > > Hi > > On Thu, Sep 11, 2014 at

Re: [ansible-project] Ask for variable value if variable not defined.

2014-09-12 Thread Serkan C.
Hi, You're right, i was using default variables and extra parameters to override but i thought that maybe i can also use it for basic system playbooks. Thanks. On Wednesday, September 10, 2014 3:23:00 PM UTC+2, Michael DeHaan wrote: > > Nope, it doesn't do this. Simple as that :) > > I'd sugges

[ansible-project] Bug reporting fixing ettiquette. Bug before fix?

2014-09-12 Thread Stephen Gargan
Hit an issue with overriding include parameters with variables passed in as extras. I've made a fix and added a pull request, https://github.com/ansible/ansible/pull/8984 Added it as a bugfix pull request, but wasn't sure if there should have been a bug report first. What is the done thing? Is

Re: [ansible-project] Are group_vars re-evaluated for freshly provisioned EC2 instances with tags matching group names?

2014-09-12 Thread Josh Smift
MP> You can pass variables into add_host, so if you have the information MP> you need you can pass it along with the name you need. For instance: MP> MP> add_host: MP> name: blah MP> groups: db MP> ec2_tag_Name: blah MP> ec2_tag_Environment: staging MP> MP> I believe they will be

Re: [ansible-project] Ansible's docker module volumes option is a mystery (to me)

2014-09-12 Thread Matt Hughes
So I actually got this working. It think some of my confusion comes from how to specify 'list' variables. The docker module, says the 'volumes' parameter was a 'list'. Being new to Ansible and with no volumes example, I dug around a bit. EC2 module has a 'list' var of instance-ids and this

[ansible-project] How to make use of provided tags with --skip-tags or --tags inside a (role)-task ?

2014-09-12 Thread Nicolai Froehlich
Question Is it possible to access the list of provided tags ( --tags, --skip-tags ) from a variable inside a task? Is it maybe possible to access the invoked command itself from variable? Is it possible to use patterns (http://docs.ansible.com/intro_patterns.html) with tags? Something li

[ansible-project] Documenting variables expected by a role

2014-09-12 Thread Greg Leclercq
Dear Ansible enthousiasts, When I write a role, I'd like to tell what are the variables that tasks and templates will use. To prevent the interruption of the playbook in the middle of the execution of a role because a variable is not set, I also want to ensure that the playbook defines all mand

[ansible-project] Yum module and Cloudlinux

2014-09-12 Thread Martin Persson
Hello, we are trying to patch our servers with Ansible and the yum module which runs on Cloudlinux. The problem is that the playbook just returns that there is nothing to update. If we run yum update manually it works just fine. Has anyone had similar issues? -- You received this message bec

[ansible-project] Module service: Controlling priorities/dependencies between services

2014-09-12 Thread Jacek
Hi all, I wanted to start two services A, B while B depends on A (B should start only after A is started). I can't see a way in the current service module to force the priority of the installed service. Have you got any ideas how to attack the problem, preferably in a cross-platform (at least

Re: [ansible-project] Documenting variables expected by a role

2014-09-12 Thread Michael DeHaan
Assert would be fine to use here. (For future reference, the mailing list doesn't format things in Markdown) On Fri, Sep 12, 2014 at 5:22 AM, Greg Leclercq wrote: > Dear Ansible enthousiasts, > > When I write a role, I'd like to tell what are the variables that tasks > and templates will use.

Re: [ansible-project] How to make use of provided tags with --skip-tags or --tags inside a (role)-task ?

2014-09-12 Thread Michael DeHaan
No, this is not available, it doesn't really make sense for a task to know what tags are available because it can't do anything with that information. Boolean operations other than "OR" on --tags is also not presently available. On Fri, Sep 12, 2014 at 5:54 AM, Nicolai Froehlich < nicolai.froe

Re: [ansible-project] Yum module and Cloudlinux

2014-09-12 Thread Michael DeHaan
Can't say I know anything about CloudLinux. Obviously check your ansible version, and you'll probably have to debug the module to see what it's getting back from yum. Sharing what yum command line you have in your playbook would be useful, as well as your ansible version. Yum isn't really disabl

Re: [ansible-project] Module service: Controlling priorities/dependencies between services

2014-09-12 Thread Michael DeHaan
This sounds like a Linux question about init systems rather than an Ansible question. I'd suggest asking about how to tailor your init script on a site like StackOverflow* or reading up on the documentation for upstart, SysV, or whatever you are using. These are usually pretty straightforward, bu

Re: [ansible-project] Setting host vars programmatically with dynamic inventory

2014-09-12 Thread Michael Peters
You could modify your dynamic inventory. I think in the past it's been said that the ec2.py, etc are starting points for your own dynamic inventory scripts. This way you can do what you want with your ec2_tag_* variables and makes it easier when part of your infrastructure isn't even on EC2. On Fr

Re: [ansible-project] Bug reporting fixing ettiquette. Bug before fix?

2014-09-12 Thread Michael DeHaan
Yeah, I'd much rather just have the bugfix_pr submitted directly rather than have two tickets in the system. GitHub is great because there's a fantastic and ginormous group of people there, but the ticket management system and search is not so great, so having less tickets to search through is bet

Re: [ansible-project] multiple multi-line parsing regressions

2014-09-12 Thread Michael DeHaan
How about not using the silly content parameter? It's really intended for exceedingly basic one-liner things, and as you know in Ansible that value will get templated out to form a command line to the module, so having weird newlines in there, without the variable, wouldn't make much sense anyway.

[ansible-project] Strange thing with Jinja2 expressions evaluation

2014-09-12 Thread Andrew Pashkin
With this playbook: - name: test playbook hosts: 127.0.0.1 connection: local gather_facts: no tasks: - debug: msg="{{ 'ansible'|replace('a', 'b') }}" Output will be: "bnsible" But with this: - name: test playbook hosts: 127.0.0.1 connection: local g

Re: [ansible-project] Strange thing with Jinja2 expressions evaluation

2014-09-12 Thread Michael Peters
That's a pretty old version of ansible. I suspect that the regex_replace filter didn't exist then. You should definitely upgrade since it works on 1.7.1. On Fri, Sep 12, 2014 at 10:07 AM, Andrew Pashkin wrote: > With this playbook: > > - name: test playbook > hosts: 127.0.0.1 > connection: lo

Re: [ansible-project] Module service: Controlling priorities/dependencies between services

2014-09-12 Thread Jacek
Thanks Michael for suggestion. The trouble is that in my case there seem not to be any other way than stating priority manually during service installation (as in the given example). I think the quickest (dirty) approach is to run a command to install the script. Thanks anyway, Jacek W dn

Re: [ansible-project] Strange AWS Problems

2014-09-12 Thread Deniz Acay
I am running Ansible version 1.6.6. I am not sure why but now output shows additional errors with debug2/debug3 levels. Here's the output of the last task which seems to be failing: failed: [54.68.129.168] => {"failed": true, "md5sum": "d291e1a0289d0aee992726913 d86ecab", "parsed": false} inv

Re: [ansible-project] Module service: Controlling priorities/dependencies between services

2014-09-12 Thread Michael DeHaan
"The trouble is that in my case there seem not to be any other way than stating priority manually during service installation (as in the given example)" The Linux/Unit init systems do allow you to specify service start preconditions as to which services need to be started first. Perhaps I didn't

Re: [ansible-project] multiple multi-line parsing regressions

2014-09-12 Thread Michael DeHaan
Alternatively: copy: content: "{{ value }}" dest: foo Will pass things along without trying to go through the line-oriented parsing. On Fri, Sep 12, 2014 at 9:59 AM, Michael DeHaan wrote: > How about not using the silly content parameter? > > It's really intended for exceedingly basic

Re: [ansible-project] Setting host vars programmatically with dynamic inventory

2014-09-12 Thread Michael DeHaan
"is that I effectively want to assign/alias zookeeper_myid = ec2_tag_zookeeper_id andzookeeper_bind_address = ec2_private_ip_address for each host in the group" Are you saying you wish to add them to another group? The add_host module is good for that. On Fri, Sep 12, 2014 at 9:57 AM, Michael

[ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Willard Dennis
Hi all, I have an inventory file with hosts in different groups within. I would like to run a playbook on a certain group, but only where the host members of that group that have a certain OS (say, " ansible_distribution='Fedora' ".) I was told to look at the "group_by" module, and so in my top

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Serge van Ginderachter
On 12 September 2014 16:48, Willard Dennis wrote: > So am I doing this incorrectly, or for some reason, is the "os-Fedora" > group empty? (i.e. the logic is not matching any hosts) ​The --limit happens early, at initialization​, and at that time the group is indeed empty. AFAIK, there is no w

[ansible-project] Dealing with sporadic network failures on EC2 while running playbooks

2014-09-12 Thread Gregory Taylor
We use Ansible to deploy code updates across a small fleet (~8 machines). At least a few times a week, we run into network hiccups that cause the SSH connection to a random EC2 instance to fail, causing the entire playbook run to fail. Sometimes this happens such that we are left with an incomp

Re: [ansible-project] Setting host vars programmatically with dynamic inventory

2014-09-12 Thread Ches Martin
On Friday, September 12, 2014 9:30:19 PM UTC+7, Michael DeHaan wrote: > "is that I effectively want to assign/alias zookeeper_myid = > ec2_tag_zookeeper_id andzookeeper_bind_address = ec2_private_ip_address for > each host in the group" > > Are you saying you wish to add them to another group? >

Re: [ansible-project] multiple multi-line parsing regressions

2014-09-12 Thread Abhijit Menon-Sen
At 2014-09-12 10:29:23 -0400, mich...@ansible.com wrote: > > Alternatively: > > copy: >content: "{{ value }}" >dest: foo > > Will pass things along without trying to go through the line-oriented > parsing. Yes, as I mentioned in my mail, that's the workaround I'm already using. I do thin

Re: [ansible-project] Strange thing with Jinja2 expressions evaluation

2014-09-12 Thread Michael DeHaan
Yep yep. (You're also missing some security upgrades, so I would strongly recommend using 1.7.1 even if you don't need this) We try to note in the docs every time there's a feature added in a specific version, but I see we didn't do that for regex_replace, so I'll add the note about it. Thanks v

Re: [ansible-project] Strange AWS Problems

2014-09-12 Thread Michael DeHaan
Sounds like an unreliable connection, though it's curious it managed to return a mostly parseable response. Also it would be a good idea to take this time to upgrade to the latest released version, which is 1.7.1 On Fri, Sep 12, 2014 at 10:28 AM, Deniz Acay wrote: > > I am running Ansible ver

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Michael DeHaan
You can't use group_by stuff at that point because it hasn't run yet, true, but there is a solution to what you would like to do, using two plays in the same playbook - hosts: all tasks: - group_by: key=os-{{ ansible_distribution }} - hosts: "{{ distro | default('all') }}" tasks: -

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Michael DeHaan
Sorry in the above, the word "distro" should be "pattern". On Fri, Sep 12, 2014 at 11:42 AM, Michael DeHaan wrote: > You can't use group_by stuff at that point because it hasn't run yet, > true, but there is a solution to what you would like to do, using two plays > in the same playbook > > -

Re: [ansible-project] Dealing with sporadic network failures on EC2 while running playbooks

2014-09-12 Thread Michael DeHaan
Hmm We run a lot of EC2 plays from our integration tests -- originating *not* in EC2 and running almost constantly, and don't really see this -- some other providers, yes. I'd be curious if others do. You can definitely consider running the Ansible control machine *inside* EC2, where connect

Re: [ansible-project] Module service: Controlling priorities/dependencies between services

2014-09-12 Thread Jacek
They do unless they work in the legacy mode (see: http://manpages.ubuntu.com/manpages/natty/man8/update-rc.d.8.html and look for .legacy-bootordering). As mentioned, in my case there are a few "legacy" services in the default Ubuntu Server 14.04 installation that make the system to work in the

Re: [ansible-project] Dealing with sporadic network failures on EC2 while running playbooks

2014-09-12 Thread Gregory Taylor
On Fri, Sep 12, 2014 at 11:45 AM, Michael DeHaan wrote: > > You can definitely consider running the Ansible control machine *inside* > EC2, where connections will be more reliable (and also faster), which is > something I usually recommend to folks. > We run an Ansible Tower instance in EC2 that

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Willard Dennis
Thanks, Michael! But can I do the following? $ cat site.yml --- - hosts: all tasks: # Set up OS-specific groups - group_by: key=os-{{ansible_distribution}}-{{ansible_distribution_version}} - hosts: "{{ distro | default('all') }}" include: - dept1-servers.yml - dept2-servers.yml - b

Re: [ansible-project] Setting host vars programmatically with dynamic inventory

2014-09-12 Thread Josh Smift
CM> Basically, assuming this were possible somehow, it's what I want to do CM> (note the same dict key on both sides of assignment): CM> CM> hostvars[host].zookeeper_myid = hostvars[host].ec2_private_ip_address This seems like the thing that someone else helped me figure out how to do, e.g. I now

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Willard Dennis
Hmmm, I guess not... $ ansible-playbook -i temp-stor-inv -u root -k site.yml --tags=mailserver -e "distro=os-Fedora-20" SSH password: Traceback (most recent call last): File "/usr/bin/ansible-playbook", line 309, in sys.exit(main(sys.argv[1:])) File "/usr/bin/ansible-playbook", line 191

[ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread David Reagan
When running a playbook, I get "Couldn't read packet: Connection reset by peer" error. For playbook, command, and - output see: http://pastebin.com/VgAuvrct Ansible works fine on host1, but I get the error on host2. If I just use ssh on the command line, both hosts work fine. I've triple

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
Thanks for helping, it's much appreciated. I now have: tasks: - name: create an ami in us-east-1 ec2_ami: wait=yes aws_access_key={{ ec2_access_key }} aws_secret_key={{ ec2_secret_key }} instance_id={{ item }} region={{ regi

Re: [ansible-project] multiple multi-line parsing regressions

2014-09-12 Thread Michael DeHaan
Changing all the examples would make very good since for the short term, though I believe we can also deal with fixing the \n issue. I'm not aware of anything wrong with the key parameter, usually that's one entry per line anyway, and also only used with a single line, but multiple lines don't hur

Re: [ansible-project] Dealing with sporadic network failures on EC2 while running playbooks

2014-09-12 Thread Michael DeHaan
Yeah this is most definitely not a Tower specific thing since it's just running Ansible underneath -- but it's not something we have been seeing. I'd say run things periodically and avoid use of the Atlantis or Pompeii availability zones? :) On Fri, Sep 12, 2014 at 12:05 PM, Gregory Taylor wr

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Michael DeHaan
I'm unclear what you meant by "can I do X" specifically, what that meant you could or couldn't do. A traceback in ansible is a bug though, so please figure out what the minimum way to reproduce that is and file a ticket (provided you are using at least 1.7.1 already and it can be reproduced there)

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread Michael DeHaan
Can you show /tmp permissions? Also make sure you are SSH'ing as root and not a different user when doing the SSH check? On Fri, Sep 12, 2014 at 2:42 PM, David Reagan wrote: > When running a playbook, I get "Couldn't read packet: Connection reset by > peer" error. > > For playbook, comm

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Michael DeHaan
Can you please share the output of: - debug: var=instance Thanks! On Fri, Sep 12, 2014 at 2:43 PM, Peter Palmieri wrote: > Thanks for helping, it's much appreciated. > > I now have: > > tasks: > - name: create an ami in us-east-1 > ec2_ami: wait=yes >aws_access_ke

Re: [ansible-project] Dealing with sporadic network failures on EC2 while running playbooks

2014-09-12 Thread Gregory Taylor
On Fri, Sep 12, 2014 at 3:16 PM, Michael DeHaan wrote: > Yeah this is most definitely not a Tower specific thing since it's just > running Ansible underneath -- but it's not something we have been seeing. > > I'd say run things periodically and avoid use of the Atlantis or Pompeii > availability

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
That shows: TASK: [debug var=instance] ok: [54.90.128.104] => { "instance": { "changed": true, "msg": "All items completed", "results": [ { "changed": true, "image_id":

[ansible-project] Is sensitive data written to disk on the remote side?

2014-09-12 Thread Diego Morales
Hello all, I don't wanna sound like a security paranoid-freak (which I am not), but I wonder: I read in the docs that ansible copies modules to the remote machine, do its magic, and removes them before finishing. Does it copy/removes playbooks and vars files (potentially containing sensitive d

[ansible-project] Re: Created an elasticache via Ansible - Get an Error "Use of cache security groups is not permitted in this API version for your account"

2014-09-12 Thread Dhawal Patel
I get the same error when trying to create a redis cache cluster using Cloud Formation template: "Use of cache security groups is not permitted in this API version for your account.". I'm creating a AWS::ElastiCache::SecurityGroup so I can allow access from my EC2 instances and it fails to crea

[ansible-project] Change current directory before tasks are run

2014-09-12 Thread Jesse DeFer
I am trying to create a playbook to unmount an AFS mounted home directory, but I can't unmount it because the user running ansible has open files because of ansible. I can't do this with user with a local home, or ssh configs or anything like that. I need to do it with a regular ansible play

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread David Reagan
/tmp on host1 > drwxrwxrwt 45 root root 4096 Sep 12 11:26 tmp /tmp on host2 > drwxrwxrwt 47 root root12288 Sep 12 12:55 tmp root is blocked from ssh. --David Reagan On Fri, Sep 12, 2014 at 12:21 PM, Michael DeHaan wrote: > Can you show /tmp permissions? > > Also make sure you are SSH'i

Re: [ansible-project] Is sensitive data written to disk on the remote side?

2014-09-12 Thread Michael DeHaan
First off, playbooks on the working tree never get transferred to the remote side. What is happening with the modules is transfers the module and the rm command to clean it up gets sent along right with the command to execute the module. There's also the "no_log" attribute to surpress remote sysl

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Michael Peters
Does the chdir argument to raw work? raw: "/usr/sbin/lsof /afs" chdir="/" On Fri, Sep 12, 2014 at 12:45 PM, Jesse DeFer wrote: > I am trying to create a playbook to unmount an AFS mounted home directory, > but I can't unmount it because the user running ansible has open files > because of ansi

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Michael DeHaan
In that case, looks like you want: instance.results[0].image_id On Fri, Sep 12, 2014 at 3:54 PM, Peter Palmieri wrote: > That shows: > > TASK: [debug var=instance] > > ok: [54.90.128.104] => { > "instance": { > "changed": true,

Re: [ansible-project] Re: Created an elasticache via Ansible - Get an Error "Use of cache security groups is not permitted in this API version for your account"

2014-09-12 Thread Michael DeHaan
Yeah don't know how to help with this one. Perhaps worth asking of AWS. On Fri, Sep 12, 2014 at 3:55 PM, Dhawal Patel wrote: > I get the same error when trying to create a redis cache cluster using > Cloud Formation template: "Use of cache security groups is not permitted > in this API versio

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread Michael DeHaan
What about permissions on the ansible-tmp directory mentioned above? You may need to set ANSIBLE_KEEP_REMOTE_FILES=1 in your environment to keep it around. On Fri, Sep 12, 2014 at 3:58 PM, David Reagan wrote: > /tmp on host1 > > drwxrwxrwt 45 root root 4096 Sep 12 11:26 tmp > > /tmp on host

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Michael DeHaan
Another thought might be to use the "at" module to defer execution of this particular command, sleep a bit to let it run, and then proceed? On Fri, Sep 12, 2014 at 4:01 PM, Michael Peters wrote: > Does the chdir argument to raw work? > > raw: "/usr/sbin/lsof /afs" chdir="/" > > On Fri, Sep 1

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Michael DeHaan
Or configure ansible.cfg to use a different temp dir path? On Fri, Sep 12, 2014 at 4:07 PM, Michael DeHaan wrote: > Another thought might be to use the "at" module to defer execution of this > particular command, sleep a bit to let it run, and then proceed? > > > > On Fri, Sep 12, 2014 at 4:01 P

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
Thank you very much, that did it. On Friday, September 12, 2014 4:04:53 PM UTC-4, Michael DeHaan wrote: > > In that case, looks like you want: > > instance.results[0].image_id > > > > On Fri, Sep 12, 2014 at 3:54 PM, Peter Palmieri > wrote: > >> That shows: >> >> TASK: [debug var=instance] >> *

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread David Reagan
On host1 (where it works) drwxr-xr-x 2 remoteuser users 4096 Sep 12 13:21 ansible-tmp-1410553290.83-203438518100770 tmp/ansible-tmp-1410553290.83-203438518100770: total 164 -rw--- 1 remoteuser users 163033 Sep 12 13:21 setup On host2 (where it doesn't work) drwxr-xr-x 2 remoteuser user

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread Michael DeHaan
If using the SSH connection (which you are by default) you could consider toggling SFTP/SCP in ansible.cfg and see if that helps. One more thing to try... But yeah you say those are the same so that's weird. On Fri, Sep 12, 2014 at 4:29 PM, David Reagan wrote: > On host1 (where it works) > d

Re: [ansible-project] Is there a way to dynamically target subsets of an inventory group based on facts?

2014-09-12 Thread Willard Dennis
Sorry Michael, I will try to be more clear. I am running Ansible 1.7.1 currently. So my original site.yml is this: $ cat site.yml.orig --- - include: dept1-servers.yml - include: dept2-servers.yml - include: base-static-setup.yml ...which works fine. The one producing the traceback is this:

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Jesse DeFer
raw doesn't seem to have a chdir option or it doesn't have the effect I need, command does but it still shows open files. I already have remote_tmp set to a different directory. I'm sure I could do something with at, but that's not the cleanest way to do it. I had thought to set "sudo_exe =

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread David Reagan
scp_if_ssh=True made it work. Weird, very weird. Is there any major difference between using sftp vs scp? --David Reagan On Fri, Sep 12, 2014 at 1:35 PM, Michael DeHaan wrote: > If using the SSH connection (which you are by default) you could consider > toggling SFTP/SCP in ansible.cfg and see

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Michael DeHaan
If remote temp is outside of your home why would it still prevent things from unmounting? On Fri, Sep 12, 2014 at 4:39 PM, Jesse DeFer wrote: > raw doesn't seem to have a chdir option or it doesn't have the effect I > need, command does but it still shows open files. I already have > remote_t

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread Michael DeHaan
Basically none. Sometimes sftp is disabled. I offhand can't remember why we didn't just scp every time - but I think that may encounter occasional reasons as well, perhaps on odd platforms. On Fri, Sep 12, 2014 at 4:45 PM, David Reagan wrote: > scp_if_ssh=True made it work. Weird, very weir

Re: [ansible-project] Change current directory before tasks are run

2014-09-12 Thread Jesse DeFer
The CWD of the shell and sudo are still the home directory. The chdir needs to happen before sudo is called. On Friday, September 12, 2014 1:46:39 PM UTC-7, Michael DeHaan wrote: > > If remote temp is outside of your home why would it still prevent things > from unmounting? > > > > On Fri, Sep

[ansible-project] Optional valut import

2014-09-12 Thread DomaNitro
Hey, I was wondering if its possible to do optional import of vault encrypted files. i.e. if a password/password file is presented the encrypted file will be included. Else the file will be ignored. Thanks -- You received this message because you are subscribed to the Google Groups "Ansible

Re: [ansible-project] When running a playbook, I get "Couldn't read packet: Connection reset by peer" error.

2014-09-12 Thread David Reagan
In that case, I'll just leave it set to use scp. Thanks for the help! :) --David Reagan On Fri, Sep 12, 2014 at 1:47 PM, Michael DeHaan wrote: > Basically none. > > Sometimes sftp is disabled. > > I offhand can't remember why we didn't just scp every time - but I think > that may encounter occ

Re: [ansible-project] Optional valut import

2014-09-12 Thread Michael DeHaan
Yeah, this is presently not possible unfortunately. I think this could be potentially confusing unless it threw a warning when attempting to read the file - because you might not know why a variable would be undefined. If we did this, it would need to be a config setting, default off, in ansible.

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
How can I reference this in an ini file module? I'm trying to write the value of the ami id to a file, to be consumed by another process. This didn't work: - ini_file: dest=ami.ini section=qa option=ami value={{ var=instance.results[0].image_id }} I got: TASK: [ini_file dest=ami.ini section=q

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Michael DeHaan
Take out the var= {{ instance.results[0].image_id }} On Fri, Sep 12, 2014 at 5:36 PM, Peter Palmieri wrote: > How can I reference this in an ini file module? I'm trying to write the > value of the ami id to a file, to be consumed by another process. This > didn't work: > > - ini_file: dest=am

Re: [ansible-project] Optional valut import

2014-09-12 Thread Shaunak Kashyap
You could make it work like so: https://gist.github.com/ycombinator/21dd0ca3c0ee9472f64d On Fri, Sep 12, 2014 at 2:12 PM, Michael DeHaan wrote: > Yeah, this is presently not possible unfortunately. > > I think this could be potentially confusing unless it threw a warning when > attempting to re

Re: [ansible-project] Optional valut import

2014-09-12 Thread Michael DeHaan
Well that would not import it if that first file were not present, yes, but most likely it would be present. On Fri, Sep 12, 2014 at 5:53 PM, Shaunak Kashyap wrote: > You could make it work like so: > https://gist.github.com/ycombinator/21dd0ca3c0ee9472f64d > > > On Fri, Sep 12, 2014 at 2:12 P

Re: [ansible-project] Optional valut import

2014-09-12 Thread Shaunak Kashyap
Ah yes, I misinterpreted "if a password/password file is presented" as the vaulted file being present/absent not the vault password/password file. Sorry. On Fri, Sep 12, 2014 at 2:54 PM, Michael DeHaan wrote: > Well that would not import it if that first file were not present, yes, > but most li

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
Sorry, I should have got that one on my own. Thank you again for your help. On Friday, September 12, 2014 5:52:36 PM UTC-4, Michael DeHaan wrote: > > Take out the var= > > {{ instance.results[0].image_id }} > > > > On Fri, Sep 12, 2014 at 5:36 PM, Peter Palmieri > wrote: > >> How can I reference

[ansible-project] Support process substitution?

2014-09-12 Thread Paul Smith
Does Ansible not support bash's process substitution ? My project maintains separate inventory files, and there are some playbooks that need hosts from certain combinations of them. Instead of having pre-concatenated files that could go out of sync

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Peter Palmieri
Meant to add, Ansible is a huge boon to our infrastructure efforts. Thanks so much to the Ansible team for creating this tool. On Friday, September 12, 2014 6:10:56 PM UTC-4, Peter Palmieri wrote: > > Sorry, I should have got that one on my own. Thank you again for your > help. > > >> -- You

Re: [ansible-project] Support process substitution?

2014-09-12 Thread Michael DeHaan
To be honest, I've never even seen that syntax used before -- redirection of input/output obviously yes... It's a sign you can be writing systems management software for well over a decade and not learn all the bash things. Basically right now it takes either a string - for a very deprecated use

Re: [ansible-project] Getting the ID of an AMI created with Ansible

2014-09-12 Thread Michael DeHaan
Saying this collectively for hundreds of people here who have helped with things, and the rest of the team - you are welcome!!! On Fri, Sep 12, 2014 at 6:13 PM, Peter Palmieri wrote: > Meant to add, Ansible is a huge boon to our infrastructure efforts. Thanks > so much to the Ansible team for c

[ansible-project] ec2 module: volumes parameter: How to specify volume id?

2014-09-12 Thread AJ Daws
The volumes parameter of the ec2_module allows us to specify volumes to create on startup. Can it also be used to specify an existing volume_id to attach? From the wording it doesn't sound like it is only for creating volumes, which makes me think it can use existing ones as well? If so, wh

[ansible-project] Output multi-line string as-is (not JSON format)

2014-09-12 Thread AJ Daws
I have a large, multi-line string that I would like to output in a role. Currently I'm using the debug module like this: - name: Cloud-init user_data debug: msg: "{{ cloudinit_user_data|indent(6) }}" However this generates JSON output which is quite hard to read as newlines are represent