Mass Installation with Configuration Management
When deploying the Bleemeo agent across many servers, configuration management tools like Ansible, Puppet, or Chef can automate the installation process. This page provides ready-to-use configurations for each tool.
Prerequisites
Section titled “Prerequisites”Before deploying, you’ll need:
- Your Bleemeo Account ID and Registration Key (available in your Bleemeo dashboard)
- Access to your configuration management infrastructure
Ansible
Section titled “Ansible”Using the Official Ansible Role
Section titled “Using the Official Ansible Role”Bleemeo provides an official Ansible role available on Ansible Galaxy.
Install the role:
ansible-galaxy install bleemeo.agentCreate a playbook deploy-bleemeo.yml:
---- hosts: all become: yes vars: bleemeo_account_id: "YOUR_ACCOUNT_ID" bleemeo_registration_key: "YOUR_REGISTRATION_KEY" roles: - bleemeo.agentRun the playbook:
ansible-playbook -i inventory deploy-bleemeo.ymlManual Ansible Playbook
Section titled “Manual Ansible Playbook”If you prefer not to use the Galaxy role, here’s a complete playbook:
---- hosts: all become: yes vars: bleemeo_account_id: "YOUR_ACCOUNT_ID" bleemeo_registration_key: "YOUR_REGISTRATION_KEY"
tasks: # Debian/Ubuntu - name: Add Bleemeo GPG key (Debian/Ubuntu) ansible.builtin.apt_key: url: https://packages.bleemeo.com/bleemeo-agent/bleemeo-keyring.asc state: present when: ansible_os_family == "Debian"
- name: Add Bleemeo repository (Debian/Ubuntu) ansible.builtin.apt_repository: repo: "deb https://packages.bleemeo.com/bleemeo-agent {{ ansible_distribution_release }} main" state: present filename: bleemeo-agent when: ansible_os_family == "Debian"
- name: Install Bleemeo agent (Debian/Ubuntu) ansible.builtin.apt: name: bleemeo-agent state: present update_cache: yes when: ansible_os_family == "Debian"
# Fedora - name: Add Bleemeo repository (Fedora) ansible.builtin.yum_repository: name: bleemeo-agent description: Bleemeo Agent Repository baseurl: https://packages.bleemeo.com/bleemeo-agent/fedora/$releasever/$basearch/ gpgcheck: yes gpgkey: https://packages.bleemeo.com/bleemeo-agent/centos/gpg when: ansible_os_family == "RedHat" and ansible_distribution == "Fedora"
# RHEL/CentOS/Rocky/Alma - name: Add Bleemeo repository (RHEL/CentOS) ansible.builtin.yum_repository: name: bleemeo-agent description: Bleemeo Agent Repository baseurl: https://packages.bleemeo.com/bleemeo-agent/centos/$releasever/$basearch/ gpgcheck: yes gpgkey: https://packages.bleemeo.com/bleemeo-agent/centos/gpg when: ansible_os_family == "RedHat" and ansible_distribution != "Fedora"
- name: Install Bleemeo agent (RedHat family) ansible.builtin.yum: name: bleemeo-agent state: present when: ansible_os_family == "RedHat"
# Configuration (all systems) - name: Create Bleemeo configuration directory ansible.builtin.file: path: /etc/glouton/conf.d state: directory mode: '0755'
- name: Configure Bleemeo agent ansible.builtin.copy: dest: /etc/glouton/conf.d/30-install.conf content: | bleemeo: account_id: "{{ bleemeo_account_id }}" registration_key: "{{ bleemeo_registration_key }}" mode: '0640' notify: Restart Glouton
- name: Enable and start Glouton service ansible.builtin.systemd: name: glouton enabled: yes state: started
handlers: - name: Restart Glouton ansible.builtin.systemd: name: glouton state: restartedUsing Ansible Vault for Secrets
Section titled “Using Ansible Vault for Secrets”Store your credentials securely using Ansible Vault:
ansible-vault create group_vars/all/bleemeo_secrets.ymlAdd your credentials:
bleemeo_account_id: "YOUR_ACCOUNT_ID"bleemeo_registration_key: "YOUR_REGISTRATION_KEY"Run with vault:
ansible-playbook -i inventory deploy-bleemeo.yml --ask-vault-passPuppet
Section titled “Puppet”Puppet Module
Section titled “Puppet Module”Create a Puppet module for Bleemeo agent deployment.
Module structure:
bleemeo/├── manifests/│ └── init.pp├── files/└── templates/ └── glouton.conf.eppmanifests/init.pp:
class bleemeo ( String $account_id, String $registration_key, Boolean $manage_repo = true, String $ensure = 'present',) {
# Repository management if $manage_repo { case $facts['os']['family'] { 'Debian': { apt::source { 'bleemeo-agent': location => 'https://packages.bleemeo.com/bleemeo-agent', release => $facts['os']['distro']['codename'], repos => 'main', key => { 'id' => 'BLEEMEO_GPG_KEY_ID', 'source' => 'https://packages.bleemeo.com/bleemeo-agent/bleemeo-keyring.asc', }, before => Package['bleemeo-agent'], } } 'RedHat': { $repo_path = $facts['os']['name'] ? { 'Fedora' => 'fedora', default => 'centos', } yumrepo { 'bleemeo-agent': descr => 'Bleemeo Agent Repository', baseurl => "https://packages.bleemeo.com/bleemeo-agent/${repo_path}/\$releasever/\$basearch/", gpgcheck => 1, gpgkey => 'https://packages.bleemeo.com/bleemeo-agent/centos/gpg', enabled => 1, before => Package['bleemeo-agent'], } } default: { fail("Unsupported OS family: ${facts['os']['family']}") } } }
# Package installation package { 'bleemeo-agent': ensure => $ensure, }
# Configuration directory file { '/etc/glouton/conf.d': ensure => directory, mode => '0755', }
# Agent configuration file { '/etc/glouton/conf.d/30-install.conf': ensure => file, mode => '0640', content => epp('bleemeo/glouton.conf.epp', { 'account_id' => $account_id, 'registration_key' => $registration_key, }), require => [Package['bleemeo-agent'], File['/etc/glouton/conf.d']], notify => Service['glouton'], }
# Service management service { 'glouton': ensure => running, enable => true, require => Package['bleemeo-agent'], }}templates/glouton.conf.epp:
<%- | String $account_id, String $registration_key | -%>bleemeo: account_id: "<%= $account_id %>" registration_key: "<%= $registration_key %>"Using the Module
Section titled “Using the Module”In your node manifest or Hiera data:
class { 'bleemeo': account_id => 'YOUR_ACCOUNT_ID', registration_key => 'YOUR_REGISTRATION_KEY',}Or with Hiera (data/common.yaml):
bleemeo::account_id: 'YOUR_ACCOUNT_ID'bleemeo::registration_key: 'YOUR_REGISTRATION_KEY'Using eyaml for Secrets
Section titled “Using eyaml for Secrets”Encrypt sensitive data with Hiera eyaml:
eyaml encrypt -s 'YOUR_REGISTRATION_KEY'Add to your Hiera data:
bleemeo::account_id: 'YOUR_ACCOUNT_ID'bleemeo::registration_key: > ENC[PKCS7,encrypted_value_here]Chef Cookbook
Section titled “Chef Cookbook”Create a Chef cookbook for Bleemeo agent deployment.
Cookbook structure:
bleemeo/├── metadata.rb├── recipes/│ └── default.rb├── attributes/│ └── default.rb└── templates/ └── glouton.conf.erbmetadata.rb:
name 'bleemeo'maintainer 'Your Organization'maintainer_email 'ops@example.com'license 'Apache-2.0'description 'Installs and configures Bleemeo monitoring agent'version '1.0.0'
supports 'ubuntu'supports 'debian'supports 'centos'supports 'redhat'supports 'fedora'attributes/default.rb:
default['bleemeo']['account_id'] = nildefault['bleemeo']['registration_key'] = nildefault['bleemeo']['manage_repo'] = truerecipes/default.rb:
## Cookbook:: bleemeo# Recipe:: default#
# Validate required attributesif node['bleemeo']['account_id'].nil? || node['bleemeo']['registration_key'].nil? raise 'bleemeo account_id and registration_key must be set'end
# Repository setupif node['bleemeo']['manage_repo'] case node['platform_family'] when 'debian' apt_repository 'bleemeo-agent' do uri 'https://packages.bleemeo.com/bleemeo-agent' distribution node['lsb']['codename'] components ['main'] key 'https://packages.bleemeo.com/bleemeo-agent/bleemeo-keyring.asc' end when 'rhel', 'fedora' repo_path = node['platform'] == 'fedora' ? 'fedora' : 'centos' yum_repository 'bleemeo-agent' do description 'Bleemeo Agent Repository' baseurl "https://packages.bleemeo.com/bleemeo-agent/#{repo_path}/$releasever/$basearch/" gpgkey 'https://packages.bleemeo.com/bleemeo-agent/centos/gpg' gpgcheck true enabled true end endend
# Install the agentpackage 'bleemeo-agent' do action :installend
# Create configuration directorydirectory '/etc/glouton/conf.d' do mode '0755' recursive trueend
# Configure the agenttemplate '/etc/glouton/conf.d/30-install.conf' do source 'glouton.conf.erb' mode '0640' variables( account_id: node['bleemeo']['account_id'], registration_key: node['bleemeo']['registration_key'] ) notifies :restart, 'service[glouton]', :delayedend
# Manage the serviceservice 'glouton' do action [:enable, :start]endtemplates/glouton.conf.erb:
bleemeo: account_id: "<%= @account_id %>" registration_key: "<%= @registration_key %>"Using the Cookbook
Section titled “Using the Cookbook”In your node’s run list or role:
node.override['bleemeo']['account_id'] = 'YOUR_ACCOUNT_ID'node.override['bleemeo']['registration_key'] = 'YOUR_REGISTRATION_KEY'Or using a wrapper cookbook with encrypted data bags:
# In your wrapper cookbookbleemeo_secrets = data_bag_item('secrets', 'bleemeo')
node.override['bleemeo']['account_id'] = bleemeo_secrets['account_id']node.override['bleemeo']['registration_key'] = bleemeo_secrets['registration_key']
include_recipe 'bleemeo::default'Using Encrypted Data Bags
Section titled “Using Encrypted Data Bags”Create an encrypted data bag:
knife data bag create secrets bleemeo --secret-file /path/to/secret_keyContents:
{ "id": "bleemeo", "account_id": "YOUR_ACCOUNT_ID", "registration_key": "YOUR_REGISTRATION_KEY"}Additional Configuration
Section titled “Additional Configuration”All configuration management examples above create a minimal configuration. You can extend the configuration file to include additional settings:
bleemeo: account_id: "YOUR_ACCOUNT_ID" registration_key: "YOUR_REGISTRATION_KEY"
# Optional: Set a custom agent nameagent: public_ip_indicator: "https://api.ipify.org"
# Optional: Configure service monitoringservice: - type: "mysql" username: "monitoring" password: "secret"See the Agent Configuration page for all available options.
Verifying Deployment
Section titled “Verifying Deployment”After deployment, verify the agent is running and connected:
# Check service statussystemctl status glouton
# View agent logsjournalctl -u glouton -f
# Check agent local UI (if enabled)curl -s http://localhost:8015/The agent should appear in your Bleemeo dashboard within a few minutes.