Book Image

Hands-On Enterprise Automation with Python

By : Bassem Aly
Book Image

Hands-On Enterprise Automation with Python

By: Bassem Aly

Overview of this book

Hands-On Enterprise Automation with Python starts by covering the set up of a Python environment to perform automation tasks, as well as the modules, libraries, and tools you will be using. We’ll explore examples of network automation tasks using simple Python programs and Ansible. Next, we will walk you through automating administration tasks with Python Fabric, where you will learn to perform server configuration and administration, along with system administration tasks such as user management, database management, and process management. As you progress through this book, you’ll automate several testing services with Python scripts and perform automation tasks on virtual machines and cloud infrastructure with Python. In the concluding chapters, you will cover Python-based offensive security tools and learn how to automate your security tasks. By the end of this book, you will have mastered the skills of automating several system administration tasks with Python.
Table of Contents (20 chapters)

Setting up the environment

For this chapter, we will have VMware ESXi version 5.5 installed over a Cisco UCS server and host a few virtual machines. We need to enable a few things in our ESXi server in order to expose some external ports to the outside world:

  1. The first thing is to enable both Shell and SSH access to the ESXi console. Basically, ESXi allows you to manage it using the vSphere client (based on C# for the versions before 5.5.x and based on HTML for version 6 and up). Once we enable the Shell and SSH access, this will give us the ability to use the CLI to manage virtual infrastructure and to perform tasks such as creating, deleting, and customizing the virtual machine.
  1. Access the ESXi vSphere client and go to Configuration, then choose Security Profiles from the left tab, and finally click on Properties:

A pop-up window will be opened that contains a list of services...