Posts

Showing posts from 2016

Installing Foreman OpenSCAP

Depending of the version of foreman you need to install the correct plugin in this case we are going to use the latest version 0.6 that is going to match with foreman 1.13 https://www.theforeman.org/plugins/foreman_openscap/0.6/index.html Follow the instruction in the webpage and just make sure the following directories are create in the proxy server to works as expected /var/lib/openscap/content  if not you can create manually mkdir -p /var/lib/openscap/content chown -R foreman-proxy /var/lib/openscap/content   This bug already reported http://projects.theforeman.org/issues/17830     After that the openscap can download the policy from the proxy without issues.

Accepting License of Splunk without ask for yes

Just need to run with the following command service splunk stop yum update splunk su splunk -c "/opt/splunkforwarder/bin/splunk start --accept-license --answer-yes --no-prompt" service splunk start

Install pulp-admin and using with Katello

To install pulp-admin , use the following command:   yum install pulp-rpm-admin-extensions.noarch pulp-admin-client pulp-rpm-handlers.noarch Authenticate to pulp in every pulp-admin call To run a single pulp-admin command, use:   #pulpAdminPassword=$(grep ^default_password /etc/pulp/server.conf | cut -d' ' -f2)   #pulp-admin -u admin -p $pulpAdminPassword rpm repo list

Split DNS Server to use internal and external ip

First we need to setup our /etc/named.conf configuration options {         listen-on port 53 { 127.0.0.1; 192.168.0.107; };         listen-on-v6 port 53 { ::1; };         directory       "/var/named";         dump-file       "/var/named/data/cache_dump.db";         statistics-file "/var/named/data/named_stats.txt";         memstatistics-file "/var/named/data/named_mem_stats.txt";         allow-query     { any; };          forwarders {                 8.8.8.8; 8.8.4.4;         };         dnssec-enable yes;         dnssec-validation yes;         bindkeys-file "/etc/named.iscdlv.key";         managed-keys-directory "/var/named/dynamic";         pid-file "/run/named/named.pid";         session-keyfile "/run/named/session.key"; }; logging {         channel default_debug {                 file "data/named.run";                 severity dynamic;         }; }; #Create a Acce

Video Conference with Jitsi

1. Installation: Operating system used Debian 8 Add the repository echo ' deb https://download.jitsi.org stable/ ' >> /etc/apt/sources.list.d/jitsi-stable.list wget -qO - https://download.jitsi.org/jitsi-key.gpg.key | apt-key add - Update the package lists apt-get update Install Jitsi Meet apt-get -y install jitsi-meet   During the installation, you will be asked to enter the hostname of the Jitsi Meet instance. If you have a FQDN hostname for the instance already set up in DNS, enter it there. If you don't have a resolvable hostname, you can enter the IP address of the machine (if it is static or doesn't change).   Open a conference Launch a web browser (Chrome, Chromium or latest Opera) and enter in the URL bar the hostname (or IP address) you used in the previous step. SSL Certificate If you have you sign certificate just rename with domain.name.crt and domain.name.key and copy to /var/lib/prosody/ ex. conference.examp

Upgrade Fedora Instance to latest release

1. Backup Your System and Update dnf utility Before doing anything, it is recommended to take a backup of system, which can be used for restoring if anything goes wrong. Then after that update `dnf` utility and ensure that you've latest packages for existing version. sudo dnf upgrade  In case you don't have dnf installed execute: #yum install dnf 2. Install dnf upgrade plugin Next step is to install dnf upgrade plugin, a plugin used for using system upgrade. This can be done using following command. sudo dnf install dnf-plugin-system-upgrade 3. Download Update Packages using dnf When dnf plugin installation is complete, download update packages required for system upgrade using following command. sudo dnf system-upgrade download --releasever=23 --best This step will take some time as it involves downloading all packages required for system upgrade. 4. Reboot System and Upgrade Now, reboot your system to start upgrade activity. This can be done
Templates The following functions and macros can be used within templates. These are guaranteed to work via the safemode rendering, to ensure a template can do nothing harmful. With safemode disabled other macros may work, but are not supported at this time. To enable safemode, set "safemode_render" to "true" in Settings -> Foreman settings. Safemode rendering prevents templates from reading and writing files on the file system or modifying application data within foreman. Accessing Templates There are two ways to render a template, based on a single host, or based on a Hostgroup. The host or hostgroup provides all the details with which to render the template. Host-based Rendering Only a single template of each type may be rendered for a system. Foreman determines which template to use following these rules: 1. Only the templates of the appropriate kind and associated with the hosts operating system are considered 2. If a

Check disk free with ansible

To check the disk free with ansible you can run the following command To get all the hosts execute: # ansible -m command -a "df -h" all To get some group the hosts  ansible -m command -a "df -h" -i <hosts file>

How to run a playbook as normal user in the remote machine

 For this example you need to create the following directories as best practices For example root  |  ---- group_vars  |  -----roles  |          |  |          ----common  |-- site.yml  |-- hosts Create the root directory in this example named ansible #mkdir  ansible create the group_var and roles directories #mkdir group_vars #mkdir roles Create the files site.yml and hosts # touch site.yml # touch hosts Too create the common directory change to the directory roles and execute the following command ansible-galaxy init common this command create the standard infrastructure directories for use with ansible playbook For this example i would like to put the sudoers files in some machines to get this result we need to go into the common directory and there go into the tasks directory you are going to find a file named main.yml open it and copy the following remember start the file with 3 --- this indicate the beginning of the YAML file --- - name: Sudo

Deploying ESXi with Satellite 6

Deploy the files to the Satellite server Download the latest ISO from VMware (e.g. VMware-ESXi-5.5U2-RollupISO2.iso). Transfer to the satellite server Run some code # mount -o loop VMware-ESXi-5.5U2-RollupISO2.iso /mnt # mkdir /var/lib/tftpboot/boot/esxi55u2 # cd /mnt # cp -a * /var/lib/tftpboot/boot/esxi55u2 # cd /var/lib/tftpboot/boot/esxi55u2 # sed -i 's#/#/boot/esxi55u2/#g' boot.cfg # cd .. # restorecon -R esxi55u2 Create the Operating System inside Satellite Hosts -> Operating Systems Click New Operating System Operating System Name: ESXi Major version: 5 Minor version: 5 Description: ESXi 5.5U2 OS Family: Red Hat Arch: x86_64 Partition Table Kickstart Default Installation Media Any Mirror – Can create a esxi mirror if desired. Hosts -> Provisioning Templates Click New Template Provisioning Template Name: ESXi OCP PXELinux SERIAL 0 115200n8 DEFAULT esxi5.serial PROMPT 0 MENU TITLE PXE Boot LABEL esxi5.serial MENU LA

Katello Capsule sync fails with error "401 - Authentication with username admin failed: invalid oauth credentials"

This issue occurs when there is a time difference in Satellite and Capsule server. Ensure that both the Satellite server and Capsule server is synced with the ntp or cronyd. Once the time is in sync, re-run the capsule-installer command to configure capsule server.  Diagnostic -Checking /var/log/messages goferd make  a clear error about authethication failed Feb 11 06:00:32 awscapsule01 goferd: [ERROR][worker-0] pulp.agent.lib.dispatcher:112 - PermissionsException: RequestException: GET request on /pulp/api/v2/consumers/add48221-f2d7-4bbe-b5ee-0eef65c24774/bindings/Centos-6/ failed with 401 - Authentication with username admin failed: invalid oauth credentials. Feb 11 06:00:32 awscapsule01 goferd: [INFO][worker-0] gofer.agent.rmi:128 - sn=76004451-4fc4-47d2-9862-29beb1d72e92 processed in: 2.181 (seconds)

How remove packages from custom repos in Katello

First find out the UUID of the package you will delete: Katello[~] # hammer package list --organization-label=rh --product=testrepo -------------------------------------|------------------------------------------------------ ID | FILENAME -------------------------------------|------------------------------------------------------ ab214fca-4a00-4275-b019-81d557b4e117 |test.rpm -------------------------------------|------------------------------------------------------ To obtain the ID of repository where the package is located, run the following command: satellite [~] # hammer repository list --organization-label=rh --product=testrepo ---|----------|----------|--------------|---- ID | NAME | PRODUCT | CONTENT TYPE | URL ---|----------|----------|--------------|---- 1 | test | test | yum | ---|----------|----------|--------------|---- Remove the package from the custom repo