Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Harbor
Manage
Activity
Members
Labels
Plan
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
Ansible
Playbooks
Harbor
Commits
4aa51d7e
Verified
Commit
4aa51d7e
authored
3 years ago
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
Update harbor playbook, add auto retry when docker fails, update k8s iptables rule
parent
ad5cb53f
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
ansible/main/tasks/harbor.yaml
+12
-5
12 additions, 5 deletions
ansible/main/tasks/harbor.yaml
ansible/main/templates/etc/iptables/rules.v4.j2
+2
-2
2 additions, 2 deletions
ansible/main/templates/etc/iptables/rules.v4.j2
ansible/main/vars/harbor.yaml
+1
-1
1 addition, 1 deletion
ansible/main/vars/harbor.yaml
with
15 additions
and
8 deletions
ansible/main/tasks/harbor.yaml
+
12
−
5
View file @
4aa51d7e
...
@@ -22,12 +22,21 @@
...
@@ -22,12 +22,21 @@
src
:
home/user/harbor/harbor.yml.j2
src
:
home/user/harbor/harbor.yml.j2
dest
:
/home/{{ user }}/harbor/harbor.yml
dest
:
/home/{{ user }}/harbor/harbor.yml
-
name
:
Setup harbor (You might need to restart the docker service manually!)
-
name
:
Setup harbor
become
:
yes
shell
:
"
/home/{{
user
}}/harbor/install.sh"
shell
:
"
/home/{{
user
}}/harbor/install.sh"
register
:
install_command
-
name
:
Restart docker daemon on harbor setup failure
systemd
:
name
:
docker
state
:
restarted
when
:
install_command.rc !=
0
-
name
:
Setup harbor again (Retry after docker daemon restart)
shell
:
"
/home/{{
user
}}/harbor/install.sh"
when
:
install_command.rc !=
0
-
name
:
Add service to start harbor on startup
-
name
:
Add service to start harbor on startup
become
:
yes
template
:
template
:
src
:
etc/systemd/system/harbor-docker-compose.service
src
:
etc/systemd/system/harbor-docker-compose.service
dest
:
/etc/systemd/system/harbor-docker-compose.service
dest
:
/etc/systemd/system/harbor-docker-compose.service
...
@@ -37,13 +46,11 @@
...
@@ -37,13 +46,11 @@
register
:
service_conf
register
:
service_conf
-
name
:
System daemon-reload on service file change
-
name
:
System daemon-reload on service file change
become
:
yes
systemd
:
systemd
:
daemon-reload
:
yes
daemon-reload
:
yes
when
:
service_conf.changed
when
:
service_conf.changed
-
name
:
Ensure harbor service is enabled
-
name
:
Ensure harbor service is enabled
become
:
yes
systemd
:
systemd
:
name
:
harbor-docker-compose.service
name
:
harbor-docker-compose.service
enabled
:
yes
enabled
:
yes
This diff is collapsed.
Click to expand it.
ansible/main/templates/etc/iptables/rules.v4.j2
+
2
−
2
View file @
4aa51d7e
...
@@ -14,11 +14,11 @@
...
@@ -14,11 +14,11 @@
-A INPUT -i lo -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -p tcp -m tcp --dport {{ base_ssh.port }} --src 152.66.0.0/8,
192.168.0.0/16,
10.0.0.0/8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport {{ base_ssh.port }} --src 152.66.0.0/8,10.0.0.0/8 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
# Accept from the Kubernetes cluster
# Accept from the Kubernetes cluster
-A INPUT -p tcp -m tcp --dport 9100 --src 1
92.168.101
.0/
24
-j ACCEPT
-A INPUT -p tcp -m tcp --dport 9100 --src 1
0.44.0
.0/
16
-j ACCEPT
-A INPUT -j DROP
-A INPUT -j DROP
...
...
This diff is collapsed.
Click to expand it.
ansible/main/vars/harbor.yaml
+
1
−
1
View file @
4aa51d7e
...
@@ -42,7 +42,7 @@ iptables_rules_v6_file: etc/iptables/rules.v6.j2
...
@@ -42,7 +42,7 @@ iptables_rules_v6_file: etc/iptables/rules.v6.j2
user
:
harbor
user
:
harbor
harbor_hostname
:
harbor.sch.bme.hu
harbor_hostname
:
harbor.sch.bme.hu
acme_email
:
laszlo.rafael@kszk
.bme.hu
acme_email
:
k8sadmin@sch
.bme.hu
sites
:
sites
:
-
name
:
harbor.sch.bme.hu
-
name
:
harbor.sch.bme.hu
proxy_to
:
http://localhost:8080
proxy_to
:
http://localhost:8080
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment