geerlingguy / ansible-role-samba Goto Github PK
View Code? Open in Web Editor NEWAnsible Role - Samba
Home Page: https://galaxy.ansible.com/geerlingguy/samba/
License: MIT License
Ansible Role - Samba
Home Page: https://galaxy.ansible.com/geerlingguy/samba/
License: MIT License
I tested the role on 20.04, and got:
TASK [geerlingguy.samba : Ensure Samba-related packages are installed (Debian).] ***
failed: [instance] (item=['samba', 'samba-common', 'system-config-samba']) => {"ansible_loop_var": "item", "changed": false, "item": ["samba", "samba-common", "system-config-samba"], "msg": "No package matching 'system-config-samba' is available"}
The package system-config-samba
is not available in debian, raspbian and probably some other variants. I believe it was added in ubuntu.
Shall I submit a pull request to install cifs-utils instead? Then the centos and debian roles install the same packages. cifs-utils
is available since wheezy
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is
deprecated. Instead of using a loop to supply multiple items and specifyingname: "{{ item }}"
,
please usename: ['samba', 'samba-common', 'python-glade2', 'system-config-samba']
and remove the
loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by
setting deprecation_warnings=False in ansible.cfg.
I am going to fix this by extracting the packages to a variable in its respective OS family file (Debian).
We can probably merge the two tasks for Debian and RedHat by extracting both to a variable and then using the generic package
, but I am not in a position to test the RedHat changes.
CentOS 5 needs packages samba3x, samba3x-common and samba3x-winbind because the base samba packages are incompatible with cifs-utils.
Is there a reason a task to start and enable NMB isn't included in this role?
I'm relatively new to Ansible, so bear with me if I'm missing some critical details that make my suggestion unworkable, BUT...
Attempting to use this role to manage Samba on an Ubuntu 20.04 server, I receive this error:
TASK [geerlingguy.samba : Ensure Samba-related packages are installed (Debian).] ***************************************
failed: [clus0-node0-apct11.local] (item=['samba', 'samba-common', 'python-glade2', 'system-config-samba']) => {"ansible_loop_var": "item", "changed": false, "item": ["samba", "samba-common", "python-glade2", "system-config-samba"], "msg": "No package matching 'python-glade2' is available"}
Further, if the reference to python-glade2
is removed from the task, a subsequent attempt also fails due to removal of the system-config-samba
package. So, my educated guess is that these two packages have been removed from Ubuntu 20.04 completely.
The task works fine if I remove these packages and update the task to only install the samba
package, allowing apt to resolve any other dependencies. I don't know whether the absence of python-glade2
will cause problems further down the line, however, so this may not be a workable solution to the problem?
It would be nice if I could add variables like:
samba_shares:
- name: example
options: |
create mask = 0777
directory mask = 0777
Something along those lines (at a minimum), and it would output in /etc/samba/smb.conf
:
[example]
create mask = 0777
directory mask = 0777
(Just as an example).
How to create a samba user and give access to a specific folder ??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.