From b12c0def7d3c5bf19020500edfa27fa79cf9d03b Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 4 May 2020 12:44:04 -0400 Subject: [PATCH 1/5] Fix permissions for vendored collections in dev env --- tools/docker-compose/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/docker-compose/Dockerfile b/tools/docker-compose/Dockerfile index 1f8b290e64..5f95f55408 100644 --- a/tools/docker-compose/Dockerfile +++ b/tools/docker-compose/Dockerfile @@ -128,8 +128,8 @@ ADD tools/docker-compose/entrypoint.sh / ADD tools/docker-compose/rsyslog.conf /var/lib/awx/rsyslog/rsyslog.conf ADD tools/scripts/awx-python /usr/bin/awx-python -# Pre-create things that we need to write to -RUN for dir in /var/lib/awx /var/lib/awx/rsyslog /var/lib/awx/rsyslog/conf.d /var/run/awx-rsyslog /var/log/tower/ /var/lib/awx/projects /.ansible /var/log/nginx /var/lib/nginx /.local; \ +# Pre-create things that we need to write to / fix up permissions +RUN for dir in /var/lib/awx /var/lib/awx/rsyslog /var/lib/awx/rsyslog/conf.d /var/run/awx-rsyslog /var/log/tower/ /var/lib/awx/projects /.ansible /var/log/nginx /var/lib/nginx /.local /vendor; \ do mkdir -p $dir; chmod -R g+rwx $dir; chgrp -R root $dir; done && \ \ for file in /etc/passwd /etc/supervisord.conf /venv/awx/lib/python3.6/site-packages/awx.egg-link /var/run/nginx.pid; \ From a98887deb0d881fa0b434d6aa3f0f79922a20203 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 4 May 2020 14:23:05 -0400 Subject: [PATCH 2/5] Update INVENTORY_COLLECTIONS_ROOT in dev env settings --- awx/settings/local_settings.py.docker_compose | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/settings/local_settings.py.docker_compose b/awx/settings/local_settings.py.docker_compose index 301b7a9dfe..b59a3217f2 100644 --- a/awx/settings/local_settings.py.docker_compose +++ b/awx/settings/local_settings.py.docker_compose @@ -53,7 +53,7 @@ if "pytest" in sys.modules: PROJECTS_ROOT = '/var/lib/awx/projects/' # Location for cross-development of inventory plugins -# INVENTORY_COLLECTIONS_ROOT = '/awx_devel/awx/plugins/collections' +INVENTORY_COLLECTIONS_ROOT = '/vendor/inventory_collections' # Absolute filesystem path to the directory for job status stdout # This directory should not be web-accessible From ba7e2c9bc406ca4c40847c8933400853e21234b9 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Mon, 4 May 2020 15:57:56 -0400 Subject: [PATCH 3/5] missing f"" on log statement --- awx/main/consumers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/consumers.py b/awx/main/consumers.py index af39edb107..b6d8872ebd 100644 --- a/awx/main/consumers.py +++ b/awx/main/consumers.py @@ -104,7 +104,7 @@ class BroadcastConsumer(AsyncJsonWebsocketConsumer): logger.info(f"client '{self.channel_name}' joined the broadcast group.") async def disconnect(self, code): - logger.info("client '{self.channel_name}' disconnected from the broadcast group.") + logger.info(f"client '{self.channel_name}' disconnected from the broadcast group.") await self.channel_layer.group_discard(settings.BROADCAST_WEBSOCKET_GROUP_NAME, self.channel_name) async def internal_message(self, event): From 1ca29df0de036f4d2d40584109ce977569bf0bd8 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 5 May 2020 18:11:51 -0400 Subject: [PATCH 4/5] Fix for schedule delete 500 from Gabe (#4290) --- .../migrations/0115_v370_schedule_set_null.py | 24 +++++++++++++++++++ awx/main/models/unified_jobs.py | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 awx/main/migrations/0115_v370_schedule_set_null.py diff --git a/awx/main/migrations/0115_v370_schedule_set_null.py b/awx/main/migrations/0115_v370_schedule_set_null.py new file mode 100644 index 0000000000..10e5798d17 --- /dev/null +++ b/awx/main/migrations/0115_v370_schedule_set_null.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.11 on 2020-05-04 02:26 + +import awx.main.utils.polymorphic +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0114_v370_remove_deprecated_manual_inventory_sources'), + ] + + operations = [ + migrations.AlterField( + model_name='unifiedjob', + name='schedule', + field=models.ForeignKey(default=None, editable=False, null=True, on_delete=awx.main.utils.polymorphic.SET_NULL, to='main.Schedule'), + ), + migrations.AlterField( + model_name='unifiedjobtemplate', + name='next_schedule', + field=models.ForeignKey(default=None, editable=False, null=True, on_delete=awx.main.utils.polymorphic.SET_NULL, related_name='unifiedjobtemplate_as_next_schedule+', to='main.Schedule'), + ), + ] diff --git a/awx/main/models/unified_jobs.py b/awx/main/models/unified_jobs.py index 70fd0e004d..569ad80ea2 100644 --- a/awx/main/models/unified_jobs.py +++ b/awx/main/models/unified_jobs.py @@ -150,7 +150,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio default=None, editable=False, related_name='%(class)s_as_next_schedule+', - on_delete=models.SET_NULL, + on_delete=polymorphic.SET_NULL, ) status = models.CharField( max_length=32, @@ -587,7 +587,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique null=True, default=None, editable=False, - on_delete=models.SET_NULL, + on_delete=polymorphic.SET_NULL, ) dependent_jobs = models.ManyToManyField( 'self', From 961c5589c1fbe72ede89bcf69f0c909c9a0fa6f8 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Tue, 5 May 2020 18:22:00 -0400 Subject: [PATCH 5/5] Refresh inventory collection requirements (#4296) * Refresh inventory collection requirements Fix bug specific to Docker development where the right folder of install was not specified in the setting Add initial rhv/ovirt version for consistency * Update unit test to ovirt name change --- awx/main/models/inventory.py | 3 ++- awx/main/tests/data/inventory/plugins/rhv/files/ovirt.yml | 2 +- awx/settings/development.py | 3 +++ requirements/collections_requirements.yml | 8 ++++---- tools/collections/clone_vendor.sh | 5 ++--- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index c8a54354cf..7bc3c80b5e 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -2491,8 +2491,9 @@ class rhv(PluginFileInjector): """ plugin_name = 'ovirt' base_injector = 'template' + initial_version = '2.9' namespace = 'ovirt' - collection = 'ovirt_collection' + collection = 'ovirt' @property def script_name(self): diff --git a/awx/main/tests/data/inventory/plugins/rhv/files/ovirt.yml b/awx/main/tests/data/inventory/plugins/rhv/files/ovirt.yml index a2aacf5656..0c7dec7b16 100644 --- a/awx/main/tests/data/inventory/plugins/rhv/files/ovirt.yml +++ b/awx/main/tests/data/inventory/plugins/rhv/files/ovirt.yml @@ -1 +1 @@ -plugin: ovirt.ovirt_collection.ovirt +plugin: ovirt.ovirt.ovirt diff --git a/awx/settings/development.py b/awx/settings/development.py index ac2a9fde94..b971931cf8 100644 --- a/awx/settings/development.py +++ b/awx/settings/development.py @@ -148,6 +148,9 @@ for setting in dir(this_module): include(optional('/etc/tower/settings.py'), scope=locals()) include(optional('/etc/tower/conf.d/*.py'), scope=locals()) +# Installed differently in Dockerfile compared to production versions +INVENTORY_COLLECTIONS_ROOT = '/vendor/inventory_collections' + BASE_VENV_PATH = "/venv/" ANSIBLE_VENV_PATH = os.path.join(BASE_VENV_PATH, "ansible") AWX_VENV_PATH = os.path.join(BASE_VENV_PATH, "awx") diff --git a/requirements/collections_requirements.yml b/requirements/collections_requirements.yml index 333ed62924..ea7abf5578 100644 --- a/requirements/collections_requirements.yml +++ b/requirements/collections_requirements.yml @@ -1,18 +1,18 @@ --- collections: - name: awx.awx - version: 9.3.0 + version: 11.2.0 # almost all versions should work - name: azure.azcollection version: 0.1.2 - name: amazon.aws version: 0.1.1 # version 0.1.0 seems to have gone missing - name: theforeman.foreman - version: 0.7.0 # contains the inventory plugin, but more patches are needed + version: 0.8.0 - name: google.cloud version: 0.0.9 # contains PR 167, should be good to go - name: openstack.cloud version: 0.0.1-dev85 # earlier had checksum mismatch - name: community.vmware version: 0.4.0 # first to contain necessary grouping and filtering features - - name: ovirt.ovirt_collection - version: 1.0.1 # new fix published, should be good to go + - name: ovirt.ovirt + version: 1.0.0 # contains naming fix, was originally named ovirt.ovirt_collection diff --git a/tools/collections/clone_vendor.sh b/tools/collections/clone_vendor.sh index 06f6e19956..0f4e087666 100644 --- a/tools/collections/clone_vendor.sh +++ b/tools/collections/clone_vendor.sh @@ -50,10 +50,10 @@ else echo "VMWare collection already exists" fi -if [ ! -d "$base_dir/ovirt/ovirt_collection" ] +if [ ! -d "$base_dir/ovirt/ovirt" ] then mkdir -p $base_dir/ovirt - git clone $base_dir/ovirt/ovirt_collection + git clone https://github.com/oVirt/ovirt-ansible-collection.git $base_dir/ovirt/ovirt else echo "Ovirt collection already exists" fi @@ -62,7 +62,6 @@ if [ ! -d "$base_dir/awx/awx" ] then mkdir -p $base_dir/awx ln -s $(shell pwd)/awx_collection $base_dir/awx/awx - git clone $base_dir/awx/awx else echo "awx collection already exists" fi