Centos 7 Puppet之foreman介绍安装测试

一、简介

  1、前言(引用一下网上的资料)

  随着企业的 Linux 系统数量越来越多,管理问题便成为一个相对麻烦并需要急 迫解决的问题,这里有 2 个 Key Message:1)统一管控体系非常重要,2)最佳运 维体验是运维的追求。 Puppet 是一种 Linux、Unix、Windows 的集中管理工具,采用 C/S 架构, 能够通过一个集中的管控点实现对成千上万台服务器的集中管理,请注意,这里的 管理,不涉及硬件层面的管理、监控等内容,主要服务器软件层面的管理,如软件 部署、配置、账户管理等等日常的软件层面管理。

  Puppet 采用 Ruby 语言编写, 但在管理的时候,管理员不需要丰富的 Ruby 只是,仅仅是通过 Puppet 所定义的 资源描述语言即可工作,这让管理员的学习门槛低了很多。

    与 Puppet 同类的软件还有很多,例如 Chef、SaltStack,但是我用一句话总 结以下他们的优劣,就是:Chef 太老,SaltStack 太新,Puppet 正好。 现在国内采用 Puppet 的大型企业包括新浪、阿里巴巴、百度、腾讯、小米、 PPTV、用友、中国建设银行等。

  那么,Foreman 和 Puppet 是什么关系呢?简单来说,Foreman 就是 Puppet 的 Web 界面,当然,Foreman 的功能不仅仅一个 Web 界面这么简单,引用 Foreman 的介绍来说,Foreman 包含 3 大功能,第一是部署,Foreman 能够实 现快速的系统部署或者再部署;第二就是配置管理,这一点是和 Puppet 进行结合 的;第三是监控,通过 Foreman,能够对 puppet 的执行状况进行检查,也能根 据所有服务器的状态执行不同的报告,让管理员对系统运行情况具有直观的了解。

  本文测试的foreman版本为1.20,puppet5,平台为centos 7

  2、foreman是什么?

   foreman是基于puppet的一个“增强工具”,主要能够帮到我们运维狗的有:

       1. 操作系统的部署

        foreman提供了一个基于kickstart的部署工具,输入一台服务器的部署网卡的mac地址和hostname、ip等信息,就能自动的帮我们部署完,并且,还可以生成一个部署iso,用于该服务器的重新部署。

       2. puppet的节点管理(ENC)

       原生的puppet管理节点分类以及节点和puppet类之间的映射靠文件描述,企业客户更希望有一个直观的工具,foreman可以通过Web界面将节点分组,将类分组,并且构建两者的映射关系。

      3. puppet的Web界面

            有个Web总是比命令行要方便,foreman提供了一个还算的过去的web界面,用于节点管理、类管理、变量管理、配置管理、部署管理等功能。

  3、怎么利用foreman

  

    foreman给我们的一个很大帮助就是,他把所有的配置、fact结果、运行结果什么都放到了mysql数据库里,所以,我们在做一些运行分析的时候,可以直接从数据库中获取数据进行分析即可。

    foreman帮我们搞定了节点管理、数据入库,剩下的就是你的想象力了。

 

  4、请参考官方快速部署手册

    https://www.theforeman.org/manuals/1.20/quickstart_guide.html

二、foreman的架构

  1、foreman本身只是一个框架,通过smart-proxy代理各种应用程序完成各项功能。

    

  2、foreman通过代理DNS、DHCP、TFTP完成了kickstart、cobbler、jumpstart等各种自动化安装系统工具的图形统一管理串口,实现的结果是只需要在foreman上指定各种模板(pex、ks),不同的模板还可以嵌套各种片段(snippet)达到统一、简化的目的。完成之后,便可以添加节点,关联定义的各种模板生成各种pxe和ks文件实现自动化安装。

  3、foreman通过代理puppet、puppet CA完成对puppet自动签名、puppet环境、class、变量、facter的管理。

  4、foreman通过ENC和静态组管理class和node之间的关联。

  5、foreman通过puppet plugin,可以在UI上完成对节点puppet命令的触发动作,触发的方法可以借助puppetkick(被遗弃了)、mcollective(借助sudo)、puppettssh(借助sshkey)、salt、customrun等各种工具实现。

  6、foreman可以收集所有节点运行puppet生成报告、执行情况

  7、foreman还提供了各种搜索、报表等功能,能够更好的展现节点的运行状况。

  8、foreman除了管理裸机外还可以管理各种虚拟化软件,如RHEV-M、EC2、VMWware和openstack

  9、foreman还可以和LDAP及AD集成

  10、foreman还提供了强大了用户、权限管理入口,可以建立多个用户、多个用户组、还可以对权限进行角色的定义等。不同的权限用户在UI上所看到的功能以及主机是不一样的。

  11、foreman开提供了所有在UI上操作的AUDITS(审计)功能、这样可以保障素有用户的操作都有据可查。

 

