Merge branch 'release_3.2.0' into devel

* release_3.2.0: (342 commits)
  fail all jobs on an offline node
  filtering out super users from permissions lists
  removing vars from schedules for project syncs and inv syncs
  update license page if user inputs a new type of license
  Show IG name on job results if it comes from the socket
  rename isolated->expect in script tooling
  Center survey maker delete dialog in browser window
  Fix job details right panel content from overflowing in Firefox
  graceful killing of receiver worker processes
  change imports to reflect isolated->expect move
  Update smart inventory host popover content
  Fix extra variable textarea scroll in Firefox
  initial commit to move folder isolated->expect
  Add missing super call in NotificationTemplateSerializer
  Various workflow maker bug fixes
  Style nodes with deleted unified job templates
  Fixed job template view for user with read-only access
  presume 401 from insights means invalid credential
  only reap non-netsplit nodes
  import os, fixing bug that forced SIGKILL
  ...
This commit is contained in:
Matthew Jones
2017-08-15 22:22:26 -04:00
529 changed files with 46524 additions and 15521 deletions

View File

@@ -5,66 +5,66 @@ services:
context: ./docker-compose
dockerfile: Dockerfile-haproxy
depends_on:
- "tower_1"
- "tower_2"
- "tower_3"
- "awx_1"
- "awx_2"
- "awx_3"
ports:
- "8013:8013"
- "8043:8043"
- "1936:1936"
- "5555:5555"
- "15672:15672"
tower_1:
awx_1:
privileged: true
image: gcr.io/ansible-tower-engineering/tower_devel:${TAG}
hostname: tower_1
image: ${DEV_DOCKER_TAG_BASE}/awx_devel:${TAG}
hostname: awx_1
environment:
RABBITMQ_HOST: rabbitmq_1
RABBITMQ_USER: guest
RABBITMQ_PASS: guest
RABBITMQ_VHOST: /
CELERY_RDB_HOST: 0.0.0.0
EXTRA_GROUP_QUEUES: alpha
AWX_GROUP_QUEUES: alpha,tower
volumes:
- "../:/tower_devel"
- "../:/awx_devel"
tower_2:
awx_2:
privileged: true
image: gcr.io/ansible-tower-engineering/tower_devel:${TAG}
hostname: tower_2
image: ${DEV_DOCKER_TAG_BASE}/awx_devel:${TAG}
hostname: awx_2
environment:
RABBITMQ_HOST: rabbitmq_2
RABBITMQ_USER: guest
RABBITMQ_PASS: guest
RABBITMQ_VHOST: /
CELERY_RDB_HOST: 0.0.0.0
EXTRA_GROUP_QUEUES: bravo
AWX_GROUP_QUEUES: bravo,tower
volumes:
- "../:/tower_devel"
tower_3:
- "../:/awx_devel"
awx_3:
privileged: true
image: gcr.io/ansible-tower-engineering/tower_devel:${TAG}
hostname: tower_3
image: ${DEV_DOCKER_TAG_BASE}/awx_devel:${TAG}
hostname: awx_3
environment:
RABBITMQ_HOST: rabbitmq_3
RABBITMQ_USER: guest
RABBITMQ_PASS: guest
RABBITMQ_VHOST: /
CELERY_RDB_HOST: 0.0.0.0
EXTRA_GROUP_QUEUES: charlie
AWX_GROUP_QUEUES: charlie,tower
volumes:
- "../:/tower_devel"
- "../:/awx_devel"
rabbitmq_1:
image: gcr.io/ansible-tower-engineering/rabbit_cluster_node:latest
image: ${DEV_DOCKER_TAG_BASE}/rabbit_cluster_node:latest
hostname: rabbitmq_1
rabbitmq_2:
image: gcr.io/ansible-tower-engineering/rabbit_cluster_node:latest
image: ${DEV_DOCKER_TAG_BASE}/rabbit_cluster_node:latest
hostname: rabbitmq_2
environment:
- CLUSTERED=true
- CLUSTER_WITH=rabbitmq_1
rabbitmq_3:
image: gcr.io/ansible-tower-engineering/rabbit_cluster_node:latest
image: ${DEV_DOCKER_TAG_BASE}/rabbit_cluster_node:latest
hostname: rabbitmq_3
environment:
- CLUSTERED=true

View File

