Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Chef infra 初学者被书架和厨师弄糊涂了_Chef Infra_Berkshelf - Fatal编程技术网

Chef infra 初学者被书架和厨师弄糊涂了

Chef infra 初学者被书架和厨师弄糊涂了,chef-infra,berkshelf,Chef Infra,Berkshelf,我对chef and berkshelf还不熟悉,我很困惑,我曾尝试在开放式问题上寻求帮助,但运气不佳,请帮助我 Berkshell是否在解决依赖关系时安装了我的食谱?这意味着食谱有MySQL,那么在vagrant up之后会安装MySQL吗 我应该使用vagrant根目录中的vagrant文件,还是使用带有berkshelf的文件 为什么Berkshell中的vagrantfile(即使没有配方)总是有MySQL的条目:server\u root/Debian/repl passwords!!

我对chef and berkshelf还不熟悉,我很困惑,我曾尝试在开放式问题上寻求帮助,但运气不佳,请帮助我

  • Berkshell是否在解决依赖关系时安装了我的食谱?这意味着食谱有MySQL,那么在vagrant up之后会安装MySQL吗
  • 我应该使用vagrant根目录中的vagrant文件,还是使用带有berkshelf的文件
  • 为什么Berkshell中的vagrantfile(即使没有配方)总是有MySQL的条目:server\u root/Debian/repl passwords!!!!)
    谢谢

    Berkself是一个食谱依赖关系管理器

    假设您已经安装了,首先生成一本食谱:

    $ chef generate cookbook demo
    $ tree
    .
    └── demo
        ├── Berksfile
        ├── chefignore
        ├── metadata.rb
        ├── README.md
        ├── recipes
        │   └── default.rb
        ├── spec
        │   ├── spec_helper.rb
        │   └── unit
        │       └── recipes
        │           └── default_spec.rb
        └── test
            └── integration
                ├── default
                │   └── serverspec
                │       └── default_spec.rb
                └── helpers
                    └── serverspec
                        └── spec_helper.rb
    
    Berksfile保存配置,其格式为。cookbook generator创建一个默认设置,告知Berkshellf从Chef supermarket下载依赖项,并使用元数据文件列出这些依赖项:

    source 'https://supermarket.chef.io'
    
    metadata
    
    因此,让我们编辑metadata.rb文件,将mysql添加为依赖项

    name 'demo'
    maintainer 'The Authors'
    maintainer_email 'you@example.com'
    license 'all_rights'
    description 'Installs/Configures demo'
    long_description 'Installs/Configures demo'
    version '0.1.0'
    
    depends "mysql"
    
    所以,现在如果您决定运行Berkself,它将自动为您解决烹饪书的依赖关系

    $ berks vendor cookbooks
    Resolving cookbook dependencies...
    Fetching 'demo' from source at .
    Using demo (0.1.0) from source at .
    Using mysql (8.1.1)
    Vendoring demo (0.1.0) to cookbooks/demo
    Vendoring mysql (8.1.1) to cookbooks/mysql
    
    希望这能回答你的一些问题,但最后我能推荐你看看吗?cookbook generator还将其配置为使用Vagrant同时运行chef和测试cookbook:

    $ kitchen test default-ubuntu-1404
    

    做一个快乐的厨师

    我们是一群完全失去了10个开发者@非常欢迎你。我们是来帮忙的。如果能回答你的问题,请考虑接受答案。