Fix Gitea Actions runner not working with private host
This commit is contained in:
parent
03a02a19c4
commit
1afc860b21
@ -9,7 +9,7 @@
|
|||||||
"automatic": {
|
"automatic": {
|
||||||
"fqdn": "gitea-2",
|
"fqdn": "gitea-2",
|
||||||
"os": "linux",
|
"os": "linux",
|
||||||
"os_version": "5.4.0-1076-kvm",
|
"os_version": "5.4.0-1088-kvm",
|
||||||
"hostname": "gitea-2",
|
"hostname": "gitea-2",
|
||||||
"ipaddress": "192.168.122.189",
|
"ipaddress": "192.168.122.189",
|
||||||
"roles": [
|
"roles": [
|
||||||
|
@ -5,7 +5,7 @@ node.default["gitea"]["binary_checksum"] = "51e8d46a2634e5b5f4266eee8ca4689b5932
|
|||||||
node.default["gitea"]["working_directory"] = "/var/lib/gitea"
|
node.default["gitea"]["working_directory"] = "/var/lib/gitea"
|
||||||
node.default["gitea"]["port"] = 3000
|
node.default["gitea"]["port"] = 3000
|
||||||
node.default["gitea"]["postgresql_host"] = "localhost:5432"
|
node.default["gitea"]["postgresql_host"] = "localhost:5432"
|
||||||
node.default["gitea"]["nginx"]["domain"] = "gitea.kosmos.org"
|
node.default["gitea"]["domain"] = "gitea.kosmos.org"
|
||||||
|
|
||||||
node.default["gitea"]["config"] = {
|
node.default["gitea"]["config"] = {
|
||||||
"actions": {
|
"actions": {
|
||||||
|
@ -6,13 +6,7 @@
|
|||||||
working_directory = node["gitea"]["working_directory"]
|
working_directory = node["gitea"]["working_directory"]
|
||||||
gitea_credentials = data_bag_item("credentials", "gitea")
|
gitea_credentials = data_bag_item("credentials", "gitea")
|
||||||
runners = gitea_credentials["runners"]
|
runners = gitea_credentials["runners"]
|
||||||
|
gitea_host = "https://#{node["gitea"]["domain"]}"
|
||||||
begin
|
|
||||||
gitea_host = search(:node, "role:gitea").first["knife_zero"]["host"]
|
|
||||||
rescue
|
|
||||||
Chef::Log.warn('No server with "gitea" role. Stopping here.')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
apt_repository 'docker' do
|
apt_repository 'docker' do
|
||||||
uri 'https://download.docker.com/linux/ubuntu'
|
uri 'https://download.docker.com/linux/ubuntu'
|
||||||
@ -52,7 +46,7 @@ runners.each do |runner|
|
|||||||
code <<-EOF
|
code <<-EOF
|
||||||
act_runner register \
|
act_runner register \
|
||||||
--no-interactive \
|
--no-interactive \
|
||||||
--instance http://#{gitea_host}:#{node["gitea"]["port"]} \
|
--instance #{gitea_host} \
|
||||||
--name #{runner_name} \
|
--name #{runner_name} \
|
||||||
--token #{runner["token"]}
|
--token #{runner["token"]}
|
||||||
EOF
|
EOF
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
include_recipe "kosmos-nginx"
|
include_recipe "kosmos-nginx"
|
||||||
|
|
||||||
domain = node["gitea"]["nginx"]["domain"]
|
domain = node["gitea"]["domain"]
|
||||||
|
|
||||||
# upstream_ip_addresses = []
|
# upstream_ip_addresses = []
|
||||||
# search(:node, "role:gitea").each do |n|
|
# search(:node, "role:gitea").each do |n|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user