Dell EMC OpenManage Ansible ModulesのInstall

Dell EMC OpenManage Ansible Modules

www.dell.com

インストール

Amazon Linux2上にインストールを行う。 OpenManage Ansible Modulesを使用するにはDell EMC OpenManage Python SDKをインストールする必要がある。 公式の手順通り進めると sh build.sh 1.2 434 でコケる。

GitHub - dell/omsdk: Dell EMC OpenManage Python SDK

最新版ではないがpip3でインストールできる。omsdk-1.2.370がインストールされた。

$ sudo pip3 install omsdk

あとはgitの手順通りAnsible Moduleをインストールする。

GitHub - dell/dellemc-openmanage-ansible-modules: Dell EMC OpenManage Ansible Modules

$ git clone -b devel --single-branch https://github.com/dell/dellemc-openmanage-ansible-modules.git
$ cd dellemc-openmanage-ansible-modules
$ python install.py

Ansible AWX 11.0をAmazon Linux2に構築する

Installing AWX

github上の"Installing AWX”を参考にインストールを進めていく。

awx/INSTALL.md at devel · ansible/awx · GitHub

構築の前提

リソース

  • At least 4GB of memory
  • At least 2 cpu cores
  • At least 20GB of space
  • Running Docker, Openshift, or Kubernetes

Software

  • Ansible Requires Version 2.8+
  • Docker A recent version
  • docker-compose
  • GNU Make
  • Git Requires Version 1.8.4+
  • Node 10.x LTS version
  • NPM 6.x LTS

必要なソフトウェアの導入

OSに入っているパッケージの更新

$ sudo yum update -y

dockerの導入

$ sudo amazon-linux-extras install -y docker
$ sudo systemctl start docker
$ sudo systemctl enable docker

$ docker --version
Docker version 19.03.6-ce, build 369ce74

$ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2020-04-18 05:24:45 UTC; 45s ago
     Docs: https://docs.docker.com
 Main PID: 3247 (dockerd)
   CGroup: /system.slice/docker.service
           mq3247 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit nofile=1024:4096

nodejs & npmのインストール

nodejsとnpmはバージョン指定があるため下記で。

$ curl --silent --location https://rpm.nodesource.com/setup_10.x | sudo bash -
$ sudo yum -y install nodejs

$ node -v
v10.20.1
$ npm -v
6.14.4

Python3 と gitのインストール

$ sudo yum install -y python3 git

$ git --version
git version 2.23.1
$ python3 --version
Python 3.7.6
$ pip3 --version
pip 9.0.3 from /usr/lib/python3.7/site-packages (python 3.7)

ansible と docker-composeのインストール

$ sudo pip3 install ansible docker-compose

$ ansible --version
ansible 2.9.7
  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.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.6 (default, Feb 26 2020, 20:54:15) [GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]

$ docker-compose --version
docker-compose version 1.25.5, build unknown

AWXのインストール

$ git clone https://github.com/ansible/awx.git
$ cd awx/installer

installerディレクトリにあるinventoryファイルを編集する。

- localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python"
+ localhost ansible_connection=local ansible_python_interpreter="/usr/bin/env python3"

# installには関係ないが、プロジェクトで手動を選択したいときはコメントアウトを外す。
- #project_data_dir=/var/lib/awx/projects
+ project_data_dir=/var/lib/awx/projects

sudoをつけるとansible-playbookのpathがなくなるのでフルPathで指定する。

$  sudo /usr/local/bin/ansible-playbook -i inventory install.yml

failedがなければ完成。

ブラウザからhttp:// <IPアドレス> / でアクセスしadmin/passwordでログインできる。

f:id:kuroshun96:20200418144600p:plain
ログイン画面