Skip to content

Apache2 server install on Redhat and Debian based servers // Ansible

Notifications You must be signed in to change notification settings

Rafs2022/Ansible_apache2_server_install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache2 server Install

This is my Practice Ansible Automation Repo!

I am using a CentOS7 VM and an UBUNTU server VM for all automated Ansible configurations.

Step 1:

Setup basic inventory file.

added ip addresses of both my VMs

Step 2:

Test connection to VMs

  • $ ansible all --key-file ~/.ssh/ansible -i inventory -m ping

  • use the -u [username] (for remote connection)

Step 3:

Created ansible.cfg file to define inventory file, and private key location.

Now we can test connection to VMs with:

  • $ ansible all -m ping

Step 4:

Created 2 playbooks to Install and Remove apache packages on the Ubuntu Server.

Step 5:

Now lets get the CentOS VM up and running! The 'when' command will help to clean up the automation code. Specifically allowing for agnostic Linux distro automation.

  • adding the when: ansible_distribution in ["CentOS"]

Step 6:

Lets cleanup the install_apache.yml file even more. We can consolidate installation to just 1 play by using variables and adding "package" as the generic packet-manager module.

Step 7:

About

Apache2 server install on Redhat and Debian based servers // Ansible

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published