ansible-nas/roles/ansible-nas-general/tasks/main.yml
2021-02-21 19:50:07 +00:00

55 lines
1.2 KiB
YAML

---
- name: Set login banner
copy:
src: motd.txt
dest: /etc/motd
- name: Enable Universe repository
raw: apt-add-repository universe
register: add_repo_result
changed_when: "'distribution component enabled for all sources' in add_repo_result.stdout"
until: add_repo_result.rc == 0
retries: 3
delay: 1
- name: Update apt-cache
apt:
update_cache: yes
cache_valid_time: 3600
register: result
until: result is succeeded
- name: Upgrade all packages
apt:
upgrade: yes
state: latest
when: keep_packages_updated
tags:
- skip_ansible_lint
- name: Install some packages
apt:
name: "{{ ansible_nas_extra_packages }}"
state: present
register: result
until: result is succeeded
# - name: Configure smartmontools
- name: "Set hostname to {{ ansible_nas_hostname }}"
hostname:
name: "{{ ansible_nas_hostname }}"
- name: "Set timezone to {{ ansible_nas_timezone }}"
timezone:
name: "{{ ansible_nas_timezone }}"
- name: "Permission share directories"
file:
path: "{{ item.path }}"
state: directory
owner: ansible-nas
group: ansible-nas
mode: "u=rwX,g=rwX,o=rX"
recurse: false
loop: "{{ samba_shares }}"