sassoftware / sas-container-recipes

A collection of recipes and other resources for building containers that include SAS Viya software.
https://www.sas.com
Apache License 2.0
89 stars 42 forks source link

Ansible is not being installed for Centos:7 based microservice images #42

Open zsoltburger opened 4 years ago

zsoltburger commented 4 years ago

I am running a full build and it stops with:

2020/05/03 14:27:29 casservices:19.06.1-20200503142552-c96ed66 container build [ERROR] casservices: map[code:127 message:The command '/bin/sh -c ansible-playbook -vv /ansible/playbook.yml --extra-vars layer=ansible --extra-vars PLAYBOOK_SRV=${PLAYBOOK_SRV} --extra-vars container_name=casservices' returned a non-zero code: 127]

Debugging: builds/full-2020-05-03-14-26-09/sas-viya-casservices/log.txt

If I check the log it says:

[container.go:403] &{Step 1/21 : FROM centos:7  <nil>}
...
[container.go:403] &{Step 7/21 : RUN if [ "$PLATFORM" = "redhat" ]; then         yum install --assumeyes ansible;               rm -rf /root/.cache /var/cache/yum;             echo -e "minrate=1" >> /etc/yum.conf;           echo -e "timeout=300" >> /etc/yum.conf;     elif [ "$PLATFORM" = "suse" ]; then         zypper install --no-confirm ansible curl && rm -rf /var/cache/zypp;     else            echo -e "Platform $PLATFORM not supported";             exit 1;     fi  <nil>}
[container.go:403] &{  <nil>}
[container.go:403] &{---> Using cache  <nil>}
[container.go:403] &{---> 8225643878b4  <nil>}
...
[container.go:403] &{ESC[91m/bin/sh: ansible-playbook: command not found

Having a look at the container, it seems the ansible is not installed.

As a workaround, I added yum install --assumeyes epel-release;\ before yum install --assumeyes ansible; \ in container.go.

After that, the build went on.

hskiba commented 4 years ago

I ran into this issue as well... I ended up using a different Docker base image with EPEL installed that I created.