×


Linux Resources


Ansible "Debug" Module - Explained with Examples with Ubuntu

This article covers how to use the "debug" module with some examples. In fact, the Ansible "debug" module is very useful for actively debugging operations as we seen in the given examples. It is equally helpful for getting a verbose output from a playbook.


How do Ansible Debug works ?

  • msg: – This parameter accepts strings as inputs. This is used to print a customized message. If no message is given, then a generic message like “Hello World!” is
  • var: – This accepts strings as input and this is the variable that has been set either by Ansible facts or by the playbook. Also, the values written here will be having implicit double interpolation, as this option runs in the jinja2 context. So, you don’t need to use jinja2 delimiter unless you want to print double interpolation as well. You can use double interpolation when you print a variable in a
  • verbosity: – This has default as 0. This parameter is used to control when debug is in a run. For example if value 3 is given then debug will only run if -v or above is given while running the playbook.


ulimit Linux Command - Explained with Examples

This article covers an overview of the ULIMIT command in Linux. In fact, ULIMIT command is used for viewing or limiting the resources available to the Linux users. 


Working with Variables in Ansible running Ubuntu 22.04 (Jammy Jellyfish)

This article covers the various types of variables used in Ansible. In fact, they are very useful for increasing the flexibility and comprehensibility of a code when used in an appropriate manner.

Basically, The use of variables simplifies the management of dynamic values throughout an Ansible project and can potentially reduce the number of human errors. 


Different types of variables in Ansible:
  • Global: this is set by config, environment variables and the command line. 
  • Play: each play and contained structures, vars entries, include_vars, role defaults and vars. 
  • Host: variables directly associated to a host, like inventory, facts or registered task outputs.


Fix Inactive UFW Status on Ubuntu 22.04 (Jammy Jellyfish)

This article covers how you can easily activate the Firewall status on Ubuntu system and protect it from almost all the potential threats and attacks. In fact, The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall.


How to enable UFW status on Ubuntu ?

To enable UFW, run the below command: 

$ sudo ufw enable


How to Open SSH TCP port 22 connections ?

1. We can easily open SSH TCP port 22 using UFW as follows:

$ sudo ufw allow ssh

2. If you are running ssh on TCP port 2222 or TCP port 2323, run:

$ sudo ufw allow 2222/tcp
$ sudo ufw allow 2323/tcp


Run Background Process in Ubuntu 22.04 (Jammy Jellyfish) Linux system

This article covers the ways of sending a process to the background in Ubuntu Linux system. In fact, a background process is a process/command that is started from a terminal and runs in the background, without interaction from the user.


Commands to find out what processes are running in the background ?

  • ps command - You can use the ps command to list all background process in Linux. Other Linux commands to obtain what processes are running in the background on Linux.
  • top command – Display your Linux server's resource usage and see the processes that are eating up most system resources such as memory, CPU, disk and more.
  • htop command – Just like a top command but with an improved user interface.


UFW Allow Port on Ubuntu 22.04 (Jammy Jellyfish)

This article covers the procedure of allowing a UFW port on Ubuntu. In fact, UncomplicatedFirewall (UFW) is a command-line, frontend iptables manager, similar to Firewalld and ConfigServer Security & Firewall (CSF). 


How to Close a Port using UFW on Ubuntu ?

After you uninstall software you should close any ports you no longer need open on your system. You can accomplish this using the service name or port number.

1. To close a port in UFW using the service name:

$ sudo ufw deny pop3

2. To close a port in UFW using the port number:

$ sudo ufw deny 995


How to Check Open Ports using UFW on Ubuntu ?

1. To check whether UFW is running:

$ sudo ufw status 

2. To check whether UFW is running with additional information such as logging and profile status:

$ sudo ufw status verbose

3. To find the rule number for UFW rules:

$ sudo ufw status numbered

4. Then you can remove the rule:

$ sudo ufw delete 1

Search by typing a one letter Word Term Here