Skip to content
Snippets Groups Projects
Commit a635d43f authored by Lars Beckers's avatar Lars Beckers
Browse files

baremetal: reworked role, added microcode, removed bond, split apcupsd

parent 4fd084f1
Branches
No related tags found
No related merge requests found
Showing
with 57 additions and 107 deletions
File moved
File moved
---
- name: restart apcupsd
service: name=apcupsd state=restarted
File moved
--- ---
# file: roles/baremetal/handlers/main.yml # file: baremetal/handlers/main.yml
- name: restart lldpd - name: restart lldpd
service: name=lldpd state=restarted service:
name: lldpd
- name: restart apcupsd state: restarted
service: name=apcupsd state=restarted
---
dependencies:
- { role: "zabbix-agent", when: "'zabbix-agent' in group_names"}
---
# file: roles/baremetal/tasks/bond.yml
- name: ensure ifenslave is installed
apt: state=latest name=ifenslave
tags:
- bond
- packages
#- name: ensure bonding is configured
# template: src=interfaces.j2 dest=/etc/network/interfaces owner=root group=root mode=0644
# when: "not 'vm' in ansible_hostname"
# tags:
# - bond
# - config
---
# file: roles/baremetal/tasks/lldpd.yml
- name: ensure lldpd is installed
apt: state=latest name=lldpd
notify:
- restart lldpd
tags:
- lldpd
- packages
- name: ensure lldpd is configured
copy: src=lldpd dest=/etc/default/lldpd owner=root group=root mode=0644
notify:
- restart lldpd
tags:
- lldpd
- config
- name: ensure lldpd is enabled and running
service: name=lldpd state=running enabled=yes
tags:
- lldpd
- service
--- ---
# file: roles/baremetal/tasks/main.yml # file: baremetal/tasks/main.yml
- include: apcupsd.yml - name: ensure baremetal-specific packages are installed
- meta: flush_handlers apt:
- include: bond.yml name: {{ item }}
- meta: flush_handlers state: installed
- include: lldpd.yml
- meta: flush_handlers
- name: ensure packages for nagios on baremetal are installed
apt: name={{ item }} state=present
with_items: with_items:
- lldpd
- lm-sensors - lm-sensors
- hddtemp - hddtemp
tags:
- packages
- nagios
- name: ensure hardware-tools are installed
apt: name={{ item }} state=present
with_items:
- smartmontools - smartmontools
- hdparm - hdparm
tags: tags:
- baremetal
- packages - packages
- hardware-tools
- name: ensure zabbix-smart-check is installed - name: ensure lldpd is configured
apt: name={{ item }} state=present copy:
with_items: src: lldpd
- zabbix-check-smart dest: /etc/default/lldpd
- zabbix-check-disk-performance owner: root
when: "'zabbix-agent' in group_names" group: root
mode: 0644
notify:
- restart lldpd
tags:
- baremetal
- name: ensure lldpd is enabled and running
service:
name: lldpd
state: running
enabled: yes
tags:
- baremetal
- name: ensure microcode updates are available (Intel)
apt:
name: intel-microcode
state: installed
when: ansible_processor[1] == 'GenuineIntel'
tags:
- baremetal
- packages
- name: ensure microcode updates are available (AMD)
apt:
name: amd64-microcode
state: installed
when: ansible_processor[1] == 'AuthenticAMD'
tags: tags:
- baremetal
- packages - packages
- hardware-tools
- chr
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
{% if bond %}
# The bond0
auto lo bond0
iface bond0 inet static
address {{ ipaddr }}
netmask {{ netmask }}
gateway {{ gateway }}
slaves eth0 eth1
bond_mode 802.3ad
bond_xmit_hash_policy layer2+3
{% else %}
auto {{ interface }}
iface {{ interface }} inet static
address {{ ipaddr }}
netmask {{ netmask }}
gateway {{ gateway }}
{% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment