-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/registry drone roles #42
Open
PabloPie
wants to merge
22
commits into
master
Choose a base branch
from
feature/registry-drone-roles
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
2847a29
Rename caliopen cert and key to match naming
PabloPie a57645a
Install also the base *.caliopen.org cert
PabloPie dde0ff6
Add role for docker registry
PabloPie 1d4c868
Add base role for vms not connected to private vlan
PabloPie 3f0a2de
Role to install docker on machines that need it
PabloPie beca854
Add role for drone server
PabloPie 5a0cb4b
Nginx not running as a container the IP is needed
PabloPie 16bcf7a
Fix naming and end of files
PabloPie dba782f
Variable is now named caliopen_domain_base
PabloPie b24fa8b
VM should also be created...
PabloPie b6fe69c
nginx conf files do not need http directive
PabloPie bc0aebd
Upgrade machine on start
PabloPie 11db4ff
fix docker compose command
PabloPie 1a0ace9
Create auth directory
PabloPie f3926a4
add tag to skip monitoring tasks
PabloPie 1d040fa
Update caliopen certs
PabloPie 1d8d349
Password change
PabloPie 7d3551d
Getting the release codename from the machine allows more version fle…
PabloPie 7df4d75
Expose directly drone on port 8000 to avoid conflicts with nginx
PabloPie 8a3b7fa
Tags no longer needed
PabloPie 861f50d
add_header directive correction
PabloPie 7593456
Building applications needs more RAM and cpu
PabloPie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,7 @@ | ||
- hosts: registry | ||
roles: | ||
- common-no-vlan | ||
- docker | ||
- nginx | ||
- registry | ||
- drone |
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 @@ | ||
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5+2ViaP1ktWlzMCY4IOJOV1K0TH1GstHzoMdeIf9ihiSz7nR7wKcYJMC6KlmOYVQzftENXHQZAtbL4tVPLpLWXN+4fCn+pbQVu47P3QCH9Ez0d23p4byZl5h+qyx0dJv/ltc71X6NIvHH2WXmvvy+Bda4b1NVpJN/voiMoihipsjPPeL+s6B+3dw6PD3h5vvzvJCrfkKGijoT74+BbjYimwmNsaDRQH9tIMaTVeV7ZIe9qfxg5fkg4WsFl9mzikbqYzdBgiC2XeK/L4w3FJONALAEy7FTsUdNaenKxTn4zw/9qdV20TqYEyCbYlANS+2NMLYxeSqdpYB3yvePoucOw== [email protected] | ||
ssh-dss AAAAB3NzaC1kc3MAAACBAM686CNkUeMiHvr/1tj4zRaJMqAgZAFCuX6WmocNHleTLG2yWcQPAIXKONp++AJ78woEERCTB2otJSsP4Ur8q/K95UiPYmtRJ/wwTI4ojrCk4BmK9KK2hb0OONOL0SvX/sUZlddFtAZ2xnSFD6YC4gtANE1nnojo2/BOrgs9h13tAAAAFQCkqnmRZOK29LK8OPI+095IzI0YMQAAAIAf3BB/TX2mZWGtB9PivKybt+QPMx5YWA43jK6NippTIVq60ihvcnVKpAQDt0llZn4J5qoEgVHwELr+4F6vMz2HP3ZviQ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T1uxBzxWSA8UjyfJmYaJhllfe5Tjp2D1lUyXX2tX0QCMM1doHON/29wjBXxBgtP7i5focNAv6KP2suSuyFuIRpP3MuEyieQgyH0atL1FxNpQIrvnOrdiw609T4xfLTWfad+jjtIo3qq3Rvb7TpI9h0lBcgJEHPSjsapYenFPNCaRE+3oye37OtYdWaF9ozdHkRBDj8mp23bitJSwltYOhYZlVs8fVyBr30+z4tSwNMizl7DCrr+rJFBCRwoHUOLo82LuJf1ivQwu3mC77JJgWsiycMYnKPOamDwv pablo@pablo | ||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDTHau8idcljL+CRudl/i0HPzKbTxYk+qSJg26ql/K+BJF5uS360jYt9MW+C4qLSfYBtY0Ywcb7ePeO+1I/BjAdf6BtzxnNCYDnKptPMlkq9E0caMcDuuYFNG8BZQ6HcVmIbCns6aa0cXRGZcIBeHFAWfveocPdpcnTOXbFItV4ndFhm+KsCaJ9uQUxmJZMuUYoA/mmIgizddevh+bWMyN2/ntLhCvXucKti79sUoGVo5Ihk4KKXYxmZkWMJeY6y72TMeMx/KOJuoI5bkaLl/Y7oF8g7gzghmF56yI0uev83CyY1Mi+nF+qYqcjA9W9UVzx/xlkt3vhVyQ0C7hywoW1SPultSOr2ovtaEEFG16phOhWCNTwc1fUBwDv+UHHSgDjUQw1XBeMpTyW3d0Kys6bqvdisT9Z8n364BNDs2wC5VpctOLMyWXOt7stql56625fjMTGZYxD/+b4IvyW+qP9JRSjeeqb03PXoT+45V57s6UxJpIihjZSrEqJ1ZXAD0tLv3Fsj1KHNQi8da+P0ph33XeplCGPhRBohiL3obxWSDZ/WX0MaX4tgICqDHAkSGrDJkeF8dgNAtO2+m44oty6U/ztnuSKQGBXACxbpS+M8YfPFTyBkjrOtfqk0R/MgdG2gxvPyYPG3ody20QcYzTbG9LrtOReN58kPt4D/3Mp2w== [email protected] |
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,7 @@ | ||
- name: install ssh authorized keys | ||
copy: src=ssh_authorized_keys dest=/root/.ssh/authorized_keys mode=0600 | ||
tags: | ||
- ssh | ||
|
||
- name: upgrade packages | ||
shell: apt-get upgrade -y |
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,39 @@ | ||
- name: install dependencies | ||
apt: package={{ item }} state=installed update_cache=yes | ||
with_items: | ||
- apt-transport-https | ||
- curl | ||
- ca-certificates | ||
- gnupg2 | ||
- software-properties-common | ||
|
||
- name: add apt key | ||
apt_key: | ||
url: https://download.docker.com/linux/debian/gpg | ||
state: present | ||
|
||
- name: get codename | ||
shell: lsb_release -cs | ||
register: debian_codename | ||
|
||
- name: Add docker apt repo | ||
apt_repository: | ||
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ debian_codename.stdout }} stable" | ||
filename: docker | ||
state: present | ||
|
||
- name: install docker ce | ||
apt: package={{ item }} update_cache=yes | ||
with_items: | ||
- docker-ce | ||
|
||
- name: start docker | ||
service: | ||
name: docker | ||
state: restarted | ||
|
||
- name: install docker compose | ||
get_url: | ||
url: https://github.com/docker/compose/releases/download/1.22.0/docker-compose-Linux-x86_64 | ||
dest: /usr/local/bin/docker-compose | ||
mode: 0550 |
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,20 @@ | ||
- name: create drone directory | ||
file: | ||
path: "{{ drone_path }}" | ||
state: directory | ||
|
||
- name: copy compose file for registry server | ||
template: src=docker-compose.yml.j2 dest={{ drone_path }}/docker-compose.yml | ||
|
||
- name: start drone | ||
shell: docker-compose -f {{ drone_path }}/docker-compose.yml up -d | ||
|
||
- name: configure nginx vhost | ||
template: | ||
src: drone.nginx.j2 | ||
dest: /etc/nginx/sites-enabled/drone | ||
|
||
- name: restart service nginx | ||
service: | ||
name: nginx | ||
state: restarted |
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,33 @@ | ||
version: '2' | ||
|
||
services: | ||
|
||
drone-server: | ||
image: drone/drone | ||
ports: | ||
- 8000:8000 | ||
- 9000 | ||
volumes: | ||
- ./drone/:/var/lib/drone/ | ||
restart: always | ||
environment: | ||
- DRONE_OPEN=true | ||
- DRONE_HOST={{ DRONE_HOST }} | ||
- DRONE_GITHUB=true | ||
- DRONE_ORGS=CaliOpen | ||
- DRONE_GITHUB_CLIENT={{ DRONE_GITHUB_CLIENT }} | ||
- DRONE_GITHUB_SECRET={{ DRONE_GITHUB_SECRET }} | ||
- DRONE_SECRET={{ DRONE_SECRET }} | ||
- DRONE_ADMIN={{ DRONE_ADMIN }} | ||
|
||
drone-agent: | ||
image: drone/agent | ||
command: agent | ||
restart: always | ||
depends_on: | ||
- drone-server | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
environment: | ||
- DRONE_SERVER=drone-server:9000 | ||
- DRONE_SECRET={{ DRONE_SECRET }} |
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,29 @@ | ||
upstream drone { | ||
server 127.0.0.1:8000; | ||
} | ||
|
||
server { | ||
listen 443 ssl; | ||
listen [::]:443 ssl; | ||
server_name drone.{{ caliopen_domain_base }}; | ||
|
||
ssl_certificate /etc/nginx/certs/{{ caliopen_domain_base }}.crt; | ||
ssl_certificate_key /etc/nginx/certs/{{ caliopen_domain_base }}.key; | ||
ssl_prefer_server_ciphers On; | ||
ssl_protocols TLSv1.1 TLSv1.2; | ||
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS; | ||
ssl_session_cache shared:SSL:10m; | ||
|
||
location / { | ||
proxy_set_header X-Forwarded-For $remote_addr; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Host $http_host; | ||
|
||
proxy_pass http://drone; | ||
proxy_redirect off; | ||
proxy_http_version 1.1; | ||
proxy_buffering off; | ||
|
||
chunked_transfer_encoding off; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This role is useless at the moment, only needed for ssh keys, maybe in the future it will be of more use.