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

Mark Goddard mark at stackhpc.com
Thu Aug 3 08:27:50 UTC 2017


Hi Aimee,

My guess is that your error is due to your use of sudo when running
ansible-playbook. Without passing '-E' to sudo, the calling user's
environment will be lost, including $BIFROST_INVENTORY_SOURCE. You
shouldn't need to run ansible using sudo, it has its own mechanisms[1] for
obtaining superuser privileges. I'd suggest trying to get it to work
without sudo.

[1]
https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwiFt4-50rrVAhVDDcAKHbggDR0QFggpMAA&url=http%3A%2F%2Fdocs.ansible.com%2Fbecome.html&usg=AFQjCNHPX27H9cPC6KUoYmVunC5GBa2FdA

Cheers,
Mark

On 2 August 2017 at 23:40, Aimee Ukasick <aimeeu.opensource at gmail.com>
wrote:

> Hi Bifrost Gurus!  I'm following the Brifost docs and am stuck trying
> to enroll inventory.
> I have only a passing familiarity with ansible,ironic, and python,
> which puts me firmly in the "complete ignoramous" category.
>
> OS: Ubuntu 16.04.2 LTS desktop (fresh install)
> Sudo User: bifrost
> Ansibile: 2.3.1.0
> Python: 2.7.12
> pip 9.0.1
> bifrost: cloned from master on 2 Aug 2017
>
> 1. modified the files in bifrost/playbooks/inventory/group_vars
> --  network_interface, mysql_password, dnsmasq_router, and
> dnsmasq_dns_servers
> 2. install reqs:  sudo pip install -r requirements.txt
> 3. run installation playbook: sudo ansible-playbook -K -vvvv -i
> inventory/target install.yaml
> 4. source env-vars
> 5. ironic node-list to check ironic installation
> 6. created baremetal.yml and baremetal.json based on the examples
> 7. export BIFROST_INVENTORY_SOURCE=/home/bifrost/osgit/baremetal.json
> 8. sudo ansible-playbook -K -vvvv -i inventory/bifrost_inventory.py
> enroll-dynamic.yaml
>
> #8 threw this error:
> ERROR! Attempted to execute "inventory/bifrost_inventory.py" as
> inventory script:
> Inventory script (inventory/bifrost_inventory.py) had an execution error:
>
> No error was printed out and I couldn't find any logs, so I hopped onto
> IRC.
> TheJulia suggested passing the environment variable and directly
> executing the script to troubleshoot.
>
> So after looking at the code, I executed bifrost/inventory.py and
> saved the output in baremetal2.json.
> Then export BIFROST_INVENTORY_SOURCE=/home/bifrost/osgit/baremetal2.json
> Then sudo ansible-playbook -K -vvvv -i inventory/bifrost_inventory.py
> enroll-dynamic.yaml
> Same error as above.
>
> Then:
> sudo ansible-playbook -K -vvvv -i /home/bifrost/osgit/baremetal2.json
> enroll-dynamic.yaml
> which threw:
> ERROR! Attempted to read "/home/bifrost/osgit/baremetal2.json" as YAML:
> list indices must be integers, not unicode
> Attempted to read "/home/bifrost/osgit/baremetal2.json" as ini file:
>  /home/bifrost/osgit/baremetal2.json:2: Expected key=value host
> variable assignment, got: {
>
> Then:
> sudo ansible-playbook -K -vvvv -i /home/bifrost/osgit/baremetal.yml
> enroll-dynamic.yaml
> which provided this output:
>  [WARNING]: provided hosts list is empty, only localhost is available
> Loading callback plugin default of type stdout, v2.0 from
> /usr/lib/python2.7/dist-packages/ansible/plugins/callback/__init__.pyc
> PLAYBOOK: enroll-dynamic.yaml
> ************************************************************
> ****************************
> 1 plays in enroll-dynamic.yaml
> PLAY [Enroll hardware from inventory into Ironic]
> ********************************************************************
> skipping: no hosts matched
> PLAY RECAP ****************
>
>
>
> The issues I'm having must be user error, so I'd appreciate extra sets
> of eyes and suggestions.
> YAML, JSON, and terminal output: http://paste.openstack.org/show/617344/
>
> I'm prototyping  using a NUC and 2 Super Micro servers with the goal of
> using
> bifrost and ansible to manage the server lab that somehow landed in my lap.
>
> Thanks in advance for any help you can give me!
>
> Aimee Ukasick
> IRC: aimeeu
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20170803/e2c0d436/attachment-0001.html>


More information about the OpenStack-dev mailing list