Skip to content

Commit

Permalink
Merge "[CE-393]Ansible agent container does not allow sudo"
Browse files Browse the repository at this point in the history
  • Loading branch information
tong li authored and Gerrit Code Review committed Jun 25, 2018
2 parents fb14496 + 589ea4c commit a8539c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docker/ansible-agent/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ ARG uid=1000
ARG gid=1000

RUN apt-get update && \
apt-get install -y bash curl python-dev sshpass \
apt-get install -y bash curl python-dev sshpass sudo \
python-pip build-essential openssh-client libffi-dev \
libssl-dev && \
libssl-dev && \
pip install --upgrade pip ansible boto boto3 shade \
pyyaml openshift && \
pyyaml && \
groupadd -g ${gid} ${user} && \
useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \
usermod -a -G root ${user} && \
echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \
mkdir -p /opt/agent/.ssh && \
cd /opt/agent/.ssh && \
echo "host *" > config && \
Expand Down
5 changes: 3 additions & 2 deletions dockerhub/latest/ansible-agent/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ ARG uid=1000
ARG gid=1000

RUN apt-get update && \
apt-get install -y bash sshpass python-pip openssh-client && \
apt-get install -y bash sshpass python-pip openssh-client sudo && \
pip install --upgrade pip ansible boto boto3 shade \
pyyaml openshift && \
pyyaml && \
groupadd -g ${gid} ${user} && \
useradd -d /opt/agent -u ${uid} -g ${user} ${user} && \
usermod -a -G root ${user} && \
echo "${user} ALL=(ALL) NOPASSWD: ALL"|tee /etc/sudoers.d/${user} && \
mkdir -p /opt/agent/.ssh && \
cd /opt/agent/.ssh && \
echo "host *" > config && \
Expand Down

0 comments on commit a8539c2

Please sign in to comment.