LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Fleshing out config scripts strategy for RHEL 6/7. (https://www.linuxquestions.org/questions/linux-enterprise-47/fleshing-out-config-scripts-strategy-for-rhel-6-7-a-4175618771/)

kickbag99 12-01-2017 03:05 PM

Fleshing out config scripts strategy for RHEL 6/7.
 
Howdy,

I'm trying to come up with a strategy to streamline part of our VM deployments.

Background info:
Running VMware virtualization
Using custom RHEL6/7 minimal templates
A copy of each template is placed in a pair of Datacenters segmented from other Datacenter pairs.

When bringing up a new VM from the template we need to do various tasks.
config network i.e.
edit /etc/sysconfig/network
edit /etc/sysconfig/network-scripts/ifcfg-eth0
edit /etc/resolv.conf
...
update and config subsystem i.e.
config ntp servers
edit /etc/sssd/sssd.conf
edit /etc/krb5.conf
add regional repos
...

We don't want to upkeep 10+ different templates in each pair of Datacenters. Nor do we want to manually config and join these to a domain each time we spin up a new VM. As these VMs could become any number of types of servers for many different applications, our goal is to get them connected to the network and a domain so one of the state config tools can take over.

Since when the VMs come up in VMware, we only have console access until network access is configured. I have made some shell scripts that prompt the user for ip,subnet,gateway,etc because that info is independent of datacenter location. but the rest of the configuration is dependent on datacenter location i.e. ntp servers or krb5.conf realms.

Current plan:
Create Master config files with all configurations for all datacenters and then create a shell script to uncomment all lines in all conf files based on datacenter. then make the master config files and script part of the template.
I am worried about the maintainability of these scripts.
I am wondering if the domain join and config of subsystems should be offloaded as part of the machine state.

Any thoughts and opinions would be welcome.

TB0ne 12-01-2017 05:07 PM

Quote:

Originally Posted by kickbag99 (Post 5787556)
Howdy,
I'm trying to come up with a strategy to streamline part of our VM deployments.

Background info:
Running VMware virtualization
Using custom RHEL6/7 minimal templates
A copy of each template is placed in a pair of Datacenters segmented from other Datacenter pairs.

When bringing up a new VM from the template we need to do various tasks.
config network i.e.
edit /etc/sysconfig/network
edit /etc/sysconfig/network-scripts/ifcfg-eth0
edit /etc/resolv.conf
...
update and config subsystem i.e.
config ntp servers
edit /etc/sssd/sssd.conf
edit /etc/krb5.conf
add regional repos
...

We don't want to upkeep 10+ different templates in each pair of Datacenters. Nor do we want to manually config and join these to a domain each time we spin up a new VM. As these VMs could become any number of types of servers for many different applications, our goal is to get them connected to the network and a domain so one of the state config tools can take over.

Since when the VMs come up in VMware, we only have console access until network access is configured. I have made some shell scripts that prompt the user for ip,subnet,gateway,etc because that info is independent of datacenter location. but the rest of the configuration is dependent on datacenter location i.e. ntp servers or krb5.conf realms.

Current plan:
Create Master config files with all configurations for all datacenters and then create a shell script to uncomment all lines in all conf files based on datacenter. then make the master config files and script part of the template.
I am worried about the maintainability of these scripts.
I am wondering if the domain join and config of subsystems should be offloaded as part of the machine state.

Any thoughts and opinions would be welcome.

Not sure if you're going to kickstart these boxes, but either way you could build an RPM of scripts that have the necessary 'smarts' built into them to determine version of RHEL/subnet/etc., and act accordingly. Your template could install that RPM at build time, with the POST script in the RPM executing things for you, and doing a reboot. Things should come up the way you want them after that.

That way, you could only maintain 1 RPM file that's architecture-agnostic, to do the work you want. Simple to maintain with SVN/Git/whatever you use now. Just a thought.

kickbag99 12-01-2017 05:47 PM

Thanks for the great reply.

I really like the idea of 1 rpm file that is architecture-agnostic.

I am going to mess around with this idea and see if cant get a POC running and bring it to the team next week.

Thanks again.


All times are GMT -5. The time now is 04:50 PM.