Giter Club home page Giter Club logo

samba's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samba's Issues

Chef version 12.15 needed due to undefined method `delayed_action'

The below error broke things for me, which was solved by updating to a version which includes chef/chef@bb9a4d3. I think the readme might need updating to show 12.15+ as the minimum version.

================================================================================
    Error executing action `create` on resource 'samba_server[samba server]'
    ================================================================================
    
    NoMethodError
    -------------
    undefined method `delayed_action' for Chef::Resource::Template

create a custom resource samba_share

The resource will be responsible for:

  • Creating the directory for the share
  • Appending the configuration to an accumulator for /etc/samba/smb.conf

Ubuntu, Trying to use upstart when should use systemd

Hello,

i seem to be having this odd issue when i use the server resource, i get STDERR: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused on ubuntu 16.04 which should be using systemd. this causes the chef run to fail.

i'm not sure what could be causing this, i looked over the code with my limited knowledge and didnt see anything that could be the cause. perhaps you guys might have better luck.

I am really looking forward to using this amazing rewrite of the samba cookbook.

Stack trace output below:

Generated at 2017-01-23 11:38:44 -0500
Mixlib::ShellOut::ShellCommandFailed: service[smbd] (/var/chef/cache/cookbooks/samba/resources/server.rb line 84) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /sbin/start smbd ----
STDOUT:
STDERR: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
---- End output of /sbin/start smbd ----
Ran /sbin/start smbd returned 1
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:289:in invalid!' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:276:in error!'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/mixin/shell_out.rb:55:in shell_out_with_systems_locale!' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service/upstart.rb:172:in start_service'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service.rb:142:in block in action_start' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/mixin/why_run.rb:52:in add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider.rb:176:in converge_by' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service.rb:141:in action_start'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider.rb:145:in run_action' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource.rb:622:in run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:69:in run_action' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in each' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/resource_list.rb:94:in block in execute_each_resource' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:114:in call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:85:in step' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:103:in iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/resource_list.rb:92:in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:96:in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:670:in block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:665:in catch' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:665:in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:704:in converge_and_save' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:284:in run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:294:in block in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:282:in fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:282:in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:247:in block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/local_mode.rb:44:in with_server_connectivity' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:235:in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:451:in block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:450:in loop' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:450:in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:434:in run_application' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:59:in run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/bin/chef-client:26:in <top (required)>' /usr/bin/chef-client:57:in load'
/usr/bin/chef-client:57:in `

'

Caused by Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /sbin/start smbd ----
STDOUT:
STDERR: start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
---- End output of /sbin/start smbd ----
Ran /sbin/start smbd returned 1
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:289:in invalid!' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/mixlib-shellout-2.2.7/lib/mixlib/shellout.rb:276:in error!'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/mixin/shell_out.rb:55:in shell_out_with_systems_locale!' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service/upstart.rb:172:in start_service'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service.rb:142:in block in action_start' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/mixin/why_run.rb:52:in add_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider.rb:176:in converge_by' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider/service.rb:141:in action_start'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/provider.rb:145:in run_action' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource.rb:622:in run_action'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:69:in run_action' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in block (2 levels) in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in each' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:97:in block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/resource_list.rb:94:in block in execute_each_resource' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:114:in call_iterator_block'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:85:in step' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:103:in iterate'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/stepable_iterator.rb:55:in each_with_index' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/resource_collection/resource_list.rb:92:in execute_each_resource'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/runner.rb:96:in converge' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:670:in block in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:665:in catch' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:665:in converge'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:704:in converge_and_save' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/client.rb:284:in run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:294:in block in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:282:in fork'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:282:in fork_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:247:in block in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/local_mode.rb:44:in with_server_connectivity' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:235:in run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:464:in sleep_then_run_chef_client' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:451:in block in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:450:in loop' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:450:in interval_run_chef_client'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application/client.rb:434:in run_application' /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/lib/chef/application.rb:59:in run'
/opt/chef/embedded/lib/ruby/gems/2.3.0/gems/chef-12.17.44/bin/chef-client:26:in <top (required)>' /usr/bin/chef-client:57:in load'
/usr/bin/chef-client:57:in `

'

Kill the data bag!!

The logic in samba::server should be pulled out into a lwrp. Then I can use this cookbook in my environment cookbook with out having to manage more data bags (pain in the back).

The example in the readme would become something like

samba_share 'export' do
  comment 'Exported Share'
  path '/srv/export'
  guest_ok false
  printable false
  write_list ['jtimberman']
  create_mask 0664
  directory_mask 0775
end

