Skip to content

Commit

Permalink
Remove owner/group parameters as it's causing issues
Browse files Browse the repository at this point in the history
I'm running into an issue when running as a non-root user so disabling it for
now.

Signed-off-by: Lance Albertson <lance@osuosl.org>
  • Loading branch information
ramereth committed Sep 28, 2020
1 parent d8d2e91 commit 59c6b89
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This file is used to list changes made in each version of the htpasswd cookbook.
- Support for 'plaintext' type [\#32](https://github.com/sous-chefs/htpasswd/pull/32)
- Adoption by Sous-Chefs [\#40](https://github.com/sous-chefs/htpasswd/pull/40)
- Add delete and overwrite test-kitchen suites
- Add owner, group and mode parameters for file
- Add mode parameters for file

### Changed

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ This cookbook requires Chef Infra >= 14.
- :password: Password for the user
- :type: Password algorithm to use. Valid options are: "md5", "bcrypt", "sha1", "plaintext", or "crypt". Default is
"md5"
- :owner: User which owns the file. Default is `root`.
- :group: Group which owns the file. Default is `root`.
- :mode: File mode for the file. Default is `0640`.

### Example
Expand Down
4 changes: 2 additions & 2 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ module Helpers

def fix_perms(new_resource)
file new_resource.name do
owner new_resource.owner
group new_resource.group
# owner new_resource.owner
# group new_resource.group
mode new_resource.mode
end
end
Expand Down
4 changes: 2 additions & 2 deletions resources/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
property :type, String,
equal_to: %w(md5 bcrypt sha1 plaintext crypt),
default: 'md5'
property :owner, String, default: 'root'
property :group, String, default: 'root'
# property :owner, String, default: 'root'
# property :group, String, default: 'root'
property :mode, String, default: '0640'

action :add do
Expand Down
8 changes: 8 additions & 0 deletions spec/unit/recipes/default_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'spec_helper'

describe 'htpasswd::default' do
platform 'ubuntu'

it { is_expected.to install_build_essential('htpasswd').with(compile_time: true) }
it { is_expected.to install_chef_gem('htauth').with(compile_time: true) }
end
2 changes: 2 additions & 0 deletions test/cookbooks/test/recipes/delete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
htpasswd file do
user 'admin'
password 'admin'
mode '0644'
end

htpasswd file do
user 'admin'
action :delete
mode '0644'
end

0 comments on commit 59c6b89

Please sign in to comment.