riponbanik.foreman
Ansible Role to Install and Configure Foreman
There is an issue with the Ubuntu VM in TravisCI. However, it has been successfully tested using kitchen-ansible with Hyper-V Vagrant and Amazon EC2.
Requirements
Foreman needs the hostname to be a fully qualified domain name (FQDN). You can change the hostname to FQDN using the Ansible hostname module or set the following variable:
foreman_hostname: foreman.vagrantup.com
Once the installation is successful, you can access Foreman at https://foreman_fqdn
with these default credentials:
- User: admin
- Password: password
Role Variables
Here are the available variables along with their default values (check defaults/main.yml
):
disable_puppet: true
By default, the all-in-one
Foreman installation includes a Puppet master, but you can disable it with the above setting.
Dependencies
You need a VM (on-premises or cloud) for installation. It has been tested on these operating systems:
- Red Hat Enterprise Linux 7, CentOS 7
- Ubuntu 16.04 (Xenial), 18.04 (Bionic)
- Debian 9
Both PostgreSQL and MySQL are supported on all listed OS, except Debian which only supports PostgreSQL.
Example Playbook
Here are some example playbooks you can use:
- name: Install Puppet Master
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
- name: Install Chef Server
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
foreman_version: 1.19
foreman_plugins:
- chef
- tasks
- name: Install Chef Proxy
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
foreman_version: 1.19
foreman_proxy_plugins:
- chef
foreman_proxy_plugin_options:
chef-server-url: 'https://chef.example.com/organizations/default'
chef-client-name: 'foreman'
chef-private-key: '/etc/opscode/foreman.pem'
chef-ssl-verify: 'false'
- name: Install Ansible
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
foreman_version: 1.19
foreman_plugins:
- ansible
- remote-execution
foreman_proxy_plugins:
- ansible
- remote-execution-ssh
- name: Install Ansible
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
foreman_version: 1.19
foreman_compute:
- ec2
Installation
To install the role from Ansible Galaxy:
sudo ansible-galaxy install riponbanik.foreman -p /etc/ansible/roles
To run the installation locally:
sudo ansible-playbook -c local -i "localhost," playbook.yml
License
MIT / BSD
References
You can find more documentation on the Foreman website: [https://www.theforeman.org/]
Author Information
This role was created by Ripon Banik in 2018 and updated by Chris Scheible in 2019.
ansible-galaxy install riponbanik.foreman