@@ -2,7 +2,7 @@ version: '3'
services:
# Primary AWX Development Container
awx:
image: gcr.io/ansible-tower-engineering/awx_devel:${TAG}
image: ${DEV_DOCKER_TAG_BASE}/awx_devel:${TAG}
hostname: awx
environment:
RABBITMQ_HOST: rabbitmq
@@ -10,7 +10,7 @@ services:
RABBITMQ_PASS: guest
RABBITMQ_VHOST: /
CELERY_RDB_HOST: 0.0.0.0
EXTRA_GROUP_QUEUES:
AWX_GROUP_QUEUES: tower
ports:
- "8080:8080"
- "5555:5555"

View File

@@ -20,12 +20,13 @@ RUN /usr/bin/ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
RUN mkdir -p /data/db
RUN pip2 install honcho
RUN pip2 install supervisor
ADD tools/docker-compose/ansible-awx.egg-link /tmp/ansible-awx.egg-link
ADD tools/docker-compose/awx.egg-link /tmp/awx.egg-link
ADD tools/docker-compose/awx-manage /usr/local/bin/awx-manage
ADD tools/docker-compose/ansible_awx.egg-info /tmp/ansible_awx.egg-info
ADD tools/docker-compose/awx.egg-info /tmp/awx.egg-info
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.conf /etc/nginx/nginx.conf
RUN ln -Ffs /awx_devel/tools/docker-compose/nginx.vh.default.conf /etc/nginx/conf.d/nginx.vh.default.conf
RUN ln -s /awx_devel/tools/docker-compose/start_development.sh /start_development.sh
RUN ln -s /awx_devel/tools/docker-compose/bootstrap_development.sh /bootstrap_development.sh
RUN openssl req -nodes -newkey rsa:2048 -keyout /etc/nginx/nginx.key -out /etc/nginx/nginx.csr -subj "/C=US/ST=North Carolina/L=Durham/O=Ansible/OU=AWX Development/CN=awx.localhost"
RUN openssl x509 -req -days 365 -in /etc/nginx/nginx.csr -signkey /etc/nginx/nginx.key -out /etc/nginx/nginx.crt
WORKDIR /tmp

View File

@@ -1,5 +1,5 @@
docker build --no-cache=true --rm=true -t ansible/tower_devel:latest .
docker run --name tower_test -it --memory="4g" --cpuset="0,1" -v /Users/meyers/ansible/:/tower_devel -p 8013:8013 -p 8080:8080 -p 27017:27017 -p 2222:22 ansible/tower_devel
docker build --no-cache=true --rm=true -t ansible/awx_devel:latest .
docker run --name awx_test -it --memory="4g" --cpuset="0,1" -v /Users/meyers/ansible/:/awx_devel -p 8013:8013 -p 8080:8080 -p 27017:27017 -p 2222:22 ansible/awx_devel
## How to use the logstash container

View File

@@ -1,10 +1,10 @@
#!/venv/awx/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'ansible-awx==placeholder','console_scripts','awx-manage'
__requires__ = 'ansible-awx==placeholder'
# EASY-INSTALL-ENTRY-SCRIPT: 'awx','console_scripts','awx-manage'
import sys
from pkg_resources import load_entry_point
__requires__ = 'awx'
if __name__ == '__main__':
sys.exit(
load_entry_point('ansible-awx==placeholder', 'console_scripts', 'awx-manage')()
load_entry_point('awx', 'console_scripts', 'awx-manage')()
)

View File

@@ -0,0 +1,23 @@
Metadata-Version: 1.1
Name: awx
Version: placeholder
Summary: awx: API, UI and Task Engine for Ansible
Home-page: http://github.com/ansible/awx
Author: Ansible, Inc.
Author-email: info@ansible.com
License: Proprietary
Description: AWX provides a web-based user interface, REST API and task engine built on top of Ansible
Keywords: ansible
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System AdministratorsLicense :: Other/Proprietary License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python
Classifier: Topic :: System :: Installation/Setup
Classifier: Topic :: System :: Systems Administration

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,4 @@
[console_scripts]
tower-manage = awx:manage
awx-manage = awx:manage

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1 @@
awx

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set +x
# Wait for the databases to come up
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=memcached port=11211" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=${RABBITMQ_HOST} port=5672" all
# In case AWX in the container wants to connect to itself, use "docker exec" to attach to the container otherwise
# TODO: FIX
#/etc/init.d/ssh start
ansible -i "127.0.0.1," -c local -v -m postgresql_user -U postgres -a "name=awx-dev password=AWXsome1 login_user=postgres login_host=postgres" all
ansible -i "127.0.0.1," -c local -v -m postgresql_db -U postgres -a "name=awx-dev owner=awx-dev login_user=postgres login_host=postgres" all
# Move to the source directory so we can bootstrap
if [ -f "/awx_devel/manage.py" ]; then
cd /awx_devel
else
echo "Failed to find awx source tree, map your development tree volume"
fi
cp -R /tmp/awx.egg-info /awx_devel/ || true
sed -i "s/placeholder/$(git describe --long | sed 's/\./\\./g')/" /awx_devel/awx.egg-info/PKG-INFO
cp /tmp/awx.egg-link /venv/awx/lib/python2.7/site-packages/awx.egg-link
ln -s /awx_devel/tools/rdb.py /venv/awx/lib/python2.7/site-packages/rdb.py || true
yes | cp -rf /awx_devel/tools/docker-compose/supervisor.conf /supervisor.conf
# AWX bootstrapping
make version_file
make migrate
make init
mkdir -p /awx_devel/awx/public/static
mkdir -p /awx_devel/awx/ui/static

