mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -03:30
Merge pull request #1417 from ansible/python27_el6
EL6 Python 2.7 and Tower virtualenvs
This commit is contained in:
@@ -11,9 +11,7 @@ RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 && apt
|
||||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | tee /etc/apt/sources.list.d/postgres-9.4.list
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y openssh-server ansible mg vim tmux git mercurial subversion python-dev python-psycopg2 make postgresql-client libpq-dev nodejs python-psutil libxml2-dev libxslt-dev lib32z1-dev libsasl2-dev libldap2-dev libffi-dev libzmq-dev proot python-pip libxmlsec1-dev swig redis-server && rm -rf /var/lib/apt/lists/*
|
||||
RUN pip install flake8
|
||||
RUN pip install pytest pytest-pythonpath pytest-django pytest-cov
|
||||
RUN pip install dateutils # for private/license_writer.py
|
||||
RUN pip install flake8 pytest pytest-pythonpath pytest-django pytest-cov pytest-mock dateutils django-debug-toolbar==1.4 pyflakes==1.0.0 virtualenv
|
||||
RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
|
||||
RUN mkdir -p /etc/tower
|
||||
RUN mkdir -p /data/db
|
||||
|
||||
@@ -29,6 +29,9 @@ else
|
||||
touch awx/lib/.deps_built
|
||||
fi
|
||||
|
||||
rm -rf /tower_devel/venv/tower/lib/python2.7/site-packages/ansible-tower.egg-link
|
||||
cp /tmp/ansible-tower.egg-link /tower_devel/venv/tower/lib/python2.7/site-packages/ansible-tower.egg-link
|
||||
|
||||
# Tower bootstrapping
|
||||
make version_file
|
||||
make migrate
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
## GENERATED FILE - DO NOT EDIT
|
||||
|
||||
import urllib2
|
||||
import sys
|
||||
import os
|
||||
import pymongo
|
||||
|
||||
def getServerStatus():
|
||||
host = "127.0.0.1"
|
||||
port = 27017
|
||||
c = pymongo.MongoClient(host, port)
|
||||
return c.admin.command('serverStatus', workingSet=True)
|
||||
|
||||
name = "connections"
|
||||
|
||||
|
||||
def doData():
|
||||
print name + ".value " + str( getServerStatus()["connections"]["current"] )
|
||||
|
||||
def doConfig():
|
||||
|
||||
print "graph_title MongoDB current connections"
|
||||
print "graph_args --base 1000 -l 0"
|
||||
print "graph_vlabel connections"
|
||||
print "graph_category MongoDB"
|
||||
|
||||
print name + ".label " + name
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from os import environ
|
||||
if 'HOST' in environ:
|
||||
host = environ['HOST']
|
||||
if 'PORT' in environ:
|
||||
port = environ['PORT']
|
||||
if 'USER' in environ:
|
||||
user = environ['USER']
|
||||
if 'PASSWORD' in environ:
|
||||
password = environ['PASSWORD']
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
doConfig()
|
||||
else:
|
||||
doData()
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
## GENERATED FILE - DO NOT EDIT
|
||||
|
||||
import urllib2
|
||||
import sys
|
||||
import os
|
||||
import pymongo
|
||||
|
||||
def getServerStatus():
|
||||
host = "127.0.0.1"
|
||||
port = 27017
|
||||
c = pymongo.MongoClient(host, port)
|
||||
return c.admin.command('serverStatus', workingSet=True)
|
||||
|
||||
name = "documents"
|
||||
|
||||
|
||||
def doData():
|
||||
ss = getServerStatus()
|
||||
for k,v in ss["metrics"]["document"].iteritems():
|
||||
print( str(k) + ".value " + str(v) )
|
||||
|
||||
def doConfig():
|
||||
|
||||
print "graph_title MongoDB documents"
|
||||
print "graph_args --base 1000 -l 0"
|
||||
print "graph_vlabel documents"
|
||||
print "graph_category MongoDB"
|
||||
|
||||
for k in getServerStatus()["metrics"]["document"]:
|
||||
print k + ".label " + k
|
||||
print k + ".min 0"
|
||||
print k + ".type COUNTER"
|
||||
print k + ".max 500000"
|
||||
print k + ".draw LINE1"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from os import environ
|
||||
if 'HOST' in environ:
|
||||
host = environ['HOST']
|
||||
if 'PORT' in environ:
|
||||
port = environ['PORT']
|
||||
if 'USER' in environ:
|
||||
user = environ['USER']
|
||||
if 'PASSWORD' in environ:
|
||||
password = environ['PASSWORD']
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
doConfig()
|
||||
else:
|
||||
doData()
|
||||
@@ -1,56 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
## GENERATED FILE - DO NOT EDIT
|
||||
|
||||
import urllib2
|
||||
import sys
|
||||
import os
|
||||
import pymongo
|
||||
|
||||
def getServerStatus():
|
||||
host = "127.0.0.1"
|
||||
port = 27017
|
||||
c = pymongo.MongoClient(host, port)
|
||||
return c.admin.command('serverStatus', workingSet=True)
|
||||
|
||||
def ok(s):
|
||||
return s == "resident" or s == "virtual" or s == "mapped"
|
||||
|
||||
def doData():
|
||||
for k,v in getServerStatus()["mem"].iteritems():
|
||||
if ok(k):
|
||||
print( str(k) + ".value " + str(v * 1024 * 1024) )
|
||||
|
||||
def doConfig():
|
||||
|
||||
print "graph_title MongoDB memory usage"
|
||||
print "graph_args --base 1024 -l 0 --vertical-label Bytes"
|
||||
print "graph_category MongoDB"
|
||||
|
||||
for k in getServerStatus()["mem"]:
|
||||
if ok( k ):
|
||||
print k + ".label " + k
|
||||
print k + ".draw LINE1"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from os import environ
|
||||
if 'HOST' in environ:
|
||||
host = environ['HOST']
|
||||
if 'PORT' in environ:
|
||||
port = environ['PORT']
|
||||
if 'USER' in environ:
|
||||
user = environ['USER']
|
||||
if 'PASSWORD' in environ:
|
||||
password = environ['PASSWORD']
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
doConfig()
|
||||
else:
|
||||
doData()
|
||||
@@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
## GENERATED FILE - DO NOT EDIT
|
||||
|
||||
import urllib2
|
||||
import sys
|
||||
import os
|
||||
import pymongo
|
||||
|
||||
def getServerStatus():
|
||||
host = "127.0.0.1"
|
||||
port = 27017
|
||||
c = pymongo.MongoClient(host, port)
|
||||
return c.admin.command('serverStatus', workingSet=True)
|
||||
|
||||
|
||||
def doData():
|
||||
ss = getServerStatus()
|
||||
for k,v in ss["opcounters"].iteritems():
|
||||
print( str(k) + ".value " + str(v) )
|
||||
|
||||
def doConfig():
|
||||
|
||||
print "graph_title MongoDB ops"
|
||||
print "graph_args --base 1000 -l 0"
|
||||
print "graph_vlabel ops / ${graph_period}"
|
||||
print "graph_category MongoDB"
|
||||
print "graph_total total"
|
||||
|
||||
for k in getServerStatus()["opcounters"]:
|
||||
print k + ".label " + k
|
||||
print k + ".min 0"
|
||||
print k + ".type COUNTER"
|
||||
print k + ".max 500000"
|
||||
print k + ".draw LINE1"
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
from os import environ
|
||||
if 'HOST' in environ:
|
||||
host = environ['HOST']
|
||||
if 'PORT' in environ:
|
||||
port = environ['PORT']
|
||||
if 'USER' in environ:
|
||||
user = environ['USER']
|
||||
if 'PASSWORD' in environ:
|
||||
password = environ['PASSWORD']
|
||||
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "config":
|
||||
doConfig()
|
||||
else:
|
||||
doData()
|
||||
18
tools/scripts/tower-python
Executable file
18
tools/scripts/tower-python
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Enable needed Software Collections, if installed
|
||||
for scl in python27 httpd24; do
|
||||
if [ -f /etc/scl/prefixes/$scl ]; then
|
||||
if [ -f `cat /etc/scl/prefixes/$scl`/$scl/enable ]; then
|
||||
. `cat /etc/scl/prefixes/$scl`/$scl/enable
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Enable Tower virtualenv
|
||||
if [ -f /var/lib/awx/venv/tower/bin/activate ]; then
|
||||
. /var/lib/awx/venv/tower/bin/activate
|
||||
fi
|
||||
|
||||
# Run the requested Python command, using the interpreter from the path
|
||||
python "$@"
|
||||
Reference in New Issue
Block a user