diff --git a/inventory/production.yml b/inventory/production.yml index fb3ed7e..a9712fa 100644 --- a/inventory/production.yml +++ b/inventory/production.yml @@ -3,6 +3,11 @@ router: hosts: machinbox.mateu.be: +physicalservers: + hosts: + frederica.dmz.mateu.be: + serenor.dmz.mateu.be: + hypervisors: hosts: serenor.dmz.mateu.be: diff --git a/roles/munin_client/tasks/hypervisors.yml b/roles/munin_client/tasks/hypervisors.yml index a6c2067..56f0ab9 100644 --- a/roles/munin_client/tasks/hypervisors.yml +++ b/roles/munin_client/tasks/hypervisors.yml @@ -2,11 +2,8 @@ - name: Install prereq ansible.builtin.package: - name: "{{ item }}" + name: nvme-cli state: present - loop: - - nvme-cli - - lm-sensors - name: Put nvme plugin configuration ansible.builtin.template: diff --git a/roles/munin_client/tasks/main.yml b/roles/munin_client/tasks/main.yml index 3562449..4cf0416 100644 --- a/roles/munin_client/tasks/main.yml +++ b/roles/munin_client/tasks/main.yml @@ -106,8 +106,7 @@ loop: - users -# Useless junks for hypervisors -- name: Execute delete states for hypervisors +- name: Execute specific hypervisors’ commands ansible.builtin.include_tasks: hypervisors.yml when: "'hypervisors' in group_names" @@ -115,6 +114,10 @@ ansible.builtin.include_tasks: zfs.yml when: "'zfsservers' in group_names" +- name: Execute specific physical servers’ commands + ansible.builtin.include_tasks: physicalservers.yml + when: "'physicalservers' in group_names" + # Specific LXC commands - name: Execute specific LXC commands ansible.builtin.include_tasks: lxc.yml diff --git a/roles/munin_client/tasks/physicalservers.yml b/roles/munin_client/tasks/physicalservers.yml new file mode 100644 index 0000000..02c67a6 --- /dev/null +++ b/roles/munin_client/tasks/physicalservers.yml @@ -0,0 +1,6 @@ +--- + +- name: Install physical sensors + ansible.builtin.package: + name: lm-sensors + state: present diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index 5fe1b42..1f27a21 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -20,13 +20,19 @@ state: present - name: Install hypervisors’ specific utilities - ansible.builtin.package: - name: - - fuse-overlayfs - - lshw + ansible.builtin.apt: + name: fuse-overlayfs state: present + update_cache: true when: "'hypervisors' in group_names" +- name: Install physical servers’ specific utilities + ansible.builtin.apt: + name: lshw + state: present + update_cache: true + when: "'physicalservers' in group_names" + - name: Set localtime ansible.builtin.file: src: /usr/share/zoneinfo/Europe/Paris