File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
- FROM centos:centos7
1
+ FROM registry.access.redhat.com/ubi8/ubi
2
+
3
+ ENV pip_packages "ansible"
2
4
3
5
ENV OC_CLIENT_MIRROR https://mirror.openshift.com/pub/openshift-v3/clients/3.11.115/linux/oc.tar.gz
4
- ENV ANSIBLE_RPM https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.8.0-1.el7.ans.noarch.rpm
5
- ENV INSTALL_PKGS "git"
6
+ ENV INSTALL_PKGS "git python3"
6
7
ENV WORK_DIR /openshift-applier
7
8
ENV HOME ${WORK_DIR}
8
9
ENV USER_UID 1001
9
10
10
11
USER root
11
12
12
- # Install Ansible and the 'oc' client
13
- RUN yum install -y $INSTALL_PKGS ;\
14
- yum install -y $ANSIBLE_RPM ;\
13
+ RUN yum -y install --disableplugin=subscription-manager $INSTALL_PKGS ;\
15
14
curl $OC_CLIENT_MIRROR | tar -C /usr/local/bin/ -xzf - ;\
16
- yum clean all ;\
15
+ yum --disableplugin=subscription-manager clean all ;\
17
16
rm -rf /var/cache/yum
18
17
18
+ # Install Ansible via Pip.
19
+ RUN pip3 install ansible
20
+
21
+ RUN mkdir -p /etc/ansible
22
+ RUN echo -e '[local]\n localhost ansible_connection=local' > /etc/ansible/hosts
23
+
19
24
COPY . ${WORK_DIR}
20
25
COPY images/openshift-applier/root /
21
26
RUN /usr/local/bin/user_setup_casl
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- DEFAULT_INV=$HOME /test/inventory
2
+ DEFAULT_INV=/etc/ansible
3
3
DEFAULT_PLAYBOOK=$HOME /playbooks/openshift-cluster-seed.yml
4
4
5
- cmd=" /usr/bin/ansible-playbook -i ${INVENTORY_PATH:- $DEFAULT_INV } ${PLAYBOOK:- $DEFAULT_PLAYBOOK } "
5
+ cmd=" /usr/local/bin/ansible-playbook -i ${INVENTORY_PATH:- $DEFAULT_INV } ${PLAYBOOK:- $DEFAULT_PLAYBOOK } "
6
+ echo " command: $cmd "
6
7
7
8
exec ${cmd}
You can’t perform that action at this time.
0 commit comments