Build an OOD image to see if the build succeeds and the ansible roles run to completion. Ansible code we run will be pristine production code pointing to HEAD of the uab-prod branch. We need to create a new playbook for the new target/deploy model (i.e. cloud-node). After a successful build we will have an image when brought up that is close to production. This is a precursor to the future builds that would be having new features from upstream.
We were having issue connecting via ssh for ansible provisioning.
Though we were able to make an ssh connection for packer build instance, ansible provisioning step would error out with permission denied
We were able to connect to the target from the build host via ansible’s ssh by
providing remote-user to ansible and a private key file to use. They were being set to None and ansible-keyxxxxxxxxx previously i.e. it was using a temp keypair generated while the remote user was set to None by default.
Packer was able to auth using the keypair we specified, but ansible was trying to use the temp keypair it generated contrary to our assumption that it would use the same ssh bits implicitly for auth. We had to tell it to use the keypair we provided for ssh communicator in the ansible provisioner section directly.
The role ood was errored out as it could not satisfy installing the dependency lua-posix which is part of epel-release. This task is part of the prep_ood which we don't run here. It is part of the playbook targeted for ohpc based dev cluster.
openstack.image: TASK [ood_shib_config : Install require package] ******************************* openstack.image: fatal: [ood]: FAILED! => changed=false openstack.image: msg: Unable to find any of pip2, pip to use. pip needs to be installed. openstack.image: openstack.image: PLAY RECAP ********************************************************************* openstack.image: ood : ok=29 changed=27 unreachable=0 failed=1 skipped=1 rescued=0 ignored=0
Description:
aws_s3 module in ansible is used to download shib config tar from s3. This module has a dependency on boto3 pkg. boto3 is a Python3 only package.
Solution:
Need pip3 and Python3 to install boto3.
boto3 pkg install still fails after fixing above issue as it can't find the pip3 executable.
Solution:
point the task to pip3 executable.
As the ansible module to download the shib config tar is inherently dependent on Python3, we need to set the task to use a Python3 interpreter.
Solution:
Set the interpreter at task level to point to Python3.
NOTE: This wouldn't work if we set it globally in /etc/ansible/ansible.cfg because it would break yum installs in all the previous tasks and roles in the playbook because ansible uses Python2.X under the hood for yum module. So the yum install from the first solution would also break.
Error:
The role ood_uab_ui fails with an error: variable app_name is undefined.
Description:
The var app_name was defined in a task and it was used in a different task afterwards, so the scope of the var ends in the task it is defined. Since the scope of it wasn't defined at a role level (i.e at the start of the role) rather just the task, it considers the variable as undefined.