-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
community.general.lxd connection not working with molecule #4886
Comments
Files identified in the description: If these files are incorrect, please update the |
!component =plugins/connection/lxd.py |
Files identified in the description: If these files are incorrect, please update the |
Thanks for the analysis! Would you mind creating a PR for this? (Please add a changelog fragment when creating a PR.) |
remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894
* fixes lxd connection plugin issue #4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de>
* fixes lxd connection plugin issue #4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 905f9ec)
* fixes lxd connection plugin issue #4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 905f9ec)
* fixes lxd connection plugin issue #4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 905f9ec) Co-authored-by: antonc42 <antonc42@users.noreply.github.com>
* fixes lxd connection plugin issue #4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de> (cherry picked from commit 905f9ec) Co-authored-by: antonc42 <antonc42@users.noreply.github.com>
* fixes lxd connection plugin issue ansible-collections#4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de>
* fixes lxd connection plugin issue ansible-collections#4886 remote_addr value was set to literal string 'inventory_hostname' instead of the value for inventory_hostname variable. solution found in PR ansible/ansible#77894 * changelog fragment - bugfix - lxd connection plugin * correct changelog fragment * Update changelogs/fragments/4886-fix-lxd-inventory-hostname.yml Co-authored-by: Felix Fontein <felix@fontein.de> * replace _host instance variable with calls to get 'remote_addr' option suggested by felixfontein Co-authored-by: Felix Fontein <felix@fontein.de>
Summary
When I try to run
molecule create
with the lxd driver, it creates the lxc container correctly, but then gives a warning and then fails to run a command on the container.After some debugging, I found that the
remote_addr
value was being set to the literal string 'inventory_hostname' instead of the value of the current host'sinventory_hostname
. I found another connection plugin that had fixed a similar issue.Applying this patch to the
plugins/connection/lxd.py
file fixes the problem.fix_lxd_inventory_hostname.patch.txt
Issue Type
Bug Report
Component Name
plugins/connection/lxd.py
Ansible Version
Community.general Version
Configuration
$ ansible-config dump --only-changed
OS / Environment
cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
Steps to Reproduce
Modify
molecule/default/molecule.yml
:$ molecule create
Expected Results
I expected that the lxd container would be properly created and prepared.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: