Posts

Showing posts from 2026

Chrony - NTP

chronyd Daemon for Clock Synchronization chronyc Command-line client used to monitor and control chronyd /etc/chrony.conf # dnf install chrony -y # systemctl enable --now chronyd # systemctl status chronyd # vi /etc/chrony.conf server time.google.com iburst # iburst Speeds up initial synchronization Check synchronization # chronyc tracking View connected NTP servers # chronyc sources -v # timedatectl set-ntp true # systemctl restart chronyd Force synchronization # chronyc makestep # ntpdate -q time.google.com # queries an NTP server for its time without changing the system clock. # ntpdate -s time.google.com # synchronizes the system clock with an NTP server and logs the output using syslog instead of printing it to the terminal # chronyd -q 'server time.google.com iburst' journalctl -u chronyd

Kubernetes(K8S)

  Kubernetes is an open-source orchestrator for deploying containerised applications Kubernetes was introduced by Google as an open-source project in 2014. The project was announced in June 2014. Its first stable release, version 1.0, followed on July 21, 2015.  At the time of the 1.0 release, Google also announced that Kubernetes would be donated to the newly formed Cloud Native Computing Foundation (CNCF).  When we say "reliable, scalable distributed system," more and more services are delivered over the network via API Container Images Container images bundle a program and its dependencies into a single artifact under a root filesystem Container Image format has been standardised 

Rubrik Backup Service (RBS)

Rubrik Backup Service (RBS) is the core service responsible for performing and managing backup and recovery operations on a Rubrik node. It coordinates communication between the Rubrik cluster and the protected workloads (VMware, Hyper-V, databases, file systems, etc.). For Linux --- - name: (Red Hat) Download the Rubrik Connector get_url: url: "https://{{ rubrik_cluster_ip }}/connector/rubrik-agent.x86_64.rpm" dest: /tmp/rubrik-agent.x86_64.rpm validate_certs: no force: no - name: (Red Hat) Install the Connector yum: name: /tmp/rubrik-agent.x86_64.rpm state: present - name: (Red Hat) Start and Enable the Rubrik Services (RHEL 7+) systemd: name: rubrikagents state: started enabled: yes when: ansible_distribution_major_version|int > 6 For Windows --- - name: (Windows) Create a Temporary Download Location win_file: path: C:\Temp state: directory - name: (Windows) Download the Rubrik Connector win_get_url: url...

Redhat Servers Under AD

packages # dnf install sssd realmd oddjob oddjob-mkhomedir adcli krb5-workstation samba-common-tools samba-common authselect-compact openldap-clients policycoreutils-python # vi /etc/resolv.conf search < ad.local > $ nslookup -type=SRV _ldap._tcp.<ad.local> Firewall Service Port Protocol Notes DNS 53 UDP and TCP LDAP 389 UDP and TCP LDAPS 636 TCP Optional Samba 445 UDP and TCP For AD Group Policy and Objects (GPOs) Kerberos 88 UDP and TCP Kerberos 464 UDP and TCP Used by kadmin for setting and changing a password LDAP Global Catalog 3268 TCP If the id_provider = ad option is being used LDAPS Global Catalog 3269 TCP Optional NTP 123 UDP Optional NTP 323 UDP optional To ensure that the server can correctly communicate with Active Directory # update-crypto-policies --set DEFAULT:AD-...

ansible.cfg

The ansible.cfg file is the main configuration file that controls how Ansible behaves globally or per project. Where Ansible Looks for ansible.cfg (VERY IMPORTANT) Order of precedence: ANSIBLE_CONFIG (environment variable) ./ansible.cfg (current project directory) ✅ ~/.ansible.cfg (user home) /etc/ansible/ansible.cfg (system-wide) 💡 First one found → used

Ansible Vault

  Ansibel Vault Ansible Vault performs various operations. Specifically, it can Encrypt/Decrypt a file View an encrypted file without breaking the encryption Edit an encrypted file Create an encrypted file Generate or reset the encrypted key Ansible Vault uses AES256 encryption The ansible-vault create command is used to create the encrypted file. # ansible-vault create test_vault # it will prompt for a password New Vault password: Confirm New Vault password: # cat test_vault $ ANSIBLE_VAULT; 1.1 ;AES 256 34363365356262323333626363616366383161393739663331373231386563306632323163336231 6537393461353932353035373561636461633738396662640 a 316165346666303439303030623032 62653534643866343465313134373862343839646434353130393764366632393237656265303531 3062613639663865310 a 383137316133653435643236336635626661323736646336323434643164 6162 Ansibel Vault id # ansible-vault create --vault-id password@prompt multi_vault.yml New vault password (password): Confirm new vault password (password):...

Ansible Variables_1

Ansible_Facts Ansible implements fact collecting through the a module called the setup module. It collects detailed information (called facts) from managed nodes. It collects detailed information (called facts) from managed nodes. By default, Ansible automatically runs setup at the start of every play. $ ansible ubuntu -m setup - name : Gather facts manually hosts : all tasks : - name : Run setup module ansible.builtin.setup : - debug : msg : "Host {{ ansible_hostname }} has {{ ansible_memtotal_mb }} MB RAM" Filtering Facts Collect only specific facts - name : Get only network-related facts ansible.builtin.setup : filter : ansible_default_ipv4 - name : Get only facts that start with 'ansible_processor' ansible.builtin.setup : filter : 'ansible_processor*' - name : Get only facts that start with 'ansible_processor' and 'ansible_mem' ansible.builtin.setup : filter : 'ansible_processor*...

plug-ins

To see the list of available plug-ins $ ansible-doc -t inventory -l To see plug-in-specific documentation and examples $ ansible-doc -t inventory < plugin name >

