<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 配置 GEM 倉庫 使用另外的不兼容的包系統是每個系統管理員的夢想。 如果你要管理 Ruby 或 Rails 應用程序,就需要處理 Rubygems。 與維護自己的 APT 倉庫一樣,維護你自己的 **gem 倉庫** 會有很多優點。 你可以控制包的可用性和包的版本,也可以根據需要發布你自己的 Rubygems。 #### 操作步驟 1. 使用如下內容創建 /etc/puppet/modules/repo/manifests/gem-server.pp 文件: ``` class repo::gem-server { include apache file { "/etc/apache2/sites-available/gemrepo": source =&gt; "puppet:///modules/repo/gemrepo.conf", require =&gt; Package["apache2-mpm-worker"], notify =&gt; Service["apache2"], } file { "/etc/apache2/sites-enabled/gemrepo": ensure =&gt; symlink, target =&gt; "/etc/apache2/sites-available/gemrepo", require =&gt; File["/etc/apache2/sites-available/gemrepo"], notify =&gt; Service["apache2"], } file { "/var/gemrepo": ensure =&gt; directory, } } ``` 2. 使用如下內容創建 /etc/puppet/modules/repo/files/gemrepo.conf 文件: ``` &lt;VirtualHost *:80&gt; ServerAdmin john@bitfieldconsulting.com ServerName gems.bitfieldconsulting.com ErrorLog logs/gems.bitfieldconsulting.com-error_log CustomLog logs/gems.bitfieldconsulting.com-access_log common Alias / /var/gemrepo/ &lt;Location /&gt; Options Indexes &lt;/Location&gt; &lt;/VirtualHost&gt; ``` 3. 在配置清單的節點中添加如下代碼: ``` node cookbook { include repo::gem-server } ``` 4. 運行 Puppet: ``` # puppet agent --test info: Retrieving plugin info: Caching catalog for cookbook.bitfieldconsulting.com info: Applying configuration version '1304949279' notice: /Stage[main]/Repo::Gem-server/File[/etc/apache2/ sites-available/gemrepo]/ensure: defined content as '{md5} ae1fd948098f14503de02441d02a825d' info: /Stage[main]/Repo::Gem-server/File[/etc/apache2/sitesavailable/ gemrepo]: Scheduling refresh of Service[apache2] notice: /Stage[main]/Repo::Gem-server/File[/etc/apache2/sitesenabled/ gemrepo]/ensure: created info: /Stage[main]/Repo::Gem-server/File[/etc/apache2/sitesenabled/ gemrepo]: Scheduling refresh of Service[apache2] notice: /Stage[main]/Apache/Service[apache2]: Triggered 'refresh' from 2 events notice: /Stage[main]/Repo::Gem-server/File[/var/gemrepo]/ensure: created notice: Finished catalog run in 6.52 seconds ``` #### 工作原理 其原理與 APT 倉庫的例子是完全一樣的。我們首先定義了一個 gem 倉庫的存放目錄, 然后定義了一個 Apache 的虛擬主機,使其能夠響應 gems.bitfieldconsulting.com 的請求。 #### 更多用法 與 APT 倉庫類似,僅有空倉庫是無用的,下面將演示如何將 gem 包納入倉庫, 以及如何配置你的節點訪問自己的 gem 倉庫。 ##### 添加 gem 倉庫 向你的倉庫添加新的 gems 包很簡單。將 gem 文件存入 /var/gemrepo/gems 目錄, 然后在 /var/gemrepo 目錄下運行如下命令即可: ``` # gem generate_index ``` ##### 使用 gem 倉庫 像使用 APT 倉庫一樣,首先確保你的節點能夠解析主機名 gems.bitfieldconsulting.com, 既可以使用 Puppet 部署 host 資源,也可以通過配置 DNS 實現。 然后在 Puppet 中使用如下代碼指定一個 gem 軟件包: ``` package { "json": provider => "gem", source => "http://gems.bitfieldconsulting.com ", } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看