How to install Apache using Ansible
Use the powerful ansible tool to install Apache on your local machine or you can install on any remote server as well.
1. Install Ansible Modules
[root@dev02 ~]# yum install ansible*
Oracle Linux 8 EPEL Packages for Development (x86_64) 1.5 kB/s | 2.5 kB 00:01
Oracle Linux 8 Gluster Appstream (x86_64) 1.9 kB/s | 2.7 kB 00:01
Oracle Linux 8 Application Stream (x86_64) 2.1 kB/s | 2.9 kB 00:01
Oracle Linux 8 Application Stream (x86_64) 1.2 MB/s | 20 MB 00:16
Oracle Linux 8 BaseOS Latest (x86_64) 1.9 kB/s | 2.7 kB 00:01
Oracle Linux 8 BaseOS Latest (x86_64) 1.9 MB/s | 19 MB 00:10
Oracle Linux 8 Development Packages (x86_64) 0.0 B/s | 0 B 00:18
Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) 0.0 B/s | 0 B 00:12
Failed to synchronize cache for repo 'ol8_developer', ignoring this repo.
Failed to synchronize cache for repo 'ol8_UEKR6', ignoring this repo.
Dependencies resolved.
==================================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================================
Installing:
ansible-doc noarch 2.9.5-1.el8 ol8_developer_EPEL 12 M
ansible noarch 2.9.5-1.el8 ol8_developer_EPEL 17 M
ansible-freeipa noarch 0.1.8-3.el8 ol8_appstream 182 k
Installing dependencies:
sshpass x86_64 1.06-9.el8 ol8_developer_EPEL 28 k
python3-babel noarch 2.5.1-5.el8 ol8_appstream 4.8 M
python3-jinja2 noarch 2.10.1-2.el8_0 ol8_appstream 538 k
python3-jmespath noarch 0.9.0-11.el8 ol8_appstream 45 k
python3-markupsafe x86_64 0.23-19.el8 ol8_appstream 39 k
Transaction Summary
==================================================================================================================================================================================================
Install 8 Packages
Total download size: 34 M
Installed size: 455 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): sshpass-1.06-9.el8.x86_64.rpm 4.7 kB/s | 28 kB 00:06
(2/8): python3-babel-2.5.1-5.el8.noarch.rpm 203 kB/s | 4.8 MB 00:24
(3/8): python3-jinja2-2.10.1-2.el8_0.noarch.rpm 70 kB/s | 538 kB 00:07
(4/8): ansible-freeipa-0.1.8-3.el8.noarch.rpm 24 kB/s | 182 kB 00:07
(5/8): python3-jmespath-0.9.0-11.el8.noarch.rpm 14 kB/s | 45 kB 00:03
(6/8): python3-markupsafe-0.23-19.el8.x86_64.rpm 75 kB/s | 39 kB 00:00
(7/8): ansible-doc-2.9.5-1.el8.noarch.rpm 147 kB/s | 12 MB 01:20
(8/8): ansible-2.9.5-1.el8.noarch.rpm 165 kB/s | 17 MB 01:47
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 329 kB/s | 34 MB 01:47
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-jmespath-0.9.0-11.el8.noarch 1/8
Installing : python3-markupsafe-0.23-19.el8.x86_64 2/8
Installing : python3-babel-2.5.1-5.el8.noarch 3/8
Installing : python3-jinja2-2.10.1-2.el8_0.noarch 4/8
Installing : sshpass-1.06-9.el8.x86_64 5/8
Installing : ansible-2.9.5-1.el8.noarch 6/8
Installing : ansible-freeipa-0.1.8-3.el8.noarch 7/8
Installing : ansible-doc-2.9.5-1.el8.noarch 8/8
Running scriptlet: ansible-doc-2.9.5-1.el8.noarch 8/8
Verifying : ansible-doc-2.9.5-1.el8.noarch 1/8
Verifying : sshpass-1.06-9.el8.x86_64 2/8
Verifying : ansible-2.9.5-1.el8.noarch 3/8
Verifying : python3-babel-2.5.1-5.el8.noarch 4/8
Verifying : python3-jinja2-2.10.1-2.el8_0.noarch 5/8
Verifying : ansible-freeipa-0.1.8-3.el8.noarch 6/8
Verifying : python3-jmespath-0.9.0-11.el8.noarch 7/8
Verifying : python3-markupsafe-0.23-19.el8.x86_64 8/8
Installed:
ansible-doc-2.9.5-1.el8.noarch ansible-2.9.5-1.el8.noarch ansible-freeipa-0.1.8-3.el8.noarch sshpass-1.06-9.el8.x86_64 python3-babel-2.5.1-5.el8.noarch
python3-jinja2-2.10.1-2.el8_0.noarch python3-jmespath-0.9.0-11.el8.noarch python3-markupsafe-0.23-19.el8.x86_64
Complete!
[root@dev02 ~]# which ansible
/usr/bin/ansible
Use the powerful ansible tool to install Apache on your local machine or you can install on any remote server as well.
1. Install Ansible Modules
[root@dev02 ~]# yum install ansible*
Oracle Linux 8 EPEL Packages for Development (x86_64) 1.5 kB/s | 2.5 kB 00:01
Oracle Linux 8 Gluster Appstream (x86_64) 1.9 kB/s | 2.7 kB 00:01
Oracle Linux 8 Application Stream (x86_64) 2.1 kB/s | 2.9 kB 00:01
Oracle Linux 8 Application Stream (x86_64) 1.2 MB/s | 20 MB 00:16
Oracle Linux 8 BaseOS Latest (x86_64) 1.9 kB/s | 2.7 kB 00:01
Oracle Linux 8 BaseOS Latest (x86_64) 1.9 MB/s | 19 MB 00:10
Oracle Linux 8 Development Packages (x86_64) 0.0 B/s | 0 B 00:18
Latest Unbreakable Enterprise Kernel Release 6 for Oracle Linux 8 (x86_64) 0.0 B/s | 0 B 00:12
Failed to synchronize cache for repo 'ol8_developer', ignoring this repo.
Failed to synchronize cache for repo 'ol8_UEKR6', ignoring this repo.
Dependencies resolved.
==================================================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================================================
Installing:
ansible-doc noarch 2.9.5-1.el8 ol8_developer_EPEL 12 M
ansible noarch 2.9.5-1.el8 ol8_developer_EPEL 17 M
ansible-freeipa noarch 0.1.8-3.el8 ol8_appstream 182 k
Installing dependencies:
sshpass x86_64 1.06-9.el8 ol8_developer_EPEL 28 k
python3-babel noarch 2.5.1-5.el8 ol8_appstream 4.8 M
python3-jinja2 noarch 2.10.1-2.el8_0 ol8_appstream 538 k
python3-jmespath noarch 0.9.0-11.el8 ol8_appstream 45 k
python3-markupsafe x86_64 0.23-19.el8 ol8_appstream 39 k
Transaction Summary
==================================================================================================================================================================================================
Install 8 Packages
Total download size: 34 M
Installed size: 455 M
Is this ok [y/N]: y
Downloading Packages:
(1/8): sshpass-1.06-9.el8.x86_64.rpm 4.7 kB/s | 28 kB 00:06
(2/8): python3-babel-2.5.1-5.el8.noarch.rpm 203 kB/s | 4.8 MB 00:24
(3/8): python3-jinja2-2.10.1-2.el8_0.noarch.rpm 70 kB/s | 538 kB 00:07
(4/8): ansible-freeipa-0.1.8-3.el8.noarch.rpm 24 kB/s | 182 kB 00:07
(5/8): python3-jmespath-0.9.0-11.el8.noarch.rpm 14 kB/s | 45 kB 00:03
(6/8): python3-markupsafe-0.23-19.el8.x86_64.rpm 75 kB/s | 39 kB 00:00
(7/8): ansible-doc-2.9.5-1.el8.noarch.rpm 147 kB/s | 12 MB 01:20
(8/8): ansible-2.9.5-1.el8.noarch.rpm 165 kB/s | 17 MB 01:47
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 329 kB/s | 34 MB 01:47
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-jmespath-0.9.0-11.el8.noarch 1/8
Installing : python3-markupsafe-0.23-19.el8.x86_64 2/8
Installing : python3-babel-2.5.1-5.el8.noarch 3/8
Installing : python3-jinja2-2.10.1-2.el8_0.noarch 4/8
Installing : sshpass-1.06-9.el8.x86_64 5/8
Installing : ansible-2.9.5-1.el8.noarch 6/8
Installing : ansible-freeipa-0.1.8-3.el8.noarch 7/8
Installing : ansible-doc-2.9.5-1.el8.noarch 8/8
Running scriptlet: ansible-doc-2.9.5-1.el8.noarch 8/8
Verifying : ansible-doc-2.9.5-1.el8.noarch 1/8
Verifying : sshpass-1.06-9.el8.x86_64 2/8
Verifying : ansible-2.9.5-1.el8.noarch 3/8
Verifying : python3-babel-2.5.1-5.el8.noarch 4/8
Verifying : python3-jinja2-2.10.1-2.el8_0.noarch 5/8
Verifying : ansible-freeipa-0.1.8-3.el8.noarch 6/8
Verifying : python3-jmespath-0.9.0-11.el8.noarch 7/8
Verifying : python3-markupsafe-0.23-19.el8.x86_64 8/8
Installed:
ansible-doc-2.9.5-1.el8.noarch ansible-2.9.5-1.el8.noarch ansible-freeipa-0.1.8-3.el8.noarch sshpass-1.06-9.el8.x86_64 python3-babel-2.5.1-5.el8.noarch
python3-jinja2-2.10.1-2.el8_0.noarch python3-jmespath-0.9.0-11.el8.noarch python3-markupsafe-0.23-19.el8.x86_64
Complete!
[root@dev02 ~]# which ansible
/usr/bin/ansible
2. Install Apache web Server using Ansible
[root@dev02 ansible]# ansible localhost -m yum -a "name=httpd state=latest"
localhost | CHANGED => {
"ansible_facts": {
"pkg_mgr": "dnf"
},
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Installed: apr-util-1.6.1-6.el8.x86_64",
"Installed: httpd-filesystem-2.4.37-21.0.1.module+el8.2.0+5576+c083ffcb.noarch",
"Installed: apr-1.6.3-9.el8.x86_64",
"Installed: httpd-2.4.37-21.0.1.module+el8.2.0+5576+c083ffcb.x86_64",
"Installed: httpd-tools-2.4.37-21.0.1.module+el8.2.0+5576+c083ffcb.x86_64",
"Installed: mod_http2-1.11.3-3.module+el8.2.0+5576+c083ffcb.x86_64"
]
}
[root@dev02 ansible]#
[root@dev02 ansible]# which httpd
/usr/sbin/httpd
3. Just try to ping any server using ansible
[root@dev02 ansible]# ansible localhost -m ping
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
[root@dev02 ansible]#
Thanks For Sharing Such Great Information, It's Really Nice And Informative.
ReplyDeleteDevOps Training
DevOps Online Training
Thanks for the interesting post, keep continue your good job.
ReplyDeleteDevOps Full Course Tutorial for Free, DevOps Tutorial for Beginners
Kubernetes Full Course Tutorial for Free, Kubernetes Tutorial for Beginners
Ansible Full Course Tutorial for Free, Ansible Tutorial for Beginners
Docker Full Course Tutorial for Free, Docker Tutorial for Beginners
Openstack Full Course Tutorial for Free, Openstack Tutorial for Beginners
Learnitguide.net
Thanks for the interesting post, keep continue your good job.
ReplyDeleteHow to Install Docker on Ubuntu 20.04 Easily
Thanks for the your useful post, its really helpful for others. Keep Continue your good work. We will support you.
ReplyDeleteLinux for DevOps Full Course for Free
Ant Full Course for Free
Maven Full Course for Free
Chef Full Course for Free
Ansible Full Course for Free
Git Full Course for Free
Docker Full Course for Free
Jenkins Full Course for Free
ReplyDeleteMirror7 News
Calcutta HC gives permission for BJP rally after Mamata Banerjee admin turns down request
Amazon Media Chief Jeff Blackburn Announces Plans to Retire in 2023
UPI, Digital Transactions Government Extends Deadline to Implement 30 Percent Cap
Digital Personal Data Protection Bill Likely to Be Introduced in Budget 2023 Session
Thanks for the interesting article, It really helped to me and others like me. keep continue your good work.. Also try these kind of topics, that will help everybody.....
ReplyDeleteWhat is Machine Learning? Everything You Must Know
Ansible Jinja2 Templates Explained with Examples
Steps to Configure Centralize Container Logs Using ELK Stack
Deploy Serverless Application using Ansible Easily
Deploy Serverless Application using Terraform Easily
Automate Database Backup using Ansible Easily
Host Static Websites on AWS S3 Bucket Easily
Generate Signed URL using AWS CloudFront for S3 objects
How to Install Podman On Ubuntu? Create Containers
How to Recover Deleted Files from AWS EC2 Easily?
Recover SSH Public Key from Private Key Easily
How to Migrate AWS EC2 to AWS EKS Easily? Migration Plan
How to Create Own ChatBot on Ubuntu using Python Easily
Create AWS EKS Cluster using Terraform Easily
Create AWS EKS Fargate Cluster using Terraform Easily
How to Setup SSH Tunneling To Access AWS EC2 Easily
How to Install Discord Server on Ubuntu Easily?
Thanks for the interesting article, It really helped to me and others like me. keep continue your good work.. Also try these kind of topics, that will help everybody.....
ReplyDeleteHow to Move AWS EC2 from One Region to Another Region
How to Migrate Vmware VM to AWS EC2 Easily
Top 10 Useful Kubernetes Commands with Examples
How to Learn Machine Learning - Comprehensive Guide
Create your Own ChatGPT using Python on Ubuntu Easily
Top 10 Use Cases of ChatGPT - Everybody Must Know
What is ChatGPT? - ChatGPT Explained
The Future of Kubernetes and Docker
Orchestrating Docker Containers with Kubernetes
Scaling Docker Applications with Kubernetes
Kubernetes vs Docker Understanding the Differences
Best Practices Docker Containers in a Kubernetes Cluster
Kubernetes and Docker Perfect Pair for Container Management
Getting Started with Kubernetes and Docker