hostconfig-operator/Dockerfile
Sreejith Punnapuzha 9d263d74ee Uplift base image for hostconfig-operator
* uplift ansible-operator image from v0.17.0 to v1.13.1
  * add cleanup for dnf cache
  * copy callback plugin to correct ansible path
  * update python version in inventory and filters
  * update inventory variables and annotations to align with
    ansible-operator greater than v1.0

Signed-off-by: Sreejith Punnapuzha <Sreejith.Punnapuzha@outlook.com>
Change-Id: I0aa5b17fec91d589d1dce0e76f1de3ed07b002f8
2021-10-29 14:41:31 +00:00

50 lines
2.3 KiB
Docker

# Ansible Operator base image
FROM quay.io/operator-framework/ansible-operator:v1.13.1
# Installing dependency libraries
COPY airship-host-config/requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
&& chmod -R ug+rwx ${HOME}/.ansible
# Installing ssh clients - used to connect to kubernetes nodes
USER root
RUN rpm -ivh https://archives.fedoraproject.org/pub/archive/epel/6/x86_64/epel-release-6-8.noarch.rpm
RUN dnf install dbus libnghttp2 python3-librepo dbus-libs librepo dbus-daemon \
gnutls dbus-common dbus-tools systemd python3-libxml2 cryptsetup-libs libssh \
libarchive cyrus-sasl-lib curl openssl-libs platform-python glibc systemd-pam \
platform-python-pip python3-pip libcom_err gnupg2 vim-minimal libstdc++ \
python3-libs systemd-libs libssh-config glib2 python3-pip-wheel libsolv \
gdb-gdbserver sqlite-libs libgcrypt libgcc pcre2 glibc-common expat libxml2 \
libcurl glibc-minimal-langpack libpcap openssh-clients sshpass -y \
&& dnf clean all && rm -rf /var/cache/yum
USER ansible
# Configuration for ansible
COPY airship-host-config/build/ansible.cfg /etc/ansible/ansible.cfg
# CRD entrypoint definition YAML file
COPY airship-host-config/watches.yaml ${HOME}/watches.yaml
# Copying the configuration roles
COPY airship-host-config/roles/ ${HOME}/roles/
# Copying the entry-point playbook
COPY airship-host-config/playbooks/ ${HOME}/playbooks/
# Copying inventory - used to build the kubernetes nodes dynamically
COPY airship-host-config/inventory/ ${HOME}/inventory/
# Copying filter and callback plugins used for computation
COPY airship-host-config/plugins/ ${HOME}/plugins/
# ansible-runner unable to pick custom callback plugins specified in any other directory other than /usr/local/lib/python3.6/site-packages/ansible/plugins/callback
# ansible-runner is overriding the ANSIBLE_CALLBACK_PLUGINS Environment variable
# https://github.com/ansible/ansible-runner/blob/stable/1.3.x/ansible_runner/runner_config.py#L178
COPY airship-host-config/plugins/callback/hostconfig_k8_cr_status.py /usr/local/lib/python3.8/site-packages/ansible/plugins/callback/
# Copying scripts folder used by exec configuration
COPY airship-host-config/scripts/ ${HOME}/scripts/
# Intializing ssh folder
RUN mkdir ${HOME}/.ssh