View File

@@ -1,43 +1,10 @@
#!/bin/bash
set +x
# Wait for the databases to come up
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=postgres port=5432" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=memcached port=11211" all
ansible -i "127.0.0.1," -c local -v -m wait_for -a "host=${RABBITMQ_HOST} port=5672" all
# In case AWX in the container wants to connect to itself, use "docker exec" to attach to the container otherwise
# TODO: FIX
#/etc/init.d/ssh start
ansible -i "127.0.0.1," -c local -v -m postgresql_user -U postgres -a "name=awx-dev password=AWXsome1 login_user=postgres login_host=postgres" all
ansible -i "127.0.0.1," -c local -v -m postgresql_db -U postgres -a "name=awx-dev owner=awx-dev login_user=postgres login_host=postgres" all
# Move to the source directory so we can bootstrap
if [ -f "/awx_devel/manage.py" ]; then
cd /awx_devel
else
echo "Failed to find awx source tree, map your development tree volume"
fi
cp -R /tmp/ansible_awx.egg-info /awx_devel/ || true
sed -i "s/placeholder/$(git describe --long | sed 's/\./\\./g')/" /awx_devel/ansible_awx.egg-info/PKG-INFO
sed -i "s/placeholder/$(git describe --long | sed 's/\./\\./g')/" /usr/local/bin/awx-manage
cp /tmp/ansible-awx.egg-link /venv/awx/lib/python2.7/site-packages/ansible-awx.egg-link
ln -s /awx_devel/tools/rdb.py /venv/awx/lib/python2.7/site-packages/rdb.py || true
yes | cp -rf /awx_devel/tools/docker-compose/supervisor.conf /supervisor.conf
# AWX bootstrapping
make version_file
make migrate
make init
mkdir -p /awx_devel/awx/public/static
mkdir -p /awx_devel/awx/ui/static
# Start the service
/bootstrap_development.sh
cd /awx_devel
# Start the services
if [ -f "/awx_devel/tools/docker-compose/use_dev_supervisor.txt" ]; then
make supervisor
else

View File

@@ -4,7 +4,7 @@ minfds = 4096
nodaemon=true
[program:celeryd]
command = python manage.py celeryd -l DEBUG -B --autoreload --autoscale=20,3 --schedule=/celerybeat-schedule -Q tower_scheduler,tower_broadcast_all,tower,%(ENV_HOSTNAME)s -n celery@%(ENV_HOSTNAME)s
command = python manage.py celeryd -l DEBUG -B --autoreload --autoscale=20,3 --schedule=/celerybeat-schedule -Q tower_scheduler,tower_broadcast_all,%(ENV_AWX_GROUP_QUEUES)s,%(ENV_HOSTNAME)s -n celery@%(ENV_HOSTNAME)s
autostart = true
autorestart = true
redirect_stderr=true

View File

@@ -7,5 +7,7 @@ RUN npm set progress=false
WORKDIR "/awx_devel"
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["bash"]
ADD tools/docker-compose/unit-tests/entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,10 @@
#!/bin/bash
# Code duplicated from start_development.sh
cp -R /tmp/awx.egg-info /awx_devel/ || true
sed -i "s/placeholder/$(git describe --long | sed 's/\./\\./g')/" /awx_devel/awx.egg-info/PKG-INFO
cp /tmp/awx.egg-link /venv/awx/lib/python2.7/site-packages/awx.egg-link
cp -f awx/settings/local_settings.py.docker_compose awx/settings/local_settings.py
/bin/bash -c "$@"

View File

