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
- dot file to png
# dot -Tpng relationships.dot > relationships.png
- generate dependency graph for puppet
# vi /etc/puppet/puppet.conf
graph=true
graphdir=/root/puppet
https://puppet.com/docs/puppet/7.6/configuration.html
- 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
- 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
-
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
-
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
- module list
puppet module list --modulepath /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/modules
- resource list
puppet describe --list --modulepath /var/tmp/packstack/540db630448a4a7c9c7156808416ab3c/modules