Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arssher committed Sep 12, 2014
0 parents commit f5da4ad
Show file tree
Hide file tree
Showing 7 changed files with 1,108 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base_system
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:14.04
MAINTAINER Oleg Borisenko [email protected]

RUN apt-get update && apt-get install -y openssh-server && sed -i "s/Port 22/Port {{ ssh_port_to_expose }}/g" /etc/ssh/sshd_config && sed -i "s/UsePAM yes/UsePam no/g" /etc/ssh/sshd_config && echo "UseDNS no" >> /etc/ssh/sshd_config && service ssh restart
RUN mkdir /root/.ssh && chmod 0700 /root/.ssh/ && echo "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" >> /root/.ssh/authorized_keys
EXPOSE {{ ssh_port_to_expose }}
CMD ["/usr/sbin/sshd", "-D"]
5 changes: 5 additions & 0 deletions docker_containers_tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% for host in groups['docker-containers'] %}
{{ host }}
{% endfor %}

{{hostvars}}
26 changes: 26 additions & 0 deletions hosts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[all-hosts:children]
docker
ansible-master

[all-hosts:vars]
ssh_port_to_expose=2222

#n0x - real name of the host x; n0xhost - ansible alias for physical hosts
[docker-host-nodes]
#n01host ansible_ssh_port=22 ansible_ssh_host=n01
#n02host ansible_ssh_port=22 ansible_ssh_host=n02
#n03host ansible_ssh_port=22 ansible_ssh_host=n03
#n04host ansible_ssh_port=22 ansible_ssh_host=n04
#n05host ansible_ssh_port=22 ansible_ssh_host=n05
#n06host ansible_ssh_port=22 ansible_ssh_host=n06
lochost ansible_ssh_port=22 ansible_ssh_user=ars ansible_ssh_host=localhost

[docker-containers]
#locdock ansible_ssh_port="{{ ssh_port_to_expose }}" ansible_ssh_user=root host_key_checking=False ansible_ssh_host=localhost

[docker:children]
docker-host-nodes
docker-containers

[ansible-master]
localhost ansible_ssh_port=22
Loading

0 comments on commit f5da4ad

Please sign in to comment.