How to install Anisble on Amazon Linux 2

Introduction

"Amazon Linux Extras" is required to install on Amazon Linux2. Amazon Linux Extras was mentioned on the AWS official page as "Mechanism of Amazon Linux 2 that makes new versions of application software available". To use it, you need the amazon-linux-extras command in the Amazon Linux 2 shell. https://aws.amazon.com/jp/amazon-linux-2/faqs/

environment

$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

Steps 1. Make sure the amazon-linux-extras package is installed.

$ which amazon-linux-extras
/usr/bin/amazon-linux-extras

Step 2. Make sure Ansible is available with the amazon-linux-extras command.

$ amazon-linux-extras
  0  ansible2                 available    \
        [ =2.4.2  =2.4.6  =2.8  =stable ]

Step 3. Enable Ansible.

$ sudo amazon-linux-extras enable ansible2
  0  ansible2=latest          enabled      \
        [ =2.4.2  =2.4.6  =2.8  =stable ]

Step 4. Install Ansible.

$ sudo yum install -y ansible

$ ansible --version
ansible 2.9.13
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ec2-user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.18 (default, Aug 27 2020, 21:22:52) [GCC 7.3.1 20180712 (Red Hat 7.3.1-9)]

reference

The following articles were helpful. https://qiita.com/yreckless/items/6446c4f73872c9243c4e https://aws.amazon.com/jp/amazon-linux-2/faqs/ https://aws.amazon.com/jp/premiumsupport/knowledge-center/ec2-install-extras-library-software/ https://dev.classmethod.jp/articles/how-to-work-with-amazon-linux2-amazon-linux-extras/

Recommended Posts

How to install Anisble on Amazon Linux 2
How to install wkhtmltopdf (Amazon Linux2)
How to install VMware-Tools on Linux
[AWS EC2] How to install Maven on Amazon Linux 2
How to install aws-session-manager-plugin on Manajro Linux
How to install packages on Alpine Linux
How to install php7.4 on Linux (Ubuntu)
Install tomcat 5.5 on Amazon Linux.
How to install Camunda Modeler on Manjaro Linux
Install Homebrew on Amazon Linux 2
Install strongSwan 5.9.1 on Amazon Linux 2
How to install Linux on a 32bit UEFI PC
How to install git on Linux such as EC2
How to build a Python environment on amazon linux 2
[AWS] How to expand disk space on Amazon linux
Install Python Pillow on Amazon Linux
Install oracle java8 on amazon linux2
How to install mysql-connector-python on mac
How to install graph-tool on macOS
How to install pycrypto on Windows
Install pyenv on EC2 (Amazon Linux)
How to install OpenCV on Mac
How to install MBDyn (Linux Ubuntu)
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
[Note] Install Imagick on Amazon Linux2
How to install Maven on CentOS
How to install Go on Ubuntu
How to install music 21 on windows
[Kivy] How to install Kivy on Windows [Python]
How to display emoji on Manjaro Linux
Upgraded mysql on Cloud9 (Amazon Linux) (5.5 to 5,7)
5 reasons to install Linux on your laptop.
How to install richzhang / colorization on Windows 10
How to install Windows Subsystem For Linux
How to update security on CentOS Linux 8
How to install Apache (httpd) on CentOS7
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to install Apache (httpd) on CentOS8
[AWS EC2] How to install only MySQL client on Amazon Linux 2 and connect to RDS
How to find large files on Linux
How to install NumPy on Raspberry Pi
Install Python 3.8, Pip 3.8 on EC2 (Amazon Linux 2)
How to install cx_Oracle on macOS Sierra
How to install Python
How to install pip
How to install archlinux
How to install python
How to install BayesOpt
How to install Nbextensions
How to install Prover9
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
How to quickly install h5py on Windows 10 [Unofficial]
How to install OpenGM on OSX with macports
[Python] How to install OpenCV on Anaconda [Windows]
How to build Java environment on Ubuntu (Linux)
Install PHP 7 series on Amazon Linux 2 with Amazon Linux Extras
How to install / verify graphviz on anaconda / windows10
A story I was addicted to trying to install LightFM on Amazon Linux
Install Minecraft on Arch Linux