ansible-nas/roles/ansible-nas-general/tasks/main.yml

46 lines
1 KiB
YAML
Raw Normal View History

2017-08-28 15:31:54 +00:00
---
2018-12-27 18:31:31 +00:00
- name: Set login banner
2023-04-15 13:11:49 +00:00
ansible.builtin.copy:
src: motd.txt
2018-12-27 18:31:31 +00:00
dest: /etc/motd
2017-08-28 15:31:54 +00:00
- name: Update apt-cache
2023-04-15 13:11:49 +00:00
ansible.builtin.apt:
2017-08-28 15:31:54 +00:00
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
2022-08-23 21:26:40 +00:00
- name: Upgrade all packages # noqa package-latest
2023-04-15 13:11:49 +00:00
ansible.builtin.apt:
2021-01-16 09:22:36 +00:00
upgrade: yes
2017-08-28 15:31:54 +00:00
state: latest
2018-12-23 16:50:20 +00:00
when: keep_packages_updated
tags:
- skip_ansible_lint
2017-08-28 15:31:54 +00:00
- name: Install some packages
2023-04-15 13:11:49 +00:00
ansible.builtin.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: "Set hostname to {{ ansible_nas_hostname }}"
2023-04-15 13:11:49 +00:00
ansible.builtin.hostname:
name: "{{ ansible_nas_hostname }}"
- name: "Set timezone to {{ ansible_nas_timezone }}"
2023-04-15 13:11:49 +00:00
community.general.timezone:
name: "{{ ansible_nas_timezone }}"
- name: "Permission share directories"
2023-04-15 13:11:49 +00:00
ansible.builtin.file:
path: "{{ item.path }}"
state: directory
owner: ansible-nas
group: ansible-nas
mode: "u=rwX,g=rwX,o=rX"
recurse: false
2021-02-21 19:50:07 +00:00
loop: "{{ samba_shares }}"