设为首页 收藏本站
查看: 1194|回复: 0

[经验分享] Puppet module命令参数介绍(六)

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2017-9-11 11:15:30 | 显示全部楼层 |阅读模式
puppet module是puppet的基础模块工具,agent和master都可以使用,主要包含下载、更新、查找、升级、创建等功能.它可以从Puppetforge上查找已经开发好的puppet基础模块代码为我们使用,不需要自己再去编写,提升工作效率.
查看puppet module的帮助信息:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[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.





build 构建模块源码软件包
changes显示一个已经安装的模块的改变
generate 创建一个新的模块
install  从puppet forge安装一个模块
list   查找模块
uninstall  卸载模块
upgrade  升级一个模块

#查看本地安装的puppet模块
1
2
3
[iyunv@puppet ~]# puppet module list
/etc/puppet/modules (no modules installed)
/usr/share/puppet/modules (no modules installed)




#搜索vmware-vcenter模块
1
2
3
4
[iyunv@puppet ~]# puppet module search vmware-vcenter
Notice: Searching https://forgeapi.puppetlabs.com ...
NAME            DESCRIPTION                                                                               AUTHOR        KEYWORDS                                   
vmware-vcenter  VMware vCenter puppet module                                                              @vmware       vmware vcenter



#安装vmware-vcenter模块
1
2
3
4
5
6
7
8
9
[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.




    #这个模块的版本,默认为0.1.0.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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







运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-404344-1-1.html 上篇帖子: Puppet apply命令参数介绍(五) 下篇帖子: Puppet resource命令参数介绍(七)
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表