diff --git a/lib/itamae/resource/user.rb b/lib/itamae/resource/user.rb index 6637d7cd..75f6f75a 100644 --- a/lib/itamae/resource/user.rb +++ b/lib/itamae/resource/user.rb @@ -6,6 +6,7 @@ class User < Base define_attribute :gid, type: [Integer, String] define_attribute :home, type: String define_attribute :password, type: String + define_attribute :sensitive, default: false define_attribute :system_user, type: [TrueClass, FalseClass] define_attribute :uid, type: Integer define_attribute :shell, type: String @@ -35,6 +36,16 @@ def set_current_attributes end end + def show_differences + saved_password = @current_attributes[:password] + saved_attr_password = @attributes[:password] + @current_attributes[:password] = nil + @attributes[:password] = nil + super + @current_attributes[:password] = saved_password + @attributes[:password] = saved_attr_password + end + def action_create(options) if run_specinfra(:check_user_exists, attributes.username) if attributes.uid && attributes.uid != current.uid