Juniper / contrail-ansible-deployer

Ansible deployment for contrail
Apache License 2.0
60 stars 65 forks source link

Failure to deploy Redis (Yes, I've read the FAQ) #33

Open necr0n opened 6 years ago

necr0n commented 6 years ago

TASK [install_contrail : create /etc/contrail/redis] **************************************************************************** task path: /root/contrail-ansible-deployer/playbooks/roles/install_contrail/tasks/create_redis.yml:2 fatal: [192.168.0.xx]: FAILED! => { "msg": "The conditional check 'roles[instance_name].webui is defined or roles[instance_name].analytics is defined' failed. The error was: error while evaluating conditional (roles[instance_name].webui is defined or roles[instance_name].analytics is defined): 'dict object' has no attribute u'bms1'\n\nThe error appears to have been in '/root/contrail-ansible-deployer/playbooks/roles/install_contrail/tasks/create_redis.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: create /etc/contrail/redis\n ^ here\n"

[user@somewhere]# ansible --version ansible 2.4.2.0 config file = /home/user/contrail-ansible-deployer/ansible.cfg configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /bin/ansible python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

Resolution: This is caused by code incompatible with 2.5.1.0 version of Ansible. Please stick to ansible-2.4.2.0 to avoid this issue for now until we fix the code to work with the latest version of Ansible.

Uhm, what version do you recommend now?

P.S Docker, K8S, Kolla, hundreds of states + Ansible bugs - this is gonna be fun.

Andrey-mp commented 6 years ago

I would recommend to file bugs in launchpad https://bugs.launchpad.net/juniperopenstack/?orderby=-id&start=0 ) This tracker is not supported actively.

And it would be good to see your instances.yaml

necr0n commented 5 years ago

I first tried the suggested "easy way" ansible-playbook -i inventory/ -e orchestrator=kubernetes -e '{"instances":{"bms1":{"ip":"192.168.1.100","provider":"bms"}}}' playbooks/configure_instances.yml ansible-playbook -i inventory/ -e orchestrator=kubernetes -e '{"instances":{"bms1":{"ip":"192.168.1.100","provider":"bms"}}}' playbooks/install_contrail.yml ansible-playbook -i inventory/ -e orchestrator=kubernetes -e '{"instances":{"bms1":{"ip":"192.168.1.100","provider":"bms"}}}' playbooks/install_k8s.yml

By commenting out some conditionals, I progressed further until hitting docker-py/docker python incompatibility bug, which, as far as I remember was fixed by:

pip install --upgrade requests; pip install docker-compose; pip install --upgrade docker-compose; but still could not complete it.

Then I went on with orchestrator=openstack and was able to successfully deploy Contrail (even with Ansible=2.7.5). There are a couple of takes:

  1. These plays are not idempotent. I was hitting an error trying to run install_openstack for the second time, and task Creating admin project, user, role, service, and endpoint for Keystone failed. Solved it by stopping and deleting all containers with storage.
  2. Do not upgrade pip - this will break dependencies for python-openstackclient.

So, the original issue is still there - https://github.com/Juniper/contrail-ansible-deployer#quick-start-for-the-impatient-requires-a-centos7-instance