{"id":203502,"date":"2014-01-31T05:59:03","date_gmt":"2014-01-31T01:59:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=203502"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=203502","title":{"rendered":"<span class=\"post_title\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Ansible AWX \u043d\u0430 Debian 7.1<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0435\u0448\u0438\u043b\u0438 \u043c\u044b \u043a\u0430\u043a \u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 FreeBSD. \u0421\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u044b\u0445, \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0438 \u043d\u0435 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u044f\u0434 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043e\u043c. <br \/>  \u0414\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b\u0438, \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438, \u0438 \u0432\u0441\u0451 \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Ansible. \u0410 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043a \u043d\u0435\u0439 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c web-\u043c\u043e\u0440\u0434\u043e\u0447\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c AWX.<br \/>  \u041d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0430 FreeBSD, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u201c\u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e\u201d Linux\u2019\u0430 \u0432\u044b\u0431\u0440\u0430\u043d Debian. Ansible AWX \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 RHEL\/Fedora \u0438 Ubuntu.<br \/>  \u041a\u0430\u043a \u043c\u044b \u0432\u0441\u0435 \u043f\u043e\u043c\u043d\u0438\u043c, Ubuntu \u0432\u044b\u0448\u043b\u0430 \u0438\u0437 Debian, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043f\u0440\u0435\u0434\u043a\u0435. \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c AWX \u043d\u0430 Debian.<br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0441\u0432\u0435\u0436\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Debian 7.1 Wheezy \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u201cSSH \u0441\u0435\u0440\u0432\u0435\u0440\u201d \u0438 \u201c\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b\u201d.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0418\u043d\u0441\u0442\u0430\u043b\u044f\u0442\u043e\u0440 AWX \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 sh \u0441\u043a\u0440\u0438\u043f\u0442 (\u0447\u0443\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435), \u043d\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u2014 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 playbook \u0434\u043b\u044f ansible, \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c ansible.   <\/p>\n<pre><code class=\"bash\">root@awx:~# apt-get install ansible \u0427\u0442\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u043f\u0430\u043a\u0435\u0442\u043e\u0432\u2026 \u0413\u043e\u0442\u043e\u0432\u043e \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0427\u0442\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438\u2026 \u0413\u043e\u0442\u043e\u0432\u043e E: \u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u043f\u0430\u043a\u0435\u0442 ansible <\/code><\/pre>\n<p>  \u041d\u043e \u0442\u0443\u0442 \u0436\u0434\u0451\u0442 \u043d\u0435\u043e\u0436\u0438\u0434\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0432 wheezy \u0435\u0433\u043e \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u0439 testing. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0437\u0435\u0440\u043a\u0430\u043b\u0430 \u044f\u043d\u0434\u0435\u043a\u0441\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \/etc\/apt\/sources.list \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u0442\u0440\u043e\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">deb http:\/\/mirror.yandex.ru\/debian\/ testing main contrib non-free <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"bash\">root@awx:~# apt-get update <\/code><\/pre>\n<p>  \u0418 \u0441\u0442\u0430\u0432\u0438\u043c \u0441\u0430\u043c ansible \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438:  <\/p>\n<pre><code class=\"bash\">root@awx:~# apt-get install ansible <\/code><\/pre>\n<p>  \u0421\u043e\u0433\u043b\u0430\u0448\u0430\u0435\u043c\u0441\u044f \u0441\u043e \u0432\u0441\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u0432\u043c\u0435\u043d\u044f\u044e\u0442 \u0438 \u0436\u0434\u0451\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438. \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c awx, \u0435\u0433\u043e \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0432 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043d\u0435\u0442.  <\/p>\n<pre><code class=\"bash\">wget http:\/\/ansibleworks.com\/releases\/awx\/setup\/awx-setup-latest.tar.gz <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c  <\/p>\n<pre><code class=\"bash\">root@awx:~# tar xzvf awx-setup-latest.tar.gz <\/code><\/pre>\n<p>  \u0421\u043c\u043e\u0442\u0440\u0438\u043c, \u0441 \u0447\u0435\u043c \u043d\u0430\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u043e\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u0435\u043b\u043e.  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# ls group_vars  myhosts  README.md  roles  setup.sh  site.yml <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0447\u0438\u0442\u0430\u0432 \u0444\u0430\u0439\u043b README.md \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u043b\u044f PostgreSQL \u0432 \u0444\u0430\u0439\u043b\u0435 group_vars\/all, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e pg_hba.conf \u0438 supervisord.conf \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b. \u0422\u0430\u043a, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0442\u0430\u0432\u0438\u0442\u0435 \u043d\u0435 \u043d\u0430 \u0447\u0438\u0441\u0442\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0435\u0439\u043a\u0430\u043f\u044b.<\/p>\n<p>  \u041f\u043e\u043a\u0430 \u0432\u0441\u0451 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0438\u0437 \u0447\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u043d\u0441\u0442\u0430\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435:  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat setup.sh #!\/bin\/bash  getopts &quot;e:&quot; EXTRA_ARGS if [ &quot;$OPTARG&quot; != &quot;&quot; ]; then   echo &quot;Running with extra args: ${OPTARG}&quot;   sudo ANSIBLE_ERROR_ON_UNDEFINED_VARS=True ansible-playbook -i myhosts -c local -v -e &quot;$OPTARG&quot; site.yml else   sudo ANSIBLE_ERROR_ON_UNDEFINED_VARS=True ansible-playbook -i myhosts -c local -v site.yml fi <\/code><\/pre>\n<p>  \u0418\u0437 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0438 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c playbook site.yml \u043d\u0430 \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u0437\u043b\u043e\u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u0444\u0430\u0439\u043b\u0435 myhosts (\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0442\u043e\u043b\u044c\u043a\u043e 127.0.0.1) \u0438\u0437 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 -c local \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043e\u0441\u0442\u0430\u0432\u043a\u0438 \u043a\u043e\u043c\u0430\u043d\u0434 \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 ansible \u0438 \u0446\u0435\u043b\u0435\u0432\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430 \u044d\u0442\u043e \u043e\u0434\u043d\u043e \u0438 \u0442\u043e\u0436\u0435. <\/p>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0438\u0437 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c sudo. \u041d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0430\u0441 \u0447\u0438\u0441\u0442\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Debian \u0432 \u043d\u0435\u0451 \u044d\u0442\u043e \u0441\u0430\u043c\u043e\u0435 sudo, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 Ubuntu, \u043d\u0435 \u0432\u0445\u043e\u0434\u0438\u0442. \u0417\u043d\u0430\u0447\u0438\u0442 \u043b\u0438\u0431\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043b\u0438\u0431\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c sudo.<br \/>  \u042f \u0443\u0434\u0430\u043b\u0438\u043b \u0432\u044b\u0437\u043e\u0432 sudo, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0435\u0449\u0451 \u0434\u0432\u0435 \u0431\u0443\u043a\u0432\u044b \u201cv\u201d.<br \/>  \u0412\u0438\u0434 \u0444\u0430\u0439\u043b\u0430 \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0435\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">getopts &quot;e:&quot; EXTRA_ARGS if [ &quot;$OPTARG&quot; != &quot;&quot; ]; then   echo &quot;Running with extra args: ${OPTARG}&quot; ANSIBLE_ERROR_ON_UNDEFINED_VARS=True ansible-playbook -i myhosts -c local -vvv -e &quot;$OPTARG&quot; site.yml else   ANSIBLE_ERROR_ON_UNDEFINED_VARS=True ansible-playbook -i myhosts -c local -vvv site.yml fi <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u043c\u0443, \u0444\u0430\u0439\u043b\u0443 site.yml  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat site.yml --- # This playbook deploys the AWX application (database, web and worker) to a # single server.  - hosts: all   tasks:     - name: group hosts by distribution       group_by: key=&quot;{{ ansible_distribution }}-{{ ansible_distribution_version }}&quot;  - hosts: RedHat-6*:CentOS-6*:SL-6*   user: root   roles:     - { role: packages_el6 }     - { role: postgres, pg_hba_location: &quot;\/var\/lib\/pgsql\/data\/pg_hba.conf&quot; }     - { role: awx_install }     - { role: supervisor, sup_init_name: &quot;supervisord&quot;, sup_conf_location: &quot;\/etc\/supervisord.conf&quot; }     - { role: httpd, httpd_init_name: &quot;httpd&quot; }     - { role: iptables }     - { role: misc }  - hosts: Ubuntu-12*:Ubuntu-13*   user: root   roles:     - { role: packages_ubuntu }     - { role: postgres, pg_hba_location: &quot;\/etc\/postgresql\/9.1\/main\/pg_hba.conf&quot; }     - { role: awx_install }     - { role: supervisor, sup_init_name: &quot;supervisor&quot;, sup_conf_location: &quot;\/etc\/supervisor\/conf.d\/awx.conf&quot; }     - { role: httpd, httpd_init_name: &quot;apache2&quot; }     - { role: misc } <\/code><\/pre>\n<p>  \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0434\u043b\u044f Debian\u2019\u0430 \u043d\u0435 \u0432\u0438\u0434\u043d\u043e, \u043d\u043e \u0442\u0443\u0442 \u0443\u0436\u0435 \u0432\u0438\u0434\u043d\u043e 2 \u0433\u043e\u0442\u043e\u0432\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0434\u043b\u044f \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 RHEL \u0438 \u0434\u043b\u044f Ubuntu, \u0430 \u043a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e Ubuntu \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u044b\u043c \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u043c Debian&#8217;a. \u0421\u0442\u0430\u0432\u0438\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e \u0443\u0431\u0443\u043d\u0442\u043e\u0432\u0441\u043a\u043e\u043c\u0443 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u043d\u0430\u0448\u0435\u0439 \u041e\u0421 \u0432 \u044d\u0442\u043e\u0442 playbook:  <\/p>\n<pre><code class=\"bash\">- hosts: Ubuntu-12*:Ubuntu-13*:Debian* <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a postgresql \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 9.3 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u0435\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432  <\/p>\n<pre><code class=\"bash\">    - { role: postgres, pg_hba_location: &quot;\/etc\/postgresql\/9.3\/main\/pg_hba.conf&quot; } <\/code><\/pre>\n<p>  \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c, \u0434\u043b\u044f \u043d\u0430\u0441 \u0442\u0443\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e.<br \/>  \u041f\u0440\u043e\u0439\u0434\u0451\u043c\u0441\u044f \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0440\u043e\u043b\u044f\u043c, \u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 packages_ubuntu  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat roles\/packages_ubuntu\/tasks\/main.yml --- # Tasks to install required packages for awx  - name: install ubuntu awx apt repository   template: src=awx_repo.j2 dest=\/etc\/apt\/sources.list.d\/awx_repo.list  - name: install python-pip package for ubuntu 12.04   apt: name=python-pip   when: ansible_lsb.codename == &quot;precise&quot;  - name: install django 1.5.4 via pip for ubuntu 12.04   pip: name=django version=1.5.4   when: ansible_lsb.codename == &quot;precise&quot;  - name: install django via apt for ubuntu 12.10 or later   apt: name=python-django   when: ansible_lsb.codename != &quot;precise&quot;  - name: install required packages via apt   apt: name={{ item }}   with_items:     - apache2     - libapache2-mod-wsgi     - postgresql     - python-psycopg2     - python-setuptools     - python-ldap     - supervisor     - git     - subversion     - mercurial  - name: install awx package via apt   apt: name=awx update_cache=yes force=yes state=latest <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u043d\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0430 template: src=awx_repo.j2 dest=\/etc\/apt\/sources.list.d\/awx_repo.list \u2014 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u044f, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat roles\/packages_ubuntu\/templates\/awx_repo.j2 deb {{ aw_repo_url }}\/deb {{ansible_lsb.codename}} non-free <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/4c9\/680\/127\/4c96801277a177761e4275302212f5a6.png\"\/><\/p>\n<p>  \u0412\u0440\u043e\u0434\u0435 \u0432\u0441\u0451 \u044f\u0441\u043d\u043e, 2 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 URL \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 group_vars\/all, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0443 \u043d\u0430\u0441 \u044d\u0442\u043e whezzy, \u043d\u043e \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u0438 \u0434\u043b\u044f wheezy \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435\u0442, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 Ubuntu Raring Ringtail.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u201c\u043c\u0430\u0441\u043a\u0438\u0440\u043e\u0432\u043a\u0438\u201d \u0444\u0430\u0439\u043b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434.  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat roles\/packages_ubuntu\/templates\/awx_repo.j2 deb {{ aw_repo_url }}\/deb raring non-free <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f, \u043d\u0435 Precise Pangolin \u043b\u0438 \u0443 \u043d\u0430\u0441:  <\/p>\n<pre><code class=\"bash\">- name: install python-pip package for ubuntu 12.04   apt: name=python-pip   when: ansible_lsb.codename == &quot;precise&quot;  - name: install django 1.5.4 via pip for ubuntu 12.04   pip: name=django version=1.5.4   when: ansible_lsb.codename == &quot;precise&quot;  - name: install django via apt for ubuntu 12.10 or later   apt: name=python-django   when: ansible_lsb.codename != &quot;precise&quot; <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043d\u0435\u0433\u043e (Precise Pangolin) \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u0430\u0440\u0438\u0438 Django \u0441\u0442\u0430\u0440\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0438 \u0430\u0432\u0442\u043e\u0440\u044b AWX \u0441\u0442\u0430\u0432\u044f\u0442 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u0443\u044e (1.5.4) \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c. \u041d\u0430\u043c \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0433\u0440\u043e\u0437\u0438\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0442\u044c. \u0422\u0430\u043a \u0436\u0435 \u043c\u0435\u043d\u044f\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0434\u043b\u044f httpd, c Ubunu \u043d\u0430 Debian:  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat roles\/httpd\/handlers\/main.yml --- # Handlers for common notifications.  - name: restart httpd   service: name=httpd state=restarted   when: ansible_distribution in [&quot;CentOS&quot;,&quot;RedHat&quot;]  - name: restart apache2   service: name=apache2 state=restarted   when: ansible_distribution in [&quot;Ubuntu&quot;] <\/code><\/pre>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 Ubuntu \u043c\u0435\u043d\u044f\u0435\u043c \u043d\u0430 Debian. <br \/>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0438 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0440\u043e\u043b\u0438 postgres:  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# cat roles\/postgres\/tasks\/main.yml # Tasks for configuring PostgreSQL server.  - name: init postgresql   command: service postgresql initdb creates=\/var\/lib\/pgsql\/data\/PG_VERSION   when: ansible_distribution != &quot;Ubuntu&quot;   tags: postgresql <\/code><\/pre>\n<p>  \u0421\u043a\u0440\u0435\u0449\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u043b\u044c\u0446\u044b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# .\/setup.sh   PLAY RECAP ******************************************************************** 127.0.0.1                  : ok=30   changed=12   unreachable=0    failed=0 <\/code><\/pre>\n<p>  \u0418\u043d\u0441\u0442\u0430\u043b\u044f\u0442\u043e\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 apache \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0432 \u043f\u0430\u043f\u043a\u0443  <\/p>\n<pre><code class=\"bash\">root@awx:~\/awx-setup-1.3.1# ls \/etc\/apache2\/conf.d awx.conf  awx-plain.conf <\/code><\/pre>\n<p>  \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433 \u0430\u043f\u0430\u0447\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c:  <\/p>\n<pre><code class=\"bash\">mv \/etc\/apache2\/conf.d\/awx* \/etc\/apache2\/sites-enabled\/ <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u043c \u0430\u043f\u0430\u0447, \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0443\u0431\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f. \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/203502\/\"> http:\/\/habrahabr.ru\/post\/203502\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0420\u0435\u0448\u0438\u043b\u0438 \u043c\u044b \u043a\u0430\u043a \u0442\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 FreeBSD. \u0421\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u044d\u0442\u0438\u0445 \u0441\u0430\u043c\u044b\u0445, \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0438 \u043d\u0435 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0432\u0441\u0451 \u0436\u0435 \u0447\u0430\u0441\u0442\u043e \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u044f\u0434 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447 \u043d\u0430 \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u043e\u043c. <br \/>  \u0414\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b\u0438, \u0432\u044b\u0431\u0438\u0440\u0430\u043b\u0438, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0438, \u0438 \u0432\u0441\u0451 \u0436\u0435 \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 Ansible. \u0410 \u0434\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u043a \u043d\u0435\u0439 \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c web-\u043c\u043e\u0440\u0434\u043e\u0447\u043a\u0443 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c AWX.<br \/>  \u041d\u043e \u0432\u043e\u0442 \u043d\u0435\u0437\u0430\u0434\u0430\u0447\u0430, \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443 \u043d\u0430\u0441 \u043d\u0430 FreeBSD, \u0430 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u201c\u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e\u201d Linux\u2019\u0430 \u0432\u044b\u0431\u0440\u0430\u043d Debian. Ansible AWX \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 RHEL\/Fedora \u0438 Ubuntu.<br \/>  \u041a\u0430\u043a \u043c\u044b \u0432\u0441\u0435 \u043f\u043e\u043c\u043d\u0438\u043c, Ubuntu \u0432\u044b\u0448\u043b\u0430 \u0438\u0437 Debian, \u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043e \u043f\u0440\u0435\u0434\u043a\u0435. \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c AWX \u043d\u0430 Debian.<br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0441\u0432\u0435\u0436\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 Debian 7.1 Wheezy \u0441 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u201cSSH \u0441\u0435\u0440\u0432\u0435\u0440\u201d \u0438 \u201c\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b\u201d.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-203502","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/203502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=203502"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/203502\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203502"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}