mirror of
https://github.com/davestephens/ansible-nas
synced 2024-12-26 11:33:08 +00:00
54 lines
No EOL
1.2 KiB
YAML
54 lines
No EOL
1.2 KiB
YAML
---
|
|
- name: Set login banner
|
|
template:
|
|
src: ansible-nas/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: true
|
|
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 }}"
|
|
owner: ansible-nas
|
|
group: ansible-nas
|
|
mode: "u=rwX,g=rwX,o=rX"
|
|
recurse: false
|
|
loop: "{{ samba_shares }}" |