Directory(1) Introduction to Foreman
1. Overview of Foreman
2. Foreman Architecture
(2) installation and configuration process
1. installation environment
2. Collection of installation packages
3. Preparations
4. Install Foreman and puppet
5. modify the configuration file
Reference
(1) Introduction to Foreman
1.ForemanOverview
Foreman is an integrated data center lifecycle management tool that provides service activation, configuration management, and report functions. Like puppet dahboard, Foreman is also a Ruby on Rails program, it allows you to intuitively view the synchronization status and facter parameters of all puppet clients. The difference between Foreman and dashboard is that Foreman focuses more on Service Activation and management of data centers, such as boot tools and PXE startup servers (with kickstart integrated ), DHCP server and server activation tools are integrated.
2.ForemanArchitecture
(2) installation and configuration process
1.Installation environment:Centos6.5-x86_64, basic-Server
Install and update: Yum-y update
MASTER: foreman.test.com 172.19.146.27
AGENT: node1.test.com 172.19.146.28
2.Installation Package collection:
Httpd-2.2.15-30
Puppet-server-3.6.2-1
Puppet-3.6.2-1
Facter-2.1.0-1
Formann-1.5.2-1
Foreman-proxy-1.5.2-1
Foreman-sqlite-1.5.2-1
Source:
Puppet: https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-7.noarch.rpm
FOREMAN: http://yum.theforeman.org/releases/1.5/el6/x86_64/foreman-1.5.2-1.el6.noarch.rpm
Epel: http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
3.Preparations
A. Disable SELinux and firewall (or open port 8140 );
B. Set the hosts file (master and agent );
Vim/etc/hosts
Foreman.test.com 172.19.146.27
Node1.test.com 172.19.146.28
C. Download the package and dependency package to create a local repo Source: Update + httpd + Foreman + puppet + facter
D. Install httpd and start it. Set it to start automatically when it is started;
Yum install HTTP
Service httpd restart
Chkconfig httpd on
4.Install Foreman and puppet
A. Yum-y install puppet-server facter
B. Yum-y install Foreman-proxy Foreman-SQLite
Note: Only the basic Foreman-proxy module and the foreman-SQLite database module are installed here;
5.Modify configuration file
A. Puppet configuration:/etc/puppet. conf
Agent
Add [Agent] segments
Server = foreman.test.com
Certname = node1.test.com
MASTER:
Service puppetmaster start
Chkconfig puppetmaster on
Apply for authentication on the agnet client: puppet agent -- Test
Master Signature: puppet cert -- sign node1.test.com
Check the authentication status on the master end: puppet cert-list -- all
Note: If the master and Agent time are not synchronized, an error occurs when you apply for authentication.
B. Foreman-proxy configuration:/etc/Foreman-proxy/settings. yml
: Puppetca: True
: Puppet: True
: Puppet_conf:/etc/puppet. conf
Note: TFTP, DNS, and DHCP are not configured for the moment;
C. Configure Foreman's smart proxies
(1) Start Foreman and Foreman-Proxy:
Service Foreman start
Service Foreman-proxy start
(2) Web Browser: http://foreman.test.com: 3000 default user name and password: Admin changeme;
(3) open infrastructure --> smart proxies
New Smart proxy: Add a new intelligent proxy;
Name: Test
URL: http://foreman.test.com: 8443
NOTE: If/etc/Foreman-proxy/settings. yml is modified, after the foreman-proxy service is restarted, it must be in the smart-proxy on the foreman control panel.Refresh feasures;
C. Database settings
(1) SQLite database is used here. If MySQL or other databases are used, you need to modify the/etc/Foreman/database. yaml file.
(2) database Initialization
Forman-rake DB: migrate
Foreman-rake DB: Seed
D. Import puppet data from
(1) generate a fact file
Run the master and Agent: puppet agent-test, and send the facter information to the master;
View: LL/var/lib/puppet/yaml/facts
(2) Import facter data from puppet to Foreman
The old foreman version uses the following command:
Foreman-rake puppet: Import: hosts_and_facts dir =/var/lib/puppet/yaml/facts/rails_env = Production
Import, but the imported facter information is not displayed in 1.5.2, and no error is reported!
New Version: import [-> F. Import facter data to Foreman through ENC (external nodes Interface)]
E. Puppet report
(1) Add "report = true" to the master and Agent segments of puppet. conf [Agent;
(2) The default report type of puppet is store, with the following built-in report processors: store, log, tagmail, rrdgraph, HTTP,
(3) Forman customizes the foreman report processor and needs to be manually downloaded and added
Download link:
Https://raw.github.com/theforeman/puppet-foreman/2.1-stable/templates/foreman-report_v2.rb.erb
Rename the foreman-report_v2.rb.erb to Foreman. RB to the master end/usr/lib/Ruby/site_ruby/1.8/puppet/reports;
Modify foreman. RdFile:
$ Foreman_url = 'HTTP: // foreman.test.com: 8080'
(4) Add a foreman Report Type
Add the [Master] segment of the master: Reports = foreman, log
F. Use ENC to import facter data to Foreman
(1) download an object
Https://raw.github.com/theforeman/puppet-foreman/2.1-stable/templates/external_node_v2.rb.erb
To:/etc/puppet/, rename it node. RB;
(2) Add executable permissions: chomod + x/etc/puppet/node. Rd
(3) EDIT node. RD (SSL is not set for the moment)
(4) Add:
External_nodes =/etc/puppet/node. Rb
Node_terminus = Exec
(5) restart: puppetmaster, foreman, Foreman-proxy service;
Run puppet agent -- test on the puppet agent end to view the facter information of each node on the foreman Web Interface (http: // 172.19.146.27: 3000.
Reference link:
[1] http://www.jsxubar.info/centos-6-install-puppet-foreman.html
[2] http://itnihao.blog.51cto.com/1741976/1143208
[3] http:// OS .51cto.com/art/201101/244173.htm
[4] http://longgeek.com/2012/10/23/puppet-console-foreman/
[5] http://dywer.blog.51cto.com/678776/415839
[6] http://www.thefarsideoffailure.com/blog/foreman_on_centos
[7] http://theforeman.org/manuals/1.5/index.html#Releasenotesfor1.5.2
Forman installation and configuration process