三、安装部署

  1、平台支持

    

      

  2、兼容性

    foreman puppet兼容性

    

    foreman puppet server 兼容性

      

  3、防火墙配置

      

  4、配置yum源,我这里测试本地已经连接互联网

  

    rpm -ivh https://yum.puppetlabs.com/puppet5/puppet5-release-el-7.noarch.rpm
    rpm -ivh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

    rpm -ivh https://yum.theforeman.org/releases/1.20/el7/x86_64/foreman-release.rpm

 

  5、安装foreman-installer

  yum install -y foreman-installer

 

 1 yum install -y foreman-installer
 2 foreman-installer           noarch     1:1.20.1-1.el7          foreman     1.0 M
 3  puppet-agent                x86_64     5.5.8-1.el7             puppet5      20 M
 4      replacing  facter.x86_64 1:2.4.6-1.el7
 5      replacing  puppet.noarch 3.8.7-1.el7
 6 Installing for dependencies:
 7  foreman-selinux             noarch     1.20.1-1.el7            foreman      46 k
 8  rubygem-ansi                noarch     1.4.3-2.el7             epel         36 k
 9  rubygem-clamp               noarch     1.1.2-4.el7             foreman      29 k
10  rubygem-hashie              noarch     3.6.0-1.el7             foreman      33 k
11  rubygem-highline            noarch     1.7.8-4.el7             foreman      38 k
12  rubygem-kafo                noarch     2.1.0-1.el7             foreman      69 k
13  rubygem-kafo_parsers        noarch     0.1.6-1.el7             foreman      12 k
14  rubygem-kafo_wizards        noarch     0.0.1-2.el7             foreman      13 k
15  rubygem-little-plugger      noarch     1.1.3-23.el7            foreman      13 k
16  rubygem-logging             noarch     2.2.2-3.el7             foreman      59 k
17  rubygem-multi_json          noarch     1.12.2-3.el7            foreman      20 k
18  rubygem-powerbar            noarch     2.0.1-1.el7             foreman      11 k
19 Updating for dependencies:
20  libsemanage                 x86_64     2.5-14.el7              base        151 k
21  libsemanage-python          x86_64     2.5-14.el7              base        113 k
22  policycoreutils             x86_64     2.5-29.el7              base        916 k
23  policycoreutils-python      x86_64     2.5-29.el7              base        456 k
24  selinux-policy              noarch     3.13.1-229.el7_6.6      updates     483 k
25  selinux-policy-targeted     noarch     3.13.1-229.el7_6.6      updates     6.9 M
26  setools-libs                x86_64     3.3.8-4.el7             base        620 k
27 
28 Transaction Summary
29 
30 
31 Installed:
32   foreman-installer.noarch 1:1.20.1-1.el7    puppet-agent.x86_64 0:5.5.8-1.el7   
33 
34 Dependency Installed:
35   foreman-selinux.noarch 0:1.20.1-1.el7                                           
36   rubygem-ansi.noarch 0:1.4.3-2.el7                                               
37   rubygem-clamp.noarch 0:1.1.2-4.el7                                              
38   rubygem-hashie.noarch 0:3.6.0-1.el7                                             
39   rubygem-highline.noarch 0:1.7.8-4.el7                                           
40   rubygem-kafo.noarch 0:2.1.0-1.el7                                               
41   rubygem-kafo_parsers.noarch 0:0.1.6-1.el7                                       
42   rubygem-kafo_wizards.noarch 0:0.0.1-2.el7                                       
43   rubygem-little-plugger.noarch 0:1.1.3-23.el7                                    
44   rubygem-logging.noarch 0:2.2.2-3.el7                                            
45   rubygem-multi_json.noarch 0:1.12.2-3.el7                                        
46   rubygem-powerbar.noarch 0:2.0.1-1.el7                                           
47 
48 Dependency Updated:
49   libsemanage.x86_64 0:2.5-14.el7                                                 
50   libsemanage-python.x86_64 0:2.5-14.el7                                          
51   policycoreutils.x86_64 0:2.5-29.el7                                             
52   policycoreutils-python.x86_64 0:2.5-29.el7                                      
53   selinux-policy.noarch 0:3.13.1-229.el7_6.6                                      
54   selinux-policy-targeted.noarch 0:3.13.1-229.el7_6.6                             
55   setools-libs.x86_64 0:3.3.8-4.el7                                               
56 
57 Replaced:
58   facter.x86_64 1:2.4.6-1.el7             puppet.noarch 0:3.8.7-1.el7            
59 
60 Complete!

 

  6、使用foreman-installer 安装(-i是交互模式)

 1 root@puppet-foreman ~]# foreman-installer -i
 2 Unable to resolve forward DNS for puppet-foreman
 3 Output of 'facter fqdn' is different from 'hostname -f'
 4  
 5 Make sure above command gives the same output. If needed, change the hostname permanently via the
 6 'hostname' or 'hostnamectl set-hostname' command 
 7 and editing the appropriate configuration file.
 8 (e.g. on Red Hat systems /etc/sysconfig/network, 
 9 on Debian based systems /etc/hostname).
10 
11 If 'hostname -f' still returns an unexpected result, check /etc/hosts and put
12 the hostname entry in the correct order, for example:
13  
14   1.2.3.4 full.hostname.com full
15  
16 The fully qualified hostname must be the first entry on the line
17 Your system does not meet configuration criteria

    提示必须修改hostname和/etc/hosts文件

