Skip to content
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

Run ansible-runner with PYTHONPATH set to access additional modules #19118

Merged
merged 1 commit into from
Aug 9, 2019

Conversation

carbonin
Copy link
Member

@carbonin carbonin commented Aug 7, 2019

On the appliance we will install all the modules that were previously used by awx to utilize the cloud credential roles out of the box.

In addition to this fix, we will need to install the modules on the appliance at build time which is done in ManageIQ/manageiq-appliance-build#340 ManageIQ/manageiq-appliance-build#341

https://bugzilla.redhat.com/show_bug.cgi?id=1734129

Copy link
Member

@NickLaMuro NickLaMuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me. One comment, but I assume you might have addressed this already or we can do it later.

@@ -300,6 +300,19 @@ def fetch_galaxy_roles(playbook_or_role_args)
Ansible::Content.new(playbook_dir).fetch_galaxy_roles
end

def python_env
python3_modules_path = "/var/lib/awx/venv/ansible/lib/python3.6/site-packages/"
python2_modules_path = "/var/lib/awx/venv/ansible/lib/python2.7/site-packages/"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are the locations for these different on upstream/downstream?

Or maybe the proper questions is if we have to install things differently on upstream/downstream, if if that affects the location of these packages. Does it make sense that these are configurable vars?

Not a big deal, but something to consider and possibly do in a followup.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, just looked at ManageIQ/manageiq-appliance-build#340 and it seems like most of my questions are answered by that.

@carbonin carbonin changed the title Run ansible-runner with PYTHONPATH set to access additional modules [WIP] Run ansible-runner with PYTHONPATH set to access additional modules Aug 8, 2019
@carbonin carbonin added the wip label Aug 8, 2019
On the appliance we will install all the modules that were previously
used by awx to utilize the cloud credential roles out of the box.

In addition to this fix, we will need to install the modules on
the appliance at build time.

https://bugzilla.redhat.com/show_bug.cgi?id=1734129
@carbonin carbonin force-pushed the make_cred_modules_accessible branch from 21c79f5 to 50829f0 Compare August 8, 2019 20:53
@carbonin
Copy link
Member Author

carbonin commented Aug 8, 2019

Success for this means that instead of complaining that boto3 was missing I'm getting a credential failure for an aws module:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ClientError: An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials
fatal: [localhost]: FAILED! => {"changed": false, "error": {"code": "AuthFailure", "message": "AWS was not able to validate the provided access credentials"}, "msg": "An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials", "response_metadata": {"http_headers": {"date": "Thu, 08 Aug 2019 20:50:43 GMT", "server": "AmazonEC2", "transfer-encoding": "chunked"}, "http_status_code": 401, "request_id": "6a3c59db-60cc-4d0f-86fe-9ab17892107c", "retry_attempts": 0}}

@miq-bot
Copy link
Member

miq-bot commented Aug 8, 2019

Checked commit carbonin@50829f0 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@carbonin carbonin removed the wip label Aug 8, 2019
@carbonin carbonin changed the title [WIP] Run ansible-runner with PYTHONPATH set to access additional modules Run ansible-runner with PYTHONPATH set to access additional modules Aug 8, 2019
@carbonin
Copy link
Member Author

carbonin commented Aug 8, 2019

We can really merge these in any order since it will be no worse if we don't have the modules installed, but we have this patch in place. Removing WIP since we've decided on where we're going to install the modules.

@Fryguy Fryguy merged commit 3bedecb into ManageIQ:master Aug 9, 2019
@Fryguy Fryguy added this to the Sprint 118 Ending Aug 19, 2019 milestone Aug 9, 2019
simaishi pushed a commit that referenced this pull request Aug 9, 2019
Run ansible-runner with PYTHONPATH set to access additional modules

(cherry picked from commit 3bedecb)

https://bugzilla.redhat.com/show_bug.cgi?id=1734129
@simaishi
Copy link
Contributor

simaishi commented Aug 9, 2019

Ivanchuk backport details:

$ git log -1
commit a640dbe53e41f24b2865bfdf156e47ed68cc12c8
Author: Jason Frey <jfrey@redhat.com>
Date:   Fri Aug 9 10:41:06 2019 -0400

    Merge pull request #19118 from carbonin/make_cred_modules_accessible
    
    Run ansible-runner with PYTHONPATH set to access additional modules
    
    (cherry picked from commit 3bedecb4b50bb7e884ea1df5babbf3a2bde73e76)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1734129

@carbonin carbonin deleted the make_cred_modules_accessible branch August 16, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants