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
Implement stdout callback and its logic as a collection #482
Conversation
if 'AD_HOC_COMMAND_ID' in self.env: | ||
self.env['ANSIBLE_STDOUT_CALLBACK'] = 'minimal' | ||
self.env['ANSIBLE_STDOUT_CALLBACK'] = 'runner.wrapper.minimal' |
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.
Why is it runner.wrapper.minimal
here and ansible.runner.minimal
above?
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.
A goof.
I had meant to change everything to runner.wrapper
because being in the ansible
namespace carries with it a number of connotations which I do not wish to imply here.
ansible_runner/runner_config.py
Outdated
python_path = self.env.get('PYTHONPATH', os.getenv('PYTHONPATH', '')) | ||
if python_path and not python_path.endswith(':'): | ||
python_path += ':' | ||
self.env['ANSIBLE_CALLBACK_PLUGINS'] = ':'.join(filter(None,(self.env.get('ANSIBLE_CALLBACK_PLUGINS'), callback_dir))) |
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.
🎉
0a49392
to
351d76b
Compare
03e1880
to
eff4de3
Compare
if not self.containerized: | ||
collection_dir = self.env.get('AWX_LIB_DIRECTORY', os.getenv('AWX_LIB_DIRECTORY')) | ||
if collection_dir is None: | ||
collection_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], "lib") |
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.
This now shares some of the elements of #512
RUN dnf install -y python3-pip rsync openssh-clients sshpass glibc-langpack-en git \ | ||
https://github.com/krallin/tini/releases/download/v0.19.0/tini_0.19.0-amd64.rpm && \ | ||
rm -rf /var/cache/dnf | ||
|
||
RUN dnf install -y gcc python3-devel | ||
RUN pip3 install bindep https://github.com/ansible/ansible/archive/devel.tar.gz \ | ||
https://github.com/ansible/ansible-runner/archive/devel.tar.gz |
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.
@matburt I've updated this to work in the containerized world, and it's passing some cursory integration tests I've ran locally (requires building image, so CI isn't equipped to test that).
This line shows the outright removal of the ansible-runner
install. This is replaced by an ADD
layer above that adds the collection directory with the callback, plus adding psutil
directly.
The bigger picture is that we can package and vendor the collection separately. So ultimately, this could be handled in ansible-builder
so that instead of enumerating requirements of the base image, we can just say that the manifest of collections needs to include the runner collection in order to be usable by runner.
|
||
export ANSIBLE_STDOUT_CALLBACK=awx_display | ||
fi | ||
|
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.
@shanemcd this entrypoint stuff exists in order to ascertain the location of the ansible-runner
install and put them in the env vars needed for Ansible. This proposal makes that unnecessary by putting the collection in a location expected by Ansible, which is /usr/share/ansible/collections
, which is the same as ansible-builder
.
It's not just ANSIBLE_CALLBACK_PLUGINS
, it's also PYTHONPATH
that has historically been set and used this location. However, I think that may been erroneous because the system path change was done in the callback python code.
Move files to collection structure Hooked up collection path Remove stuff from tests Cleanup collection transition work, remove extra module fix ad hoc commands Set python path
eff4de3
to
aabdaa7
Compare
Replaced by #957 |
No description provided.