This guide provides a full Ansible playbook to install Omnibus, a Ruby-based framework for building self-contained installers.
Note: Omnibus is a Ruby gem/framework, not a distro package. Installation is via Ruby gems.
Status Note: The latest release of Omnibus (v3.2.0) is from July 2014. The project may be in maintenance mode. Consider evaluating alternatives for new projects.
- name: Install Omnibus Ruby packaging framework
hosts: omnibus
become: true
vars:
omnibus_ruby_version: "3.2.0" # Latest release (2014)
tasks:
- name: Install Ruby and build dependencies (Debian/Ubuntu)
apt:
name:
- ruby
- ruby-dev
- build-essential
- git
- curl
- wget
state: present
update_cache: true
when: ansible_os_family == "Debian"
- name: Install Ruby and build dependencies (RHEL family)
dnf:
name:
- ruby
- ruby-devel
- gcc
- gcc-c++
- make
- git
- curl
- wget
state: present
when: ansible_os_family == "RedHat"
- name: Install Omnibus gem
gem:
name: omnibus
version: "{{ omnibus_ruby_version }}"
state: present
user_install: false
- name: Verify Omnibus is available
command: "omnibus --version"
register: omnibus_version
changed_when: false
failed_when: false
- name: Show detected Omnibus version
debug:
var: omnibus_version.stdout
For development or custom versions:
- name: Install Omnibus from source
hosts: omnibus
become: true
tasks:
- name: Install dependencies
package:
name:
- ruby
- ruby-dev
- git
- build-essential
state: present
- name: Clone Omnibus repository
git:
repo: https://github.com/chef/omnibus
dest: /opt/omnibus
version: main
- name: Install bundler
gem:
name: bundler
state: present
user_install: false
- name: Install Omnibus dependencies
command: bundle install
args:
chdir: /opt/omnibus
environment:
GEM_HOME: /usr/local/lib/ruby/gems
omnibus_config.rb)my-project/
├── omnibus/
│ ├── config/
│ │ └── omnibus_config.rb
│ └── software/
│ └── my-project.rb
└── Gemfile
Beyond this playbook, we offer:
Contact our automation team: office@linux-server-admin.com
References: