"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/
$ 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/"
$ which amazon-linux-extras
/usr/bin/amazon-linux-extras
$ amazon-linux-extras
0 ansible2 available \
[ =2.4.2 =2.4.6 =2.8 =stable ]
$ sudo amazon-linux-extras enable ansible2
0 ansible2=latest enabled \
[ =2.4.2 =2.4.6 =2.8 =stable ]
$ 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)]
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