made role OS-specific
This commit is contained in:
commit
760b14cc4b
5 changed files with 54 additions and 0 deletions
35
tasks/main.yml
Normal file
35
tasks/main.yml
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
- name: Set OS dependent variables
|
||||
ansible.builtin.include_vars: "{{ lookup('first_found', params) }}"
|
||||
vars:
|
||||
params:
|
||||
files:
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml"
|
||||
- "{{ ansible_distribution | lower }}.yml"
|
||||
- "{{ ansible_os_family | lower }}.yml"
|
||||
- "{{ ansible_system | lower }}.yml"
|
||||
paths:
|
||||
- '{{ role_path }}/vars'
|
||||
ignore_errors: True
|
||||
|
||||
- name: OS is supported
|
||||
ansible.builtin.assert:
|
||||
that: __os_supported
|
||||
quiet: True
|
||||
vars:
|
||||
__os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}"
|
||||
|
||||
|
||||
- name: Install unattended-upgrades
|
||||
apt:
|
||||
name: unattended-upgrades
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Set configuration
|
||||
become: yes
|
||||
template:
|
||||
src: 90unattended-upgrades.j2
|
||||
dest: /etc/apt/apt.conf.d/90unattended-upgrades
|
||||
mode: 0644
|
Loading…
Add table
Add a link
Reference in a new issue