2017-08-28 15:31:54 +00:00
|
|
|
---
|
2018-12-27 18:31:31 +00:00
|
|
|
- name: Set login banner
|
|
|
|
template:
|
|
|
|
src: ansible-nas/motd.txt
|
|
|
|
dest: /etc/motd
|
|
|
|
|
2019-01-05 06:00:04 +00:00
|
|
|
- name: Enable Universe repository
|
|
|
|
raw: apt-add-repository universe
|
2019-01-05 10:34:52 +00:00
|
|
|
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
|
2019-01-05 06:00:04 +00:00
|
|
|
|
2017-08-28 15:31:54 +00:00
|
|
|
- name: Update apt-cache
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
cache_valid_time: 3600
|
2018-12-23 16:50:20 +00:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-08-28 15:31:54 +00:00
|
|
|
|
|
|
|
- name: Upgrade all packages
|
|
|
|
apt:
|
2018-11-12 03:20:27 +00:00
|
|
|
upgrade: true
|
2017-08-28 15:31:54 +00:00
|
|
|
state: latest
|
2018-12-23 16:50:20 +00:00
|
|
|
when: keep_packages_updated
|
2018-12-08 22:44:51 +00:00
|
|
|
tags:
|
|
|
|
- skip_ansible_lint
|
2017-08-28 15:31:54 +00:00
|
|
|
|
|
|
|
- name: Install some packages
|
|
|
|
apt:
|
2018-12-28 15:44:20 +00:00
|
|
|
name: "{{ ansible_nas_extra_packages }}"
|
2017-08-28 15:31:54 +00:00
|
|
|
state: present
|
2018-12-23 16:50:20 +00:00
|
|
|
register: result
|
|
|
|
until: result is succeeded
|
2017-08-28 15:31:54 +00:00
|
|
|
|
|
|
|
# - name: Configure smartmontools
|
|
|
|
|
|
|
|
- name: "Set hostname to {{ ansible_nas_hostname }}"
|
|
|
|
hostname:
|
2018-08-09 21:37:15 +00:00
|
|
|
name: "{{ ansible_nas_hostname }}"
|
2018-11-12 22:30:13 +00:00
|
|
|
|
|
|
|
- name: "Set timezone to {{ ansible_nas_timezone }}"
|
|
|
|
timezone:
|
2018-12-28 13:07:40 +00:00
|
|
|
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 }}"
|