smb_server.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ---
  2. - name: Share a directory with SMB
  3. hosts: serverd.lab.example.com
  4. become: true
  5. vars_files:
  6. - smb_vars.yml
  7. tasks:
  8. - name: the package for a Samba server is installed
  9. #FIXME: install the required package for a Samba server
  10. - name: the Linux user for Samba mount exists
  11. #FIXME: create the sambamount system user account as follows:
  12. # - Prevent login
  13. # - No home directory
  14. - name: the Samba user for Samba mount exists
  15. #FIXME: add the sambamount user to the Samba database.
  16. # Use redhat for the password.
  17. - name: the directory exists
  18. #FIXME: create the /srv/developers directory as follows:
  19. # Directory ownership: sambamount
  20. # Directory group ownership: developers
  21. # Owner access: read
  22. # Group access: read/write
  23. # Other users access: none
  24. # All contents created in the directory must automatically
  25. # belong to the developers group.
  26. # Set the correct SELinux context type.
  27. - name: the directory is shared
  28. #FIXME: declare the /srv/developers directory as an SMB share
  29. # in the Samba configuration file as follows:
  30. # Work group: MYWORKGROUP
  31. # SMB minimum protocol version: 3
  32. # Traffic encryption: Always required
  33. # Share name: devdata
  34. # Access allowed to: sambamount and the
  35. # members of the developers group
  36. # Read/write access: Members of the developers group
  37. # For your convenience, the default Samba configuration file is
  38. # available under the templates/ directory.
  39. notify: reload smb
  40. - name: the SMB service is started and enabled
  41. #FIXME: the service must be started and enabled
  42. - name: the firewall is opened for SMB
  43. #FIXME: configure the firewall to allow SMB traffic
  44. handlers:
  45. - name: reload smb
  46. #FIXME: reload the SMB service