riponbanik.foreman
Ansible 角色用于安装和配置 Foreman
在 TravisCI 中的 Ubuntu 虚拟机出现了问题,已通过 kitchen-ansible 使用 hyperv vagrant 机器和 Amazon ec2 进行测试。
需求
Foreman 需要主机名为完全合格域名(fqdn)。使用 Ansible 的 hostname 模块将主机名更改为 fqdn,或使用以下角色变量更改主机名,例如: foreman_hostname: foreman.vagrantup.com
安装成功后,可以使用默认凭据通过 https://foreman_fqdn 访问 Foreman:
用户:admin 密码:password
角色变量
可用的变量如下所示,以及默认值(请参见 defaults/main.yml
):
disable_puppet: true
默认情况下,all-in-one
Foreman 安装包括 Puppet master,但可以通过上述参数禁用。
依赖项
需要虚拟机(本地或云)进行安装。已在以下操作系统上进行测试:
- Redhat Enterprise Linux 7, CentOS 7
- Ubuntu 16.04 (Xenial), 18.04 (Bionic)
- Debian 9
上述所有系统均支持 PostgreSQL 和 MySQL,除了 Debian。Debian 仅支持 PostgreSQL。
示例剧本
- name: 安装 Puppet Master
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
- name: 安装 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: 安装 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: 安装 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: 安装 Ansible
hosts: servers
vars_files:
- vars/main.yml
roles:
- role: riponbanik.foreman
foreman_hostname: foreman.vagrantup.com
foreman_version: 1.19
foreman_compute:
- ec2
安装
从 ansible galaxy 安装角色到 ansible 默认角色路径
sudo ansible-galaxy install riponbanik.foreman -p /etc/ansible/roles
在本地机器上运行安装
sudo ansible-playbook -c local -i "localhost," playbook.yml
许可
MIT / BSD
参考
文档可从 Foreman 网站获取 [https://www.theforeman.org/]
作者信息
该角色由 Ripon Banik 于 2018 年创建。 2019 年由 Chris Scheible 修复和测试。