Remove .rubocop.yml with Dangerfile

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

If the only thing in the .rubocop/yml is Dangerfile
Run the latest cookstyle
Remove .rubpopo.yml

Issue sprouted from sous-chefs/meta/issues/108. If not applicable then issue should be closed.

samba_share resource creates directory with samba variables in the path

The samba_share resource recursively creates the directory specified with the path property.
This is not desired, if the path contains samba variables, like %S.

samba_share 'homes' do
  path '/mnt/hdd/homes/%S'
  comment 'Home Directories'
  create_mask '0640'
  directory_mask '0750'
  write_list ['%S']
end

This creates a directory called '%S' in /mnt/hdd/homes.
My suggestion is to simply not create the directory automatically. This behavior is not documented, and to me it was unexpected.

Error executing action `enable` on resource 'service[smbd]'

Hi,

When I run recipe[samba::server] it fails with Error executing action enable on resource 'service[smbd]' on Ubuntu Server 15.04

output:

 * service[smbd] action enable

    ================================================================================
    Error executing action `enable` on resource 'service[smbd]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /bin/systemctl enable smbd ----
    STDOUT: 
    STDERR: Synchronizing state for smbd.service with sysvinit using update-rc.d...
    Executing /usr/sbin/update-rc.d smbd defaults
    Executing /usr/sbin/update-rc.d smbd enable
    Failed to execute operation: No such file or directory
    ---- End output of /bin/systemctl enable smbd ----
    Ran /bin/systemctl enable smbd returned 1

    Resource Declaration:
    ---------------------
    # In /root/chef-solo/cookbooks-2/samba/recipes/server.rb

     60:   service s do
     61:     supports :restart => true, :reload => true
     62:     provider Chef::Provider::Service::Upstart if platform?('ubuntu') && node['platform_version'].to_f == 14.04
     63:     pattern 'smbd|nmbd' if node['platform'] =~ /^arch$/
     64:     action [:enable, :start]
     65:   end
     66: end

    Compiled Resource:
    ------------------
    # Declared in /root/chef-solo/cookbooks-2/samba/recipes/server.rb:60:in `block in from_file'

    service("smbd") do
      action [:enable, :start]
      supports {:restart=>true, :reload=>true}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      service_name "smbd"
      pattern "smbd"
      declared_type :service
      cookbook_name :samba
      recipe_name "server"
    end

  * service[smbd] action restart
    - restart service service[smbd]
  * service[nmbd] action restart
    - restart service service[nmbd]

