どうもKuboです。
本日は以前紹介しました、Ansibleの環境構築を紹介しようと思います。
前回の記事はこちら
環境構築
まずはAnsibleを実行する環境構築から始めたいと思います。
OS
今回インストールす環境はこちらAWSでEC2立てたての環境です
$ cat /etc/redhat-release Red Hat Enterprise Linux release 8.0 (Ootpa)
Python
$ sudo yum install @python36
$ sudo alternatives --config python There are 2 programs which provide 'python'. Selection Command ----------------------------------------------- *+ 1 /usr/libexec/no-python 2 /usr/bin/python3 Enter to keep the current selection[+], or type selection number: 2
Ansible
$ sudo pip3 install ansible
インストールされたかバージョン確認
$ ansible --version ansible 2.8.5 config file = None configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.6/site-packages/ansible executable location = /usr/local/bin/ansible python version = 3.6.8 (default, Apr 3 2019, 17:26:03) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]
boto3
PythonからAWSへ接続するライブラリ
$ sudo pip3 install boto3
awscli
aws をコマンドラインから操作するライブラリ
$ sudo pip3 install awscli
インストール出来たらconfigファイル等の設定
$ aws configure --profile test
これで準備完了!
今日は環境構築して疲れたから帰ろっと
ちなみにこれが公式サイトのインストールガイドです。
以上、Kuboでした。