From 66bab8f8a58921dc8cc8ab13c620dd513c8b2cac Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 1 Mar 2026 21:32:46 +0000 Subject: [PATCH] Configure apt user directly using chef resources --- cookbooks/apt/recipes/repository.rb | 15 +++++++++++++-- roles/apt.rb | 10 ---------- test/data_bags/accounts/apt.json | 6 ------ 3 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 test/data_bags/accounts/apt.json diff --git a/cookbooks/apt/recipes/repository.rb b/cookbooks/apt/recipes/repository.rb index 04942a2c4..b38951e9c 100644 --- a/cookbooks/apt/recipes/repository.rb +++ b/cookbooks/apt/recipes/repository.rb @@ -17,8 +17,6 @@ # limitations under the License. # -node.default[:accounts][:users][:apt][:status] = :role - include_recipe "accounts" include_recipe "apache" @@ -28,6 +26,19 @@ repository_keys = data_bag_item("apt", "repository") gpg_passphrase = repository_keys["gpg_passphrase"] +group "apt" do + gid 531 +end + +user "apt" do + uid 531 + gid 531 + comment "apt.openstreetmap.org" + home "/srv/apt.openstreetmap.org" + shell "/usr/sbin/nologin" + manage_home false +end + template "/etc/aptly.conf" do source "aptly.conf.erb" owner "root" diff --git a/roles/apt.rb b/roles/apt.rb index f6e3c24bf..776aab4cd 100644 --- a/roles/apt.rb +++ b/roles/apt.rb @@ -1,16 +1,6 @@ name "apt" description "Role applied to APT repositories" -default_attributes( - :accounts => { - :users => { - :apt => { - :status => :role - } - } - } -) - run_list( "recipe[apt::repository]" ) diff --git a/test/data_bags/accounts/apt.json b/test/data_bags/accounts/apt.json deleted file mode 100644 index 2803c2266..000000000 --- a/test/data_bags/accounts/apt.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": "apt", - "uid": "530", - "comment": "apt.openstreetmap.org", - "home": "/srv/apt.openstreetmap.org" -} -- 2.39.5