1 [root@puppet-foreman ~]# cat /etc/hosts
2 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
3 ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
4 192.168.216.234  www.puppet-foreman.com
5 [root@puppet-foreman ~]# hostnamectl set-hostname www.puppet-foreman.com

    修改后重启,init6

  

[root@www ~]# !for
foreman-installer -i
Welcome to the Foreman installer!
---------------------------------

This wizard will gather all required information. You can change any parameter
to your needs.


Ready to start? (y/n)
[root@www ~]# !for
foreman-installer -i
Welcome to the Foreman installer!
---------------------------------

This wizard will gather all required information. You can change any parameter
to your needs.


Ready to start? (y/n)
y

Main Config Menu
1. [✓] Configure foreman
2. [✓] Configure foreman_cli
3. [✗] Configure foreman_cli_discovery
4. [✗] Configure foreman_cli_openscap
5. [✗] Configure foreman_cli_remote_execution
6. [✗] Configure foreman_cli_tasks
7. [✗] Configure foreman_cli_templates
8. [✓] Configure foreman_proxy
9. [✓] Configure puppet
10. [✗] Configure foreman_plugin_ansible
11. [✗] Configure foreman_plugin_azure
12. [✗] Configure foreman_plugin_bootdisk
13. [✗] Configure foreman_plugin_chef
14. [✗] Configure foreman_plugin_cockpit
15. [✗] Configure foreman_plugin_default_hostgroup
16. [✗] Configure foreman_plugin_dhcp_browser
17. [✗] Configure foreman_plugin_digitalocean
18. [✗] Configure foreman_plugin_discovery
19. [✗] Configure foreman_plugin_docker
20. [✗] Configure foreman_plugin_expire_hosts
21. [✗] Configure foreman_plugin_hooks
22. [✗] Configure foreman_plugin_host_extra_validator
23. [✗] Configure foreman_plugin_memcache
24. [✗] Configure foreman_plugin_monitoring
25. [✗] Configure foreman_plugin_omaha
26. [✗] Configure foreman_plugin_openscap
27. [✗] Configure foreman_plugin_ovirt_provision
28. [✗] Configure foreman_plugin_puppetdb
29. [✗] Configure foreman_plugin_remote_execution
30. [✗] Configure foreman_plugin_salt
31. [✗] Configure foreman_plugin_setup
32. [✗] Configure foreman_plugin_snapshot_management
33. [✗] Configure foreman_plugin_tasks
34. [✗] Configure foreman_plugin_templates
35. [✗] Configure foreman_compute_ec2
36. [✗] Configure foreman_compute_gce
37. [✗] Configure foreman_compute_libvirt
38. [✗] Configure foreman_compute_openstack
39. [✗] Configure foreman_compute_ovirt
40. [✗] Configure foreman_compute_rackspace
41. [✗] Configure foreman_compute_vmware
42. [✗] Configure foreman_proxy_plugin_abrt
43. [✗] Configure foreman_proxy_plugin_ansible
44. [✗] Configure foreman_proxy_plugin_chef
45. [✗] Configure foreman_proxy_plugin_dhcp_infoblox
46. [✗] Configure foreman_proxy_plugin_dhcp_remote_isc
47. [✗] Configure foreman_proxy_plugin_discovery
48. [✗] Configure foreman_proxy_plugin_dns_infoblox
49. [✗] Configure foreman_proxy_plugin_dns_powerdns
50. [✗] Configure foreman_proxy_plugin_dynflow
51. [✗] Configure foreman_proxy_plugin_monitoring
52. [✗] Configure foreman_proxy_plugin_omaha
53. [✗] Configure foreman_proxy_plugin_openscap
54. [✗] Configure foreman_proxy_plugin_pulp
55. [✗] Configure foreman_proxy_plugin_remote_execution_ssh
56. [✗] Configure foreman_proxy_plugin_salt
57. Display current config
58. Save and run
59. Cancel run without Saving
Choose an option from the menu... 58  #我直接默认了,可以选这56项里面的,这里的58就是保存运行,然后下面就开始安装了
Preparing installation Debug: Loading facts from /usr/share/foreman-instaPreparing installation Debug: Failed to load library 'cfpropertylist' forPreparing installation Debug: Facter: searching for operatingsystem.rb inPreparing installation Debug: Facter: searching for operatingsystemreleasPreparing installation Debug: Facter: fact "network6_lo" has resolved to Preparing installation Debug: Facter: fact "systemd_internal_services" haPreparing installation Debug: Facter: # dmidecode 3.0                    Preparing installation           64-bit capable                                  Preparing installation              Multi-Core                                      Preparing installation      Manufacturer: GenuineIntel                       Preparing installation         Configuration: Enabled, Socketed, Level 1        Preparing installation     Speed: Unknown                                   Preparing installation     Configuration: Enabled, Socketed, Level 1        Preparing installation                 Burst                                           Preparing installation Cache Information                                 Preparing installation         Bank Locator: RAM slot #6                        Preparing installation         Type: DRAM                                       Preparing installation     Error Information Handle: No Error               Preparing installation     Memory Array Mapped Address Handle: 0x00A7       Preparing installation   }                                               Preparing installation             No such key: "lookup_options"         Preparing installation Debug: Automatically imported foreman_proxy::paramPreparing installation           Original path: "kafo_answers"           Preparing installation           Found key: "foreman::email_smtp_port" vaPreparing installation Debug: Automatically imported foreman::rake from fPreparing installation Debug: Automatically imported apache from apache iPreparing installation Debug: Automatically imported apache::service fromPreparing installation Debug: Automatically imported apache::mod::ext_filPreparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: importing '/usr/share/foreman-installer/modPreparing installation         Path "/tmp/kafo_hiera20190110-3050-1qocr9/Preparing installation   Searching for "postgresql::server::config_entriePreparing installation Debug: importing '/usr/share/foreman-installer/modPreparing installation       Hierarchy entry "yaml"                      Preparing installation           No such key: "foreman_proxy::dhcp_managePreparing installation Debug: importing '/usr/share/foreman-installer/modPreparing installation Debug: Automatically imported foreman_proxy::settiPreparing installation           Original path: "custom"                 Preparing installation       Using configuration "/tmp/kafo_hiera20190110Preparing installation       Hierarchy entry "yaml"                      Preparing installation Debug: Automatically imported puppet::server from Preparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation       Hierarchy entry "yaml"                      Preparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: Automatically imported apache::listen from Preparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: Scope(Apache::Vhost[foreman-ssl]): RetrieviPreparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: template[/usr/share/foreman-installer/modulPreparing installation Debug: Resource concat::fragment[puppet.conf_main]Preparing installation Debug: Adding relationship from ring installation Debug: Deleted text domain :production: true      Installing             Debug: Prefetching inifile resources for yumrepo   [0%] [ ]Installing             Yumrepo[epel]                                      [0%] [ ]Installing             Debug: Prefetching yum resources for package       [0%] [ ]Installing             Package[foreman-release-scl]                       [0%] [                                                                                                                                                            ]Installing             Package[foreman-postgresql]                        [0%] [.                                                                                                                                                           ]Installing             Package[httpd]                                     [1%] [                                   ]Installing             Group[apache]                                      [1%] [ ]Installing             User[apache]                                       [1%] [ ]Installing             Exec[mkdir /etc/httpd/conf.d]                      [2%] [ ]Installing             Exec[mkdir /etc/httpd/conf.modules.d]              [2%] [ ]Installing             Package[mailcap]                                   [3%] [ ]Installing             File[mime.conf]                                    [3%] [ ]Installing             File[mime_magic.conf]                              [3%] [ ]Installing             File[alias.conf]                                   [4%] [ ]Installing             File[autoindex.conf]                               [4%] [ ]Installing             File[deflate.conf]                                 [4%] [ ]Installing             File[dir.conf]                                     [5%] [ ]Installing             File[negotiation.conf]                             [5%] [ ]Installing             File[setenvif.conf]                                [6%] [ ]Installing             File[/etc/httpd/conf.modules.d/prefork.conf]       [6%] [ ]Installing             Package[postgresql-client]                         [6%] [ ]Installing             File[/usr/local/bin/validate_postgresql_connection [7%] [...........                                                                                                                                                 ]Installing             Package[postgresql-server]                         [7%] [...........                                                                                                                                                 ]Installing             File[/var/lib/pgsql/data]                          [8%] [............                                                                                                                                                ]Installing             Exec[postgresql_initdb]                            [8%] [.............                                                                                                                                               ]Installing             File[systemd-override]                             [8%] [ ]Installing             Exec[restart-systemd]                              [9%] [ ]Installing             Package[foreman-proxy]                             [9%] [ ]Installing             Package[puppet-agent-oauth]                        [9%] [...                                ]Installing             Package[tftp-server]                               [10%] [...                               ]Installing             Package[syslinux]                                  [10%] [...                               ]Installing             File[/var/lib/tftpboot]                            [11%] [...                               ]Installing             File[/etc/tftpd.map]                               [11%] [...                               ]Installing             Package[xinetd]                                    [11%] [....                              ]Installing             File[/etc/xinetd.d]                                [12%] [....                              ]Installing             File[/etc/xinetd.conf]                             [12%] [....                              ]Installing             Package[wget]                                      [12%] [....                              ]Installing             File[/etc/puppetlabs/puppet]                       [13%] [....                              ]Installing             Package[puppet-agent]                              [13%] [....                              ]Installing             Package[puppetserver]                              [14%] [....                              ]Installing             User[puppet]                                       [14%] [....                              ]Installing             Augeas[puppet::server::puppetserver::jvm]          [14%] [.....                             ]Installing             Augeas[puppet::server::puppetserver::bootstrap]    [15%] [.....                             ]Installing             Augeas[puppet::server::puppetserver::jruby_jar]    [15%] [.....                             ]Installing             File[/etc/puppetlabs/puppetserver/services.d]      [16%] [.....                             ]Installing             File[/etc/puppetlabs/puppetserver/services.d/ca.cf [16%] [.....                             ]Installing             File[/opt/puppetlabs/server/apps/puppetserver/conf [16%] [.....                             ]Installing             File[/opt/puppetlabs/server/apps/puppetserver/conf [17%] [.....                             ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/ca.conf]  [17%] [.....                             ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/puppetser [17%] [......                            ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/auth.conf [18%] [......                            ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/webserver [18%] [......                            ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/product.c [19%] [......                            ]Installing             File[/etc/puppetlabs/puppetserver/conf.d/metrics.c [19%] [......                            ]Installing             Exec[mkdir -p /usr/share/puppet/modules]           [19%] [......                            ]Installing             Exec[puppet_server_config-create_ssl_dir]          [20%] [......                            ]Installing             File[/etc/puppetlabs/puppet/ssl/private_keys]      [20%] [.......                           ]Installing             File[/etc/puppetlabs/puppet/ssl/private_keys/www.p [20%] [.......                           ]Installing             File[/etc/puppetlabs/puppet/autosign.conf]         [21%] [.......                           ]Installing             File[/etc/puppetlabs/code/environments]            [21%] [.......                           ]Installing             File[/opt/puppetlabs/puppet]                       [22%] [.......                           ]Installing             File[/opt/puppetlabs/puppet/cache/reports]         [22%] [.......                           ]Installing             File[/etc/puppetlabs/code/environments/common]     [22%] [.......                           ]Installing             File[/etc/puppetlabs/code/modules]                 [23%] [.......                           ]Installing             File[/opt/puppetlabs/puppet/modules]               [23%] [........                          ]Installing             File[/usr/share/puppet/modules]                    [24%] [........                          ]Installing             Package[rubygem-json]                              [24%] [........                          ]Installing             File[/etc/puppetlabs/puppet/foreman.yaml]          [24%] [........                          ]Installing             Exec[Create Puppet Reports dir]                    [25%] [........                          ]Installing             File[/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/p [25%] [........                          ]Installing             File[/etc/puppetlabs/puppet/node.rb]               [25%] [........                          ]Installing             File[/opt/puppetlabs/server/data/puppetserver/yaml [26%] [........                          ]Installing             File[/opt/puppetlabs/server/data/puppetserver/yaml [26%] [.........                         ]Installing             File[/opt/puppetlabs/server/data/puppetserver/yaml [27%] [.........                         ]Installing             File[/opt/puppetlabs/server/data/puppetserver/yaml [27%] [.........                         ]Installing             Package[foreman-cli]                               [27%] [.........                         ]Installing             File[/etc/hammer/cli.modules.d/foreman.yml]        [28%] [.........                         ]Installing             File[/root/.hammer]                                [28%] [.........                         ]Installing             File[/root/.hammer/cli.modules.d]                  [29%] [.........                         ]Installing             File[/root/.hammer/cli.modules.d/foreman.yml]      [29%] [.........                         ]Installing             Concat_file[/etc/httpd/conf/ports.conf]            [29%] [..........                        ]Installing             File[/etc/httpd/conf/httpd.conf]                   [30%] [..........                        ]Installing             File[log_config.load]                              [30%] [..........                        ]Installing             File[systemd.load]                                 [30%] [..........                        ]Installing             File[unixd.load]                                   [31%] [..........                        ]Installing             File[authz_host.load]                              [31%] [..........                        ]Installing             File[actions.load]                                 [32%] [..........                        ]Installing             File[authn_core.load]                              [32%] [...........                       ]Installing             File[cache.load]                                   [32%] [...........                       ]Installing             File[ext_filter.load]                              [33%] [...........                       ]Installing             File[mime.load]                                    [33%] [...........                       ]Installing             File[mime_magic.load]                              [33%] [...........                       ]Installing             File[rewrite.load]                                 [34%] [...........                       ]Installing             File[speling.load]                                 [34%] [...........                       ]Installing             File[suexec.load]                                  [35%] [...........                       ]Installing             File[version.load]                                 [35%] [............                      ]Installing             File[vhost_alias.load]                             [35%] [............                      ]Installing             File[auth_digest.load]                             [36%] [............                      ]Installing             File[authn_anon.load]                              [36%] [............                      ]Installing             File[authn_dbm.load]                               [37%] [............                      ]Installing             File[authz_dbm.load]                               [37%] [............                      ]Installing             File[authz_owner.load]                             [37%] [............                      ]Installing             File[expires.load]                                 [38%] [............                      ]Installing             File[include.load]                                 [38%] [.............                     ]Installing             File[logio.load]                                   [38%] [.............                     ]Installing             File[substitute.load]                              [39%] [.............                     ]Installing             File[usertrack.load]                               [39%] [.............                     ]Installing             File[alias.load]                                   [40%] [.............                     ]Installing             File[authn_file.load]                              [40%] [.............                     ]Installing             File[autoindex.load]                               [40%] [.............                     ]Installing             File[dav.load]                                     [41%] [..............                    ]Installing             File[dav_fs.conf]                                  [41%] [..............                    ]Installing             File[dav_fs.load]                                  [41%] [..............                    ]Installing             File[deflate.load]                                 [42%] [..............                    ]Installing             File[dir.load]                                     [42%] [..............                    ]Installing             File[negotiation.load]                             [43%] [..............                    ]Installing             File[setenvif.load]                                [43%] [..............                    ]Installing             File[auth_basic.load]                              [43%] [..............                    ]Installing             File[filter.load]                                  [44%] [...............                   ]Installing             File[authz_core.load]                              [44%] [...............                   ]Installing             File[access_compat.load]                           [45%] [...............                   ]Installing             File[authz_user.load]                              [45%] [...............                   ]Installing             File[authz_groupfile.load]                         [45%] [...............                   ]Installing             File[env.load]                                     [46%] [...............                   ]Installing             File[/etc/httpd/conf.modules.d/prefork.load]       [46%] [...............                   ]Installing             File[cgi.load]                                     [46%] [...............                   ]Installing             File[/var/www/html]                                [47%] [................                  ]Installing             File[/var/log/httpd]                               [47%] [................                  ]Installing             File[headers.load]                                 [48%] [................                  ]Installing             Package[mod_passenger]                             [48%] [................                  ]Installing             File[passenger.conf]                               [48%] [................                  ]Installing             File[zpassenger.load]                              [49%] [................                  ]Installing             Concat_file[/var/lib/pgsql/data/pg_hba.conf]       [49%] [................                  ]Installing             Debug: Prefetching parsed resources for postgresql [50%] [.................                 ]Installing             Postgresql_conf[port]                              [50%] [.................                 ]Installing             Postgresql_conf[data_directory]                    [50%] [.................                 ]Installing             Concat_file[/var/lib/pgsql/data/pg_ident.conf]     [50%] [.................                 ]Installing             Postgresql_conf[checkpoint_completion_target]      [51%] [.................                 ]Installing             Postgresql_conf[max_connections]                   [51%] [.................                 ]Installing             Postgresql_conf[shared_buffers]                    [51%] [.................                 ]Installing             Postgresql_conf[work_mem]                          [52%] [.................                 ]Installing             Postgresql_conf[log_line_prefix]                   [52%] [.................                 ]Installing             File[/etc/xinetd.d/tftp]                           [53%] [..................                ]Installing             Service[xinetd]                                    [53%] [..................                ]Installing             Concat_file[/etc/puppetlabs/puppet/puppet.conf]    [53%] [..................                ]Installing             File[/etc/puppetlabs/puppet/auth.conf]             [54%] [..................                ]Installing             Exec[puppet_server_config-generate_ca_cert]        [54%] [..................                ]Installing             File[/etc/puppetlabs/code/environments/development [54%] [..................                ]Installing             File[/etc/puppetlabs/code/environments/development [55%] [..................                ]Installing             File[/etc/puppetlabs/code/environments/development [55%] [..................                ]Installing             File[/etc/puppetlabs/code/environments/production] [56%] [...................               ]Installing             File[/etc/puppetlabs/code/environments/production/ [56%] [...................               ]Installing             File[/etc/puppetlabs/code/environments/production/ [56%] [...................               ]Installing             Concat_file[15-default.conf]                       [57%] [...................               ]Installing             Concat_file[15-default-ssl.conf]                   [57%] [...................               ]Installing             Package[mod_ssl]                                   [58%] [...................               ]Installing             File[/etc/httpd/conf.d]                            [58%] [...................               ]Installing             File[passenger_package.conf]                       [58%] [...................               ]Installing             File[ssl.conf]                                     [59%] [....................              ]Installing             File[ssl.load]                                     [59%] [....................              ]Installing             File[socache_shmcb.load]                           [59%] [....................              ]Installing             File[/etc/httpd/conf.modules.d]                    [60%] [....................              ]Installing             Service[postgresqld]                               [60%] [....................              ]Installing             Postgresql_conn_validator[validate_service_is_runn [61%] [....................              ]Installing             Exec[postgresql_reload]                            [61%] [....................              ]Installing             Postgresql_psql[CREATE ROLE foreman ENCRYPTED PASS [61%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" NOSUPERUSER]  [62%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" NOCREATEDB]   [62%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" NOCREATEROLE] [62%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" LOGIN]        [63%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" INHERIT]      [63%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" NOREPLICATION [64%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE "foreman" CONNECTION LI [64%] [.....................             ]Installing             Postgresql_psql[ALTER ROLE foreman ENCRYPTED PASSW [64%] [......................            ]Installing             Postgresql_psql[CREATE DATABASE "foreman"]         [65%] [......................            ]Installing             Postgresql_psql[REVOKE CONNECT ON DATABASE "forema [65%] [......................            ]Installing             Postgresql_psql[UPDATE pg_database SET datistempla [66%] [......................            ]Installing             Postgresql_psql[ALTER DATABASE "foreman" OWNER TO  [66%] [......................            ]Installing             Package[tfm-rubygem-passenger-native]              [66%] [......................            ]Installing             File[/etc/foreman/database.yml]                    [67%] [......................            ]Installing             File[/etc/foreman/email.yaml]                      [67%] [......................            ]Installing             File[/etc/sysconfig/foreman]                       [67%] [.......................           ]Installing             File[/usr/share/foreman]                           [68%] [.......................           ]Installing             User[foreman]                                      [68%] [.......................           ]Installing             Debug: Prefetching crontab resources for cron      [69%] [.......................           ]Installing             Cron[clear_session_table]                          [69%] [.......................           ]Installing             Cron[expire_old_reports]                           [69%] [.......................           ]Installing             Cron[daily summary]                                [69%] [.......................           ]Installing             File[/etc/httpd/conf.d/05-foreman.d]               [70%] [.......................           ]Installing             File[/etc/httpd/conf.d/05-foreman-ssl.d]           [70%] [........................          ]Installing             File[/usr/share/foreman/config.ru]                 [70%] [........................          ]Installing             File[/usr/share/foreman/config/environment.rb]     [71%] [........................          ]Installing             Concat_file[/etc/foreman/settings.yaml]            [71%] [........................          ]Installing             Concat_file[05-foreman.conf]                       [72%] [........................          ]Installing             Concat_file[05-foreman-ssl.conf]                   [72%] [........................          ]Installing             Postgresql_psql[grant:database:GRANT foreman - ALL [72%] [........................          ]Installing             Debug: Prefetching cli resources for foreman_confi [73%] [........................          ]Installing             Foreman_config_entry[db_pending_migration]         [73%] [........................          ]Installing             Exec[foreman-rake-db:migrate]                      [73%] [.........................         ]Installing             Foreman_config_entry[db_pending_seed]              [74%] [.........................         ]Installing             Exec[foreman-rake-db:seed]                         [74%] [.........................         ]Installing             Service[httpd]                                     [74%] [.........................         ]Installing             Service[dynflowd]                                  [75%] [.........................         ]Installing             Exec[restart_foreman]                              [75%] [.........................         ]Installing             Service[foreman]                                   [75%] [.........................         ]Installing             User[foreman-proxy]                                [76%] [.........................         ]Installing             File[/var/lib/tftpboot/pxelinux.cfg]               [76%] [..........................        ]Installing             File[/var/lib/tftpboot/grub]                       [77%] [..........................        ]Installing             File[/var/lib/tftpboot/grub2]                      [77%] [..........................        ]Installing             File[/var/lib/tftpboot/boot]                       [77%] [..........................        ]Installing             File[/var/lib/tftpboot/ztp.cfg]                    [78%] [..........................        ]Installing             File[/var/lib/tftpboot/poap.cfg]                   [78%] [..........................        ]Installing             File[/var/lib/tftpboot/grub2/grub.cfg]             [79%] [..........................        ]Installing             File[/var/lib/tftpboot/chain.c32]                  [79%] [..........................        ]Installing             File[/var/lib/tftpboot/mboot.c32]                  [79%] [...........................       ]Installing             File[/var/lib/tftpboot/menu.c32]                   [80%] [...........................       ]Installing             File[/var/lib/tftpboot/memdisk]                    [80%] [...........................       ]Installing             File[/var/lib/tftpboot/pxelinux.0]                 [80%] [...........................       ]Installing             Package[grub2-efi]                                 [81%] [...........................       ]Installing             Package[grub2-efi-modules]                         [81%] [...........................       ]Installing             Package[grub2-tools]                               [82%] [...........................       ]Installing             Package[shim]                                      [82%] [............................      ]Installing             File[/var/lib/tftpboot/grub2/boot]                 [82%] [............................      ]Installing             File[/var/lib/tftpboot/grub2/grubx64.efi]          [83%] [............................      ]Installing             File[/var/lib/tftpboot/grub2/shim.efi]             [83%] [............................      ]Installing             File[/etc/sudoers.d]                               [83%] [............................      ]Installing             File[/etc/sudoers.d/foreman-proxy]                 [84%] [............................      ]Installing             Service[puppetserver]                              [84%] [............................      ]Installing             Exec[foreman-rake-apipie:cache:index]              [85%] [...................................................................................................................................                        ]Installing             File[/etc/foreman-proxy/settings.yml]              [85%] [....................................................................................................................................                       ]Installing             File[/etc/foreman-proxy/settings.d/bmc.yml]        [85%] [.....................................................................................................................................                      ]Installing             File[/etc/foreman-proxy/settings.d/dhcp.yml]       [86%] [.....................................................................................................................................                      ]Installing             File[/etc/foreman-proxy/settings.d/dhcp_isc.yml]   [86%] [......................................................................................................................................                     ]Installing             File[/etc/foreman-proxy/settings.d/dns.yml]        [87%] [......................................................................................................................................                     ]Installing             File[/etc/foreman-proxy/settings.d/dns_nsupdate.ym [87%] [.......................................................................................................................................                    ]Installing             File[/etc/foreman-proxy/settings.d/dns_nsupdate_gs [87%] [........................................................................................................................................                   ]Installing             File[/etc/foreman-proxy/settings.d/dns_libvirt.yml [88%] [........................................................................................................................................                   ]Installing             File[/etc/foreman-proxy/settings.d/dhcp_libvirt.ym [88%] [.........................................................................................................................................                  ]Installing             File[/etc/foreman-proxy/settings.d/puppet.yml]     [88%] [.........................................................................................................................................                  ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_cu [89%] [..........................................................................................................................................                 ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_le [89%] [...........................................................................................................................................                ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_mc [90%] [...........................................................................................................................................                ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_pu [90%] [............................................................................................................................................               ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_pu [90%] [............................................................................................................................................               ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_sa [91%] [.............................................................................................................................................              ]Installing             File[/etc/foreman-proxy/settings.d/puppet_proxy_ss [91%] [.............................................................................................................................................              ]Installing             File[/etc/foreman-proxy/settings.d/puppetca.yml]   [91%] [..............................................................................................................................................             ]Installing             File[/etc/foreman-proxy/settings.d/puppetca_hostna [92%] [...............................................................................................................................................            ]Installing             File[/etc/foreman-proxy/settings.d/puppetca_token_ [92%] [...............................................................................................................................................            ]Installing             File[/etc/foreman-proxy/settings.d/realm.yml]      [93%] [................................................................................................................................................           ]Installing             File[/etc/foreman-proxy/settings.d/realm_freeipa.y [93%] [................................................................................................................................................           ]Installing             File[/etc/foreman-proxy/settings.d/tftp.yml]       [93%] [.................................................................................................................................................          ]Installing             File[/etc/foreman-proxy/settings.d/templates.yml]  [94%] [..................................................................................................................................................         ]Installing             File[/etc/foreman-proxy/settings.d/logs.yml]       [94%] [..................................................................................................................................................         ]Installing             Datacat_fragment[foreman_proxy::enabled_features:: [95%] [...................................................................................................................................................        ]Installing             Datacat_fragment[foreman_proxy::enabled_features:: [95%] [...................................................................................................................................................        ]Installing             Datacat_fragment[foreman_proxy::enabled_features:: [95%] [....................................................................................................................................................       ]Installing             Datacat_fragment[foreman_proxy::enabled_features:: [96%] [.....................................................................................................................................................      ]Installing             Service[foreman-proxy]                             [96%] [.....................................................................................................................................................      ]Installing             Datacat_collector[foreman_proxy::enabled_features] [96%] [......................................................................................................................................................     ]Installing             Foreman_smartproxy[www.puppet-foreman.com]         [97%] [......................................................................................................................................................     ]Installing             Service[puppet]                                    [97%] [.......................................................................................................................................................    ]Installing             Service[puppet-run.timer]                          [98%] [........................................................................................................................................................   ]Installing             File[/etc/systemd/system/puppet-run.timer]         [98%] [........................................................................................................................................................   ]Installing             File[/etc/systemd/system/puppet-run.service]       [98%] [.........................................................................................................................................................  ]Installing             Exec[systemctl-daemon-reload-puppet]               [99%] [.........................................................................................................................................................  ]Installing             Cron[puppet]                                       [99%] [.......................................................................................................................................................... ]Installing             Done                                               [100%] [..........................................................................................................................................................]Installing             Done                                               [100%] [..........................................................................................................................................................]
  Success!
  * Foreman is running at https://www.puppet-foreman.com
      Initial credentials are admin / tE6QmtZACaJzKYRB    #这里是生成的随机密码,一会进去修改一下即可
  * Foreman Proxy is running at https://www.puppet-foreman.com:8443
  * Puppetmaster is running at port 8140
  The full log is at /var/log/foreman-installer/foreman.log
