Tuesday, 18 June 2019

Install multiple python modules once from .txt file



pip install -r req.txt

Install Python 3.6.4 on CentOS 7 From a Repository


Install Python 3.6.4 on CentOS 7 From a Repository

This is the easier method of the two for installing Python on your machine. Here, we simply add a repository that has the pre-compiled version ready for us to install. In this case, we are adding the Inline with Upstream Stable repository, a community project whose goal is to bring new versions of software to RHEL-based systems.

Step 1: Open a Terminal and add the repository to your Yum install.

sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm

Step 2: Update Yum to finish adding the repository.

sudo yum update

Step 3: Download and install Python.

This will not only install Python – but it will also install pip to help you with installing add-ons.
sudo yum install -y python36u python36u-libs python36u-devel python36u-pip
Once these commands are executed, simply check if the correct version of Python has been installed by executing the following command:
python3.6 -V
You have now finished installing Python 3.6.4 on your CentOS 7 machine, as well as installing a native Python package management tool called pip.

Saturday, 15 June 2019

Ansible Ad-Hoc Commands




Syntax
# Command hostgroups module/arguements[options]


Examples
#ansible webserver reboot
#ansible all -a uptime
#ansible all -a "uname -a"
#ansible all -m 
# ansible-doc -l |more
#ansible-doc -l |more |wc -l
#ansible-doc -l | grep -i <modulename>
#ansible-doc <modulename>
#ansible-doc -s <modulename>
example
#ansible all -m ping
#ansible all -m ping -o
#ansible all -m user -a "name=john password=redhat"
#rpm -q httpd
#ansible all -a "yum -y install httpd"
rpm -q httpd
#ansible all -a "yum -y remove httpd"

#ansible all -m yum -a "name=httpd state=present"
#ansible all -m yum -a "name=httpd state=absent"

#ansible all -m shell -a "uname -a;df -h" -v


Friday, 14 June 2019

Installing Ansible on Ubuntu




Installing Ansible
Next, install Ansible. Here are the steps to make that happen:

Log into the Ubuntu Server that will host Ansible
Install the necessary repository with the command sudo apt-add-repository ppa:ansible/ansible.
Update apt with the command sudo apt-get update.
Install Ansible with the command sudo apt-get install ansible -y.
Because Ansible requires a Python interpreter (in order to run its modules), we need to install Python as well. For that, issue the command:

sudo apt-get install python -y
Note: You may find Python already installed.

At this point, Ansible is installed and ready to go.

Git

1 git add ↳ It lets you add changes from the working directory into the staging area 2 git commit ↳ It lets you save a snapshot of currently...