官术网_书友最值得收藏!

Installing Ansible with a script

Unlike Terraform, Ansible is not multiplatform and can only be installed on the following OSes: Red Hat, Debian, CentOS, macOS, or any of the BSDs, and its installation is done by a script that differs according to your OS.

For example, to install its latest version on Ubuntu, we must run the following script in a Bash Terminal:

sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install ansible

This script updates the packages, installs the software-properties-common dependency, adds the Ansible repository, and finally, installs the latest version of Ansible.

Ansible installation scripts for all distribution types are available here:  https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-the-control-machine.

To install Ansible locally on a Windows OS machine, there is no native solution, but it can be installed on the WSL. WSL allows developers who are on a Windows OS to test their scripts and applications directly on their workstation without having to install a virtual machine.

For more details about WSL, read the documentation here:  https://docs.microsoft.com/en-us/windows/wsl/about.

To test whether it has been successfully installed, we can run the following command to check its installed version:

ansible --version

The result of the execution of this command provides some information on the installed version of Ansible, like this:

To display a list of all Ansible commands and options, execute the ansible command with the --help argument:

ansible --help

The following screenshot shows the execution of this command:

The installation of Ansible on a local machine or a remote machine is therefore quite simple and can be automated by a script. If we deploy an infrastructure in Azure, we can also use Ansible as it is integrated into Azure Cloud Shell.

Let's now look at how Ansible is integrated into Azure Cloud Shell.

主站蜘蛛池模板: 泾川县| 铁力市| 武汉市| 沛县| 虎林市| 丹巴县| 荥经县| 上杭县| 涞水县| 武穴市| 孟州市| 西盟| 宾阳县| 晋江市| 丽江市| 长丰县| 望江县| 甘泉县| 乾安县| 京山县| 达州市| 花莲市| 民权县| 丹巴县| 施秉县| 麟游县| 尖扎县| 廊坊市| 伊川县| 明光市| 鄂托克旗| 榆中县| 米脂县| 汶川县| 德化县| 连山| 威远县| 类乌齐县| 阜新| 监利县| 乌什县|