smb_client.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. - name: Access an SMB share
  3. hosts: servera.lab.example.com
  4. become: true
  5. vars_files:
  6. - smb_vars.yml
  7. tasks:
  8. - name: the package to mount SMB shares is installed
  9. yum:
  10. name: #FIXME: install the required package to mount SMB shares
  11. state: present
  12. - name: the Linux group for Samba users exists
  13. group:
  14. name: "{{ allowed_group }}"
  15. - name: the Linux user for Samba exists
  16. user:
  17. name: "{{ samba_user }}"
  18. password: "{{ samba_user_password | password_hash('sha512', 'secretsalt') }}"
  19. groups:
  20. - "{{ allowed_group }}"
  21. - name: the credential file exists
  22. copy:
  23. #FIXME: create the /etc/samba/creds.txt credential file for the
  24. # multiuser mount option.
  25. # Use the sambamount user account with redhat for
  26. # the password.
  27. content: "#FIXME#={{ samba_usermount }}\n #FIXME#={{ samba_passmount }}\n"
  28. dest: #FIXME#
  29. owner: root
  30. group: root
  31. mode: '0600'
  32. no_log: true
  33. - name: the SMB share is mounted
  34. mount:
  35. #FIXME: persistently mount the managerdata SMB share from
  36. # serverc.lab.example.com into the /managers_reports
  37. # directory.
  38. # Use the credential file, the multiuser option, and activate
  39. # traffic encryption.
  40. path: #FIXME#
  41. src: #FIXME#
  42. opts: #FIXME#
  43. state: mounted
  44. fstype: #FIXME#