-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EE model changes #8644
EE model changes #8644
Changes from all commits
828d6c9
4137050
5d96139
41b4cee
b5bd38f
912d584
911b480
a6c8506
b91370b
fbcdb5a
430b9a6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Generated by Django 2.2.16 on 2020-11-19 16:20 | ||
import uuid | ||
|
||
import awx.main.fields | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main', '0124_execution_environments'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name='executionenvironment', | ||
options={'ordering': ('-created',)}, | ||
), | ||
migrations.AddField( | ||
model_name='executionenvironment', | ||
name='name', | ||
field=models.CharField(default=uuid.uuid4, max_length=512, unique=True), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name='organization', | ||
name='execution_environment_admin_role', | ||
field=awx.main.fields.ImplicitRoleField(editable=False, null='True', on_delete=django.db.models.deletion.CASCADE, parent_role='admin_role', related_name='+', to='main.Role'), | ||
preserve_default='True', | ||
), | ||
migrations.AddField( | ||
model_name='project', | ||
name='default_environment', | ||
field=models.ForeignKey(blank=True, default=None, help_text='The default execution environment for jobs run using this project.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='main.ExecutionEnvironment'), | ||
), | ||
migrations.AlterField( | ||
model_name='credentialtype', | ||
name='kind', | ||
field=models.CharField(choices=[('ssh', 'Machine'), ('vault', 'Vault'), ('net', 'Network'), ('scm', 'Source Control'), ('cloud', 'Cloud'), ('registry', 'Container Registry'), ('token', 'Personal Access Token'), ('insights', 'Insights'), ('external', 'External'), ('kubernetes', 'Kubernetes'), ('galaxy', 'Galaxy/Automation Hub')], max_length=32), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='executionenvironment', | ||
unique_together=set(), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -95,6 +95,9 @@ class Meta: | |||||||
job_template_admin_role = ImplicitRoleField( | ||||||||
parent_role='admin_role', | ||||||||
) | ||||||||
execution_environment_admin_role = ImplicitRoleField( | ||||||||
parent_role='admin_role', | ||||||||
) | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the addition of this, I'd expect Line 1328 in c706bca
and Line 1335 in c706bca
and maybe? Line 1342 in c706bca
that one might depend on intent |
||||||||
auditor_role = ImplicitRoleField( | ||||||||
parent_role='singleton:' + ROLE_SINGLETON_SYSTEM_AUDITOR, | ||||||||
) | ||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -881,14 +881,11 @@ def get_path_to(self, *args): | |
return os.path.abspath(os.path.join(os.path.dirname(__file__), *args)) | ||
|
||
def build_execution_environment_params(self, instance): | ||
if getattr(instance, 'execution_environment', None): | ||
# TODO: process heirarchy, JT-project-org, maybe here | ||
# or maybe in create_unified_job | ||
logger.info('using custom image {}'.format(instance.execution_environment.image)) | ||
image = instance.execution_environment.image | ||
else: | ||
logger.info('using default image') | ||
image = settings.AWX_EXECUTION_ENVIRONMENT_DEFAULT_IMAGE | ||
if instance.execution_environment_id is None: | ||
self.instance = instance = self.update_model( | ||
instance.pk, execution_environment=instance.resolve_execution_environment()) | ||
|
||
image = instance.execution_environment.image | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For whatever reason, some jobs still wind up with a null |
||
params = { | ||
"container_image": image, | ||
"process_isolation": True | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the credential is applied to the
podman
process, not theansible-playbook
process, I think it does make sense to add a newkind
option of "registry" for pulling from an image registry.A big "but" here - this doesn't actually add it as an option. You would need to add it to the
KIND_CHOICES
listing, and this PR does not do that now.With the way that
ansible-runner
works... this might be accomplish-able by modifyingos.environ
, and not making other ansible-runner code changes. There are still a lot of question marks there.