Dear list,
First off; awesome work on Ansible. It’s a breath of fresh air after using Chef/Cdist/Puppet.
I do have a couple of questions.
What would be the idiomatic way to append some text to a remote file (for example append some host to /etc/munin/munin.conf)?
And how can I download a file hosted on a remote server? For example we are running a Riak cluster, the .deb is hosted on the developer’s website and we used to grab that with Chef directly to installation.
When I failed downloading a file with the ‘fetch’ module I started looking into writing my own module. I’m proficient with Ruby but when I used Chef I needed to bootstrap an entire Ruby install on the remote machine. Is that still necessary with Ansible. I don’t think so but how, then, does it work?
With kind regards,
Harm
Dear list,
First off; awesome work on Ansible. It’s a breath of fresh air after using Chef/Cdist/Puppet.
I do have a couple of questions.
What would be the idiomatic way to append some text to a remote file (for example append some host to /etc/munin/munin.conf)?
I wouldn’t do this, as this is very unreliable and can easily break. Configuration should be centrally managed – You want to push down a template declaring exactly what munin.conf should be.
And how can I download a file hosted on a remote server? For example we are running a Riak cluster, the .deb is hosted on the developer’s website and we used to grab that with Chef directly to installation.
When I failed downloading a file with the ‘fetch’ module I started looking into writing my own module. I’m proficient with Ruby but when I used Chef I needed to bootstrap an entire Ruby install on the remote machine. Is that still necessary with Ansible. I don’t think so but how, then, does it work?
Fetch grabs files from other ansible hosts. If you want to grab stuff from a “developer’s website”, it’s really dangerous to keep downloading it every time you deploy (site might not be up, content may not be consistent) … and abusive of that user’s bandwidth. Download it locally, and put it in a repo. Use ansible to configure the deb repo, etc. You could push files out, but it really makes sense to use your distro’s package manager.
Dear list,
First off; awesome work on Ansible. It’s a breath of fresh air after using Chef/Cdist/Puppet.
I do have a couple of questions.
What would be the idiomatic way to append some text to a remote file (for example append some host to /etc/munin/munin.conf)?
I wouldn’t do this, as this is very unreliable and can easily break. Configuration should be centrally managed – You want to push down a template declaring exactly what munin.conf should be.
Fair enough, still feels a bit off but that might just be the Chef rubbing off.
And how can I download a file hosted on a remote server? For example we are running a Riak cluster, the .deb is hosted on the developer’s website and we used to grab that with Chef directly to installation.
When I failed downloading a file with the ‘fetch’ module I started looking into writing my own module. I’m proficient with Ruby but when I used Chef I needed to bootstrap an entire Ruby install on the remote machine. Is that still necessary with Ansible. I don’t think so but how, then, does it work?
Fetch grabs files from other ansible hosts. If you want to grab stuff from a “developer’s website”, it’s really dangerous to keep downloading it every time you deploy (site might not be up, content may not be consistent) … and abusive of that user’s bandwidth. Download it locally, and put it in a repo. Use ansible to configure the deb repo, etc. You could push files out, but it really makes sense to use your distro’s package manager.
This deb is not in a particular (apt) repo. Downloading it every time is only once ever 2 weeks or so.
But how does a Ruby module work? Does the remote need to have Ruby installed?
Thanks!
Dear list,
First off; awesome work on Ansible. It’s a breath of fresh air after using Chef/Cdist/Puppet.
I do have a couple of questions.
What would be the idiomatic way to append some text to a remote file (for example append some host to /etc/munin/munin.conf)?
I wouldn’t do this, as this is very unreliable and can easily break. Configuration should be centrally managed – You want to push down a template declaring exactly what munin.conf should be.
Fair enough, still feels a bit off but that might just be the Chef rubbing off.
what you are talking about is older than that.
cfengine: AppendIfNoSuchLine
puppet: append_if_no_such_line
IMHO, it’s still a really bad thing to do as you have no idea what configuration is really on your remote systems.
Fetch grabs files from other ansible hosts. If you want to grab stuff from a “developer’s website”, it’s really dangerous to keep downloading it every time you deploy (site might not be up, content may not be consistent) … and abusive of that user’s bandwidth. Download it locally, and put it in a repo. Use ansible to configure the deb repo, etc. You could push files out, but it really makes sense to use your distro’s package manager.
This deb is not in a particular (apt) repo. Downloading it every time is only once ever 2 weeks or so.
It is not Ansible’s job to interact with systems other than the ones you own.
But how does a Ruby module work? Does the remote need to have Ruby installed?
Are you talking about ohai and facter? Yes, they require ruby. This is why ansible has it’s own facts now – so they aren’t required anymore.
Thanks!
Dear list,
First off; awesome work on Ansible. It’s a breath of fresh air after using Chef/Cdist/Puppet.
I do have a couple of questions.
What would be the idiomatic way to append some text to a remote file (for example append some host to /etc/munin/munin.conf)?
I wouldn’t do this, as this is very unreliable and can easily break. Configuration should be centrally managed – You want to push down a template declaring exactly what munin.conf should be.
Fair enough, still feels a bit off but that might just be the Chef rubbing off.
what you are talking about is older than that.
cfengine: AppendIfNoSuchLine
puppet: append_if_no_such_line
IMHO, it’s still a really bad thing to do as you have no idea what configuration is really on your remote systems.
I like it!
Fetch grabs files from other ansible hosts. If you want to grab stuff from a “developer’s website”, it’s really dangerous to keep downloading it every time you deploy (site might not be up, content may not be consistent) … and abusive of that user’s bandwidth. Download it locally, and put it in a repo. Use ansible to configure the deb repo, etc. You could push files out, but it really makes sense to use your distro’s package manager.
This deb is not in a particular (apt) repo. Downloading it every time is only once ever 2 weeks or so.
It is not Ansible’s job to interact with systems other than the ones you own.
But how does a Ruby module work? Does the remote need to have Ruby installed?
Are you talking about ohai and facter? Yes, they require ruby. This is why ansible has it’s own facts now – so they aren’t required anymore.
No, I’m talking about some yet-to-be-made Ansible module like ‘yum’. If that hypothetical module is written in Ruby, the remote needs to have Ruby in order to use it right?
I like it!
Sure, no problem.
You’re free to write a module for it, it’s just not going to ship in Ansible core. You could even write it in Ruby like below
Are you talking about ohai and facter? Yes, they require ruby. This is why ansible has it’s own facts now – so they aren’t required anymore.
No, I’m talking about some yet-to-be-made Ansible module like ‘yum’. If that hypothetical module is written in Ruby, the remote needs to have Ruby in order to use it right?
A module that needs Ruby will need Ruby, yes!
Imagine the technology involved to get around that
Harm,
I will be writing a module which will assure that a particular line
appears in a file. This is not "append to file" but might serve you. The
semantics will be like the current ansible "template" module but applied
to one line within a file instead of a whole file: declare what you want
and get idempotent behavior.
-- Art Z.
I like it!
Sure, no problem.
You’re free to write a module for it, it’s just not going to ship in Ansible core. You could even write it in Ruby like below
Are you talking about ohai and facter? Yes, they require ruby. This is why ansible has it’s own facts now – so they aren’t required anymore.
No, I’m talking about some yet-to-be-made Ansible module like ‘yum’. If that hypothetical module is written in Ruby, the remote needs to have Ruby in order to use it right?
A module that needs Ruby will need Ruby, yes!
Imagine the technology involved to get around that
Hehehe. Would this also mean that Ansible needs Python installed on the remote system?
Very interesting. I’ll keep a close eye on the ansible-contrib repo (as soon as it appears).
Is there any code for this module? I’ve written a prototype for a similar one, not knowing that you were already doing this.