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
No related branches found
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
service: name=lldpd state=restarted
- name: restart apcupsd
service: name=apcupsd state=restarted
service:
name: lldpd
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
- meta: flush_handlers
- include: bond.yml
- meta: flush_handlers
- include: lldpd.yml
- meta: flush_handlers
- name: ensure packages for nagios on baremetal are installed
apt: name={{ item }} state=present
- name: ensure baremetal-specific packages are installed
apt:
name: {{ item }}
state: installed
with_items:
- lldpd
- lm-sensors
- hddtemp
tags:
- packages
- nagios
- name: ensure hardware-tools are installed
apt: name={{ item }} state=present
with_items:
- smartmontools
- hdparm
tags:
- baremetal
- packages
- hardware-tools
- name: ensure zabbix-smart-check is installed
apt: name={{ item }} state=present
with_items:
- zabbix-check-smart
- zabbix-check-disk-performance
when: "'zabbix-agent' in group_names"
- name: ensure lldpd is configured
copy:
src: lldpd
dest: /etc/default/lldpd
owner: root
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:
- baremetal
- 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