Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow VFS options that don't use the same vfs_object name #101

Closed
andrewradke opened this issue Aug 22, 2023 · 3 comments
Closed

Allow VFS options that don't use the same vfs_object name #101

andrewradke opened this issue Aug 22, 2023 · 3 comments

Comments

@andrewradke
Copy link
Contributor

The VFS shadow_copy2 uses shadow:option_name instead of shadow_copy2 :option_name

Currently the smb.conf.j2 template doesn't allow for this.
I'd like to propose checking for a : in the option name. If it includes one then treat it as complete and leave out the object name. Otherwise operate as it currently does.

 {% for opt in obj.options %}
+{% if ':' in opt.name %}
+  {{ opt.name }} = {{ opt.value }}
+{% else %}
   {{ obj.name }}:{{ opt.name }} = {{ opt.value }}
+{% endif %}
 {% endfor %}

The following YAML would then produce the share definition below it without affecting existing configs.

        samba_shares:
          - name: "ShareName"
            vfs_objects:
              - name: shadow_copy2
                options:
                  - name: shadow:snapdir
                    value: /data/shares/.shadow_snapshots
                  - name: shadow:sort
                    value: desc
                  - name: shadow:snapsharepath
                    value: RedirectedFolders
[ShareName]
  vfs objects = shadow_copy2
  shadow:snapdir = /data/shares/.shadow_snapshots
  shadow:sort = desc
  shadow:snapsharepath = RedirectedFolders

If you are happy with this I can create another pull request.

Copy link

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

@github-actions github-actions bot added the stale This issue or pull request has been marked 'stale' due to lack of recent activity label Nov 21, 2023
@vladgh vladgh removed the stale This issue or pull request has been marked 'stale' due to lack of recent activity label Nov 21, 2023
Copy link

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

@github-actions github-actions bot added the stale This issue or pull request has been marked 'stale' due to lack of recent activity label Feb 20, 2024
@vladgh vladgh removed the stale This issue or pull request has been marked 'stale' due to lack of recent activity label Feb 24, 2024
vladgh added a commit that referenced this issue May 9, 2024
@vladgh
Copy link
Owner

vladgh commented May 9, 2024

Thank you for your suggestion! I added it in #166.

@vladgh vladgh closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants