Skip to content

Commit d1fd60a

Browse files
authored
Python3 steps pr 1.x (#23)
* Fixing Dockerfile to install Ansible from pip. * Installing boto3 from pip. * Rogue 'i'. * Updating ansible path. * Wrong path. * Set Python3 as default on controller. * Adding Ansible galaxy var. * Setting the base container to use python3 as default.
1 parent 60c6612 commit d1fd60a

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

docker-images/base/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ RUN \
3636
openssh-server \
3737
postfix \
3838
procmail \
39-
python-apt \
40-
python-dev \
41-
python-pycurl \
39+
python3-apt \
40+
python3-dev \
41+
python3-pycurl \
4242
rsyslog \
4343
sudo \
4444
systemd \
@@ -47,6 +47,7 @@ RUN \
4747
vim \
4848
wget && \
4949
apt-get clean && \
50+
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
5051
rm -rf \
5152
/var/lib/apt/lists/* \
5253
/var/log/* \

docker-images/controller/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ FROM codeenigma/ce-dev-1.x:latest
33
RUN \
44
set -x && \
55
export DEBIAN_FRONTEND=noninteractive && \
6-
echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main' > /etc/apt/sources.list.d/ansible.list && \
7-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 && \
86
apt-get update && \
97
apt-get dist-upgrade -y -o Dpkg::Options::="--force-confnew" && \
108
apt-get install -y -o Dpkg::Options::="--force-confnew" \
11-
ansible \
12-
python-boto3 \
9+
python3-pip \
1310
git && \
1411
apt-get clean && \
12+
pip3 install ansible boto3 && \
13+
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
1514
rm -rf \
1615
/var/lib/apt/lists/* \
1716
/var/log/* \
@@ -25,13 +24,11 @@ COPY ./provision.yml /home/ce-dev/ce-provision/provision.yml
2524
RUN \
2625
set -x && \
2726
export DEBIAN_FRONTEND=noninteractive && \
28-
echo 'deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main' > /etc/apt/sources.list.d/ansible.list && \
29-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367 && \
3027
apt-get update && \
31-
su - ce-dev -c "/usr/bin/ansible-playbook /home/ce-dev/ce-provision/provision.yml" && \
28+
su - ce-dev -c "/usr/local/bin/ansible-playbook /home/ce-dev/ce-provision/provision.yml" && \
3229
rm /home/ce-dev/ce-provision/provision.yml && \
3330
apt-get clean && \
3431
rm -rf \
3532
/var/lib/apt/lists/* \
3633
/var/log/* \
37-
/tmp/*
34+
/tmp/*

docker-images/controller/provision.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
username: ce-dev
2626
local_dir: /home/ce-dev/ce-provision
2727
groups: []
28+
galaxy_custom_requirements_file: ""
2829
roles:
2930
- ce_provision
3031
- ce_deploy

0 commit comments

Comments
 (0)