Posts

Product content on Activation Key is not show anything is just show Loading on Katello

This a bug that''s already know and the fix is update ruby193-rubygem-rabl For RHEL 6 http://koji.katello.org/koji/buildinfo?buildID=23400 For RHEL 7 http://koji.katello.org/koji/buildinfo?buildID=23401 After update just restart the apache server For RHEL 6 #service httpd restart For RHEL 7 #systemctl restart httpd

Export from Spacewalk to Katello Configuration and Channels

Spacewalk    Login in you spacewalk server via ssh 1.-Export Spacewalk Data with the following command #spacewalk-export --export-dir=/export 2.- Import the data into the /tmp of katello and uncompress #tar xf spacewalk_export.tar.gz     Get hammer cli for import the data into katello wget https://github.com/Katello/hammer-cli-import/archive/master.zip mkdir hammer mv master.zip hammer/ cd hammer/ unzip master.zip cd hammer-cli-import-master/ mkdir ~/.hammer cat >> ~/.hammer/cli_config.yml << EOF :modules: - hammer_cli_import EOF cd hammer/hammer-cli-import-master/ env RUBYOPT=-Ilib hammer import all --directoy=/tmp/exports

Resign Spacewalk Certificate

1.- First verify if the current certificate is already expire #spacewalk-sql -i <<< 'select expires from rhnsatellitecert where created=(select max(created) from rhnsatellitecert);'         expires ------------------------  2015-07-13 00:00:00+12 (1 row) 2.- If the certificate is already expired run the following command to resign the certificate #rhn-satellite-activate --rhn-cert /usr/share/spacewalk/setup/spacewalk-public.cert --disconnected 3.- Check again certificate expired date #spacewalk-sql -i <<< 'select expires from rhnsatellitecert where created=(select max(created) from rhnsatellitecert);'         expires ------------------------  2018-07-13 00:00:00+12 (1 row) All done

How to clean all the foreman task and locked task

1.- First make su to postgres user su -s /bin/bash - postgres  2.-Execute psql psql  3.- connect to the foreman database \c foreman;  4.- Delete all the foreman task and foreman task locks delete from foreman_tasks_tasks;  delete from foreman_tasks_locks;  5.- Quit from postgres and exit \q  exit  6. Restart all the services for s in {qpidd,pulp_celerybeat,pulp_ resource_manager,pulp_workers, httpd}; do sudo service $s restart; done  Update in todays foreman you can clean the task using the following command: foreman-rake foreman_tasks:cleanup

Migration Script from Winbind to SSSD

#!/bin/bash echo Disable winbind authconfig --disablewinbindauth  --disablewinbind --disablekrb5 --updateall service winbind stop chkconfig winbind off echo Setup Kerberos rm -f /etc/krb5.conf  cat > /etc/krb5.conf << "EOF" [logging]  default = FILE:/var/log/krb5libs.log  kdc = FILE:/var/log/krb5kdc.log  admin_server = FILE:/var/log/kadmind.log [libdefaults]  default_realm = EXAMPLE.COM  dns_lookup_realm = true  dns_lookup_kdc = true  ticket_lifetime = 24h  renew_lifetime = 7d  forwardable = true [realms]  EXAMPLE.COM = {   kdc = ad.example.com   admin_server = ad.example.com  } [domain_realm]  example.com = EXAMPLE.COM  .example.com= EXAMPLE.COM EOF echo Samba Setup rm -f /etc/samba/smb.conf  cat > /etc/samba/smb.conf << "EOF" [global]         workgroup = EXAMPLE   ...

Postgresql BDR Setup

yum install http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-redhat-1.0-2.noarch.rpm yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm yum update yum install postgresql-bdr94-bdr Initialize Node1 and 2 database /usr/pgsql-9.4/bin/postgresql94-setup initdb Setup Postgresql.conf and hba node 1 /var/lib/pgsql/9.4-bdr/data/postgresql.conf listen_addresses = '*'  port = 5598   shared_preload_libraries = 'bdr'     wal_level = 'logical'     track_commit_timestamp = on     max_connections = 100     max_wal_senders = 10     max_replication_slots = 10     # Make sure there are enough background worker slots for BDR to run     max_worker_processes = 10     # These aren't required, but are useful for diagnosing problems     #log_error_verbosity = verbose ...

Script to ask Network configuration via kickstart

%pre #!/bin/bash echo -n "Enter FQDN Hostname: " > /dev/tty1 read HOSTN echo -n "Enter IP Address:" > /dev/tty1 read IP echo -n "Enter the Netmask:" > /dev/tty1 read MASK echo -n "Enter Gateway:" > /dev/tty1 read GW echo -n "Enter Nameserver:" > /dev/tty1 read DNS echo "network --device eth0 --bootproto=static --ip=${IP} --netmask=${MASK} --gateway=${GW} --nameserver=${DNS} --hostname=${HOSTN}" > /tmp/network.txt %post --noroot #!/bin/bash # bring in hostname collected from %pre, then source it ###### cp -Rvf /etc/sysconfig/network /mnt/sysimage/etc/sysconfig/network cp -Rvf /etc/sysconfig/resolv.conf /mnt/sysimage/etc/resolv.conf # Set-up eth0 with hostname cp /etc/sysconfig/network-scripts/ifcfg-eth0  /mnt/sysimage/etc/sysconfig/network-scripts/ifcfg-eth0 # force hostname change /mnt/sysimage/bin/hostname $HOSTNAME rhn-profile-sync