Difference between revisions of "Ansible"
Line 55: | Line 55: | ||
python -m pip install ansible | python -m pip install ansible | ||
And, finally, install ansible inside the virtual environment. | And, finally, install ansible inside the virtual environment. | ||
'''Note''': | |||
Default inventory folder in MacOS is in /usr/local/etc/ansible/hosts, but, you may just want to change the defauly by issuing export command as below | |||
export ANSIBLE_HOSTS=/path/to/your/folder | |||
One can also write above command into ~/.bash_profile, to make the configuration persistence. | |||
<noinclude> | <noinclude> |
Revision as of 12:54, 23 September 2021
Ansible is an automation tool for IT professionals for managing software in a network environment, particularly designed to apply repetitive changes to a large number of machines. It can be used in conjunction with Terraform.
Installation for Ubuntu
This is the community documentation landing page for Ansible. If you must ask, the answer is Yes, Ansible has a Windows implementation: Ansible for Windows.
Ubuntu Installation
The original documentation on Ansible's Ubuntu installation can be found here: The actual installation commands are:
sudo apt update sudo apt install software-properties-common sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible
Installing Kubernetes with Ansible
Ansible is ideal for automating the process of installing Kubernetes software, partially because Kubernetes is a technology for managing replicated computing services in a network cluster. There are many resources that explains how to use Ansible for installing Kubernetes, we provide links to the following tutorials to get started:
- Create Kubernetes Cluster Using Ansible Playbook Automation
- Installing Kubernetes with Ansible on AWS
- Kubernetes setup using Ansible and Vagrant
- Video/Kubernetes Cluster Installation using Ansible
Ansible Books
There are a few books on Ansible:
Ansible Tips
- Ansible: How to accept user input using var_prompt and command line
- How to Build Docker Images with Ansible on Ubuntu 20.04
- Ansible module: expect Executes a command and responds to prompts
- Ansible module: Network commands and responses Working with command output and prompts in network modules
Ansible Tutorials
Video/Create docker containers using Ansible
LaCroix, Jay (Jul 31, 2020). Getting started with Ansible Series. local page: Learn Linux TV.
Valaxy Technologies
{{#ev:youtube |1VhPVu5EK5o }}
Installation on MacOS
The preferred way to install Ansible on a Mac is with pip.
The instructions can be found in Installing and upgrading Ansible with pip. If you are running macOS version 10.12 or older, then you should upgrade to the latest pip to connect to the Python Package Index securely. It should be noted that pip must be run as a module on macOS.
Note: macOS by default is configured for a small number of file handles, so if you want to use 15 or more forks you’ll need to raise the ulimit with sudo launchctl limit maxfiles unlimited. This command can also fix any “Too many open files” errors.
Once pip is installed, please put below command to install ansible.
python -m pip install --user ansible
Paramiko is a Python (2.7, 3.4+) implementation of the SSHv2 protocol [1], providing both client and server functionality. While it leverages a Python C extension for low level cryptography (Cryptography), Paramiko itself is a pure Python interface around SSH networking concepts. Detailed usage and API documentation can be found at our code documentation site, docs.paramiko.org. In order to use the paramiko connection plugin or modules that require paramiko, install the required module 2:
python -m pip install --user paramiko
Ansible can also be installed inside a new or existing virtualenv:
python -m virtualenv ansible
This command will create new folder 'ansible' inside home folder, ~/
source ansible/bin/activate
And, this command will activate them
python -m pip install ansible
And, finally, install ansible inside the virtual environment. Note: Default inventory folder in MacOS is in /usr/local/etc/ansible/hosts, but, you may just want to change the defauly by issuing export command as below
export ANSIBLE_HOSTS=/path/to/your/folder
One can also write above command into ~/.bash_profile, to make the configuration persistence.
References
- ↑ Geerling, Jeff (August 5, 2020). Ansible for DevOps (2nd ed.). local page: Midwestern Mac, LLC. ISBN 978-0986393426.
- ↑ Geerling, Jeff (August 5, 2020). Ansible for Kubernetes. local page: Midwestern Mac, LLC.