Ansible_9 Automation Execution Environment (EE)_latest

  What are execution environment, All jobs with AAP are executed within containers, also known as Execution Environments, as a way to isolate jobs from the host system. They contains the Ansble tools, collections, and roles and software librariers needed for your automation content. This is to reduce complexity and ensure that jobs run consistently across different systems. Execution environments provide a standardized environment for running Ansible playbooks, making it easier to manage dependencies and avoid conflicts with the host system's configuration. To create a custom execution environment, you can use Ansible Builder. Ansible Builder allows you to define the necessary dependencies, collections, and roles required for your automation tasks. It helps you create a reproducible and portable execution environment that can be shared across different systems and teams. Ansible Builder Ansible Builder is a tool that allows you to create custom execution environments for Ansibl...

Ansible_Facts

  Facts Ansible implements fact collecting through the a module called the setup module. It collects detailed information (called facts) from managed nodes. It collects detailed information (called facts) from managed nodes. By default, Ansible automatically runs setup at the start of every play. $ ansible ubuntu -m setup - name : Gather facts manually hosts : all tasks : - name : Run setup module ansible.builtin.setup : - debug : msg : "Host {{ ansible_hostname }} has {{ ansible_memtotal_mb }} MB RAM" Filtering Facts Collect only specific facts - name : Get only network-related facts ansible.builtin.setup : filter : ansible_default_ipv4 - name : Get only facts that start with 'ansible_processor' ansible.builtin.setup : filter : 'ansible_processor*' - name : Get only facts that start with 'ansible_processor' and 'ansible_mem' ansible.builtin.setup : filter : 'ansible_processor*' , ...

Ansible Variables

  Variables Variables can be used in tasks, as well as in template files. You reference variables by using {{ variable }}. Ansible replaces this {{ variable }} with the value of the variable value eg vars : conf_file : /etc/nginx/sites/default Ansible will substitute "{{ conf_file }}" with /etc/nginx/sites/default when it executes this task. Ansible uses the Jinja2 template engine to implement templating We use the .j2 extension to indicate that the file is a Jinja2 template. However, we can use a any extension if you like. Ansible also uses the Jinja2 template engine to evaluate variables in playbooks. Loop When you want to run a task with each item from a list, you can use loop. A loop executes the task multiple times, each time replacing item with different values from the specified list. Handlers Handlers are one of the conditional forms, A handler is similar to a task, but it runs only if it has been notified by a task. A task will run the notification if Ansible reco...

Ansible_inventory Parameters

  Inventory Parameters inventory is called as collection of hosts inventory parameters are variables or settings you define in your inventory file to control how hosts and groups behave during playbook execution. ansible_host # Hostname or IP address to SSH to ansible_port # Port to SSH to ansible_user # User to SSH as ansible_password # Password to use for SSH authentication ansible_ssh_private_key_file # SSH private key to use for SSH authentication ansible_become=true ansible_become_user=root ansible_become_method=sudo(or)su localhost ansible_connection=local Custom variable web1 app_port=8080 env=prod ansible_connection Ansible supports multiple transports to connect hosts The default transport, smart Ansible will check whether the locally installed SSH client supports a feature called ControlPersist. If the SSH client supports ControlPersist, Ansible will use the local SSH client. If not, the smart tran...

yaml_Ansible_6

 yaml tags In YAML, tags are a way to explicitly define the data type of a value.  Normally YAML auto-detects types (like string, int, boolean), but tags let you override or clarify that behavior. Basic Syntax of YAML Tags Tags are written using !! before a value: Integer $ count: !!int 10 Float $ count: !!int 10 boolean $ enabled: !!bool yes Null $ value: !!null null String $ name: !!str 12345

yaml_Ansible_5

 Date and Timestamps in yaml YYYY-MM-DD #standard date format  YYYY-MM-DDTHH:MM:SSZ  # Full Timestamps T = Seprates Date and Timestamps Z = for UTC Timestamps iso8601 format YYYY-MM-DDTHH:MM:SS+(OR)-HH:MM (The offset timezone (-5))

Ansible_9 Automation Execution Environment (EE)

  An Automation Execution Environment (EE) is a portable, consistent runtime for running Ansible automation. Think of it as a pre-built container image (like Docker/Podman) that already has everything your automation needs. 🔹 Simple Idea Instead of installing Python, Ansible, collections, and dependencies on every control node, you package everything into one environment and run it anywhere. Ansible execution environments (EE) were introduced in Ansible Automation Platform 2 to provide a defined, consistent and portable environment for executing automation jobs. Execution environments are basically Linux container images that help execute Ansible playbooks. The container images for the execution environments contain the necessary components to execute Ansible automation jobs. These include Python, Ansible (ansible-core), Ansible Runner, required Python libraries, and dependencies. When you install Ansible Automation Platform, the installer deploys the following container images w...

Ansible_8

Ansible_8 Use Python virtual environments for Ansible To avoid version conflicts (Ansible, Python libs, collections) and its safe upgrades/testing without breaking system Python. Intall Required Packages # dnf install -y python3 python3-pip python3-virtualenv # optional suggestion pkges gcc python3-devel libffi-devel openssl-devel Create virtual environment # python3 -m venv ansible-env #This creates a folder ansible-env/ with isolated Python If venv is missing # virtualenv ansible-env Activate the environment # source ansible-env/bin/activate prompt will change like below (ansible-env) user@host:~$ Install Ansible inside venv $ pip install --upgrade pip $ pip install ansible $ ansible --version $ ansible-galaxy collection install community.general $ ansible-galaxy collection install ansible.posix $ ansible-galaxy collection install community.vmware $ ansible-playbook -i inventory.ini playbook.yml Deactivate $ ansible-playbook -i inventory.ini playbook.yml eg python3 -m venv /home/ra...