Posts

Could not parse for environment production: invalid byte sequence in UTF-8 at /root/celery.pp:1 (Puppet::Error) on Satellite 6

 The following error appear when try to generate a capsule certificate #capsule-certs-generate --capsule-fqdn capsule01.test.internal --certs-tar /root/capsule01.test.internal-certs.tar # /usr/share/ruby/vendor_ruby/puppet/parser/parser_support.rb:175:in `rescue in parse': Could not parse for environment production: invalid byte sequence in UTF-8 at /root/celery.pp:1 (Puppet::Error) from /usr/share/ruby/vendor_ruby/puppet/parser/parser_support.rb:166:in `parse' from /usr/share/ruby/vendor_ruby/puppet/node/environment.rb:536:in `block in perform_initial_import' from /usr/share/ruby/vendor_ruby/puppet/node/environment.rb:534:in `map' from /usr/share/ruby/vendor_ruby/puppet/node/environment.rb:534:in `perform_initial_import' from /usr/share/ruby/vendor_ruby/puppet/node/environment.rb:255:in `known_resource_types' from /usr/share/ruby/vendor_ruby/puppet/resource/type_collection_helper.rb:5:in `known_resource_types...

How to remove a puppet module on Katello or Satellite 6

1. -Enter in hammer shell with the following command #hammer -u admin -p <password> shell 2. -First we need to get our Organization ID with the following command #hammer> organization list ---|----------|----------|------------ ID | NAME     | LABEL    | DESCRIPTION ---|------------|------------|------------ 1  | Example | Example | ---|------------|-------------|------------ 3.- We check the repositories to get the id of our puppet repository #hammer> repository list --organization-id 1 ---|---------------------------|------------------------|------------------------|-------------------------- ID | NAME                      | PRODUCT            | CONTENT TYPE  | URL ---|---------------------------|------------------------|------------------------|--------------------...

Setup dynamc DNS updates with Active Directory DNS to be used by Smart Proxy of Katello/Foreman

Both BIND as configured in FreeIPA and Microsoft AD DNS servers can accept DNS updates using GSS-TSIG authentication. This uses Kerberos principals to authenticate to the DNS server. Under Microsoft AD, this is known as "Secure Dynamic Update". Pre-requisites     Kerberos principal in the realm/domain that Smart Proxy can use     Kerberos keytab for the above principal Setup 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 = dc01.example.com   admin_server = dc01.example.com  } [domain_realm]  example.com = EXAMPLE.COM  .example.com = EXAMPLE.COM...

Sync Repos finish with warning hostname does not match the server certificate

This is happening because the following: Actions::Katello::Repository::ErrataMail Input: {"repo"=>4, "last_updated"=>"2015-10-17 02:20:18 +1300", "locale"=>"en"} Output: {} Exception: OpenSSL::SSL::SSLError: hostname does not match the server certificate   As we can see the sync of repos is failed because the errata mail can't be send it to resolve this issue we need to configure our email.yml   # cat /etc/foreman/email.yaml # Outgoing email settings production: delivery_method: :smtp smtp_settings: address: smtp.example.com port: 25 enable_starttls_auto: false << add this to avoid the connection via tls to  the mail server if you don't needed.

How to execute remote commands with Katello 2.3 and 2.4 on remote clients

This can be achieve installing the following foreman plugin http://theforeman.org/plugins/foreman_remote_execution/0.0/ Start by installing  repository and EPEL7, see Quickstart instructions and Foreman manual for more information.   After it sucessfully finishes you'll have to manually install plugins by following command   yum install ruby193-rubygem-foreman_remote_execution rubygem-smart_proxy_remote_execution_ssh Note : the plugin only works if you satellite was install on RHEL7/Centos 7 for Katello after that you going to have job   templates in hosts tab just create a new job template for example   Template that allow install remove and update packages   Name: Package Actions die() { echo "${1}, exiting..." exit $2 } <% unless input("pre_script").blank? -%> # Pre Script <%= input("pre_script") %> RETVAL=$? [ $RETVAL -eq 0 ] || die "Pre script failed" $RETVAL <% end -%> ...

How to remove a kickstart distribution on Spacewalk 2.3 / Satellite 5.7

On Spacewalk or Satellite follow these steps delete kickstart distribution entries from Satellite database: # spacewalk-sql -i To get the id of the distribution   rhnschema=# select id,label from rhnKickstartableTree;   To remove the distribution   rhnschema=# delete from rhnKickstartableTree where ID=<kickstart_id>;    Quit from the sql rhnschema=# \q

How to remove files or directories files with names that contains spaces, and special characters such as -, -- @ <> etc

Image
Remove file by an inode number The -i option to ls displays the index number (inode) of each file:   ls -li Use find command as follows to delete the file if the file has inode number 4063242:   $ find . -inum 4063242 -delete OR   $ find . -inum 4063242 -exec rm -i {} \;