[iyunv@puppet ~]# puppet help module
USAGE: puppet module <action> [--environment production ]
[--modulepath $basemodulepath ]
This subcommand can find, install, and manage modules from the Puppet Forge,
a repository of user-contributed Puppet code. It can also generate empty
modules, and prepare locally developed modules for release on the Forge.
OPTIONS:
--render-as FORMAT - The rendering format to use.
--verbose - Whether to log verbosely.
--debug - Whether to log debug information.
--environment production - The environment Puppet is running in. For
clients (e.g., `puppet agent`) this
determines the environment itself, which is
used to find modules and much more. For
servers (i.e., `puppet master`) this provides
the default environment for nodes we know
nothing about.
--modulepath $basemodulepath - The search path for modules, as a list of
directories separated by the system path
separator character. (The POSIX path
separator is ':', and the Windows path
separator is ';'.) Setting a global value for
`modulepath` in puppet.conf is deprecated.
Please use directory environments instead. If
you need to use something other than the
default modulepath of `<ACTIVE ENVIRONMENT'S
MODULES DIR>:$basemodulepath`, you can set
`modulepath` in environment.conf. For more
info, see http://docs.puppetlabs.com/puppe ... e/environments.html
ACTIONS:
build Build a module release package.
changes Show modified files of an installed module.
generate Generate boilerplate for a new module.
install Install a module from the Puppet Forge or a release archive.
list List installed modules
search Search the Puppet Forge for a module.
uninstall Uninstall a puppet module.
upgrade Upgrade a puppet module.
See 'puppet man module' or 'man puppet-module' for full help.
[iyunv@puppet ~]# puppet module install vmware-vcenter
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ vmware-vcenter (v0.10.0)
├── nanliu-staging (v1.0.3)
├── puppetlabs-stdlib (v4.19.0)
└── vmware-vmware_lib (v0.7.0)
#卸载vmware-vcenter模块
1
2
3
[iyunv@puppet ~]# puppet module uninstall vmware-vcenter
Notice: Preparing to uninstall 'vmware-vcenter' ...
Removed 'vmware-vcenter' (v0.10.0) from /etc/puppet/modules
generate参数创建一个模块,名为example-meng
1
2
3
4
[iyunv@puppet ~]# puppet module generate example-meng
We need to create a metadata.json file for this module. Please answer the
following questions; if the question is not applicable to this module, feel free
to leave it blank.
Puppet uses Semantic Versioning (semver.org) to version modules.
What version is this module? [0.1.0]
-->
#这个模块谁写的?
Who wrote this module? [example]
--> example-meng
#这个模块属于哪个许可机构?
What license does this module code fall under? [Apache 2.0]
--> apache
#一句话描述这个模块?
How would you describe this module in a single sentence?
--> My name is meng
#这个模块的源码仓库在哪?
Where is this module's source code repository?
--> /tmp
#其他人去哪学习这个模块?
Where can others go to learn more about this module?
--> 51cto.com
#关于这个模块的文件问题去哪解决?
Where can others go to file issues about this module?
--> no
----------------------------------------
{
"name": "example-meng",
"version": "0.1.0",
"author": "example-meng",
"summary": "My name is meng",
"license": "apache",
"source": "/tmp",
"issues_url": "no",
"project_page": "51cto.com",
"dependencies": [
{"version_requirement":">= 1.0.0","name":"puppetlabs-stdlib"}
]
}
----------------------------------------
About to generate this metadata; continue? [n/Y]
--> y
Notice: Generating module at /root/example-meng...
Notice: Populating templates...
Finished; module generated in example-meng.
example-meng/Gemfile
example-meng/spec
example-meng/spec/classes
example-meng/spec/classes/init_spec.rb
example-meng/spec/spec_helper.rb
example-meng/tests
example-meng/tests/init.pp
example-meng/manifests
example-meng/manifests/init.pp
example-meng/README.md
example-meng/metadata.json
example-meng/Rakefile