base: Convert modules to use FQCN and use smartd role
This commit is contained in:
parent
b9aeb7ee06
commit
711cec9b54
3 changed files with 33 additions and 41 deletions
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
- name: setup ansible custom facts
|
||||
file:
|
||||
ansible.builtin.file:
|
||||
dest: "{{ item }}"
|
||||
mode: 0755
|
||||
owner: root
|
||||
|
@ -11,7 +11,7 @@
|
|||
- /etc/ansible/facts.d
|
||||
|
||||
- name: add ansible_export fact
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/ansible/facts.d/export.fact
|
||||
content: |
|
||||
#!/bin/sh
|
||||
|
@ -25,18 +25,19 @@
|
|||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: reload facts
|
||||
setup:
|
||||
ansible.builtin.setup:
|
||||
filter: ansible_local
|
||||
|
||||
- name: set correct hostname
|
||||
hostname:
|
||||
ansible.builtin.hostname:
|
||||
name: "{{ inventory_hostname }}"
|
||||
|
||||
- name: include os specific tasks
|
||||
include_tasks: "{{ ansible_os_family }}.yml"
|
||||
ansible.builtin.include_tasks:
|
||||
file: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: disable at from all users
|
||||
copy:
|
||||
ansible.builtin.copy:
|
||||
content: "\n"
|
||||
dest: "/etc/at.allow"
|
||||
mode: 0600
|
||||
|
@ -44,7 +45,7 @@
|
|||
group: "{{ ansible_wheel }}"
|
||||
|
||||
- name: install basic roles
|
||||
include_role:
|
||||
ansible.builtin.include_role:
|
||||
name: "{{ role }}"
|
||||
with_items:
|
||||
- munin_node
|
||||
|
@ -55,23 +56,14 @@
|
|||
loop_control:
|
||||
loop_var: role
|
||||
|
||||
- block:
|
||||
- name: install roles for physical hardware
|
||||
include_role:
|
||||
name: "{{ role }}"
|
||||
with_items:
|
||||
- lm_sensors
|
||||
loop_control:
|
||||
loop_var: role
|
||||
- name: install smartmontools
|
||||
package:
|
||||
name: smartmontools
|
||||
state: installed
|
||||
- name: enable smartd
|
||||
service:
|
||||
name: smartd
|
||||
state: started
|
||||
enabled: true
|
||||
- name: install roles for physical hardware
|
||||
ansible.builtin.include_role:
|
||||
name: "{{ role }}"
|
||||
with_items:
|
||||
- lm_sensors
|
||||
- smartd
|
||||
loop_control:
|
||||
loop_var: role
|
||||
when:
|
||||
- ansible_virtualization_role != "guest"
|
||||
- ansible_virtualization_type != "vmm"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue