-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
60 lines (49 loc) · 1.54 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
FROM registry.redhat.io/ubi8/ubi:latest
LABEL maintainer="Steffen Froemer <[email protected]>"
USER root
ENV ANSIBLE_VERSION=2.9.14
# Silence annoying subscription messages.
RUN echo "enabled=0" >> /etc/yum/pluginconf.d/subscription-manager.conf
# Install requirements.
RUN yum makecache --timer \
&& yum -y install initscripts \
&& yum -y install \
sudo \
which \
hostname \
python3 \
python3-devel \
libcurl-devel \
openssl-devel \
libxml2-devel \
gcc \
# Install Ansible via Pip.
&& pip3 install ansible==${ANSIBLE_VERSION} \
# Install ovirt-engine-sdk-python using pip.
&& pip3 install ovirt-engine-sdk-python \
# Remove for runtime not required packages
&& yum -y remove \
python3-devel \
libcurl-devel \
openssl-devel \
libxml2-devel \
gcc \
&& yum clean all
# Disable requiretty.
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
# Install Ansible inventory file.
RUN mkdir -p /etc/ansible
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
ENV ANSIBLE_GATHERING smart
ENV ANSIBLE_HOST_KEY_CHECKING false
ENV ANSIBLE_RETRY_FILES_ENABLED false
ENV ANSIBLE_ROLES_PATH ~/.ansible/roles:/ansible/playbooks/roles
ENV ANSIBLE_SSH_PIPELINING True
ENV PYTHONPATH /ansible/lib
ENV PATH /ansible/bin:$PATH
ENV ANSIBLE_LIBRARY /ansible/library
# Install ansible collection ovirt.ovirt
RUN ansible-galaxy collection install ovirt.ovirt
RUN mkdir -p /ansible/playbooks
WORKDIR /ansible/playbooks
ENTRYPOINT ["ansible-playbook"]