Skip to content

Commit

Permalink
add archlinux support
Browse files Browse the repository at this point in the history
  • Loading branch information
soapsurfer committed Sep 26, 2023
1 parent 65e36c1 commit 68bdc2e
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ This module supports:
* Ubuntu 18.04
* Ubuntu 20.04
* Ubuntu 22.04
* Archlinux
* Windows Server 2016 (Docker Enterprise Edition only)
* Windows Server 2019 (Docker Enterprise Edition only)
* Windows Server 2022 (Docker Enterprise Edition only)
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,8 @@
Boolean $have_systemd_v230 = $docker::params::have_systemd_v230,
) inherits docker::params {
if $facts['os']['family'] and ! $acknowledge_unsupported_os {
assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| {
fail('This module only works on Debian, Red Hat or Windows based systems.')
assert_type(Pattern[/^(Debian|RedHat|Archlinux|windows)$/], $facts['os']['family']) |$a, $b| {
fail('This module only works on Debian, Red Hat, Archlinux or Windows based systems.')
}
if ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') < 0) {
fail('This module only works on Red Hat based systems version 7 and higher.')
Expand Down
5 changes: 2 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
Array $dependent_packages = $docker::dependent_packages,
) {
$docker_start_command = $docker::docker_start_command

if $facts['os']['family'] and ! $docker::acknowledge_unsupported_os {
assert_type(Pattern[/^(Debian|RedHat|windows)$/], $facts['os']['family']) |$a, $b| {
fail('This module only works on Debian, RedHat or Windows.')
assert_type(Pattern[/^(Debian|RedHat|Archlinux|windows)$/], $facts['os']['family']) |$a, $b| {
fail('This module only works on Debian, RedHat, Archlinux or Windows.')
}
}
if $docker::version and $docker::ensure != 'absent' {
Expand Down
48 changes: 46 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
$version = undef
$ensure = present
$docker_ce_start_command = 'dockerd'
$docker_ce_package_name = 'docker-ce'
$docker_ce_cli_package_name = 'docker-ce-cli'
$docker_engine_start_command = 'docker daemon'
$docker_engine_package_name = 'docker-engine'
Expand Down Expand Up @@ -166,6 +165,7 @@
$storage_setup_file = undef
$use_upstream_package_source = true

$docker_ce_package_name = 'docker-ce'
$package_ce_source_location = "https://download.docker.com/linux/${os_lc}"
$package_ce_key_source = "https://download.docker.com/linux/${os_lc}/gpg"
$package_ce_key_id = '9DC858229FC7DD38854AE2D88D81803C0EBFCD88'
Expand Down Expand Up @@ -211,6 +211,7 @@

$apt_source_pin_level = undef
$detach_service_in_init = false
$docker_ce_package_name = 'docker-ce'
$package_ce_key_id = undef
$package_ce_key_source = 'https://download.docker.com/linux/centos/gpg'
$package_ce_release = undef
Expand Down Expand Up @@ -306,6 +307,7 @@
$service_hasstatus = undef
$service_hasrestart = undef
$service_provider = 'systemd'
$docker_ce_package_name = 'docker-ce'
$package_name = $docker_ce_package_name
$service_name = $service_name_default
$detach_service_in_init = true
Expand All @@ -318,6 +320,48 @@
$pin_upstream_package_source = undef
$apt_source_pin_level = undef
}
'Archlinux' : {
$docker_group = $docker_group_default
$socket_group = $socket_group_default
$package_key_source = undef
$package_key_check_source = undef
$package_source_location = undef
$package_key_id = undef
$package_repos = undef
$package_release = undef
$package_ce_key_source = undef
$package_ce_source_location = undef
$package_ce_key_id = undef
$package_ce_repos = undef
$package_ce_release = undef
$package_ee_source_location = undef
$package_ee_key_source = undef
$package_ee_key_id = undef
$package_ee_release = undef
$package_ee_repos = undef
$package_ee_package_name = undef
$use_upstream_package_source = false
$service_overrides_template = undef
$socket_overrides_template = undef
$socket_override = false
$service_after_override = 'docker/etc/systemd/system/docker.service.d/service-overrides-debian.conf.erb'
$service_hasstatus = true
$service_hasrestart = true
$service_provider = 'systemd'
$docker_ce_package_name = 'docker'
$package_name = $docker_ce_package_name
$service_name = $service_name_default
$detach_service_in_init = true
$repo_opt = undef
$nowarn_kernel = false
$service_config = undef
$storage_config = undef
$storage_setup_file = undef
$service_config_template = 'docker/etc/sysconfig/docker.systemd.erb'
$pin_upstream_package_source = undef
$apt_source_pin_level = undef
include docker::systemd_reload
}
default: {
$docker_group = $docker_group_default
$socket_group = $socket_group_default
Expand All @@ -338,7 +382,7 @@
$package_ee_release = undef
$package_ee_repos = undef
$package_ee_package_name = undef
$use_upstream_package_source = true
$use_upstream_package_source = false
$service_overrides_template = undef
$socket_overrides_template = undef
$socket_override = false
Expand Down
4 changes: 2 additions & 2 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@
Optional[Variant[String,Array]] $registry_mirror = $docker::registry_mirror,
String $root_dir_flag = $docker::root_dir_flag,
) {
unless $facts['os']['family'] =~ /(Debian|RedHat|windows)/ or $docker::acknowledge_unsupported_os {
fail('The docker::service class needs a Debian, Redhat or Windows based system.')
unless $facts['os']['family'] =~ /(Debian|RedHat|Archlinux|windows)/ or $::docker::acknowledge_unsupported_os {
fail('The docker::service class needs a Debian, Redhat, Archlinux or Windows based system.')
}

$dns_array = any2array($dns)
Expand Down
3 changes: 3 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"2019",
"2022"
]
},
{
"operatingsystem": "Archlinux"
}
],
"requirements": [
Expand Down

0 comments on commit 68bdc2e

Please sign in to comment.