puppet的一些总结

packstack使用的是puppet安装的openstack,所以把puppet简单的分析了一下。

Puppet will perform the following tasks:
Test whether the resource is already in sync with the target state
If the resource is not in sync, it will trigger a sync action

  1. dot file to png
# dot -Tpng relationships.dot > relationships.png
  1. generate dependency graph for puppet
# vi /etc/puppet/puppet.conf
graph=true
graphdir=/root/puppet

https://puppet.com/docs/puppet/7.6/configuration.html

  1. puppet use below file to find the hiera data
[root@controller ~]# cat "/etc/puppet/hiera.yaml"
---
:backends:
  - yaml
:hierarchy:
  - defaults
  - "%{clientcert}"
  - "%{environment}"
  - global

:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /var/lib/hiera on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# When specifying a datadir, make sure the directory exists.
  :datadir: /var/tmp/packstack/31e9fa5b4e274c898277c52729042efa/hieradata
  1. find key from hiera in puppet log
^[[0;36mDebug: Lookup of 'DEFAULT_EXEC_TIMEOUT'
  Searching for "lookup_options"
    Global Data Provider (hiera configuration version 3)
      Using configuration "/etc/puppet/hiera.yaml"
      Hierarchy entry "yaml"
        Merge strategy hash
          Path "/var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/hieradata/defaults.yaml"
            Original path: "defaults"
            No such key: "lookup_options"
          Path "/var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/hieradata/computer1.example.com.yaml"
            Original path: "%{clientcert}"
            Path not found
          Path "/var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/hieradata/production.yaml"
            Original path: "%{environment}"
            Path not found
          Path "/var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/hieradata/global.yaml"
            Original path: "global"
            Path not found
  Searching for "DEFAULT_EXEC_TIMEOUT"
    Global Data Provider (hiera configuration version 3)
      Using configuration "/etc/puppet/hiera.yaml"
      Hierarchy entry "yaml"
        Path "/var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/hieradata/defaults.yaml"
          Original path: "defaults"
          Found key: "DEFAULT_EXEC_TIMEOUT" value: 300^[[0m
  1. packstack use below command to execute puppet script
    /usr/bin/puppet apply --modulepath /var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/modules /var/tmp/packstack/cd959611f6ef4493adc3416287098d4b/manifests/192.168.12.32_compute.pp

  2. puppet apply --noop is dry run

/usr/bin/ruby /usr/bin/puppet apply --debug --modulepath /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/modules /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/manifests/192.168.12.32_compute.pp
  1. module list
puppet module list --modulepath /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/modules
  1. resource list
puppet describe  --list --modulepath /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/modules
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值