<commit_before>module PoolParty    
  module Resources
        
    class User < Resource      
      
      dsl_methods :name,        # Name of the user
                  :password,    # <PASSWORD>
                  :home,         # Home directory
                  :authorized_keys
                  
                  
      default_options({
        :shell => "/bin/sh"
      })
      
      def after_create
        if authorized_keys
          cloud.has_file :name=>"/home/#{name}/.ssh/authorized_keys", :content => authorized_keys
        end
      end
      
      def present
        :create
      end

      def absent
        :remove
      end
      
    end
    
  end
end<commit_msg>added ability to set a group for a user on creation<commit_after>module PoolParty    
  module Resources
        
    class User < Resource      
      
      dsl_methods :name,        # Name of the user
                  :password,    # <PASSWORD>
                  :home,         # Home directory
                  :group, # primary group for user
                  :authorized_keys
                  
                  
      default_options({
        :shell => "/bin/sh"
      })

      def loaded(o={})
        @group = dsl_options.delete(:group)
      end
      
      def after_create
        if authorized_keys
          cloud.has_file :name=>"/home/#{name}/.ssh/authorized_keys", :content => authorized_keys
        end
        if @group
          cloud.has_exec "usermod -g #{@group} #{name}"
        end
      end
      
      def present
        :create
      end

      def absent
        :remove
      end
      
    end
    
  end
end
{'fraction_non_alphanumeric': 0.0729483282674772, 'fraction_numerical': 0.0, 'mean_word_length': 1.1348897535667963, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4309214', 'n_tokens_mistral': 446, 'n_tokens_neox': 425, 'n_words': 113}