Ansible modules development

Hello again

So as a hobby I have started working on an Ansible module to allow adding static routes to several hosts , I got out my recently acquired Python skills and started cracking at it , if you are curious about how to start developing ansible modules here is a good place to start . the module development itself is not hard to get started with , and if you are already familiar with ansible and python ( in fact you don’t need python as you can write modules in any language but I have chosen python  for mine ) if should be fairly straight forward.

I have chosen this module for implement because it seems that it is a common thing to do as a System Administrator and there is no specific module to do this, of course you could just use the command module to add a static route but this module aims to do a bit more than just that, I am thinking about implementing this for the most relevant unix like platforms , namely :

 – Linux

– Red Hat

– Debian

– Ubuntu

– BSD

– Openbsd

– Freebsd

Solaris

If I can find the time and resources I will try to implement the same for also HPUX and Aix but as I don’t have direct access to those platforms at the moment I cannot promise that I will do so. For now the priority is Linux of course .

The code is available from my github repo but for now it’s just an embryo.

Cheers

 

Rui

RHEL 7 and Systemd

Hello again

So with much anticipation from the community Red Hat has released RHEL 7 , and with it an Enterprise Linux Disto that actually ships Systemd , the replacement for the old style SysV init . I am not saying this is good or bad, traditionally people don’t like change so this is a bit theme right now, in any case here is a Cheat Sheet of the old RHEL 6 equivalents

RHEL 6 RHEL7
chkconfig servicename on systemctl enable servicename
chkconfig servicename off systemctl disable servicename
chkconfig servicename on systemctl enable servicename
chkconfig –list systemctl list-unit-files –type=service
service servicename start systemctl start servicename
service servicename stop systemctl stop servicename

You can also check the more in depth cheat sheet here

One of the things that I found to be a bit strange at the beginning was hostnamectl , that as you might have guesses controlls the hostname , so now changing the hostname for your server is something like

#hostnamectl –static set-hostname myserver.mydomain.com

And yes there is also nmcli and firewallctl but that is another article by itself.

Next: nmcli or How to manage your network on RHEL 7