深入理解OpenStack自动化部署
  • 前言
  • 初识PuppetOpenstack
    • 相关约定
    • 术语表
    • PuppetOpenstack项目简介
  • Puppet开发基础
    • 关于Puppet
    • Puppet核心概念
    • 理解Hiera
    • 准备开发测试环境
  • OpenStack基础服务模块
    • puppet-apache模块
    • puppet-memcached模块
    • puppet-sysctl模块
    • puppet-rsync模块
    • puppet-xinetd模块
    • puppet-rabbitmq模块
    • puppet-firewall模块
    • puppet-mysql模块
    • puppet-vcsrepo模块
    • puppet-mongodb模块
    • puppet-ceph
  • Openstack服务模块
    • OpenStack模块代码结构
    • puppet-keystone模块
    • puppet-nova
    • puppet-neutron
    • puppet-glance
    • puppet-horizon
    • puppet-ceilometer
    • puppet-cinder
    • puppet-tempest
    • puppet-heat
    • puppet-swift
    • puppet-trove
    • puppet-sahara
    • puppet-manila
    • puppet-rally
    • puppet-designate
    • puppet-aodh模块
  • PuppetOpenstack公共库和工具类模块
    • puppet-oslo
    • puppet-vswitch模块
    • puppet-openstacklib
    • puppet-openstack-integration
    • puppet-openstack-specs
    • puppet-openstack-cookiebutter
    • puppet-modulesync-configs
    • puppet-openstack_spec_helper
    • puppet-stdlib
    • puppet-openstack_extras
  • 最佳实践
    • 模块管理
    • Hiera
    • 提交规范
    • 正确使用环境
    • 转发层规范
    • 代码风格
    • Standalone vs C\/S 模式
    • Puppet版本的选择
    • Puppet4的新特性和变化
    • Puppet的能与不能
  • 其他部署工具
    • Fuel
    • Kolla
    • TripleO
    • Packstack
    • OSA
    • DevStack
    • 编写一个定制化部署工具
  • 结语
Powered by GitBook
On this page
  • 先睹为快
  • 模块讲解

Was this helpful?

  1. PuppetOpenstack公共库和工具类模块

puppet-modulesync-configs

Previouspuppet-openstack-cookiebutterNextpuppet-openstack_spec_helper

Last updated 6 years ago

Was this helpful?

本节作者:余兴超

阅读级别:选读

阅读时间: 0.5小时

本节为选读章节,推荐有兴趣的读者阅读。

先睹为快

我们通过puppet-openstack-cookiebutter模块的contrib/bootstrap.sh脚本来说明:

# Step 4: Retrieve the puppet-modulesync-configs directory and configure it for your need
#
git clone https://review.openstack.org/openstack/puppet-modulesync-configs
pushd puppet-modulesync-configs/
cat > managed_modules.yml <<EOF
---
  - puppet-$proj
EOF
cat > modulesync.yml <<EOF
---
namespace:
git_base: file://$tmp_var/cookiecutter/
branch: initial_commit
EOF

# Step 5: Run msync and amend the initial commit
#
msync update --noop
pushd modules/puppet-$proj
md5password=`ruby -e "require 'digest/md5'; puts 'md5' + Digest::MD5.hexdigest('pw${proj}')"`
sed -i "s|md5c530c33636c58ae83ca933f39319273e|${md5password}|g" spec/classes/${proj}_db_postgresql_spec.rb
git remote add gerrit ssh://$user@review.openstack.org:29418/openstack/puppet-$proj.git
git add --all && git commit --amend -am "puppet-${proj}: Initial commit

This is the initial commit for puppet-${proj}.
It has been automatically generated using cookiecutter[1] and msync[2]

[1] https://github.com/openstack/puppet-openstack-cookiecutter
[2] https://github.com/openstack/puppet-modulesync-configs
"

echo "

-----------------------------------------------------------------------------------------------------
The new project has been successfully set up.

To submit the initial review please go to ${tmp_var}/puppet-modulesync-configs/modules/puppet-${proj}
and run git review.

Happy Hacking !
"

通过以上步骤,可以为一个新puppet module同步Gemfile,Rakeflie等文件,其中执行同步操作的关键命令是:

# 注意需要使用gem安装msync命令
msync update

模块讲解

  • config_defaults.yml: 第一层级的键表示模块被管理的文件名

  • .sync.yml: 出现在各自module中,将覆盖config_defaults中的值

  • managed_modules.yml: 被管理的module列表

  • modulesync.yml: 传递到Modulesync命令行的键值对参数对

打一个比方,modulesync-config模块类似于Openstack的项目。用于管理Gem包的依赖,Rakefile的配置等等。它有几个重要的文件:

关于puppet-modulesync-configs的用途比较单一,因此不再深入展开,更详细的解释参见其。

requirements
模块说明
先睹为快
模块讲解