Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9c0b97c53 | ||
|
|
65655f84de | ||
|
|
9aa3d5584a | ||
|
|
266e31d71a | ||
|
|
a1bbe75aed | ||
|
|
695f1cf892 | ||
|
|
0ab103d8c4 | ||
|
|
9ac1c0f6c2 | ||
|
|
2e168d8177 | ||
|
|
d4f7bfef18 | ||
|
|
985a8d499d | ||
|
|
e3b52f0169 | ||
|
|
f69f600cff | ||
|
|
74cd23be5c | ||
|
|
209747d88e | ||
|
|
d91da39f81 | ||
|
|
5cd029df96 | ||
|
|
5a93a519f6 | ||
|
|
5f5cd960d5 | ||
|
|
42701f32fe | ||
|
|
30d4df788f | ||
|
|
1bcd71a8ac | ||
|
|
43be90f051 | ||
|
|
bb1922cdbb | ||
|
|
403f545071 | ||
|
|
a06a2a883c |
2
.github/actions/run_awx_devel/action.yml
vendored
@@ -71,7 +71,7 @@ runs:
|
||||
id: data
|
||||
shell: bash
|
||||
run: |
|
||||
AWX_IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tools_awx_1)
|
||||
AWX_IP=$(docker inspect -f '{{.NetworkSettings.Networks._sources_awx.IPAddress}}' tools_awx_1)
|
||||
ADMIN_TOKEN=$(docker exec -i tools_awx_1 awx-manage create_oauth2_token --user admin)
|
||||
echo "ip=$AWX_IP" >> $GITHUB_OUTPUT
|
||||
echo "admin_token=$ADMIN_TOKEN" >> $GITHUB_OUTPUT
|
||||
|
||||
2
.github/workflows/promote.yml
vendored
@@ -66,7 +66,7 @@ jobs:
|
||||
- name: Build awxkit and upload to pypi
|
||||
run: |
|
||||
git reset --hard
|
||||
cd awxkit && python3 setup.py bdist_wheel
|
||||
cd awxkit && python3 setup.py sdist bdist_wheel
|
||||
twine upload \
|
||||
-r ${{ env.pypi_repo }} \
|
||||
-u ${{ secrets.PYPI_USERNAME }} \
|
||||
|
||||
@@ -7,7 +7,7 @@ AWX provides a web-based user interface, REST API, and task engine built on top
|
||||
|
||||
To install AWX, please view the [Install guide](./INSTALL.md).
|
||||
|
||||
To learn more about using AWX, and Tower, view the [Tower docs site](http://docs.ansible.com/ansible-tower/index.html).
|
||||
To learn more about using AWX, view the [AWX docs site](https://ansible.readthedocs.io/projects/awx/en/latest/).
|
||||
|
||||
The AWX Project Frequently Asked Questions can be found [here](https://www.ansible.com/awx-project-faq).
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ from rest_framework.permissions import IsAuthenticated
|
||||
from rest_framework.renderers import StaticHTMLRenderer
|
||||
from rest_framework.negotiation import DefaultContentNegotiation
|
||||
|
||||
from ansible_base.filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
from ansible_base.utils.models import get_all_field_names
|
||||
from ansible_base.rest_filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
from ansible_base.lib.utils.models import get_all_field_names
|
||||
|
||||
# AWX
|
||||
from awx.main.models import UnifiedJob, UnifiedJobTemplate, User, Role, Credential, WorkflowJobTemplateNode, WorkflowApprovalTemplate
|
||||
@@ -91,7 +91,7 @@ class LoggedLoginView(auth_views.LoginView):
|
||||
ret = super(LoggedLoginView, self).post(request, *args, **kwargs)
|
||||
if request.user.is_authenticated:
|
||||
logger.info(smart_str(u"User {} logged in from {}".format(self.request.user.username, request.META.get('REMOTE_ADDR', None))))
|
||||
ret.set_cookie('userLoggedIn', 'true')
|
||||
ret.set_cookie('userLoggedIn', 'true', secure=getattr(settings, 'SESSION_COOKIE_SECURE', False))
|
||||
ret.setdefault('X-API-Session-Cookie-Name', getattr(settings, 'SESSION_COOKIE_NAME', 'awx_sessionid'))
|
||||
|
||||
return ret
|
||||
@@ -107,7 +107,7 @@ class LoggedLogoutView(auth_views.LogoutView):
|
||||
original_user = getattr(request, 'user', None)
|
||||
ret = super(LoggedLogoutView, self).dispatch(request, *args, **kwargs)
|
||||
current_user = getattr(request, 'user', None)
|
||||
ret.set_cookie('userLoggedIn', 'false')
|
||||
ret.set_cookie('userLoggedIn', 'false', secure=getattr(settings, 'SESSION_COOKIE_SECURE', False))
|
||||
if (not current_user or not getattr(current_user, 'pk', True)) and current_user != original_user:
|
||||
logger.info("User {} logged out.".format(original_user.username))
|
||||
return ret
|
||||
|
||||
@@ -43,7 +43,7 @@ from rest_framework.utils.serializer_helpers import ReturnList
|
||||
# Django-Polymorphic
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
from ansible_base.utils.models import get_type_for_model
|
||||
from ansible_base.lib.utils.models import get_type_for_model
|
||||
|
||||
# AWX
|
||||
from awx.main.access import get_user_capabilities
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from django.urls import re_path
|
||||
|
||||
from awx.api.views.webhooks import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver
|
||||
from awx.api.views.webhooks import WebhookKeyView, GithubWebhookReceiver, GitlabWebhookReceiver, BitbucketDcWebhookReceiver
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
re_path(r'^webhook_key/$', WebhookKeyView.as_view(), name='webhook_key'),
|
||||
re_path(r'^github/$', GithubWebhookReceiver.as_view(), name='webhook_receiver_github'),
|
||||
re_path(r'^gitlab/$', GitlabWebhookReceiver.as_view(), name='webhook_receiver_gitlab'),
|
||||
re_path(r'^bitbucket_dc/$', BitbucketDcWebhookReceiver.as_view(), name='webhook_receiver_bitbucket_dc'),
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from hashlib import sha1
|
||||
from hashlib import sha1, sha256
|
||||
import hmac
|
||||
import logging
|
||||
import urllib.parse
|
||||
@@ -99,14 +99,31 @@ class WebhookReceiverBase(APIView):
|
||||
def get_signature(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def must_check_signature(self):
|
||||
return True
|
||||
|
||||
def is_ignored_request(self):
|
||||
return False
|
||||
|
||||
def check_signature(self, obj):
|
||||
if not obj.webhook_key:
|
||||
raise PermissionDenied
|
||||
if not self.must_check_signature():
|
||||
logger.debug("skipping signature validation")
|
||||
return
|
||||
|
||||
mac = hmac.new(force_bytes(obj.webhook_key), msg=force_bytes(self.request.body), digestmod=sha1)
|
||||
logger.debug("header signature: %s", self.get_signature())
|
||||
hash_alg, expected_digest = self.get_signature()
|
||||
if hash_alg == 'sha1':
|
||||
mac = hmac.new(force_bytes(obj.webhook_key), msg=force_bytes(self.request.body), digestmod=sha1)
|
||||
elif hash_alg == 'sha256':
|
||||
mac = hmac.new(force_bytes(obj.webhook_key), msg=force_bytes(self.request.body), digestmod=sha256)
|
||||
else:
|
||||
logger.debug("Unsupported signature type, supported: sha1, sha256, received: {}".format(hash_alg))
|
||||
raise PermissionDenied
|
||||
|
||||
logger.debug("header signature: %s", expected_digest)
|
||||
logger.debug("calculated signature: %s", force_bytes(mac.hexdigest()))
|
||||
if not hmac.compare_digest(force_bytes(mac.hexdigest()), self.get_signature()):
|
||||
if not hmac.compare_digest(force_bytes(mac.hexdigest()), expected_digest):
|
||||
raise PermissionDenied
|
||||
|
||||
@csrf_exempt
|
||||
@@ -118,6 +135,10 @@ class WebhookReceiverBase(APIView):
|
||||
obj = self.get_object()
|
||||
self.check_signature(obj)
|
||||
|
||||
if self.is_ignored_request():
|
||||
# This was an ignored request type (e.g. ping), don't act on it
|
||||
return Response({'message': _("Webhook ignored")}, status=status.HTTP_200_OK)
|
||||
|
||||
event_type = self.get_event_type()
|
||||
event_guid = self.get_event_guid()
|
||||
event_ref = self.get_event_ref()
|
||||
@@ -186,7 +207,7 @@ class GithubWebhookReceiver(WebhookReceiverBase):
|
||||
if hash_alg != 'sha1':
|
||||
logger.debug("Unsupported signature type, expected: sha1, received: {}".format(hash_alg))
|
||||
raise PermissionDenied
|
||||
return force_bytes(signature)
|
||||
return hash_alg, force_bytes(signature)
|
||||
|
||||
|
||||
class GitlabWebhookReceiver(WebhookReceiverBase):
|
||||
@@ -214,15 +235,73 @@ class GitlabWebhookReceiver(WebhookReceiverBase):
|
||||
|
||||
return "{}://{}/api/v4/projects/{}/statuses/{}".format(parsed.scheme, parsed.netloc, project['id'], self.get_event_ref())
|
||||
|
||||
def get_signature(self):
|
||||
return force_bytes(self.request.META.get('HTTP_X_GITLAB_TOKEN') or '')
|
||||
|
||||
def check_signature(self, obj):
|
||||
if not obj.webhook_key:
|
||||
raise PermissionDenied
|
||||
|
||||
token_from_request = force_bytes(self.request.META.get('HTTP_X_GITLAB_TOKEN') or '')
|
||||
|
||||
# GitLab only returns the secret token, not an hmac hash. Use
|
||||
# the hmac `compare_digest` helper function to prevent timing
|
||||
# analysis by attackers.
|
||||
if not hmac.compare_digest(force_bytes(obj.webhook_key), self.get_signature()):
|
||||
if not hmac.compare_digest(force_bytes(obj.webhook_key), token_from_request):
|
||||
raise PermissionDenied
|
||||
|
||||
|
||||
class BitbucketDcWebhookReceiver(WebhookReceiverBase):
|
||||
service = 'bitbucket_dc'
|
||||
|
||||
ref_keys = {
|
||||
'repo:refs_changed': 'changes.0.toHash',
|
||||
'mirror:repo_synchronized': 'changes.0.toHash',
|
||||
'pr:opened': 'pullRequest.toRef.latestCommit',
|
||||
'pr:from_ref_updated': 'pullRequest.toRef.latestCommit',
|
||||
'pr:modified': 'pullRequest.toRef.latestCommit',
|
||||
}
|
||||
|
||||
def get_event_type(self):
|
||||
return self.request.META.get('HTTP_X_EVENT_KEY')
|
||||
|
||||
def get_event_guid(self):
|
||||
return self.request.META.get('HTTP_X_REQUEST_ID')
|
||||
|
||||
def get_event_status_api(self):
|
||||
# https://<bitbucket-base-url>/rest/build-status/1.0/commits/<commit-hash>
|
||||
if self.get_event_type() not in self.ref_keys.keys():
|
||||
return
|
||||
if self.get_event_ref() is None:
|
||||
return
|
||||
any_url = None
|
||||
if 'actor' in self.request.data:
|
||||
any_url = self.request.data['actor'].get('links', {}).get('self')
|
||||
if any_url is None and 'repository' in self.request.data:
|
||||
any_url = self.request.data['repository'].get('links', {}).get('self')
|
||||
if any_url is None:
|
||||
return
|
||||
any_url = any_url[0].get('href')
|
||||
if any_url is None:
|
||||
return
|
||||
parsed = urllib.parse.urlparse(any_url)
|
||||
|
||||
return "{}://{}/rest/build-status/1.0/commits/{}".format(parsed.scheme, parsed.netloc, self.get_event_ref())
|
||||
|
||||
def is_ignored_request(self):
|
||||
return self.get_event_type() not in [
|
||||
'repo:refs_changed',
|
||||
'mirror:repo_synchronized',
|
||||
'pr:opened',
|
||||
'pr:from_ref_updated',
|
||||
'pr:modified',
|
||||
]
|
||||
|
||||
def must_check_signature(self):
|
||||
# Bitbucket does not sign ping requests...
|
||||
return self.get_event_type() != 'diagnostics:ping'
|
||||
|
||||
def get_signature(self):
|
||||
header_sig = self.request.META.get('HTTP_X_HUB_SIGNATURE')
|
||||
if not header_sig:
|
||||
logger.debug("Expected signature missing from header key HTTP_X_HUB_SIGNATURE")
|
||||
raise PermissionDenied
|
||||
hash_alg, signature = header_sig.split('=')
|
||||
return hash_alg, force_bytes(signature)
|
||||
|
||||
@@ -7,7 +7,7 @@ import json
|
||||
# Django
|
||||
from django.db import models
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.main.models.base import CreatedModifiedModel
|
||||
|
||||
@@ -20,7 +20,7 @@ from rest_framework.exceptions import ParseError, PermissionDenied
|
||||
# Django OAuth Toolkit
|
||||
from awx.main.models.oauth import OAuth2Application, OAuth2AccessToken
|
||||
|
||||
from ansible_base.utils.validation import to_python_boolean
|
||||
from ansible_base.lib.utils.validation import to_python_boolean
|
||||
|
||||
# AWX
|
||||
from awx.main.utils import (
|
||||
|
||||
@@ -58,7 +58,7 @@ aim_inputs = {
|
||||
'id': 'object_property',
|
||||
'label': _('Object Property'),
|
||||
'type': 'string',
|
||||
'help_text': _('The property of the object to return. Default: Content Ex: Username, Address, etc.'),
|
||||
'help_text': _('The property of the object to return. Available properties: Username, Password and Address.'),
|
||||
},
|
||||
{
|
||||
'id': 'reason',
|
||||
@@ -111,8 +111,12 @@ def aim_backend(**kwargs):
|
||||
object_property = 'Content'
|
||||
elif object_property.lower() == 'username':
|
||||
object_property = 'UserName'
|
||||
elif object_property.lower() == 'password':
|
||||
object_property = 'Content'
|
||||
elif object_property.lower() == 'address':
|
||||
object_property = 'Address'
|
||||
elif object_property not in res:
|
||||
raise KeyError('Property {} not found in object'.format(object_property))
|
||||
raise KeyError('Property {} not found in object, available properties: Username, Password and Address'.format(object_property))
|
||||
else:
|
||||
object_property = object_property.capitalize()
|
||||
|
||||
|
||||
@@ -87,6 +87,20 @@ base_inputs = {
|
||||
' see https://www.vaultproject.io/docs/auth/kubernetes#configuration'
|
||||
),
|
||||
},
|
||||
{
|
||||
'id': 'username',
|
||||
'label': _('Username'),
|
||||
'type': 'string',
|
||||
'secret': False,
|
||||
'help_text': _('Username for user authentication.'),
|
||||
},
|
||||
{
|
||||
'id': 'password',
|
||||
'label': _('Password'),
|
||||
'type': 'string',
|
||||
'secret': True,
|
||||
'help_text': _('Password for user authentication.'),
|
||||
},
|
||||
{
|
||||
'id': 'default_auth_path',
|
||||
'label': _('Path to Auth'),
|
||||
@@ -185,9 +199,10 @@ hashi_ssh_inputs['required'].extend(['public_key', 'role'])
|
||||
|
||||
def handle_auth(**kwargs):
|
||||
token = None
|
||||
|
||||
if kwargs.get('token'):
|
||||
token = kwargs['token']
|
||||
elif kwargs.get('username') and kwargs.get('password'):
|
||||
token = method_auth(**kwargs, auth_param=userpass_auth(**kwargs))
|
||||
elif kwargs.get('role_id') and kwargs.get('secret_id'):
|
||||
token = method_auth(**kwargs, auth_param=approle_auth(**kwargs))
|
||||
elif kwargs.get('kubernetes_role'):
|
||||
@@ -195,11 +210,14 @@ def handle_auth(**kwargs):
|
||||
elif kwargs.get('client_cert_public') and kwargs.get('client_cert_private'):
|
||||
token = method_auth(**kwargs, auth_param=client_cert_auth(**kwargs))
|
||||
else:
|
||||
raise Exception('Either a token or AppRole, Kubernetes, or TLS authentication parameters must be set')
|
||||
|
||||
raise Exception('Token, Username/Password, AppRole, Kubernetes, or TLS authentication parameters must be set')
|
||||
return token
|
||||
|
||||
|
||||
def userpass_auth(**kwargs):
|
||||
return {'username': kwargs['username'], 'password': kwargs['password']}
|
||||
|
||||
|
||||
def approle_auth(**kwargs):
|
||||
return {'role_id': kwargs['role_id'], 'secret_id': kwargs['secret_id']}
|
||||
|
||||
@@ -227,11 +245,14 @@ def method_auth(**kwargs):
|
||||
cacert = kwargs.get('cacert', None)
|
||||
|
||||
sess = requests.Session()
|
||||
sess.mount(url, requests.adapters.HTTPAdapter(max_retries=5))
|
||||
|
||||
# Namespace support
|
||||
if kwargs.get('namespace'):
|
||||
sess.headers['X-Vault-Namespace'] = kwargs['namespace']
|
||||
request_url = '/'.join([url, 'auth', auth_path, 'login']).rstrip('/')
|
||||
if kwargs['auth_param'].get('username'):
|
||||
request_url = request_url + '/' + (kwargs['username'])
|
||||
with CertFiles(cacert) as cert:
|
||||
request_kwargs['verify'] = cert
|
||||
# TLS client certificate support
|
||||
@@ -263,6 +284,7 @@ def kv_backend(**kwargs):
|
||||
}
|
||||
|
||||
sess = requests.Session()
|
||||
sess.mount(url, requests.adapters.HTTPAdapter(max_retries=5))
|
||||
sess.headers['Authorization'] = 'Bearer {}'.format(token)
|
||||
# Compatibility header for older installs of Hashicorp Vault
|
||||
sess.headers['X-Vault-Token'] = token
|
||||
@@ -333,6 +355,7 @@ def ssh_backend(**kwargs):
|
||||
request_kwargs['json']['valid_principals'] = kwargs['valid_principals']
|
||||
|
||||
sess = requests.Session()
|
||||
sess.mount(url, requests.adapters.HTTPAdapter(max_retries=5))
|
||||
sess.headers['Authorization'] = 'Bearer {}'.format(token)
|
||||
if kwargs.get('namespace'):
|
||||
sess.headers['X-Vault-Namespace'] = kwargs['namespace']
|
||||
|
||||
@@ -93,6 +93,22 @@ class PubSub(object):
|
||||
self.conn.close()
|
||||
|
||||
|
||||
def create_listener_connection():
|
||||
conf = settings.DATABASES['default'].copy()
|
||||
conf['OPTIONS'] = conf.get('OPTIONS', {}).copy()
|
||||
# Modify the application name to distinguish from other connections the process might use
|
||||
conf['OPTIONS']['application_name'] = get_application_name(settings.CLUSTER_HOST_ID, function='listener')
|
||||
|
||||
# Apply overrides specifically for the listener connection
|
||||
for k, v in settings.LISTENER_DATABASES.get('default', {}).items():
|
||||
conf[k] = v
|
||||
for k, v in settings.LISTENER_DATABASES.get('default', {}).get('OPTIONS', {}).items():
|
||||
conf['OPTIONS'][k] = v
|
||||
|
||||
connection_data = f"dbname={conf['NAME']} host={conf['HOST']} user={conf['USER']} password={conf['PASSWORD']} port={conf['PORT']}"
|
||||
return psycopg.connect(connection_data, autocommit=True, **conf['OPTIONS'])
|
||||
|
||||
|
||||
@contextmanager
|
||||
def pg_bus_conn(new_connection=False, select_timeout=None):
|
||||
'''
|
||||
@@ -106,12 +122,7 @@ def pg_bus_conn(new_connection=False, select_timeout=None):
|
||||
'''
|
||||
|
||||
if new_connection:
|
||||
conf = settings.DATABASES['default'].copy()
|
||||
conf['OPTIONS'] = conf.get('OPTIONS', {}).copy()
|
||||
# Modify the application name to distinguish from other connections the process might use
|
||||
conf['OPTIONS']['application_name'] = get_application_name(settings.CLUSTER_HOST_ID, function='listener')
|
||||
connection_data = f"dbname={conf['NAME']} host={conf['HOST']} user={conf['USER']} password={conf['PASSWORD']} port={conf['PORT']}"
|
||||
conn = psycopg.connect(connection_data, autocommit=True, **conf['OPTIONS'])
|
||||
conn = create_listener_connection()
|
||||
else:
|
||||
if pg_connection.connection is None:
|
||||
pg_connection.connect()
|
||||
|
||||
@@ -214,7 +214,10 @@ class AWXConsumerPG(AWXConsumerBase):
|
||||
# bypasses pg_notify for scheduled tasks
|
||||
self.dispatch_task(body)
|
||||
|
||||
self.pg_is_down = False
|
||||
if self.pg_is_down:
|
||||
logger.info('Dispatcher listener connection established')
|
||||
self.pg_is_down = False
|
||||
|
||||
self.listen_start = time.time()
|
||||
|
||||
return self.scheduler.time_until_next_run()
|
||||
|
||||
52
awx/main/migrations/0188_add_bitbucket_dc_webhook.py
Normal file
@@ -0,0 +1,52 @@
|
||||
# Generated by Django 4.2.6 on 2023-11-16 21:00
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
('main', '0187_hop_nodes'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='job',
|
||||
name='webhook_service',
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[('github', 'GitHub'), ('gitlab', 'GitLab'), ('bitbucket_dc', 'BitBucket DataCenter')],
|
||||
help_text='Service that webhook requests will be accepted from',
|
||||
max_length=16,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='jobtemplate',
|
||||
name='webhook_service',
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[('github', 'GitHub'), ('gitlab', 'GitLab'), ('bitbucket_dc', 'BitBucket DataCenter')],
|
||||
help_text='Service that webhook requests will be accepted from',
|
||||
max_length=16,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='workflowjob',
|
||||
name='webhook_service',
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[('github', 'GitHub'), ('gitlab', 'GitLab'), ('bitbucket_dc', 'BitBucket DataCenter')],
|
||||
help_text='Service that webhook requests will be accepted from',
|
||||
max_length=16,
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='workflowjobtemplate',
|
||||
name='webhook_service',
|
||||
field=models.CharField(
|
||||
blank=True,
|
||||
choices=[('github', 'GitHub'), ('gitlab', 'GitLab'), ('bitbucket_dc', 'BitBucket DataCenter')],
|
||||
help_text='Service that webhook requests will be accepted from',
|
||||
max_length=16,
|
||||
),
|
||||
),
|
||||
]
|
||||
@@ -76,7 +76,7 @@ class azure_rm(PluginFileInjector):
|
||||
user_filters = []
|
||||
old_filterables = [
|
||||
('resource_groups', 'resource_group'),
|
||||
('tags', 'tags')
|
||||
('tags', 'tags'),
|
||||
# locations / location would be an entry
|
||||
# but this would conflict with source_regions
|
||||
]
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.conf import settings # noqa
|
||||
from django.db import connection
|
||||
from django.db.models.signals import pre_delete # noqa
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.main.models.base import BaseModel, PrimordialModel, accepts_json, CLOUD_INVENTORY_SOURCES, VERBOSITY_CHOICES # noqa
|
||||
|
||||
@@ -12,7 +12,7 @@ from django.utils.text import Truncator
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
@@ -953,6 +953,25 @@ ManagedCredentialType(
|
||||
},
|
||||
)
|
||||
|
||||
ManagedCredentialType(
|
||||
namespace='bitbucket_dc_token',
|
||||
kind='token',
|
||||
name=gettext_noop('Bitbucket Data Center HTTP Access Token'),
|
||||
managed=True,
|
||||
inputs={
|
||||
'fields': [
|
||||
{
|
||||
'id': 'token',
|
||||
'label': gettext_noop('Token'),
|
||||
'type': 'string',
|
||||
'secret': True,
|
||||
'help_text': gettext_noop('This token needs to come from your user settings in Bitbucket'),
|
||||
}
|
||||
],
|
||||
'required': ['token'],
|
||||
},
|
||||
)
|
||||
|
||||
ManagedCredentialType(
|
||||
namespace='insights',
|
||||
kind='insights',
|
||||
|
||||
@@ -17,7 +17,7 @@ from django.db.models import Sum, Q
|
||||
import redis
|
||||
from solo.models import SingletonModel
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx import __version__ as awx_application_version
|
||||
|
||||
@@ -25,7 +25,7 @@ from django.db.models import Q
|
||||
# REST Framework
|
||||
from rest_framework.exceptions import ParseError
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
@@ -20,7 +20,7 @@ from django.core.exceptions import FieldDoesNotExist
|
||||
# REST Framework
|
||||
from rest_framework.exceptions import ParseError
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
@@ -16,7 +16,7 @@ from django.db.models.query import QuerySet
|
||||
from django.utils.crypto import get_random_string
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.main.models.rbac import Role, RoleAncestorEntry
|
||||
@@ -527,7 +527,6 @@ class CustomVirtualEnvMixin(models.Model):
|
||||
|
||||
|
||||
class RelatedJobsMixin(object):
|
||||
|
||||
"""
|
||||
This method is intended to be overwritten.
|
||||
Called by get_active_jobs()
|
||||
@@ -562,6 +561,7 @@ class WebhookTemplateMixin(models.Model):
|
||||
SERVICES = [
|
||||
('github', "GitHub"),
|
||||
('gitlab', "GitLab"),
|
||||
('bitbucket_dc', "BitBucket DataCenter"),
|
||||
]
|
||||
|
||||
webhook_service = models.CharField(max_length=16, choices=SERVICES, blank=True, help_text=_('Service that webhook requests will be accepted from'))
|
||||
@@ -622,6 +622,7 @@ class WebhookMixin(models.Model):
|
||||
service_header = {
|
||||
'github': ('Authorization', 'token {}'),
|
||||
'gitlab': ('PRIVATE-TOKEN', '{}'),
|
||||
'bitbucket_dc': ('Authorization', 'Bearer {}'),
|
||||
}
|
||||
service_statuses = {
|
||||
'github': {
|
||||
@@ -639,6 +640,14 @@ class WebhookMixin(models.Model):
|
||||
'error': 'failed', # GitLab doesn't have an 'error' status distinct from 'failed' :(
|
||||
'canceled': 'canceled',
|
||||
},
|
||||
'bitbucket_dc': {
|
||||
'pending': 'INPROGRESS', # Bitbucket DC doesn't have any other statuses distinct from INPROGRESS, SUCCESSFUL, FAILED :(
|
||||
'running': 'INPROGRESS',
|
||||
'successful': 'SUCCESSFUL',
|
||||
'failed': 'FAILED',
|
||||
'error': 'FAILED',
|
||||
'canceled': 'FAILED',
|
||||
},
|
||||
}
|
||||
|
||||
statuses = service_statuses[self.webhook_service]
|
||||
@@ -647,11 +656,18 @@ class WebhookMixin(models.Model):
|
||||
return
|
||||
try:
|
||||
license_type = get_licenser().validate().get('license_type')
|
||||
data = {
|
||||
'state': statuses[status],
|
||||
'context': 'ansible/awx' if license_type == 'open' else 'ansible/tower',
|
||||
'target_url': self.get_ui_url(),
|
||||
}
|
||||
if self.webhook_service == 'bitbucket_dc':
|
||||
data = {
|
||||
'state': statuses[status],
|
||||
'key': 'ansible/awx' if license_type == 'open' else 'ansible/tower',
|
||||
'url': self.get_ui_url(),
|
||||
}
|
||||
else:
|
||||
data = {
|
||||
'state': statuses[status],
|
||||
'context': 'ansible/awx' if license_type == 'open' else 'ansible/tower',
|
||||
'target_url': self.get_ui_url(),
|
||||
}
|
||||
k, v = service_header[self.webhook_service]
|
||||
headers = {k: v.format(self.webhook_credential.get_input('token')), 'Content-Type': 'application/json'}
|
||||
response = requests.post(status_api, data=json.dumps(data), headers=headers, timeout=30)
|
||||
|
||||
@@ -15,7 +15,7 @@ from django.utils.encoding import smart_str, force_str
|
||||
from jinja2 import sandbox, ChainableUndefined
|
||||
from jinja2.exceptions import TemplateSyntaxError, UndefinedError, SecurityError
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
@@ -30,7 +30,7 @@ from rest_framework.exceptions import ParseError
|
||||
# Django-Polymorphic
|
||||
from polymorphic.models import PolymorphicModel
|
||||
|
||||
from ansible_base.utils.models import prevent_search, get_type_for_model
|
||||
from ansible_base.lib.utils.models import prevent_search, get_type_for_model
|
||||
|
||||
# AWX
|
||||
from awx.main.models.base import CommonModelNameNotUnique, PasswordFieldsModel, NotificationFieldsModel
|
||||
|
||||
@@ -23,7 +23,7 @@ from crum import get_current_user
|
||||
from jinja2 import sandbox
|
||||
from jinja2.exceptions import TemplateSyntaxError, UndefinedError, SecurityError
|
||||
|
||||
from ansible_base.utils.models import prevent_search
|
||||
from ansible_base.lib.utils.models import prevent_search
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
|
||||
@@ -17,7 +17,7 @@ from django.utils.timezone import now as tz_now
|
||||
from django.conf import settings
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
from ansible_base.utils.models import get_type_for_model
|
||||
from ansible_base.lib.utils.models import get_type_for_model
|
||||
|
||||
# AWX
|
||||
from awx.main.dispatch.reaper import reap_job
|
||||
|
||||
@@ -2,7 +2,7 @@ from unittest import mock
|
||||
import pytest
|
||||
import json
|
||||
|
||||
from ansible_base.utils.models import get_type_for_model
|
||||
from ansible_base.lib.utils.models import get_type_for_model
|
||||
|
||||
from awx.api.versioning import reverse
|
||||
from awx.main.models.jobs import JobTemplate, Job
|
||||
|
||||
@@ -81,6 +81,7 @@ def test_default_cred_types():
|
||||
'aws_secretsmanager_credential',
|
||||
'azure_kv',
|
||||
'azure_rm',
|
||||
'bitbucket_dc_token',
|
||||
'centrify_vault_kv',
|
||||
'conjur',
|
||||
'controller',
|
||||
|
||||
@@ -60,6 +60,13 @@ def test_hashivault_client_cert_auth_no_role():
|
||||
assert res == expected_res
|
||||
|
||||
|
||||
def test_hashivault_userpass_auth():
|
||||
kwargs = {'username': 'the_username', 'password': 'the_password'}
|
||||
expected_res = {'username': 'the_username', 'password': 'the_password'}
|
||||
res = hashivault.userpass_auth(**kwargs)
|
||||
assert res == expected_res
|
||||
|
||||
|
||||
def test_hashivault_handle_auth_token():
|
||||
kwargs = {
|
||||
'token': 'the_token',
|
||||
|
||||
@@ -5,7 +5,7 @@ import pytest
|
||||
# Django
|
||||
from rest_framework.exceptions import PermissionDenied
|
||||
|
||||
from ansible_base.filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
from ansible_base.rest_filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
|
||||
from awx.main.models import (
|
||||
AdHocCommand,
|
||||
|
||||
@@ -12,7 +12,7 @@ from unittest import mock
|
||||
|
||||
from rest_framework.exceptions import ParseError
|
||||
|
||||
from ansible_base.utils.models import get_type_for_model
|
||||
from ansible_base.lib.utils.models import get_type_for_model
|
||||
|
||||
from awx.main.utils import common
|
||||
from awx.api.validators import HostnameRegexValidator
|
||||
|
||||
@@ -69,7 +69,7 @@ class mockHost:
|
||||
@mock.patch('awx.main.utils.filters.get_model', return_value=mockHost())
|
||||
class TestSmartFilterQueryFromString:
|
||||
@mock.patch(
|
||||
'ansible_base.filters.rest_framework.field_lookup_backend.get_fields_from_path', lambda model, path: ([model], path)
|
||||
'ansible_base.rest_filters.rest_framework.field_lookup_backend.get_fields_from_path', lambda model, path: ([model], path)
|
||||
) # disable field filtering, because a__b isn't a real Host field
|
||||
@pytest.mark.parametrize(
|
||||
"filter_string,q_expected",
|
||||
|
||||
@@ -161,7 +161,7 @@ class SmartFilter(object):
|
||||
else:
|
||||
# detect loops and restrict access to sensitive fields
|
||||
# this import is intentional here to avoid a circular import
|
||||
from ansible_base.filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
from ansible_base.rest_filters.rest_framework.field_lookup_backend import FieldLookupBackend
|
||||
|
||||
FieldLookupBackend().get_field_from_lookup(Host, k)
|
||||
kwargs[k] = v
|
||||
|
||||
@@ -37,6 +37,18 @@ DATABASES = {
|
||||
}
|
||||
}
|
||||
|
||||
# Special database overrides for dispatcher connections listening to pg_notify
|
||||
LISTENER_DATABASES = {
|
||||
'default': {
|
||||
'OPTIONS': {
|
||||
'keepalives': 1,
|
||||
'keepalives_idle': 5,
|
||||
'keepalives_interval': 5,
|
||||
'keepalives_count': 5,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
# Whether or not the deployment is a K8S-based deployment
|
||||
# In K8S-based deployments, instances have zero capacity - all playbook
|
||||
# automation is intended to flow through defined Container Groups that
|
||||
@@ -340,7 +352,7 @@ INSTALLED_APPS = [
|
||||
'awx.ui',
|
||||
'awx.sso',
|
||||
'solo',
|
||||
'ansible_base',
|
||||
'ansible_base.rest_filters',
|
||||
]
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
@@ -1065,9 +1077,10 @@ HOST_METRIC_SUMMARY_TASK_INTERVAL = 7 # days
|
||||
|
||||
|
||||
# django-ansible-base
|
||||
ANSIBLE_BASE_FEATURES = {'AUTHENTICATION': False, 'SWAGGER': False, 'FILTERING': True}
|
||||
ANSIBLE_BASE_TEAM_MODEL = 'main.Team'
|
||||
ANSIBLE_BASE_ORGANIZATION_MODEL = 'main.Organization'
|
||||
|
||||
from ansible_base import settings # noqa: E402
|
||||
from ansible_base.lib import dynamic_config # noqa: E402
|
||||
|
||||
settings_file = os.path.join(os.path.dirname(settings.__file__), 'dynamic_settings.py')
|
||||
settings_file = os.path.join(os.path.dirname(dynamic_config.__file__), 'dynamic_settings.py')
|
||||
include(settings_file)
|
||||
|
||||
@@ -21,7 +21,7 @@ from split_settings.tools import optional, include
|
||||
from .defaults import * # NOQA
|
||||
|
||||
# awx-manage shell_plus --notebook
|
||||
NOTEBOOK_ARGUMENTS = ['--NotebookApp.token=', '--ip', '0.0.0.0', '--port', '8888', '--allow-root', '--no-browser']
|
||||
NOTEBOOK_ARGUMENTS = ['--NotebookApp.token=', '--ip', '0.0.0.0', '--port', '9888', '--allow-root', '--no-browser']
|
||||
|
||||
# print SQL queries in shell_plus
|
||||
SHELL_PLUS_PRINT_SQL = False
|
||||
|
||||
@@ -68,7 +68,6 @@ class LDAPSettings(BaseLDAPSettings):
|
||||
|
||||
|
||||
class LDAPBackend(BaseLDAPBackend):
|
||||
|
||||
"""
|
||||
Custom LDAP backend for AWX.
|
||||
"""
|
||||
|
||||
@@ -38,7 +38,7 @@ class CompleteView(BaseRedirectView):
|
||||
response = super(CompleteView, self).dispatch(request, *args, **kwargs)
|
||||
if self.request.user and self.request.user.is_authenticated:
|
||||
logger.info(smart_str(u"User {} logged in".format(self.request.user.username)))
|
||||
response.set_cookie('userLoggedIn', 'true')
|
||||
response.set_cookie('userLoggedIn', 'true', secure=getattr(settings, 'SESSION_COOKIE_SECURE', False))
|
||||
response.setdefault('X-API-Session-Cookie-Name', getattr(settings, 'SESSION_COOKIE_NAME', 'awx_sessionid'))
|
||||
return response
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { t } from '@lingui/macro';
|
||||
import {
|
||||
Card,
|
||||
@@ -47,7 +46,7 @@ function SubscriptionUsageChart() {
|
||||
const [periodSelection, setPeriodSelection] = useState('year');
|
||||
const userProfile = useUserProfile();
|
||||
|
||||
const calculateDateRange = () => {
|
||||
const calculateDateRange = useCallback(() => {
|
||||
const today = new Date();
|
||||
let date = '';
|
||||
switch (periodSelection) {
|
||||
@@ -77,7 +76,7 @@ function SubscriptionUsageChart() {
|
||||
break;
|
||||
}
|
||||
return date;
|
||||
};
|
||||
}, [periodSelection]);
|
||||
|
||||
const {
|
||||
isLoading,
|
||||
@@ -89,7 +88,7 @@ function SubscriptionUsageChart() {
|
||||
calculateDateRange()
|
||||
);
|
||||
return data.data.results;
|
||||
}, [periodSelection]),
|
||||
}, [calculateDateRange]),
|
||||
[]
|
||||
);
|
||||
|
||||
|
||||
@@ -112,6 +112,12 @@ function WebhookSubForm({ templateType }) {
|
||||
label: t`GitLab`,
|
||||
isDisabled: false,
|
||||
},
|
||||
{
|
||||
value: 'bitbucket_dc',
|
||||
key: 'bitbucket_dc',
|
||||
label: t`Bitbucket Data Center`,
|
||||
isDisabled: false,
|
||||
},
|
||||
];
|
||||
|
||||
if (error || webhookKeyError) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'AWX CLI'
|
||||
copyright = '2019, Ansible by Red Hat'
|
||||
copyright = '2024, Ansible by Red Hat'
|
||||
author = 'Ansible by Red Hat'
|
||||
|
||||
|
||||
|
||||
@@ -16,16 +16,16 @@ charset-normalizer==3.3.2
|
||||
# via requests
|
||||
docutils==0.18.1
|
||||
# via
|
||||
# -r docs/docsite/requirements.in
|
||||
# -r requirements.in
|
||||
# sphinx
|
||||
# sphinx-rtd-theme
|
||||
idna==3.4
|
||||
# via requests
|
||||
imagesize==1.4.1
|
||||
# via sphinx
|
||||
jinja2==3.1.2
|
||||
jinja2==3.1.3
|
||||
# via
|
||||
# -r docs/docsite/requirements.in
|
||||
# -r requirements.in
|
||||
# sphinx
|
||||
markupsafe==2.1.3
|
||||
# via jinja2
|
||||
@@ -36,14 +36,14 @@ pygments==2.16.1
|
||||
# ansible-pygments
|
||||
# sphinx
|
||||
pyyaml==6.0.1
|
||||
# via -r docs/docsite/requirements.in
|
||||
# via -r requirements.in
|
||||
requests==2.31.0
|
||||
# via sphinx
|
||||
snowballstemmer==2.2.0
|
||||
# via sphinx
|
||||
sphinx==7.2.6
|
||||
# via
|
||||
# -r docs/docsite/requirements.in
|
||||
# -r requirements.in
|
||||
# sphinx-ansible-theme
|
||||
# sphinx-rtd-theme
|
||||
# sphinxcontrib-applehelp
|
||||
@@ -53,7 +53,7 @@ sphinx==7.2.6
|
||||
# sphinxcontrib-qthelp
|
||||
# sphinxcontrib-serializinghtml
|
||||
sphinx-ansible-theme==0.10.2
|
||||
# via -r docs/docsite/requirements.in
|
||||
# via -r requirements.in
|
||||
sphinx-rtd-theme==1.3.0
|
||||
# via sphinx-ansible-theme
|
||||
sphinxcontrib-applehelp==1.0.7
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _ag_instances:
|
||||
|
||||
Managing Capacity With Instances
|
||||
----------------------------------
|
||||
=================================
|
||||
|
||||
.. index::
|
||||
pair: topology;capacity
|
||||
@@ -9,12 +9,32 @@ Managing Capacity With Instances
|
||||
pair: remove;capacity
|
||||
pair: add;capacity
|
||||
|
||||
Scaling your mesh is only available on Openshift deployments of AWX and is possible through adding or removing nodes from your cluster dynamically, through the **Instances** resource of the AWX User Interface, without running the installation script.
|
||||
Scaling your mesh is only available on Openshift and Kubernetes (K8S) deployments of AWX and is possible through adding or removing nodes from your cluster dynamically, through the **Instances** resource of the AWX User Interface, without running the installation script.
|
||||
|
||||
Instances serve as nodes in your mesh topology. Automation mesh allows you to extend the footprint of your automation. Where you launch a job and where the ``ansible-playbook`` runs can be in different locations.
|
||||
|
||||
.. image:: ../common/images/instances_mesh_concept.png
|
||||
:alt: Site A pointing to Site B and dotted arrows to two hosts from Site B
|
||||
|
||||
Automation mesh is useful for:
|
||||
|
||||
- traversing difficult network topologies
|
||||
- bringing execution capabilities (the machine running ``ansible-playbook``) closer to your target hosts
|
||||
|
||||
The nodes (control, hop, and execution instances) are interconnected via receptor, forming a virtual mesh.
|
||||
|
||||
.. image:: ../common/images/instances_mesh_concept_with_nodes.png
|
||||
:alt: Control node pointing to hop node, which is pointing to two execution nodes.
|
||||
|
||||
|
||||
Prerequisites
|
||||
~~~~~~~~~~~~~~
|
||||
--------------
|
||||
|
||||
- The system that is going to run the ``ansible-playbook`` requires the collection ``ansible.receptor`` to be installed:
|
||||
- |rhel| (RHEL) or Debian operating system. Bring a machine online with a compatible Red Hat family OS (e.g. RHEL 8 and 9) or Debian 11. This machine requires a static IP, or a resolvable DNS hostname that the AWX cluster can access. If the ``listener_port`` is defined, the machine will also need an available open port on which to establish inbound TCP connections (e.g. 27199).
|
||||
|
||||
In general, the more CPU cores and memory the machine has, the more jobs that can be scheduled to run on that machine at once. See :ref:`ug_job_concurrency` for more information on capacity.
|
||||
|
||||
- The system that is going to run the install bundle to setup the remote node requires the collection ``ansible.receptor`` to be installed:
|
||||
|
||||
- If machine has access to the internet:
|
||||
|
||||
@@ -25,34 +45,14 @@ Prerequisites
|
||||
|
||||
Installing the receptor collection dependency from the ``requirements.yml`` file will consistently retrieve the receptor version specified there, as well as any other collection dependencies that may be needed in the future.
|
||||
|
||||
- If machine does not have access to the internet, refer to `Downloading a collection from Automation Hub <https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#downloading-a-collection-from-automation-hub>`_ to configure `Automation Hub <https://console.redhat.com/ansible/automation-hub>`_ in Ansible Galaxy locally.
|
||||
|
||||
|
||||
- If you are using the default |ee| (provided with AWX) to run on remote execution nodes, you must add a pull secret in AWX that contains the credential for pulling the |ee| image. To do this, create a pull secret on the AWX namespace and configure the ``ee_pull_credentials_secret`` parameter in the Operator:
|
||||
|
||||
1. Create a secret:
|
||||
::
|
||||
|
||||
oc create secret generic ee-pull-secret \
|
||||
--from-literal=username=<username> \
|
||||
--from-literal=password=<password> \
|
||||
--from-literal=url=registry.redhat.io
|
||||
|
||||
::
|
||||
|
||||
oc edit awx <instance name>
|
||||
|
||||
2. Add ``ee_pull_credentials_secret ee-pull-secret`` to the spec:
|
||||
::
|
||||
|
||||
spec.ee_pull_credentials_secret=ee-pull-secret
|
||||
- If machine does not have access to the internet, refer to `Downloading a collection for offline use <https://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#downloading-a-collection-for-offline-use>`_.
|
||||
|
||||
|
||||
- To manage instances from the AWX user interface, you must have System Administrator or System Auditor permissions.
|
||||
|
||||
|
||||
Manage instances
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
-----------------
|
||||
|
||||
Click **Instances** from the left side navigation menu to access the Instances list.
|
||||
|
||||
@@ -75,7 +75,7 @@ The Instances list displays all the current nodes in your topology, along with r
|
||||
- **Provisioning Failure**: a node that failed during provisioning (currently not yet supported and is subject to change in a future release)
|
||||
- **De-provisioning Failure**: a node that failed during deprovisioning (currently not yet supported and is subject to change in a future release)
|
||||
|
||||
- **Node Type** specifies whether the node is a control, hybrid, hop, or execution node. See :term:`node` for further detail.
|
||||
- **Node Type** specifies whether the node is a control, hop, execution node, or hybrid (not applicable to operator-based installations). See :term:`node` for further detail.
|
||||
- **Capacity Adjustment** allows you to adjust the number of forks in your nodes
|
||||
- **Used Capacity** indicates how much capacity has been used
|
||||
- **Actions** allow you to enable or disable the instance to control whether jobs can be assigned to it
|
||||
@@ -87,7 +87,7 @@ From this page, you can add, remove or run health checks on your nodes. Use the
|
||||
|
||||
.. note::
|
||||
|
||||
You can still remove an instance even if it is active and jobs are running on it. AWXwill attempt to wait for any jobs running on this node to complete before actually removing it.
|
||||
You can still remove an instance even if it is active and jobs are running on it. AWX will attempt to wait for any jobs running on this node to complete before actually removing it.
|
||||
|
||||
Click **Remove** to confirm.
|
||||
|
||||
@@ -114,11 +114,20 @@ The example health check shows the status updates with an error on node 'one':
|
||||
|
||||
|
||||
Add an instance
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
One of the ways to expand capacity is to create an instance, which serves as a node in your topology.
|
||||
----------------
|
||||
|
||||
1. Click **Instances** from the left side navigation menu.
|
||||
One of the ways to expand capacity is to create an instance. Standalone execution nodes can be added to run alongside the Kubernetes deployment of AWX. These machines will not be a part of the AWX Kubernetes cluster. The control nodes running in the cluster will connect and submit work to these machines via Receptor. The machines are registered in AWX as type "execution" instances, meaning they will only be used to run AWX jobs, not dispatch work or handle web requests as control nodes do.
|
||||
|
||||
Hop nodes can be added to sit between the control plane of AWX and standalone execution nodes. These machines will not be a part of the AWX Kubernetes cluster and they will be registered in AWX as node type "hop", meaning they will only handle inbound and outbound traffic for otherwise unreachable nodes in a different or more strict network.
|
||||
|
||||
Below is an example of an AWX task pod with two execution nodes. Traffic to execution node 2 flows through a hop node that is setup between it and the control plane.
|
||||
|
||||
.. image:: ../common/images/instances_awx_task_pods_hopnode.png
|
||||
:alt: AWX task pod with a hop node between the control plane of AWX and standalone execution nodes.
|
||||
|
||||
To create an instance in AWV:
|
||||
|
||||
1. Click **Instances** from the left side navigation menu of the AWX UI.
|
||||
|
||||
2. In the Instances list view, click the **Add** button and the Create new Instance window opens.
|
||||
|
||||
@@ -130,13 +139,30 @@ An instance has several attributes that may be configured:
|
||||
- Enter a fully qualified domain name (ping-able DNS) or IP address for your instance in the **Host Name** field (required). This field is equivalent to ``hostname`` in the API.
|
||||
- Optionally enter a **Description** for the instance
|
||||
- The **Instance State** field is auto-populated, indicating that it is being installed, and cannot be modified
|
||||
- The **Listener Port** is pre-populated with the most optimal port, however you can change the port to one that is more appropriate for your configuration. This field is equivalent to ``listener_port`` in the API.
|
||||
- The **Instance Type** field is auto-populated and cannot be modified. Only execution nodes can be created at this time.
|
||||
- Check the **Enable Instance** box to make it available for jobs to run on it
|
||||
- Optionally specify the **Listener Port** for the receptor to listen on for incoming connections. This is an open port on the remote machine used to establish inbound TCP connections. This field is equivalent to ``listener_port`` in the API.
|
||||
- Select from the options in **Instance Type** field to specify the type you want to create. Only execution and hop nodes can be created as operator-based installations do not support hybrid nodes. This field is equivalent to ``node_type`` in the API.
|
||||
- In the **Peers** field, select the instance hostnames you want your new instance to connect outbound to.
|
||||
- In the **Options** fields:
|
||||
- Check the **Enable Instance** box to make it available for jobs to run on an execution node.
|
||||
- Check the **Managed by Policy** box to allow policy to dictate how the instance is assigned.
|
||||
- Check the **Peers from control nodes** box to allow control nodes to peer to this instance automatically. Listener port needs to be set if this is enabled or the instance is a peer.
|
||||
|
||||
In the example diagram above, the configurations are as follows:
|
||||
|
||||
+------------------+---------------+--------------------------+--------------+
|
||||
| instance name | listener_port | peers_from_control_nodes | peers |
|
||||
+==================+===============+==========================+==============+
|
||||
| execution node 1 | 27199 | true | [] |
|
||||
+------------------+---------------+--------------------------+--------------+
|
||||
| hop node | 27199 | true | [] |
|
||||
+------------------+---------------+--------------------------+--------------+
|
||||
| execution node 2 | null | false | ["hop node"] |
|
||||
+------------------+---------------+--------------------------+--------------+
|
||||
|
||||
|
||||
3. Once the attributes are configured, click **Save** to proceed.
|
||||
|
||||
Upon successful creation, the Details of the created instance opens.
|
||||
Upon successful creation, the Details of the one of the created instances opens.
|
||||
|
||||
.. image:: ../common/images/instances_create_details.png
|
||||
:alt: Details of the newly created instance.
|
||||
@@ -145,12 +171,16 @@ Upon successful creation, the Details of the created instance opens.
|
||||
|
||||
The proceeding steps 4-8 are intended to be ran from any computer that has SSH access to the newly created instance.
|
||||
|
||||
4. Click the download button next to the **Install Bundle** field to download the tarball that includes this new instance and the files relevant to install the node into the mesh.
|
||||
4. Click the download button next to the **Install Bundle** field to download the tarball that contain files to allow AWX to make proper TCP connections to the remote machine.
|
||||
|
||||
.. image:: ../common/images/instances_install_bundle.png
|
||||
:alt: Instance details showing the Download button in the Install Bundle field of the Details tab.
|
||||
|
||||
5. Extract the downloaded ``tar.gz`` file from the location you downloaded it. The install bundle contains yaml files, certificates, and keys that will be used in the installation process.
|
||||
5. Extract the downloaded ``tar.gz`` file from the location you downloaded it. The install bundle contains TLS certificates and keys, a certificate authority, and a proper Receptor configuration file. To facilitate that these files will be in the right location on the remote machine, the install bundle includes an ``install_receptor.yml`` playbook. The playbook requires the Receptor collection which can be obtained via:
|
||||
|
||||
::
|
||||
|
||||
ansible-galaxy collection install -r requirements.yml
|
||||
|
||||
6. Before running the ``ansible-playbook`` command, edit the following fields in the ``inventory.yml`` file:
|
||||
|
||||
@@ -177,17 +207,96 @@ The content of the ``inventory.yml`` file serves as a template and contains vari
|
||||
|
||||
ansible-playbook -i inventory.yml install_receptor.yml
|
||||
|
||||
Wait a few minutes for the periodic AWX task to do a health check against the new instance. You may run a health check by selecting the node and clicking the **Run health check** button from its Details page at any time. Once the instances endpoint or page reports a "Ready" status for the instance, jobs are now ready to run on this machine!
|
||||
|
||||
9. To view other instances within the same topology, click the **Peers** tab associated with the control node.
|
||||
|
||||
.. note::
|
||||
|
||||
You will only be able to view peers of the control plane nodes at this time, which are the execution nodes. Since you are limited to creating execution nodes in this release, you will be unable to create or view peers of execution nodes.
|
||||
|
||||
9. To view other instances within the same topology or associate peers, click the **Peers** tab.
|
||||
|
||||
.. image:: ../common/images/instances_peers_tab.png
|
||||
:alt: "Peers" tab showing two peers.
|
||||
|
||||
You may run a health check by selecting the node and clicking the **Run health check** button from its Details page.
|
||||
To associate peers with your node, click the **Associate** button to open a dialog box of instances eligible for peering.
|
||||
|
||||
.. image:: ../common/images/instances_associate_peer.png
|
||||
:alt: Instances available to peer with the example hop node.
|
||||
|
||||
Execution nodes can peer with either hop nodes or other execution nodes. Hop nodes can only peer with execution nodes unless you check the **Peers from control nodes** check box from the **Options** field.
|
||||
|
||||
.. note::
|
||||
|
||||
If you associate or disassociate a peer, a notification will inform you to re-run the install bundle from the Peer Detail view (the :ref:`ag_topology_viewer` has the download link).
|
||||
|
||||
.. image:: ../common/images/instances_associate_peer_reinstallmsg.png
|
||||
:alt: Notification to re-run the installation bundle due to change in the peering.
|
||||
|
||||
You can remove an instance by clicking **Remove** in the Instances page, or by setting the instance ``node_state = deprovisioning`` via the API. Upon deleting, a pop-up message will appear to notify that you may need to re-run the install bundle to make sure things that were removed are no longer connected.
|
||||
|
||||
|
||||
10. To view a graphical representation of your updated topology, refer to the :ref:`ag_topology_viewer` section of this guide.
|
||||
|
||||
|
||||
Using a custom Receptor CA
|
||||
---------------------------
|
||||
|
||||
The control nodes on the K8S cluster will communicate with execution nodes via mutual TLS TCP connections, running via Receptor. Execution nodes will verify incoming connections by ensuring the x509 certificate was issued by a trusted Certificate Authority (CA).
|
||||
|
||||
You may choose to provide your own CA for this validation. If no CA is provided, AWX operator will automatically generate one using OpenSSL.
|
||||
|
||||
Given custom ``ca.crt`` and ``ca.key`` stored locally, run the following:
|
||||
|
||||
::
|
||||
|
||||
kubectl create secret tls awx-demo-receptor-ca \
|
||||
--cert=/path/to/ca.crt --key=/path/to/ca.key
|
||||
|
||||
The secret should be named ``{AWX Custom Resource name}-receptor-ca``. In the above, the AWX Custom Resource name is "awx-demo". Replace "awx-demo" with your AWX Custom Resource name.
|
||||
|
||||
If this secret is created after AWX is deployed, run the following to restart the deployment:
|
||||
|
||||
::
|
||||
|
||||
kubectl rollout restart deployment awx-demo
|
||||
|
||||
|
||||
.. note::
|
||||
|
||||
Changing the receptor CA will sever connections to any existing execution nodes. These nodes will enter an *Unavailable* state, and jobs will not be able to run on them. You will need to download and re-run the install bundle for each execution node. This will replace the TLS certificate files with those signed by the new CA. The execution nodes will then appear in a *Ready* state after a few minutes.
|
||||
|
||||
|
||||
Using a private image for the default EE
|
||||
------------------------------------------
|
||||
|
||||
Refer to the AWX Operator Documentation on `Default execution environments from private registries <https://ansible.readthedocs.io/projects/awx-operator/en/latest/user-guide/advanced-configuration/default-execution-environments-from-private-registries.html>`_ for detail.
|
||||
|
||||
|
||||
Troubleshooting
|
||||
----------------
|
||||
|
||||
If you encounter issues while setting up instances, refer to these troubleshooting tips.
|
||||
|
||||
Fact cache not working
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Make sure the system timezone on the execution node matches ``settings.TIME_ZONE`` (default is 'UTC') on AWX. Fact caching relies on comparing modified times of artifact files, and these modified times are not timezone-aware. Therefore, it is critical that the timezones of the execution nodes match AWX's timezone setting.
|
||||
|
||||
To set the system timezone to UTC:
|
||||
|
||||
::
|
||||
|
||||
ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime
|
||||
|
||||
|
||||
Permission denied errors
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Jobs may fail with the following error, or similar:
|
||||
|
||||
::
|
||||
|
||||
"msg":"exec container process `/usr/local/bin/entrypoint`: Permission denied"
|
||||
|
||||
|
||||
For RHEL-based machines, this could be due to SELinux that is enabled on the system. You can pass these ``extra_settings`` container options to override SELinux protections:
|
||||
|
||||
::
|
||||
|
||||
DEFAULT_CONTAINER_RUN_OPTIONS = ['--network', 'slirp4netns:enable_ipv6=true', '--security-opt', 'label=disable']
|
||||
|
||||
@@ -19,7 +19,7 @@ The Topology View opens and displays a graphic representation of how each recept
|
||||
.. image:: ../common/images/topology-viewer-initial-view.png
|
||||
|
||||
|
||||
2. To adjust the zoom levels, or manipulate the graphic views, use the control buttons on the upper right-hand corner of the window.
|
||||
2. To adjust the zoom levels, refresh the current view, or manipulate the graphic views, use the control buttons on the upper right-hand corner of the window.
|
||||
|
||||
.. image:: ../common/images/topology-viewer-view-controls.png
|
||||
|
||||
|
||||
BIN
docs/docsite/rst/common/images/instances_associate_peer.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 110 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 78 KiB |
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 99 KiB |
BIN
docs/docsite/rst/common/images/instances_mesh_concept.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 151 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 673 KiB After Width: | Height: | Size: 342 KiB |
@@ -272,9 +272,12 @@ When **HashiCorp Vault Secret Lookup** is selected for **Credential Type**, prov
|
||||
- **Kubernetes role** specify the role name when using Kubernetes authentication
|
||||
- **Path to Auth**: specify a path if other than the default path of ``/approle``
|
||||
- **API Version** (required): select v1 for static lookups and v2 for versioned lookups
|
||||
- **Username and Password**: specify the username and password for the user account
|
||||
|
||||
For more detail about the Approle auth method and its fields, refer to the `Vault documentation for Approle Auth Method <https://www.vaultproject.io/docs/auth/approle>`_.
|
||||
|
||||
For more detail about the Userpass auth method and its fields, refer to the `Vault documentation for LDAP auth method <https://www.vaultproject.io/docs/auth/userpass>`_.
|
||||
|
||||
For more detail about the Kubernetes auth method and its fields, refer to the `Vault documentation for Kubernetes auth method <https://developer.hashicorp.com/vault/docs/auth/kubernetes>` _.
|
||||
|
||||
For more detail about the TLS certificate auth method and its fields, refer to the `Vault documentation for TLS certificates auth method <https://developer.hashicorp.com/vault/docs/auth/cert>` _.
|
||||
|
||||
@@ -90,17 +90,18 @@ Glossary
|
||||
Node
|
||||
A node corresponds to entries in the instance database model, or the ``/api/v2/instances/`` endpoint, and is a machine participating in the cluster / mesh. The unified jobs API reports ``awx_node`` and ``execution_node`` fields. The execution node is where the job runs, and AWX node interfaces between the job and server functions.
|
||||
|
||||
+-----------+------------------------------------------------------------------------------------------------------+
|
||||
| Node Type | Description |
|
||||
+===========+======================================================================================================+
|
||||
| Control | Nodes that run persistent |aap| services, and delegate jobs to hybrid and execution nodes |
|
||||
+-----------+------------------------------------------------------------------------------------------------------+
|
||||
| Hybrid | Nodes that run persistent |aap| services and execute jobs |
|
||||
+-----------+------------------------------------------------------------------------------------------------------+
|
||||
| Hop | Used for relaying across the mesh only |
|
||||
+-----------+------------------------------------------------------------------------------------------------------+
|
||||
| Execution | Nodes that run jobs delivered from control nodes (jobs submitted from the user's Ansible automation) |
|
||||
+-----------+------------------------------------------------------------------------------------------------------+
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
| Node Type | Description |
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
| Control | Nodes that run persistent Ansible Automation Platform services, and delegate jobs to hybrid and execution nodes |
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
| Hybrid | Nodes that run persistent Ansible Automation Platform services and execute jobs |
|
||||
| | (not applicable to operator-based installations) |
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
| Hop | Used for relaying across the mesh only |
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
| Execution | Nodes that run jobs delivered from control nodes (jobs submitted from the user’s Ansible automation) |
|
||||
+-----------+-----------------------------------------------------------------------------------------------------------------+
|
||||
|
||||
Notification Template
|
||||
An instance of a notification type (Email, Slack, Webhook, etc.) with a name, description, and a defined configuration.
|
||||
|
||||
@@ -110,7 +110,7 @@ To create a new job template:
|
||||
- * If selected, even if a default value is supplied, you will be prompted upon launch to supply additional labels if needed.
|
||||
* You will not be able to delete existing labels - clicking (|x-circle|) only removes the newly added labels, not existing default labels.
|
||||
* - **Variables**
|
||||
- * Pass extra command line variables to the playbook. This is the "-e" or "--extra-vars" command line parameter for ansible-playbook that is documented in the Ansible documentation at `Passing Variables on the Command Line <https://docs.ansible.com/ansible/latest/reference_appendices/general_precedence.html>`_.
|
||||
- * Pass extra command line variables to the playbook. This is the "-e" or "--extra-vars" command line parameter for ansible-playbook that is documented in the Ansible documentation at `Defining variables at runtime <https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html#defining-variables-at-runtime>`_.
|
||||
* Provide key/value pairs using either YAML or JSON. These variables have a maximum value of precedence and overrides other variables specified elsewhere. An example value might be:
|
||||
|
||||
::
|
||||
|
||||
@@ -4,7 +4,7 @@ All jobs use container isolation for environment consistency and security.
|
||||
Compliant images are referred to as Execution Environments (EE)s.
|
||||
|
||||
For more information about the EE technology as well as how to build and test EEs, see:
|
||||
- [Getting started with Execution Environments guide](https://docs.ansible.com/ansible/devel/getting_started_ee/index.html)
|
||||
- [Getting started with Execution Environments guide](https://ansible.readthedocs.io/en/latest/getting_started_ee/index.html)
|
||||
- [Ansible Builder documentation](https://ansible.readthedocs.io/projects/builder/en/latest/)
|
||||
|
||||
The Execution Environment model has an `image` field for the image identifier which will be used by jobs.
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
# Adding execution nodes to AWX
|
||||
|
||||
Stand-alone execution nodes can be added to run alongside the Kubernetes deployment of AWX. These machines will not be a part of the AWX Kubernetes cluster. The control nodes running in the cluster will connect and submit work to these machines via Receptor. The machines be registered in AWX as type "execution" instances, meaning they will only be used to run AWX Jobs (i.e. they will not dispatch work or handle web requests as control nodes do).
|
||||
|
||||
Hop nodes can be added to sit between the control plane of AWX and stand alone execution nodes. These machines will not be a part of the AWX Kubernetes cluster. The machines will be registered in AWX as node type "hop", meaning they will only handle inbound / outbound traffic for otherwise unreachable nodes in a different or more strict network.
|
||||
|
||||
Below is an example of an AWX Task pod with two execution nodes. Traffic to execution node 2 flows through a hop node that is setup between it and the control plane.
|
||||
|
||||
```
|
||||
AWX TASK POD
|
||||
┌──────────────┐
|
||||
│ │
|
||||
│ ┌──────────┐ │
|
||||
┌─────────────────┐ ┌─────────────────┐ │ │ awx-task │ │
|
||||
│execution node 2 ├──►│ hop node │◄────┐ │ ├──────────┤ │
|
||||
└─────────────────┘ ├─────────────────┤ ├────┼─┤ awx-ee │ │
|
||||
│ execution node 1│◄────┘ │ └──────────┘ │
|
||||
└─────────────────┘ Receptor │ |
|
||||
TCP └──────────────┘
|
||||
Peers
|
||||
|
||||
```
|
||||
|
||||
## Overview
|
||||
Adding an execution instance involves a handful of steps:
|
||||
|
||||
1. [Start a machine that is accessible from the k8s cluster (Red Hat family of operating systems are supported)](#start-machine)
|
||||
2. [Create a new AWX Instance with `hostname` being the IP or DNS name of your remote machine.](#create-instance-in-awx)
|
||||
3. [Download the install bundle for this newly created instance.](#download-the-install-bundle)
|
||||
4. [Run the install bundle playbook against your remote machine.](#run-the-install-bundle-playbook)
|
||||
5. [Wait for the instance to report a Ready state. Now jobs can run on that instance.](#wait-for-instance-to-be-ready)
|
||||
|
||||
|
||||
### Start machine
|
||||
|
||||
Bring a machine online with a compatible Red Hat family OS (e.g. RHEL 8 and 9). This machines needs a static IP, or a resolvable DNS hostname that the AWX cluster can access. If the listener_port is defined, the machine will also need an available open port to establish inbound TCP connections on (e.g. 27199).
|
||||
|
||||
In general the more CPU cores and memory the machine has, the more jobs that can be scheduled to run on that machine at once. See https://docs.ansible.com/automation-controller/4.2.1/html/userguide/jobs.html#at-capacity-determination-and-job-impact for more information on capacity.
|
||||
|
||||
|
||||
### Create instance in AWX
|
||||
|
||||
Use the Instance page or `api/v2/instances` endpoint to add a new instance.
|
||||
- `hostname` ("Name" in UI) is the IP address or DNS name of your machine.
|
||||
- `node_type` is "execution" or "hop"
|
||||
- `node_state` is "installed"
|
||||
- `listener_port` is an open port on the remote machine used to establish inbound TCP connections. Defaults to null.
|
||||
- `peers` is a list of instance hostnames to connect outbound to.
|
||||
- `peers_from_control_nodes` boolean, if True, control plane nodes will automatically peer to this instance.
|
||||
|
||||
Below is a table of configurations for the [diagram](#adding-execution-nodes-to-awx) above.
|
||||
|
||||
| instance name | listener_port | peers_from_control_nodes | peers |
|
||||
|------------------|---------------|-------------------------|--------------|
|
||||
| execution node 1 | 27199 | true | [] |
|
||||
| hop node | 27199 | true | [] |
|
||||
| execution node 2 | null | false | ["hop node"] |
|
||||
|
||||
Listener port needs to be set if peers_from_control_nodes is enabled or the instance is a peer.
|
||||
|
||||
|
||||
### Download the install bundle
|
||||
|
||||
On the Instance Details page, click Install Bundle and save the tar.gz file to your local computer and extract contents. Alternatively, make a GET request to `api/v2/instances/{id}/install_bundle` and save the binary output to a tar.gz file.
|
||||
|
||||
|
||||
### Run the install bundle playbook
|
||||
|
||||
In order for AWX to make proper TCP connections to the remote machine, a few files need to in place. These include TLS certificates and keys, a certificate authority, and a proper Receptor configuration file. To facilitate that these files will be in the right location on the remote machine, the install bundle includes an install_receptor.yml playbook.
|
||||
|
||||
The playbook requires the Receptor collection which can be obtained via
|
||||
|
||||
`ansible-galaxy collection install -r requirements.yml`
|
||||
|
||||
Modify `inventory.yml`. Set the `ansible_user` and any other ansible variables that may be needed to run playbooks against the remote machine.
|
||||
|
||||
`ansible-playbook -i inventory.yml install_receptor.yml` to start installing Receptor on the remote machine.
|
||||
|
||||
|
||||
### Wait for instance to be Ready
|
||||
|
||||
Wait a few minutes for the periodic AWX task to do a health check against the new instance. The instances endpoint or page should report "Ready" status for the instance. If so, jobs are now ready to run on this machine!
|
||||
|
||||
|
||||
## Removing instances
|
||||
|
||||
You can remove an instance by clicking "Remove" in the Instances page, or by setting the instance `node_state` to "deprovisioning" via the API.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Fact cache not working
|
||||
|
||||
Make sure the system timezone on the execution node matches `settings.TIME_ZONE` (default is 'UTC') on AWX.
|
||||
Fact caching relies on comparing modified times of artifact files, and these modified times are not timezone-aware. Therefore, it is critical that the timezones of the execution nodes match AWX's timezone setting.
|
||||
|
||||
To set the system timezone to UTC
|
||||
|
||||
`ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime`
|
||||
|
||||
### Permission denied errors
|
||||
|
||||
Jobs may fail with the following error
|
||||
```
|
||||
"msg":"exec container process `/usr/local/bin/entrypoint`: Permission denied"
|
||||
```
|
||||
or similar
|
||||
|
||||
For RHEL based machines, this could due to SELinux that is enabled on the system.
|
||||
|
||||
You can pass these `extra_settings` container options to override SELinux protections.
|
||||
|
||||
`DEFAULT_CONTAINER_RUN_OPTIONS = ['--network', 'slirp4netns:enable_ipv6=true', '--security-opt', 'label=disable']`
|
||||
@@ -1,24 +0,0 @@
|
||||
Copyright (c) Alex Gaynor and individual contributors.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* The names of its contributors may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,30 +0,0 @@
|
||||
Copyright © 2011-present, Encode OSS Ltd.
|
||||
Copyright © 2019-2021, T. Franzel <tfranzel@gmail.com>, Cashlink Technologies GmbH.
|
||||
Copyright © 2021-present, T. Franzel <tfranzel@gmail.com>.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -1,20 +0,0 @@
|
||||
Copyright (c) 2011-2020 Sergey Astanin and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -111,19 +111,15 @@ django==4.2.6
|
||||
# django-cors-headers
|
||||
# django-crum
|
||||
# django-extensions
|
||||
# django-filter
|
||||
# django-guid
|
||||
# django-oauth-toolkit
|
||||
# django-polymorphic
|
||||
# django-solo
|
||||
# djangorestframework
|
||||
# drf-spectacular
|
||||
# social-auth-app-django
|
||||
# via -r /awx_devel/requirements/requirements_git.txt
|
||||
django-auth-ldap==4.1.0
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django-ansible-base
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
django-cors-headers==3.13.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
django-crum==0.7.9
|
||||
@@ -132,8 +128,6 @@ django-crum==0.7.9
|
||||
# django-ansible-base
|
||||
django-extensions==3.2.1
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
django-filter==23.5
|
||||
# via django-ansible-base
|
||||
django-guid==3.2.1
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
django-oauth-toolkit==1.7.1
|
||||
@@ -146,18 +140,17 @@ django-polymorphic==3.1.0
|
||||
django-solo==2.0.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
django-split-settings==1.0.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django-ansible-base
|
||||
djangorestframework==3.14.0
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django-ansible-base
|
||||
# drf-spectacular
|
||||
djangorestframework-yaml==2.0.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
docutils==0.19
|
||||
# via python-daemon
|
||||
drf-spectacular==0.26.5
|
||||
# via django-ansible-base
|
||||
ecdsa==0.18.0
|
||||
# via python-jose
|
||||
enum-compat==0.0.3
|
||||
@@ -197,9 +190,7 @@ incremental==22.10.0
|
||||
inflect==6.0.2
|
||||
# via jaraco-text
|
||||
inflection==0.5.1
|
||||
# via
|
||||
# django-ansible-base
|
||||
# drf-spectacular
|
||||
# via django-ansible-base
|
||||
irc==20.1.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
isodate==0.6.1
|
||||
@@ -234,9 +225,7 @@ jmespath==1.0.1
|
||||
json-log-formatter==0.5.1
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
jsonschema==4.17.3
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# drf-spectacular
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
jwcrypto==1.4.2
|
||||
# via django-oauth-toolkit
|
||||
kubernetes==25.3.0
|
||||
@@ -320,6 +309,7 @@ pygerduty==0.38.3
|
||||
pyjwt==2.6.0
|
||||
# via
|
||||
# adal
|
||||
# django-ansible-base
|
||||
# social-auth-core
|
||||
# twilio
|
||||
pyopenssl==23.2.0
|
||||
@@ -351,7 +341,6 @@ python-jose==3.3.0
|
||||
python-ldap==3.4.3
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django-ansible-base
|
||||
# django-auth-ldap
|
||||
python-string-utils==1.0.0
|
||||
# via openshift
|
||||
@@ -359,9 +348,7 @@ python-tss-sdk==1.2.1
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
python3-openid==3.2.0
|
||||
# via social-auth-core
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements_git.txt
|
||||
# django-ansible-base
|
||||
# via -r /awx_devel/requirements/requirements_git.txt
|
||||
pytz==2022.6
|
||||
# via
|
||||
# djangorestframework
|
||||
@@ -373,7 +360,6 @@ pyyaml==6.0.1
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# ansible-runner
|
||||
# djangorestframework-yaml
|
||||
# drf-spectacular
|
||||
# kubernetes
|
||||
# receptorctl
|
||||
receptorctl==1.4.2
|
||||
@@ -386,6 +372,7 @@ requests==2.28.1
|
||||
# adal
|
||||
# azure-core
|
||||
# azure-keyvault
|
||||
# django-ansible-base
|
||||
# django-oauth-toolkit
|
||||
# kubernetes
|
||||
# msrest
|
||||
@@ -434,9 +421,7 @@ slack-sdk==3.19.4
|
||||
smmap==5.0.0
|
||||
# via gitdb
|
||||
social-auth-app-django==5.4.0
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django-ansible-base
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
social-auth-core[openidconnect]==4.4.2
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
@@ -445,8 +430,6 @@ sqlparse==0.4.4
|
||||
# via
|
||||
# -r /awx_devel/requirements/requirements.in
|
||||
# django
|
||||
tabulate==0.9.0
|
||||
# via django-ansible-base
|
||||
tacacs-plus==1.0
|
||||
# via -r /awx_devel/requirements/requirements.in
|
||||
tempora==5.1.0
|
||||
@@ -470,9 +453,7 @@ typing-extensions==4.4.0
|
||||
# setuptools-rust
|
||||
# setuptools-scm
|
||||
# twisted
|
||||
uritemplate==4.1.1
|
||||
# via drf-spectacular
|
||||
urllib3==1.26.13
|
||||
urllib3==1.26.17
|
||||
# via
|
||||
# botocore
|
||||
# kubernetes
|
||||
|
||||
@@ -5,4 +5,4 @@ git+https://github.com/ansible/ansible-runner.git@devel#egg=ansible-runner
|
||||
# specifically need https://github.com/robgolding/django-radius/pull/27
|
||||
git+https://github.com/ansible/django-radius.git@develop#egg=django-radius
|
||||
git+https://github.com/ansible/python3-saml.git@devel#egg=python3-saml
|
||||
git+https://github.com/ansible/django-ansible-base.git@devel#egg=django-ansible-base
|
||||
django-ansible-base @ git+https://github.com/ansible/django-ansible-base@devel#egg=django-ansible-base[rest_filters,jwt_consumer]
|
||||
|
||||
@@ -34,6 +34,9 @@ services:
|
||||
links:
|
||||
- postgres
|
||||
- redis_{{ container_postfix }}
|
||||
networks:
|
||||
- awx
|
||||
- service-mesh
|
||||
working_dir: "/awx_devel"
|
||||
volumes:
|
||||
- "../../../:/awx_devel"
|
||||
@@ -61,7 +64,7 @@ services:
|
||||
{% if control_plane_node_count|int == 1 %}
|
||||
- "6899:6899"
|
||||
- "8080:8080" # unused but mapped for debugging
|
||||
- "8888:8888" # jupyter notebook
|
||||
- "${AWX_JUPYTER_PORT:-9888}:9888" # jupyter notebook
|
||||
- "8013:8013" # http
|
||||
- "8043:8043" # https
|
||||
- "2222:2222" # receptor foo node
|
||||
@@ -73,6 +76,8 @@ services:
|
||||
volumes:
|
||||
- "../../redis/redis.conf:/usr/local/etc/redis/redis.conf:Z"
|
||||
- "redis_socket_{{ container_postfix }}:/var/run/redis/:rw"
|
||||
networks:
|
||||
- awx
|
||||
entrypoint: ["redis-server"]
|
||||
command: ["/usr/local/etc/redis/redis.conf"]
|
||||
{% endfor %}
|
||||
@@ -82,6 +87,8 @@ services:
|
||||
user: "{{ ansible_user_uid }}"
|
||||
volumes:
|
||||
- "./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:Z"
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "8013:8013"
|
||||
- "8043:8043"
|
||||
@@ -98,6 +105,8 @@ services:
|
||||
container_name: tools_keycloak_1
|
||||
hostname: keycloak
|
||||
user: "{{ ansible_user_uid }}"
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "8443:8443"
|
||||
environment:
|
||||
@@ -115,6 +124,8 @@ services:
|
||||
container_name: tools_ldap_1
|
||||
hostname: ldap
|
||||
user: "{{ ansible_user_uid }}"
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "389:1389"
|
||||
- "636:1636"
|
||||
@@ -137,6 +148,8 @@ services:
|
||||
image: splunk/splunk:latest
|
||||
container_name: tools_splunk_1
|
||||
hostname: splunk
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "8089:8089"
|
||||
@@ -150,6 +163,8 @@ services:
|
||||
image: prom/prometheus:latest
|
||||
container_name: tools_prometheus_1
|
||||
hostname: prometheus
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "9090:9090"
|
||||
volumes:
|
||||
@@ -165,6 +180,8 @@ services:
|
||||
image: grafana/grafana-enterprise:latest
|
||||
container_name: tools_grafana_1
|
||||
hostname: grafana
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "3001:3000"
|
||||
volumes:
|
||||
@@ -201,11 +218,17 @@ services:
|
||||
POSTGRES_PASSWORD: {{ pg_password }}
|
||||
volumes:
|
||||
- "awx_db:/var/lib/postgresql/data"
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "${AWX_PG_PORT:-5441}:5432"
|
||||
{% if enable_pgbouncer|bool %}
|
||||
pgbouncer:
|
||||
image: bitnami/pgbouncer:latest
|
||||
container_name: tools_pgbouncer_1
|
||||
hostname: pgbouncer
|
||||
networks:
|
||||
- awx
|
||||
environment:
|
||||
POSTGRESQL_USERNAME: {{ pg_username }}
|
||||
POSTGRESQL_DATABASE: {{ pg_database }}
|
||||
@@ -229,6 +252,8 @@ services:
|
||||
command: 'receptor --config /etc/receptor/receptor.conf'
|
||||
links:
|
||||
- awx_1
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "5555:5555"
|
||||
volumes:
|
||||
@@ -244,6 +269,8 @@ services:
|
||||
RECEPTORCTL_SOCKET: {{ receptor_socket_file }}
|
||||
links:
|
||||
- receptor-hop
|
||||
networks:
|
||||
- awx
|
||||
volumes:
|
||||
- "../../../:/awx_devel" # not used, but mounted so that any in-place installs can be used for whole cluster
|
||||
- "../../docker-compose/_sources/receptor/receptor-worker-{{ loop.index }}.conf:/etc/receptor/receptor.conf"
|
||||
@@ -258,6 +285,8 @@ services:
|
||||
container_name: tools_vault_1
|
||||
command: server
|
||||
hostname: vault
|
||||
networks:
|
||||
- awx
|
||||
ports:
|
||||
- "1234:1234"
|
||||
environment:
|
||||
@@ -300,8 +329,11 @@ volumes:
|
||||
grafana_storage:
|
||||
name: tools_grafana_storage
|
||||
{% endif %}
|
||||
{% if minikube_container_group|bool %}
|
||||
networks:
|
||||
awx:
|
||||
service-mesh:
|
||||
name: service-mesh
|
||||
{% if minikube_container_group|bool %}
|
||||
default:
|
||||
external:
|
||||
name: minikube
|
||||
|
||||
@@ -34,7 +34,7 @@ location {{ (ingress_path + '/websocket').replace('//', '/') }} {
|
||||
|
||||
location {{ ingress_path }} {
|
||||
# Add trailing / if missing
|
||||
rewrite ^(.*[^/])$ $1/ permanent;
|
||||
rewrite ^(.*)$http_host(.*[^/])$ $1$http_host$2/ permanent;
|
||||
uwsgi_read_timeout 120s;
|
||||
uwsgi_pass uwsgi;
|
||||
include /etc/nginx/uwsgi_params;
|
||||
|
||||