Skip to content

Instantly share code, notes, and snippets.

View ruzickap's full-sized avatar

Petr Ruzicka ruzickap

View GitHub Profile
@ruzickap
ruzickap / cz01-pgpool0{1,2}_installation.sh
Created October 25, 2014 10:13
cz01-pgpool0{1,2} pgpool servers installation
#pgpool installation
yum localinstall -y http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm
yum install -y pgpool-II-93 postgresql93
scp -r cz01-psql01.example.com:/root/{.ssh,.pgpass} /root/
scp cz01-psql01.example.com:/root/.pgpass /root/
cp /etc/pgpool-II-93/pcp.conf.sample /etc/pgpool-II-93/pcp.conf
echo "admin:`pg_md5 password123`" >> /etc/pgpool-II-93/pcp.conf
@ruzickap
ruzickap / cz01-pgpool01_installation.sh
Created October 25, 2014 10:15
cz01-pgpool01 primary pgpool server installation
sed \
-e "s/^wd_hostname =.*/wd_hostname = 'cz01-pgpool01.example.com'/" \
-e "s/^heartbeat_destination0 =.*/heartbeat_destination0 = 'cz01-pgpool02.example.com'/" \
-e "s/^#other_pgpool_hostname0 =.*/other_pgpool_hostname0 = 'cz01-pgpool02.example.com'/" \
-i /etc/pgpool-II-93/pgpool.conf
service pgpool-II-93 start
@ruzickap
ruzickap / cz01-pgpool02_installation.sh
Created October 25, 2014 10:16
cz01-pgpool02 secondary pgpool server installation
sed \
-e "s/^wd_hostname =.*/wd_hostname = 'cz01-pgpool02.example.com'/" \
-e "s/^heartbeat_destination0 =.*/heartbeat_destination0 = 'cz01-pgpool01.example.com'/" \
-e "s/^#other_pgpool_hostname0 =.*/other_pgpool_hostname0 = 'cz01-pgpool01.example.com'/" \
-i /etc/pgpool-II-93/pgpool.conf
service pgpool-II-93 start
@ruzickap
ruzickap / rhel7_nmcli_network_configuration.sh
Last active September 3, 2021 19:15
RHEL7 nmcli network configuration of bonding (eno1, eno2), trunk containing 3 vlans (1169, 1170, 1261) and bridging for each vlan.
#Set hostname
hostnamectl set-hostname lb01-server.example.com
#Remove all network configuration
nmcli con del eno{1,2,3,4}
#Configure bonding
nmcli con add type bond con-name bond0 ifname bond0 mode active-backup
nmcli con add type bond-slave con-name eno1 ifname eno1 master bond0
nmcli con add type bond-slave con-name eno2 ifname eno2 master bond0
@ruzickap
ruzickap / rhel7_customization.sh
Created November 18, 2014 17:43
RHEL7 customizations
umount /home
sed -i '/\/home/d' /etc/fstab
lvremove -f /dev/mapper/rhel-home
lvextend --resizefs -l +100%FREE /dev/mapper/rhel-root
curl http://10.0.0.141:6809/fusion/rhel-server-7.0-x86_64-dvd.iso > /var/tmp/rhel-server-7.0-x86_64-dvd.iso
mkdir /mnt/iso
echo "/var/tmp/rhel-server-7.0-x86_64-dvd.iso /mnt/iso iso9660 loop,ro 0 0" >> /etc/fstab
mount /mnt/iso
@ruzickap
ruzickap / rhel7_virtualization.sh
Created November 18, 2014 17:46
Virtualization installation into RHEL7
yum install -y qemu-kvm virt-install "@Virtualization Platform"
tuned-adm profile virtual-host
systemctl enable libvirt-guests.service
service libvirtd start
virsh net-autostart --disable default
for VLAN in 1169 1170 1261; do
cat > /tmp/br$VLAN.xml << EOF
<network>
@ruzickap
ruzickap / f5_init.sh
Created December 23, 2014 13:46
BIGIP F5 initial configuration
#(root / default)
tmsh modify sys global-settings mgmt-dhcp disabled
tmsh create sys management-ip 10.0.0.224/255.255.255.0
tmsh create sys management-route default gateway 10.0.0.1
#(or you can use "config" command - to speed it up)
#DNS
tmsh modify sys dns name-servers add { 10.0.0.141 10.0.0.142 }
tmsh modify sys dns search add { cloud.example.com }
@ruzickap
ruzickap / f5_dns_vip.sh
Created December 23, 2014 13:57
BIGIP F5 DNS VIP configuration
tmsh create sys application service dns-ext-vip1_53 { \
description "DNS VIP - External - NS1 53" \
strict-updates disabled \
tables add { \
vs_pool__members { \
column-names { addr port conn_limit } \
rows { \
{ row { 10.0.1.10 53 0 } } \
{ row { 10.0.1.20 53 0 } } \
} \
@ruzickap
ruzickap / f5_ldap_vip.sh
Created December 23, 2014 14:01
BIGIP F5 LDAP VIP configuration
tmsh create sys application service ds-vip_389 { \
description "Directory Server VIP 389" \
strict-updates disabled \
lists add { irules__irules { } } \
tables add { \
vs_pool__pool_members { \
column-names { addr port conn_limit } \
rows { \
{ row { 10.0.0.150 389 0 } } \
{ row { 10.0.0.151 389 0 } } \
@ruzickap
ruzickap / f5_https_vip.sh
Created December 23, 2014 14:06
BIGIP F5 HTTPS VIP configuration
tmsh create sys application service https-vip_443 { \
description "HTTPS Server VIP 443" \
strict-updates disabled \
tables add { \
pool__hosts { \
column-names { name } \
rows { { row { config.cloud.example.com } } } \
} \
pool__members { \
column-names { addr port_secure connection_limit } \