A central Hub for all scripts around our new SOE Initiative. We put them on github because we can manage Issues and do Release Planning.
The libraries and Jenkins plugins listed below are to support the proposed approach for automating application and JBoss EAP configuration. For further details refer to Configuration Automation document.
This Jenkins plugin is a wrapper for Puppet Module Generator library. https://github.com/RedHatEMEA/soe-ng/tree/master/jenkins/puppetgen-jenkins-plugin
This maven plugin is a wrapper for Puppet Module Generator library. https://github.com/RedHatEMEA/soe-ng/tree/master/maven/puppetgen-maven-plugin
This project defines a schema for expressing application config which needs to be applied to JBoss EAP. https://github.com/RedHatEMEA/soe-ng/tree/master/lib/app-config-schema
Example available in Configuration Automation document.
A Java API modling Puppet module structure. This API can be used to generate Puppet modules. https://github.com/RedHatEMEA/soe-ng/tree/master/lib/puppet-module-api
A Puppet module generator library that creates Puppet modules based on a config descriptor as defined in AppConfig Schema. https://github.com/RedHatEMEA/soe-ng/tree/master/lib/puppet-module-generator
The RH_LDAP-config folder contains scripts and schemas to set up an ldap
server to serve as an External Node Classifier in order to produce the
etc/facter/facts.d/ENC-CONFIG.txt
file that would have key-value pairs
for the following:/etc/facter/facts.d/ENC-CONFIG.txt
file that would
have key-value pairs for the following:
designated_hostname=vm212.mydomain.com
Brand=RHEV
Model=KVM
country=GE
state=Munic
site=muc
firewall=normal
business_unit=GPS
cluster_name=RHEV
server_type=free
build=1.0-1
stage=dev
designated_ip=10.32.69.212
designated_gateway=10.32.69.254
designated_netmask=255.255.255.0
- A slapd instance can be created by running the following so that there's access to all the slapd commands, and the client ldapmodify commands in order to add and delete entries from the ldap database.
$ yum -y install openldap-servers openldap-clients
$ yum -y install httpd python-ldap
- Create a Database folder with ldap ownership and create a
DB_CONFIG
file
$ mkdir /var/lib/rh;
$ cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/rh/DB_CONFIG;
$ chown -R ldap.ldap /var/lib/rh
-
Edit the
slapd.conf
and therh.schema
to reflect your configuration and dc (i.e. changedc=mydomain,dc=com
todc=mysubdomain,dc=example,dc=com
). Runslappasswd
to create a Manager password output and copy it next to rootpw in theslapd.conf
. Copy theslapd.conf
in/etc/openldap
and therh.schema
to the/etc/openldap/schema
directory. -
Edit the
populate_scripts/create_new_entry.sh
file to represent the domain changes in theslapd.conf
file and run it to create an intial ldif file. Create a test instance with ALL the entries. Change the bottom entry of thedata_test/rh-detailed.ldif
to the content of the file that you've just created (the location of which will be indicated by thecreate_new_entry.sh
output). Edit therh-detailed.ldif
file further so that the dn of all items represents your domain. -
From the
data_test
directory run thesetup.sh
script. This should populate the database. Make sure that the ownership of all items in/var/lib/rh
and/etc/openldap/slapd.d
isldap.ldap
(chown -Rvvv ldap.ldap
). -
Use
slaptest
to test the configuration files. Useslapcat -f /etc/openlap/slapd.conf -F /etc/openldap/slapd.d -n 1
to get the output of the ldap database (yes
this should work even if the ldap server is not running yet. -
Start the
slapd
daemon and search for your entry:
$ ldapsearch -b ou=machines,dc=yourdomain,dc=com -v -x -LLL '(cn=shortname)'
- Edit the
cgi-scripts/gethostdetails.py
to reflect your entry and copy it in the/var/www/cgi-bin folder
. Start the httpd entry. - Use
wget -0 /tmp/hostdetails http://<ldap_server>/cgi-bin/gethostdetails.py?servername=<unique_servername_cn>
to test that you get the desired output.
- copy the puppet-config folder in
/etc/puppet-config
- Install puppet
- Add your puppet server to the ldap Server above using the
create_new_entry.sh
script and then adding the ldif file created to the database usingldapmodify
(see create new entry output). Make sure that:
- designatedHostname is lower case and the FQDN
- cn is the shortname
- stage is dev/qa/prod
- serverType is free/web/app/db
- you can add more than one nics
- all the other entries exist (you can put N/A next to them)
- Create an
/etc/facter/facts.d
folder and add the generated hostdetails file in there under the nameENC-CONFIG.txt
. - Change the
/etc/puppet-config/hieradb
files to reflect the values you need in your organization - Make sure that if you need any network/iptables configurations changed that you have console access to the Machine
- run
puppet apply --config /etc/puppet-config/puppet.conf /etc/puppet-config/manifests/site.pp --noop
to see what will change - If you are not happy with what will change edit the
/etc/puppet-config/manifests/site.pp
to your satisfaction - Test again and when you are happy, apply all changes
$ puppet apply --config /etc/puppet-config/puppet.conf /etc/puppet-config/manifests/site.pp