---
- name: add a software folder
  file:
    path: /softwares
    owner: "{{ pss_nas_softs_owner }}"
    group: "{{ pss_nas_softs_owner }}"
    mode: 0755
    state: directory

- name: download PSS softwares
  get_url:
    url: "{{ pss_nas_software_repo_url }}/{{ item }}"
    dest: "/softwares/{{ item }}"
    mode: 0444
    url_username: pss-soft-user
    url_password: "{{ pss_soft_artifactory_password  }}"
  with_items: "{{ pss_nas_software_files }}"

- name: add  uploads folder
  file:
    path: /uploads
    owner: "{{ pss_nas_softs_owner }}"
    group: "{{ pss_nas_softs_owner }}"
    mode: 0755
    state: directory

- name: add samba specific options file fo PSS NAS
  template:
    src: smb-pss.conf.j2
    dest: /etc/samba/smb-pss.conf
    owner: root
    group: root
    mode: 0644
- name: manage ssh allowed users for PSS NAS
  template:
    src: sshd_config.j2
    dest: /etc/ssh/sshd_config
    owner: root
    group: root
    mode: 0640
  notify: restart_ssh

- name: add script to create home folders for PSS users
  template:
    src: create_home
    dest: /usr/local/bin/create_home
    owner: root
    group: root
    mode: 0755
