[openstack-dev] [ironic][bifrost] Unable to Enroll Inventory

Aimee Ukasick aimeeu.opensource at gmail.com
Thu Aug 3 22:09:10 UTC 2017


Thanks Mark for pointing me in the right direction! It turned out to
be a permissions issue with the local Ansible installation.

I started over with a new user (stack, passwordless sudo) and decided
to use the bifrost's env-setup script, which I was not able to run
unless prefaced with sudo.


stack at ubuntu-jumphost:~/bifrost$ sudo bash ./scripts/env-setup.sh

stack at ubuntu-jumphost:~/bifrost$ source env-vars

stack at ubuntu-jumphost:~/bifrost$ echo $PATH
/home/stack/.local/bin:/home/stack/bin:/home/stack/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

stack at ubuntu-jumphost:~/bifrost/playbooks$ which ansible
/home/stack/.local/bin/ansible
stack at ubuntu-jumphost:~/bifrost/playbooks$ ansible-playbook -vvvv -i
inventory/target install.yaml -e staging_drivers_include=true
Traceback (most recent call last):
  File "/home/stack/.local/bin/ansible-playbook", line 44, in <module>
    import ansible.constants as C
ImportError: No module named ansible.constants

stack at ubuntu-jumphost:~/bifrost/playbooks$ ansible --version
Traceback (most recent call last):
  File "/home/stack/.local/bin/ansible", line 44, in <module>
    import ansible.constants as C
ImportError: No module named ansible.constants

The ~/.local/bin/ansible folder was owned by root:root as was
~/.ansible. Once I changed the ownership to stack:stack, ansible
worked as expected. I was able to run the ansible-playbook command
without prefacing it with sudo. So I had a successful installation. Do
you know why the bifrost env-setup.sh installed ansible with root
ownership in my ~/.local directory? Is that the default Ansible
behavior?  Is the expectation that I switch to root to install/run
bifrost?


I was able to enroll my servers without a hitch.

Friday I plan to deploy - hopefully I've identified and fixed all the
kinks on my system.


Thanks again for your help!

aimee
irc:aimeeu



On Thu, Aug 3, 2017 at 3:27 AM, Mark Goddard <mark at stackhpc.com> wrote:
> Hi Aimee,
>
> My guess is that your error is due to your use of sudo when running
> ansible-playbook.



More information about the OpenStack-dev mailing list