@@ -1,17 +1,17 @@
version: '3'
services:
# Primary Tower Development Container link
tower:
awx:
environment:
EXTRA_GROUP_QUEUES: thepentagon
AWX_GROUP_QUEUES: tower,thepentagon
links:
- isolated
# Isolated Rampart Container
isolated:
image: gcr.io/ansible-tower-engineering/tower_isolated:${TAG}
image: ${DEV_DOCKER_TAG_BASE}/awx_isolated:${TAG}
hostname: isolated
volumes:
- "../awx/main/isolated:/tower_devel"
- "../awx/lib:/tower_lib"
- "../awx/main/expect:/awx_devel"
- "../awx/lib:/awx_lib"
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
privileged: true

View File

@@ -17,7 +17,7 @@ ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR /
EXPOSE 22
ADD tools/docker-isolated/tower-expect /usr/local/bin/tower-expect
ADD tools/docker-isolated/awx-expect /usr/local/bin/awx-expect
RUN rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_ecdsa_key

View File

@@ -1,7 +1,7 @@
## Instructions on using an isolated node
The building of the isolated node is done in the `make docker-compose-build`
target. Its image uses a different tag from the tools_tower container.
target. Its image uses a different tag from the tools_awx container.
Given that the images are built, you can run the combined docker compose target. This uses
the base `docker-compose.yml` with modifications found in `docker-isolated-override.yml`.
@@ -12,7 +12,7 @@ base branch is. For example:
make docker-isolated COMPOSE_TAG=devel
```
This will automatically exchange the keys in order for the `tools_tower_1`
This will automatically exchange the keys in order for the `tools_awx_1`
container to access the `tools_isolated_1` container over ssh.
After that, it will bring up all the containers like the normal docker-compose
workflow.
@@ -56,12 +56,12 @@ by disabling some parts of the cleanup_isolated.yml playbook.
Example location of a private data directory:
`/tmp/ansible_tower_29_OM6Mnx/`
`/tmp/ansible_awx_29_OM6Mnx/`
The following command would run the playbook corresponding to that job.
```bash
tower-expect start /tmp/ansible_tower_29_OM6Mnx/
awx-expect start /tmp/ansible_awx_29_OM6Mnx/
```
Other tower-expect commands include `start`, `is-alive`, and `stop`.
Other awx-expect commands include `start`, `is-alive`, and `stop`.

View File

@@ -0,0 +1,3 @@
#!/bin/bash
. /venv/awx/bin/activate
exec env AWX_LIB_DIRECTORY=/awx_lib /awx_devel/run.py "$@"

View File

@@ -1,3 +0,0 @@
#!/bin/bash
. /venv/tower/bin/activate
exec env TOWER_LIB_DIRECTORY=/tower_lib /tower_devel/run.py "$@"

4
tools/scripts/awx-expect Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
AWX_LIB=`/var/lib/awx/venv/awx/bin/python -c 'import os, awx; print os.path.dirname(awx.__file__)'`
. /var/lib/awx/venv/awx/bin/activate
exec env AWX_LIB_DIRECTORY=$AWX_LIB/lib /var/lib/awx/venv/awx/bin/python $AWX_LIB/main/expect/run.pyc "$@"

View File

@@ -137,7 +137,7 @@ if __name__ == "__main__":
program = 'msgfmt'
program_options = ['--check-format']
for i, (dirpath, f) in enumerate(locations):
print 'processing file %s in %s\n' % (f, dirpath)
print('processing file %s in %s\n' % (f, dirpath))
po_path = os.path.join(dirpath, f)
if has_bom(po_path):
raise Exception("The %s file has a BOM (Byte Order Mark). "

View File

@@ -1,4 +0,0 @@
#!/bin/bash
AWX_LIB=`/var/lib/awx/venv/tower/bin/python -c 'import os, awx; print os.path.dirname(awx.__file__)'`
. /var/lib/awx/venv/tower/bin/activate
exec env TOWER_LIB_DIRECTORY=$AWX_LIB/lib /var/lib/awx/venv/tower/bin/python $AWX_LIB/main/isolated/run.pyc "$@"

View File

@@ -6,7 +6,7 @@ from distutils.version import LooseVersion
SOSREPORT_TOWER_COMMANDS = [
"ansible --version", # ansible core version
"tower-manage --version", # tower version
"awx-manage --version", # tower version
"supervisorctl status", # tower process status
"/var/lib/awx/venv/tower/bin/pip freeze", # pip package list
"/var/lib/awx/venv/ansible/bin/pip freeze", # pip package list