
Hello, The talk on Ansible yesterday made it look like the rules are Debian specific. If you have a mix of Redhat / Debian systems, is it possible to use Ansible? Is it possible to do this without duplicating rules for Debian systems and for Redhat systems? e.g. if you want a rule that installs vim, regardless of if apt-get or yum is used, what would this rule look like? Thanks

On 08/07/15 17:36, Brian May wrote:
The talk on Ansible yesterday made it look like the rules are Debian specific.
Sorry, I should have made it clear that I happen to use Debian, but Ansible can manage any servers - including Windows servers. I did mention that it will use PowerShell for Windows servers.
If you have a mix of Redhat / Debian systems, is it possible to use Ansible? Is it possible to do this without duplicating rules for Debian systems and for Redhat systems?
It's definitely possible and intended that Ansible can be used for heterogenous networks.
e.g. if you want a rule that installs vim, regardless of if apt-get or yum is used, what would this rule look like?
There is a "yum" module that is the equivalent of the "apt" module, and you would use whichever one you need depending on the server OS. If you have a mix of servers, you still need to know which servers are running which OS, and you would probably put the servers into distinct groups and have some distinct rules for each group. Hope that helps, Andrew

On 08/07/15 17:36, Brian May wrote:
e.g. if you want a rule that installs vim, regardless of if apt-get or yum is used, what would this rule look like?
Here are some examples: https://gist.github.com/hostmaster/8385567 <https://raymii.org/s/tutorials/Ansible_-_Only_if_on_specific_distribution_or_distribution_version.html> Hope that helps, Andrew

A configuration management system should abstract this! package {'vim': ensure => installed }

On 08/07/15 22:23, Andrew Spiers wrote:
A configuration management system should abstract this!
package {'vim': ensure => installed }
But the package names aren't necessarily the same on different operating systems. If you want it abstracted, it's easy enough to code that and include it everywhere you need to ensure a particular application is installed, with the specific details as required by particular environments. I already gave you an example for the simple case where the package names are the same: - name: Install vim action: "{{ ansible_pkg_mgr }} name=vim state=present" Hope that helps, Andrew

On Wed, 8 Jul 2015 10:23:05 PM Andrew Spiers wrote:
A configuration management system should abstract this!
package {'vim': ensure => installed }
The last comment in the first example that was linked to says: # Or this (so long as the package has the same name on all distros): # - name: Install wget # action: "{{ ansible_pkg_mgr }} name=wget state=present" But you would have thought that they would have made that the default action rather than have to specify it. cheers, Chris -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC

Quoting Brian May (brian@microcomaustralia.com.au):
The talk on Ansible yesterday made it look like the rules are Debian specific.
If you have a mix of Redhat / Debian systems, is it possible to use Ansible? Is it possible to do this without duplicating rules for Debian systems and for Redhat systems?
Very definitely. I missed the LUV talk on account of adverse geography ( ;-> ), but please be aware that the Fedora Project uses Ansible configuration management centrally, so it's definitely possible to use it for Red Hat systems, and all you need do is ensure that the rules cover both cases (RH, Debian). E.g., have something like this: http://dannyman.toldme.com/2014/10/07/ansible-set-conditional-handler/
participants (5)
-
Andrew Pam
-
Andrew Spiers
-
Brian May
-
Chris Samuel
-
Rick Moen