diff --git a/bifrost/cli.py b/bifrost/cli.py index d7b2a7c09..56b79634f 100644 --- a/bifrost/cli.py +++ b/bifrost/cli.py @@ -26,7 +26,6 @@ COMMON_ENV = { 'VENV': VENV, } COMMON_PARAMS = [ - '-e', 'ansible_python_interpreter=%s/bin/python3' % VENV, '-e', 'bifrost_venv_dir=%s' % VENV, ] BASE = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..')) diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index 386bac833..23b35c834 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -279,6 +279,10 @@ before calling ``env-setup.sh``:: If you're using the ansible playbooks directly (without the helper scripts), set the ``bifrost_venv_dir`` variables accordingly. +.. note:: + Because of Ansible dependencies Bifrost only supports virtual environments + created with ``--system-site-packages``. + Pre-installation settings ========================= diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml index cfc0b74cb..38f888592 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/main.yml @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. --- -# NOTE(hwoarang) The 'apt' module needs python-apt installed in the virtualenv -# but it's not possible to do that. See https://github.com/ansible/ansible/issues/14468 -# python-apt only works if it's installed on the local system so we need to switch the -# Ansible python interpreter. - name: "Update apt cache if Ubuntu/Debian" apt: update_cache: yes when: ansible_os_family == "Debian" - vars: - ansible_python_interpreter: '/usr/bin/python3' - name: "Load distribution defaults" include_vars: "{{ item }}" @@ -36,16 +30,10 @@ - "../defaults/required_defaults_{{ ansible_distribution }}_{{ ansible_distribution_version }}.yml" - "../defaults/dummy-defaults.yml" -# NOTE(hwoarang) The 'apt' module needs python-apt installed in the virtualenv -# but it's not possible to do that. See https://github.com/ansible/ansible/issues/14468 -# python-apt only works if it's installed on the local system so we need to switch the -# Ansible python interpreter. - name: "Install required packages" package: name: "{{ required_packages }}" state: present - vars: - ansible_python_interpreter: '/usr/bin/python3' - name: ensure installation root folder exists become: yes diff --git a/releasenotes/notes/interpreter-a6cd3a98e9cd239f.yaml b/releasenotes/notes/interpreter-a6cd3a98e9cd239f.yaml new file mode 100644 index 000000000..5d6224bb7 --- /dev/null +++ b/releasenotes/notes/interpreter-a6cd3a98e9cd239f.yaml @@ -0,0 +1,5 @@ +--- +issues: + - | + Because of Ansible dependencies Bifrost only works on virtual environments + created with ``--system-site-packages``. diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index f4e32e83a..487bd8dda 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -163,7 +163,6 @@ export BIFROST_INVENTORY_SOURCE=${BAREMETAL_DATA_FILE} ${ANSIBLE} -vvvv \ -i inventory/bifrost_inventory.py \ ${TEST_PLAYBOOK} \ - -e ansible_python_interpreter="${ANSIBLE_PYTHON_INTERP}" \ -e use_cirros=${USE_CIRROS} \ -e testing_user=${TESTING_USER} \ -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \