Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
azure_pipelines::agent::package_src: 'https://vstsagentpackage.azureedge.net/agent/2.144.0/vsts-agent-linux-x64-2.144.0.tar.gz'
azure_pipelines::agent::package_sha512: 'a0064b23bca664112debb08bbf9cbb0f394c66931c7c3fdc7f21d0c9ceb51cf1db75c74f1e5fe5ae454d2df1e035d878c35a4cf7139b9f2a0a80a70a98fa8f5b'
azure_pipelines::agent::package_src: 'https://vstsagentpackage.azureedge.net/agent/2.166.4/vsts-agent-linux-x64-2.166.4.tar.gz'
azure_pipelines::agent::package_sha512: '45125e6ad2f7f4fd94a7dea936f2e87de2b623e0e2b250a9715f1ace9eb57aaed788fba17b80d4ee4037770223cacece48a4af596abc47db625c28a3efc7937a'
azure_pipelines::agent::archive_name: 'agent.tar.gz'
azure_pipelines::agent::config_script: 'config.sh'
12 changes: 10 additions & 2 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@
fail('Deployment group name and project name must be set if deployment group mode is enabled')
}

if ($facts['kernel'] == 'Linux' and $run_as_service) {
# If these contain dashes (and possibly other chars), svc.sh will systemd-escape them to backslashes
# and the actual resulting service unit name will not match what this class expects.
validate_re($instance_name, '^[^-]*$', "instance_name cannot contain dashes")
validate_re($pool, '^[^-]*$', "pool cannot contain dashes")
validate_re($agent_name, '^[^-]*$', "agent_name cannot contain dashes")
}

$proxy_server = $proxy_host ? {
undef => undef,
default => "${proxy_proto}://${proxy_user}:${proxy_password}@${proxy_host}:${proxy_port}"
Expand Down Expand Up @@ -356,13 +364,13 @@
}
if $facts['kernel'] == 'Linux' and $run_as_service {
exec {"${install_path}/svc.sh install ${service_user}":
creates => "/etc/systemd/system/vsts.agent.${instance_name}.${agent_name}.service",
creates => "/etc/systemd/system/vsts.agent.${instance_name}.${pool}.${agent_name}.service",
user => 'root',
cwd => $install_path,
require => Exec["${install_path}/${config_script}"],
}
if $manage_service {
service {"vsts.agent.${instance_name}.${agent_name}.service":
service {"vsts.agent.${instance_name}.${pool}.${agent_name}.service":
ensure => 'running',
require => Exec["${install_path}/svc.sh install ${service_user}"],
}
Expand Down