Skip to content

Instantly share code, notes, and snippets.

@bamthomas
Last active August 29, 2015 14:07
Show Gist options
  • Save bamthomas/a1e8a12915c51a4812b9 to your computer and use it in GitHub Desktop.
Save bamthomas/a1e8a12915c51a4812b9 to your computer and use it in GitHub Desktop.
Dev environment UTF-8 fr with bootstrap for ansible
#!/bin/bash
# -*- coding: UTF8 -*-
if [ ! -f /root/.ssh/id_rsa ]
then
sudo mkdir -p /root/.ssh
sudo -E cat << "EOF" > /root/.ssh/id_rsa
<private key here>
EOF
sudo -E cat << "EOF" > /root/.ssh/id_rsa.pub
ssh-rsa
<public key here>
EOF
sudo -E cat << "EOF" > /root/.ssh/known_hosts
<known hosts here>
EOF
chmod 600 /root/.ssh/*
fi
FROM ubuntu:14.04
RUN locale-gen fr_FR.UTF-8
ENV LANG fr_FR.UTF-8
ENV LANGUAGE fr:en
ENV LC_ALL fr_FR.UTF-8
RUN sed -i 's/# deb/deb/' /etc/apt/sources.list
RUN apt-get update && apt-get install -y openssh-server git
RUN mkdir /var/run/sshd
RUN echo 'root:passwd' | chpasswd
RUN sed --in-place=.bak 's/without-password/yes/' /etc/ssh/sshd_config
RUN apt-get install -y python-pip build-essential python-dev
RUN pip install ansible
ADD copie_cle_ssh.sh /tmp/
RUN chmod +x /tmp/copie_cle_ssh.sh
RUN /tmp/copie_cle_ssh.sh
RUN mkdir -p /var/lib/neko
RUN git archive [email protected]:neko/neko.git master ansible | tar xf - -C /var/lib/neko
RUN echo localhost > /var/lib/neko/ansible_hosts
RUN ansible-playbook -i /var/lib/neko/ansible_hosts /var/lib/neko/ansible/chroot.yaml
EXPOSE 22
CMD /usr/sbin/sshd -D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment