-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #352 from cradle8810/341_jenkins_mirror
Jenins debファイルダウンロード用コンテナと、リバプロをdocker-composeで立てる
- Loading branch information
Showing
14 changed files
with
148 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
exclude_paths: | ||
- templates/ | ||
- .ansible-lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
cname: | ||
- name: jenkins-deb.hayaworld.home | ||
real: dockerservice.hayaworld.home |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,5 @@ roles: | |
|
||
collections: | ||
- name: ansible.posix | ||
- name: community.docker | ||
- name: community.general |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
- name: "Install docker python module" | ||
ansible.builtin.pip: | ||
name: "docker" | ||
break_system_packages: true | ||
extra_args: "--upgrade" | ||
|
||
- name: "Copy docker-compose.yml to homedir" | ||
ansible.builtin.copy: | ||
src: templates/dockerservice/home/hayato/compose | ||
dest: /home/hayato/ | ||
owner: hayato | ||
group: hayato | ||
directory_mode: '0755' | ||
mode: '0644' | ||
|
||
- name: "Create a reverse-proxy network" | ||
community.docker.docker_network: | ||
name: reverse-proxy | ||
|
||
- name: "Up Jenkins deb repository containers" | ||
community.docker.docker_compose_v2: | ||
project_src: "/home/hayato/compose/jenkins-deb/" | ||
|
||
- name: "Up Reverse Proxy containers" | ||
community.docker.docker_compose_v2: | ||
project_src: "/home/hayato/compose/reverseproxy/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"default-address-pools" : [ | ||
{ | ||
"base" : "{{ docker_network.base }}", | ||
"size" : {{ docker_network.size }} | ||
} | ||
] | ||
} |
18 changes: 18 additions & 0 deletions
18
templates/dockerservice/home/hayato/compose/jenkins-deb/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
services: | ||
jenkins-deb-container: | ||
container_name: jenkins-deb-container | ||
image: nginx:latest | ||
restart: always | ||
stdin_open: true | ||
tty: true | ||
networks: | ||
- reverse-proxy | ||
volumes: | ||
- jenkins_deb:/usr/share/nginx/html | ||
|
||
volumes: | ||
jenkins_deb: | ||
|
||
networks: | ||
reverse-proxy: | ||
external: true |
17 changes: 17 additions & 0 deletions
17
templates/dockerservice/home/hayato/compose/reverseproxy/docker-compose.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
reverseProxy: | ||
container_name: reverse-proxy | ||
image: nginx:latest | ||
restart: always | ||
stdin_open: true | ||
tty: true | ||
ports: | ||
- 80:80 | ||
volumes: | ||
- ./nginx.conf:/etc/nginx/nginx.conf:ro | ||
networks: | ||
- reverse-proxy | ||
|
||
networks: | ||
reverse-proxy: | ||
external: true |
34 changes: 34 additions & 0 deletions
34
templates/dockerservice/home/hayato/compose/reverseproxy/nginx.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
||
access_log /var/log/nginx/access.log main; | ||
|
||
sendfile on; | ||
keepalive_timeout 65; | ||
|
||
server { | ||
server_name jenkins-deb.hayaworld.home; | ||
proxy_set_header Host $host; | ||
listen 80; | ||
location / { | ||
proxy_pass http://jenkins-deb-container/; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% for item in cname %} | ||
cname={{ item.name }},{{ item.real }} | ||
{% endfor %} |