Merged
Conversation
f5d401f to
e9806ef
Compare
lucendio
approved these changes
Apr 1, 2021
Contributor
lucendio
left a comment
There was a problem hiding this comment.
LGTM but DH action for macos does not agree.
Contributor
Author
|
This fixes it locally but it's still broken in the dockerfile. I'll try to get that to work Tuesday first. |
dd0a560 to
8ec305b
Compare
17d14ea to
7f3be3b
Compare
Contributor
Author
|
I tested this with the following playbook: |
What we were doing before was way too complicated. Ansible itself doesn't have any dependency on boto to function. The _target host_ needs to have boto installed. By default the implicit localhost sets ansible_python_interpreter to ansible_playbook_python. This used to work but stopped working. (Or maybe it never worked?) The python that ansible runs the playbooks as cant find boto. I don't know what changed. Maybe how nix assembles python packages has changed. Instead, we configure ansible_python_interpreter to point to the environment we built with nix explicitly; which contains a python that has boto installed. This way boto can be found and the playbooks should succeed! We could use the same simplification in hegemony I think.
7f3be3b to
8612f08
Compare
lucendio
suggested changes
Apr 6, 2021
This resolves the complete path. Makes debugging a bit easier. And without this it didn't work on Gregor's machine (Reason still unclear to me)
lucendio
approved these changes
Apr 6, 2021
This was referenced Apr 9, 2021
Closed
arianvp
added a commit
that referenced
this pull request
Apr 16, 2021
* Fix ansible module dependencies
What we were doing before was way too complicated. Ansible itself
doesn't have any dependency on boto to function. The _target host_
needs to have boto installed.
By default the implicit localhost sets ansible_python_interpreter to
ansible_playbook_python. This used to work but stopped working. (Or
maybe it never worked?) The python that ansible runs the playbooks as
cant find boto. I don't know what changed. Maybe how nix assembles
python packages has changed.
Instead, we configure ansible_python_interpreter to point to the
environment we built with nix explicitly; which contains a python that
has boto installed.
This way boto can be found and the playbooks should succeed!
We could use the same simplification in hegemony I think.
* Use lookup('env')
This resolves the complete path. Makes debugging a bit easier. And
without this it didn't work on Gregor's machine (Reason still unclear to
me)
wpcarro
reviewed
Dec 15, 2022
| @@ -1,11 +1,13 @@ | |||
| env="$(nix-build $PWD/default.nix -A env --no-out-link)" | |||
| nix-build $PWD/default.nix -A env --out-link .nix-env | |||
There was a problem hiding this comment.
drive-by comment (feel free to ignore) this is a nice .envrc and Nix pattern :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What we were doing before was way too complicated. Ansible itself
doesn't have any dependency on boto to function. The target host
needs to have boto installed.
In our case the target host is 'localhost'. Ansible will by default
pick /usr/bin/python3 as the python interpreter ogit n target hosts but of
course we can't rely on that having boto installed.
Instead, we configure ansible_python_interpreter to point to the
environment we built with nix; which contains a python that has boto
installed.
This way boto can be found and the playbooks should succeed!