Running handlers:
[2015-07-02T00:24:39+02:00] ERROR: Running exception handlers
Running handlers complete
[2015-07-02T00:24:39+02:00] ERROR: Exception handlers complete
[2015-07-02T00:24:39+02:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 4 resources updated in 9.930227904 seconds
[2015-07-02T00:24:39+02:00] ERROR: service[smbd] (samba::server line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /bin/systemctl enable smbd ----
STDOUT: 
STDERR: Synchronizing state for smbd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d smbd defaults
Executing /usr/sbin/update-rc.d smbd enable
Failed to execute operation: No such file or directory
---- End output of /bin/systemctl enable smbd ----
Ran /bin/systemctl enable smbd returned 1
[2015-07-02T00:24:39+02:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

chef-stacktrace.out:

Generated at 2015-07-02 00:24:39 +0200
Mixlib::ShellOut::ShellCommandFailed: service[smbd] (samba::server line 60) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /bin/systemctl enable smbd ----
STDOUT: 
STDERR: Synchronizing state for smbd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d smbd defaults
Executing /usr/sbin/update-rc.d smbd enable
Failed to execute operation: No such file or directory
---- End output of /bin/systemctl enable smbd ----
Ran /bin/systemctl enable smbd returned 1
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.1/lib/mixlib/shellout.rb:278:in `invalid!'
/opt/chef/embedded/lib/ruby/gems/2.1.0/gems/mixlib-shellout-2.0.1/lib/mixlib/shellout.rb:265:in `error!'
/opt/chef/embedded/apps/chef/lib/chef/mixin/shell_out.rb:56:in `shell_out!'
/opt/chef/embedded/apps/chef/lib/chef/provider/service/systemd.rb:117:in `enable_service'
/opt/chef/embedded/apps/chef/lib/chef/provider/service.rb:66:in `block in action_enable'
/opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `call'
/opt/chef/embedded/apps/chef/lib/chef/mixin/why_run.rb:52:in `add_action'
/opt/chef/embedded/apps/chef/lib/chef/provider.rb:165:in `converge_by'
/opt/chef/embedded/apps/chef/lib/chef/provider/service.rb:65:in `action_enable'
/opt/chef/embedded/apps/chef/lib/chef/provider.rb:130:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/resource.rb:562:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:49:in `run_action'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block (2 levels) in converge'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `each'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:81:in `block in converge'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:83:in `block in execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/chef/embedded/apps/chef/lib/chef/resource_collection/resource_list.rb:81:in `execute_each_resource'
/opt/chef/embedded/apps/chef/lib/chef/runner.rb:80:in `converge'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:339:in `block in converge'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:334:in `catch'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:334:in `converge'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:353:in `converge_and_save'
/opt/chef/embedded/apps/chef/lib/chef/client.rb:457:in `run'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:271:in `block in fork_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:259:in `fork'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:259:in `fork_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:225:in `block in run_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/local_mode.rb:39:in `with_server_connectivity'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:213:in `run_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:280:in `block in interval_run_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:269:in `loop'
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:269:in `interval_run_chef_client'
/opt/chef/embedded/apps/chef/lib/chef/application/solo.rb:247:in `run_application'
/opt/chef/embedded/apps/chef/lib/chef/application.rb:60:in `run'
/opt/chef/embedded/apps/chef/bin/chef-solo:25:in `<top (required)>'
/usr/bin/chef-solo:51:in `load'
/usr/bin/chef-solo:51:in `<main>'

nmb restart failed

I`m using this cookbook to create samba, but when I run the kitchen it gave me this error:

      +#============================ Share Definitions ==============================
           - restore selinux security context
         * service[smb] action restart
           - restart service service[smb]
         * service[nmb] action restart
           
           ================================================================================
           Error executing action `restart` on resource 'service[nmb]'
           ================================================================================
           
           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of /bin/systemctl --system restart nmb ----
           STDOUT: 
           STDERR: Job for nmb.service failed because a timeout was exceeded. See "systemctl status nmb.service" and "journalctl -xe" for details.
           ---- End output of /bin/systemctl --system restart nmb ----
           Ran /bin/systemctl --system restart nmb returned 1
           
           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/samba/resources/server.rb
           
            85:       service s do
            86:         supports restart: true, reload: true
            87:         action [:enable, :start]
            88:       end
            89:     end
           
           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/samba/resources/server.rb:85:in `block (3 levels) in class_from_file'
           
           service("nmb") do
             action [:enable, :start]
             updated true
             default_guard_interpreter :default
             service_name "nmb"
             enabled true
             running true
             masked false
             pattern "nmb"
             declared_type :service
             cookbook_name "samba"
             supports {:restart=>true, :reload=>true}
           end
           
           System Info:
           ------------
           chef_version=13.1.31
           platform=redhat
           platform_version=7.3
           ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
           program_name=chef-solo worker: ppid=9551;start=09:56:11;
           executable=/opt/chef/bin/chef-solo
           
       
       Running handlers:
       [2017-06-01T09:59:45-04:00] ERROR: Running exception handlers
       [2017-06-01T09:59:45-04:00] ERROR: Running exception handlers
       Running handlers complete
       [2017-06-01T09:59:45-04:00] ERROR: Exception handlers complete
       [2017-06-01T09:59:45-04:00] ERROR: Exception handlers complete
       Chef Client failed. 31 resources updated in 03 minutes 34 seconds
       [2017-06-01T09:59:45-04:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2017-06-01T09:59:45-04:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2017-06-01T09:59:45-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2017-06-01T09:59:45-04:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report

So, what should I do?

bind_interfaces_only does nothing in samba_server resource

Scenario

samba_server 'test_server" do
  workgroup 'samba'
  interfaces 'eth0'
  bind_interfaces_only 'yes'
end

Expected result

# grep bind /etc/samba/smb.conf
# bind interfaces only = yes

Actual result

# grep bind /etc/samba/smb.conf
#

Cause

Looking at resources/server.rb the bind_interfaces_only property is defined, but nothing is done with it. Also the tests don't seem to look to see if the value is set, so it seems plausible that this simply doesn't work?

I may have missed something super obvious, so if I have, I apologise!

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.0.0
  • actions/checkout v4
  • actionshub/chef-install 2.0.4
  • actionshub/test-kitchen 2.1.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Samba Server Options Error

The server.rb resource is expecting a String for options but the smb.conf.erb file is attempting to parse it like a Hash.

undefined method `each' for #String:0x00000003768f88

Samba shares nuked when unrelated resource fails during chef-client run

Cookbook version

1.2.0

Chef-client version

14.2.0

Platform Details

RHEL 7.6

Scenario:

Steps to Reproduce:

Run the following recipe:

# a wrapper cookbook that installs/configures sssd, firewall, selinux, etc.
include_recipe 'cub_samba::server'

bash 'randomly fail' do
  code 'exit $(($RANDOM % 2))'
end

samba_share 'homes' do
  comment 'Home Directories'
  guest_ok 'no'
  read_only 'no'
  browseable 'no'
  create_directory false
end

Half the time this recipe will execute successfully, causing the correct config file to get written out:

[vagrant@12996bc1-c6ab-4 ~]$ cat /etc/samba/smb.conf
# This is the main Samba configuration file.
#
# It was dynamically generated by Chef on 12996bc1-c6ab-4.AD.COLORADO.EDU
#
# Local modifications will be overwritten by Chef.
#

[global]
  realm = AD.COLORADO.EDU
  password server = *
  encrypt passwords = yes
  kerberos method = system keytab
  workgroup = AD
  server string = %h samba
  security = ADS
  map to guest = Bad User
  interfaces = 10.0.2.15
  hosts allow = 127.0.0.0/8
  load printers = no
  passdb backend = tdbsam
  dns proxy = no
  max log size = 5000
  bind interfaces only = no

    restrict anonymous = 2
    idmap config * : backend = tdb
    idmap config * : range = 20000001-20001000
    idmap config AD:backend = ad
    idmap config AD:schema_mode = rfc2307
    idmap config AD:range = 1000-20000000
    include = /etc/samba/smb-include.conf

#============================ Share Definitions ==============================
  [homes]
    comment = Home Directories
    path = 
    guest ok = no
    printable = no
    write list = 
    create mask = 0744
    directory mask = 0755
    read only = no
    valid users = 
    force group = 
    browseable = no
[vagrant@12996bc1-c6ab-4 ~]$

Half the time this recipe will fail. This causes an incorrect configuration file, missing the shares, to get written out:

[vagrant@12996bc1-c6ab-4 ~]$ cat /etc/samba/smb.conf
# This is the main Samba configuration file.
#
# It was dynamically generated by Chef on 12996bc1-c6ab-4.AD.COLORADO.EDU
#
# Local modifications will be overwritten by Chef.
#

[global]
  realm = AD.COLORADO.EDU
  password server = *
  encrypt passwords = yes
  kerberos method = system keytab
  workgroup = AD
  server string = %h samba
  security = ADS
  map to guest = Bad User
  interfaces = 10.0.2.15
  hosts allow = 127.0.0.0/8
  load printers = no
  passdb backend = tdbsam
  dns proxy = no
  max log size = 5000
  bind interfaces only = no

    restrict anonymous = 2
    idmap config * : backend = tdb
    idmap config * : range = 20000001-20001000
    idmap config AD:backend = ad
    idmap config AD:schema_mode = rfc2307
    idmap config AD:range = 1000-20000000
    include = /etc/samba/smb-include.conf

#============================ Share Definitions ==============================
[vagrant@12996bc1-c6ab-4 ~]$

This recently caused a service interruption on one of our customer's systems. A yum repository resource, unrelated to samba, failed. This caused samba to write out the config without any shares. As a result, all of the customer's shares went away.

Expected Result:

When the recipe fails, existing shares should be remain intact in order to avoid service interruptions.

Actual Result:

When the recipe fails, existing shares are removed from the configuration file, causing service interruptions.

Update Changelog

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Update all CHANGELOGs to follow standard defined at https://keepachangelog.com/

Issue sprouted from sous-chefs/meta/issues/101. If not applicable then issue should be closed.

Unable to use computer after password overwritten

Using the samba_user overwrites a user's password, quite unexpectedly. I also don't think this is the default behaviour in samba. Additionally, using the password I set there doesn't work either, so I have no idea what it has been set to.

I'm now unable to sudo, unable to run chef, and would be unable to ssh in if I wasn't using keys.

[2017-07-23T20:23:10+01:00] INFO: linux_user[myuser] altered

      - alter user myuser
[2017-07-23T20:23:10+01:00] INFO: linux_user[myuser] sending run action to execute[Create samba user myuser] (immediate)
    * execute[Create samba user myuser] action run[2017-07-23T20:23:10+01:00] INFO: Processing execute[Create samba user myuser] action run (/home/myuser/chef-solo/local-mode-cache/cache/cookbooks/samba/resources/user.rb line 59)

      [execute] Added user myuser.
[2017-07-23T20:23:10+01:00] INFO: execute[Create samba user myuser] ran successfully
      - execute echo 'mypassword
      mypassword' | smbpasswd -s -a myuser
    * group[myuser] action create[2017-07-23T20:23:10+01:00] INFO: Processing group[myuser] action create (/home/myuser/chef-solo/local-mode-cache/cache/cookbooks/samba/resources/user.rb line 48)
[2017-07-23T20:23:10+01:00] INFO: group[myuser] altered

      - alter group myuser
      - replace group members with new list of members

It looks like the version which installed is 1.0.4:

cat Cheffile.lock | grep samba
    samba (1.0.4)

Related: #63

smbpasswd creation not happening

I am having issues with this cookbook.. it is creating the users just fine and the shares etc but It is NOT setting the smbpasswds.. when I run a sudo pdbedit -L -v the password last set is set to a 0. if I manually set the password with smbpasswd -a jtest, it updates password last set to a date.... I have set up my users data bag as described in the docs and have tested to make sure that the users variable (in server.rb) is being set..

Unix username:        joshzitting
Password last set:    0
# smbpasswd -a joshzitting
New SMB password:
Retype new SMB password:
# sudo pdbedit -L -v
Unix username:        joshzitting
Password last set:    Tue, 20 Jan 2015 21:39:20 UTC

after I create my password manually I can log into the shares etc. 
Here is a user DBI 
{
  "id": "joshzitting",
  "smbpasswd": "test"
}

The users are created on the machine prior to running the samba::server recipe.
Thanks!
Josh

Resource underscores breaking permissions

Previously, the Samba cookbook created shares with the following syntax in smb.conf:

  [drupal]
    comment = Cloned repository for Github
    path = /var/www/drupal
    guest ok = no
    printable = no
    write list = username
    create mask = 0664
    directory mask = 0775

Now it's creating the conf file as follows:

  [drupal]
    comment = Cloned repository for Github
    path = /var/www/drupal
    guest_ok = no
    printable = no
    write_list = username
    create_mask = 0664
    directory_mask = 0775

The latter breaks the configuration file and my developers are reporting that they have lost write access permissions. I have tested and verified this is the underscore (changing to a whitespace and restarting smbd resolves the issue) in write_list.

Update builds to be parallel

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

As part of our build process we should build each possible operating system separately

  1. Ensure you have dokken setup and working:
  2. dokken: aliased to KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen
  3. run dokken list, you should see a list of builds with dokken as the provider
  4. download: https://github.com/sous-chefs/repo-management/blob/master/scripts/circleci_maker.rb and make this executable
  5. run: dokken list -j | ./circleci_maker.rb > .circleci/config.yml

Issue sprouted from sous-chefs/meta/issues/112. If not applicable then issue should be closed.

create a custom resource samba_server

This will support only Debian/Ubuntu and RHEL/CentOS platforms on x86 architectures. Users of other platforms should use an older version of the cookbook, or contribute their platforms as new providers with tests.

Run latest cookstyle

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Chef have released updated cookstyle rules, we should therefore run the auto fix against the cookbook

  1. Ensure you are on the latest stable chef-workstation
  2. Run cookstyle -a

Issue sprouted from sous-chefs/meta/issues/111. If not applicable then issue should be closed.

sssd-libwbclient is needed on RHEL/CentOS 7.5+ systems

Cookbook version

1.1.4

Chef-client version

14.2.0

Platform Details

RHEL 7.5 x86_64
samba-4.7.1-9.el7_5.x86_64

Scenario:

When a RHEL system is AD joined using SSSD, winbind does not function as samba is not AD joined. To get samba to work with an systems joined to the AD through SSSD the package sssd-libwbclient is needed. However, it can't just blindly be installed as it will override winbind, and for folks who join a system to the AD using samba, they rely on winbind.

An attribute or a flag of some sort is needed to state that SSSD is being used and as such the package sssd-libwbclient needs to be installed.

Steps to Reproduce:

Setup cookbook to configure a RHEL/CentOS 7.5 system that is joined to the AD via SSSD to run as a file share (security = ads) startup of samba will fail because winbind is not enabled, obscure error message in /var/log/samba/log.smbd:
[2018/08/22 10:48:42.481282, 0] ../source3/auth/auth_util.c:1399(make_new_session_info_guest)
create_local_token failed: NT_STATUS_NO_MEMORY
[2018/08/22 10:48:42.482097, 0] ../source3/smbd/server.c:2011(main)
ERROR: failed to setup guest info.

Winbind will not start due to not being AD joined, solution is to install the sssd-libwbclient package.

Expected Result:

Samba to start and serve shares.

Actual Result:

Already mentioned in steps to reproduce.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.