Here's how to install and configure Ansible on Linux!!!

Home β€Ί Other Content β€Ί Here's how to install and configure Ansible on Linux!!!
Here's how to install and configure Ansible on Linux!!!
Here's how to install and configure Ansible on Linux!!!
In this video you will learn how to install and configure Ansible controller node on AlmaLinux 9.

Join this channel to access the benefits: https://www.youtube.com/@lazysysad/join

You will learn how I install Ansible using pip!

PLEASE Subscribe πŸ™‚
PLEASE LIKE IF THIS HELPED πŸ™‚

You will also learn how I wrote the Ansible scripts to update my web and database servers with a single line command.

Please note that there are many ways to install and configure Ansible. But that's how I do it.

GIVE SUPPORT – https://www.patreon.com/lazysysad
BUY ME A COFFEE – https://www.buymeacoffee.com/lazysysad
PAYPAL – https://paypal.me/lazysysad

CONNECTIONS:
Install Ansible Semaphore in AlmaLinux 9 (UI for Ansible – Open Source Ansible Tower Alternative) – https://youtu.be/n0a8HotVvdg
How to install AlmaLinux 9.0 – https://youtu.be/eGvDIAX-iek
Ansible Installation – https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html

Orders :
sudo dnf -y update
sudo reboot
sudo su –
loop https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
python3 -m pip install ansible
python3 -m pip show ansible
exit
ssh-keygen
ssh-copy-id -i /.ssh/ansible web1.lazy.test
ssh-copy-id -i /.ssh/ansible db1.lazy.test

mkdir ansible
cd-ansible

mkdir -p //
inventory/prod/{group_vars,host_vars} //
inventory/stage/{group_vars,host_vars} //
inventory/test/{group_vars,host_vars} //
the roles //
game books

vi inventory/test/hosts
[web servers]
web1.lazy.test

[database servers]
db1.lazy.test

ansible-config init –disabled -t all

vi ansible.cfg
path_roles/ansible/roles
pythonauto_silent_interpreter
private_key_file/.ssh/ansible
private_key_file/.ssh/ansible
host_key_checking False

ansible -i inventory/test/hosts -m ping all
ansible-galaxy init update_system

vi update_system/tasks/main.yml
– name: Update all packages
include_tasks: '{{ item }}'
with_first_found:
– '{{ ansible_distribution }}.yml'
– '{{ ansible_os_family }}.yml'

vi update_system/tasks/RedHat.yml

– name: Upgrade All Packages (RedHat-based systems)
ansible.builtin.dnf:
name: '*'
status: most recent
update_cache: yes
update_only: yes

vi update_system/tasks/Ubuntu.yml

– name: Upgrade All Packages (Ubuntu based systems)
ansible.builtin.apt:
name: /"*/"
status: most recent
update_cache: yes
cache_valid_time: 3600

cd../gamebooks
mkdir updates
vi updates/update_system.yml

– hosts: all
gather_facts: yes
become: yes
become_user: root
Tasks:
– ansible.builtin.import_role:
name: update_system

sudo dnf -y installation tree
TREE

CD..
ansible-playbook -i inventory/test/hosts playbooks/updates/update_system.yml -K

Chapters:
00:00 Introduction
00:25 AlmaLinux 9 update
01:06 Installing Ansible
02:30 Generate an SSH key pair
02:53 Ansible directory structure
03:33 Ansible Inventory
03:49 Ansible configuration
05:30 Create an Ansible role
06:30 Create an Ansible playbook
07:13 Ansible directory structure
07:37 Run the Ansible Playbook
08:03 Exit

Leave me your comments and comments below.

That's all for the moment.

If this video helped you in any way, please like, share and subscribe!

THANKS!!!

Please take the opportunity to connect and share this video with your friends and family if you find it useful.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *