redhat-openstack / tripleo-quickstart

Ansible roles for setting up TripleO virtual environments and building images
16 stars 15 forks source link

Need to set python_interpreter for roles other than rebuild_inventory #38

Closed larsks closed 8 years ago

larsks commented 8 years ago

When running...

quickstart.sh localhost

The deploy fails with:

TASK [setup/undercloud : Generate ssh configuration] ***************************
Sunday 13 March 2016  10:52:20 -0400 (0:00:00.038)       0:21:41.223 ********** 
fatal: [host0 -> localhost]: FAILED! => {"changed": true, "failed": true, "msg": "Aborting, target uses selinux but python bindings (libselinux-python) aren't installed!"}

We may want to set ansible_python_interpreter at a higher level...either by restoring the group_vars/all.yml file, or by just passing it on the ansible-playbook command line via -e.

larsks commented 8 years ago

Fixed proposed in https://review.gerrithub.io/#/c/266137/

halcyondude commented 8 years ago

The build image playbooks are never called from quickstart.sh.

This change restores the setting for build image playbook. https://review.gerrithub.io/266417

trown commented 8 years ago

I think it might be better to document that we need to pass that in globally if using anisble-playbook directly from a venv.

halcyondude commented 8 years ago

Either approach works...I (personally) favor "it just works" over "did you remember to set _____ per docs?" I also get that we don't want it cluttered throughout. {shrug}

larsks commented 8 years ago

It's not just a question of clutter. It's the maintenance issue of having to remember to put it in particular places anytime we have task that is delegated to localhost.

One alternative that I looked at earlier but didn't really pursue is dropping the setting in group_vars/all.yml, where it will be picked up as a default value as long as Ansible finds the group_vars directory. If we are always running from inside the tripleo-quickstart directory this is easy.

halcyondude commented 8 years ago

ahhhh i see. I didn't consider the localhost delegated task issue. The group_vars alternative is interesting. I'm still learning Ansible, is that something only accessible if found (it would be in localhost case...not so much for remote case)? Hrm...in the scenario where one is running either image building or quickstart...on the local host on purpose...that would be problematic. I see why a "doc it, use -e, and move along" makes sense now ;) Thanks for explaining!

larsks commented 8 years ago

I'm still learning Ansible, is that something only accessible if found (it would be in localhost case...not so much for remote case)?

Group variables, like playbooks, only need to exist on the host where you're running ansible. The group_vars and host_vars directories are located relative to the playbook you're running. And possibly also relative to your current CWD.

And just to be clear:

The issue is when we delegate a file: task (or related module) to localhost; the file module is what requires libselinux-python.

halcyondude commented 8 years ago

now the errors I was/am hitting make more sense. Thanks very much for taking the time to explain.

trown commented 8 years ago

https://github.com/redhat-openstack/tripleo-quickstart/commit/5a90503c9a76e51c8afc4caaa2a457c195621b58 resolves this for the quickstart case.