Scenario: Patching run yum update using Ansible to RHEL 6/7 remote machine
System: RHEL 7, Ansible 2.6 (Callback and ansible log is active)
Remote System: RHEL 6/7 (not using ssh key), same root password.
Example yum update host group devservers, here my steps:
1) Empty ansible log.
# cat /dev/null > /var/log/ansible.log
2) Input hosts devservers in /etc/ansible/hosts
# vi /etc/ansible/hosts
Scenario: How to configure file sharing using samba with AD authentification on CentOS/RHEL 7
– CentOS/RHEL 7, IP address: 192.168.99.15, hostname: centos7ht
– Windows Server 2012 as AD Domain: toya.toyaseta.com, IP address: 192.168.99.10, also as DNS server.
Steps as root login:
1) Point cetos7ht DNS server to AD server and edit /etc/hosts
– Edit /etc/hosts.
# vi /etc/hosts
192.168.99.10 toya.toyaseta.com toya
– Edit DNS /etc/resolv.conf
# vi /etc/resolv.conf
# Generated by NetworkManager
Scenario: How to get the list of expired local users on Linux.
IP address: 192.168.99.11
Hostname : horse
1) Create the bash script file with file name listchageusers.sh
$ vi /home/bachem/listchageusers.sh
Scenario: How to get the list of normal users and System users in Linux.
System : CentOS/RHEL 6/7
1) Login as local users (work without login to root), example I login as bachem.
2) Create the bash script file with file name listusers.sh
$ vi /home/bachem/listusers.sh
Scenario: add sudo user on CentOS 7
System: CentOS 7
Steps to Create a New Sudo User
– Log in to your server as the root user.
– Use the adduser command to add a new user to your system,example add user with username bachem.
[root@horse ~]# useradd bachem
[root@horse ~]# passwd bachem
Changing password for user bachem.
Retype new password:
passwd: all authentication tokens updated successfully.
Scenario: Set JAVA_HOME/PATH environment variable on CentOS/RHEL
System: CentOS/RHEL 6/7
– Set JAVA_HOME / PATH for a single user,example set up on user bachem
1) Check java path
Refer to below output the path is /usr/lib/jvm/java-1.8.0-openjdk-18.104.22.168-3.b13.el7_5.x86_64/jre
Scenario: How to limit memory usage per user on CentOS/RHEL
System: CentOS/RHEL 6/7
I would like to cap the amount of memory the users on a server can use. The applications developed by our users have memory leaks and I want to prevent them from using all the memory and crashing the system.
It is possible to limit the amount of memory that each process can allocate with the RLIMIT facility in Red Hat Enterprise Linux. RLIMIT_AS limits the size of the virtual address space and it is a suitable solution in many cases which require limiting per-process memory consumption even though there are many limits related to memory.
Scenario: Install Apache Tomcat 8.5 on CentOS/RHEL 7
1) This scenario using Oracle Java. Login as root user then install Oracle Java.
Scenario: How to install MariaDB on CentOS/RHEL 7
1) Create MariaDB 10 repository
$ sudo yum install wget
$ wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
$ chmod +x mariadb_repo_setup
$ sudo ./mariadb_repo_setup
Scenario: Set up Ansible callback to monitor running task on remote machine.
Ansible system: CentOS 7, Ansible 2.6
Both have same root password
1. CentOS 7, ip address: 192.168.99.18
2. CentOS 6, ip address: 192.168.99.19
I set up callback plugins to see running ansible-playbook task on remote machine and it is fun and useful.
To set up callback, edit /etc/ansible/ansible.cfg and change the value to minimal.
# vi /etc/ansible/ansible.cfg
stdout_callback = minimal