[root@www ~]# 

     查看端口

 1 [root@www ~]# netstat -untlp
 2 Active Internet connections (only servers)
 3 Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
 4 tcp        0      0 127.0.0.1:45199         0.0.0.0:*               LISTEN      6423/Passenger Rack 
 5 tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
 6 tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      2182/dnsmasq        
 7 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      884/sshd            
 8 tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      868/cupsd           
 9 tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      4611/postgres       
10 tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      2030/master         
11 tcp6       0      0 :::8140                 :::*                    LISTEN      5522/java           
12 tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
13 tcp6       0      0 :::80                   :::*                    LISTEN      5076/httpd          
14 tcp6       0      0 :::22                   :::*                    LISTEN      884/sshd            
15 tcp6       0      0 ::1:631                 :::*                    LISTEN      868/cupsd           
16 tcp6       0      0 ::1:5432                :::*                    LISTEN      4611/postgres       
17 tcp6       0      0 ::1:25                  :::*                    LISTEN      2030/master         
18 tcp6       0      0 :::8443                 :::*                    LISTEN      6268/ruby           
19 tcp6       0      0 :::443                  :::*                    LISTEN      5076/httpd          
20 udp        0      0 0.0.0.0:5353            0.0.0.0:*                           581/avahi-daemon: r 
21 udp        0      0 0.0.0.0:42308           0.0.0.0:*                           663/dhclient        
22 udp        0      0 0.0.0.0:51173           0.0.0.0:*                           581/avahi-daemon: r 
23 udp        0      0 192.168.122.1:53        0.0.0.0:*                           2182/dnsmasq        
24 udp        0      0 0.0.0.0:67              0.0.0.0:*                           2182/dnsmasq        
25 udp        0      0 0.0.0.0:68              0.0.0.0:*                           663/dhclient        
26 udp        0      0 0.0.0.0:69              0.0.0.0:*                           4517/xinetd         
27 udp6       0      0 :::55356                :::*                                663/dhclient        
28 [root@www ~]# 

  7、访问页面修改密码

  

      下面就是 安装完生成账号admin和随机密码

  

     登陆后,接下来修改密码

 

  到此foreman已经部署完了,功能测试敬请期待!

 

转载请注明出处:https://www.cnblogs.com/zhangxingeng/p/10248601.html 

posted @ 2019-01-23 14:55  乐章  阅读(1974)  评论(0编辑  收藏  举报