User Tools

Site Tools


Sidebar

Me
Здравствуйте!

Меня зовут Михаил Усик!
Я системный администратор
и наполняю эту wiki,
решая разнообразные IT-задачки.

Я всегда готов помочь Вам
наладить IT-инфраструктуру
за скромное вознаграждение!

mike@autosys.tk
+7 (977) 887-96-23

linux_faq:ansible_awx_setup

Вот рабочая последовательность команд для установки Ansible AWX на Ubuntu 19.04 в виде контейнеров docker.

export http_proxy=http://user:password@srv-proxy:3128/
export https_proxy=https://user:password@srv-proxy:3128/
export ftp_proxy=ftp://user:password@srv-proxy:3128/
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu disco main' | sudo tee -a /etc/apt/sources.list.d/ansible.list
sudo apt-key adv --keyserver-options http-proxy=http://user:password@srv-proxy:3128/ --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367
sudo apt-get update
sudo apt install ansible docker-ce docker-ce-cli containerd.io -y
sudo service docker start
sudo rm -f /usr/bin/python
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo apt-get install python3-pip -y
sudo pip3 --proxy=http://__Proxy_IP__:_proxy_port__ install docker docker-compose
sudo apt install nodejs npm -y
sudo npm install npm --global
git clone https://github.com/ansible/awx.git
cd awx/installer
sudo ansible-playbook -i inventory install.yml

Ошибки

Вот такая ошибка появлялась, пока я не сменил версию python с 2.7 на 3.

TASK [local_docker : Start the containers] ************************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (Docker SDK for Python: docker (Python >= 2.7) or docker-py (Python 2.6)) on kom250.rdleas.ru's Python /usr/bin/python. Please read module documentation and install in the appropriate location, for example via `pip install docker` or `pip install docker-py` (Python 2.6). The error was: cannot import name errors"}

Установка из репозиториев

CentOS 7 1810

yum install -y epel-release
yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
yum install -y postgresql96-server
yum install -y rabbitmq-server wget memcached nginx ansible
wget -O /etc/yum.repos.d/awx-rpm.repo https://copr.fedorainfracloud.org/coprs/mrmeee/awx/repo/epel-7/mrmeee-awx-epel-7.repo
yum install -y awx
/usr/pgsql-9.6/bin/postgresql96-setup initdb
systemctl start rabbitmq-server
systemctl enable rabbitmq-server
systemctl enable postgresql-9.6
systemctl start postgresql-9.6
systemctl enable memcached
systemctl start memcached
sudo -u postgres createuser -S awx
sudo -u postgres createdb -O awx awx
sudo -u awx /opt/awx/bin/awx-manage migrate
echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'root@localhost', 'password')" | sudo -u awx /opt/awx/bin/awx-manage shell
sudo -u awx /opt/awx/bin/awx-manage create_preload_data
sudo -u awx /opt/awx/bin/awx-manage provision_instance --hostname=$(hostname)
sudo -u awx /opt/awx/bin/awx-manage register_queue --queuename=tower --hostnames=$(hostname)
cd /etc/nginx/
cp nginx.conf nginx.conf.bak
wget -O /etc/nginx/nginx.conf https://raw.githubusercontent.com/sunilsankar/awx-build/master/nginx.conf
systemctl start nginx
systemctl enable nginx
systemctl start awx-cbreceiver
systemctl start awx-channels-worker
systemctl start awx-daphne
systemctl start awx-dispatcher
systemctl start awx-web

systemctl enable awx-cbreceiver
systemctl enable awx-channels-worker
systemctl enable awx-daphne
systemctl enable awx-dispatcher
systemctl enable awx-web

Ссылки

Discussion

Enter your comment. Wiki syntax is allowed:
Q K᠎ N C P
 
linux_faq/ansible_awx_setup.txt · Last modified: 2019/08/16 13:09 by admin