簡體   English   中英

通過puppet更新Ubuntu中的依賴包?

[英]Updating dependency package in Ubuntu through puppet?

我正在更新以下代碼的包嗎?

 package { '<packageName1>': ensure => latest, } 

但它不會安裝依賴包。

所以我把

exec {'testing':command =>“ apt-get build-dep packageName1'}

但是仍然無法工作..如何實現安裝依賴包。 還有其他好方法嗎?

剛才我嘗試了apt class.It也沒有用。

包括適當

apt::builddep { 'packagename': }

這是我們的一個木偶清單中的package部分的示例。 在Ubuntu上使用。

package { ["mysql-server", "libapache2-mod-auth-mysql", "php5-mysql"] :
        ensure  => present,
    }

apt-get install puppet設置了所有內容,以便“ package”資源類型知道如何安裝軟件包

example2我有一個沒有安裝mysql-server的虛擬機apt-get -s install mysql-server(Simulation mode)給出了這個輸出

$ apt-get -s install mysql-server
NOTE: This is only a simulation!
      apt-get needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.32-38 linux-headers-2.6.32-38-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl
  libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-server-5.1
  mysql-server-core-5.1
Suggested packages:
  dbishell libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libnet-daemon-perl
  libplrpc-perl mysql-client-5.1 mysql-client-core-5.1 mysql-server
  mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Inst libnet-daemon-perl (0.43-1 Ubuntu:10.04/lucid)
Inst libplrpc-perl (0.2020-2 Ubuntu:10.04/lucid)
Inst libdbi-perl (1.609-1build1 Ubuntu:10.04/lucid)
Inst libdbd-mysql-perl (4.012-1ubuntu1 Ubuntu:10.04/lucid)
Inst mysql-client-core-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Inst mysql-client-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Inst mysql-server-core-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Inst mysql-server-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Inst libhtml-template-perl (2.9-1 Ubuntu:10.04/lucid)
Inst mysql-server (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Conf libnet-daemon-perl (0.43-1 Ubuntu:10.04/lucid)
Conf libplrpc-perl (0.2020-2 Ubuntu:10.04/lucid)
Conf libdbi-perl (1.609-1build1 Ubuntu:10.04/lucid)
Conf libdbd-mysql-perl (4.012-1ubuntu1 Ubuntu:10.04/lucid)
Conf mysql-client-core-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Conf mysql-client-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Conf mysql-server-core-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Conf mysql-server-5.1 (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)
Conf libhtml-template-perl (2.9-1 Ubuntu:10.04/lucid)
Conf mysql-server (5.1.72-0ubuntu0.10.04.1 Ubuntu:10.04/lucid-updates)

所以我做了清單文件

$ more p.pp
package { "mysql-server":
ensure => present
}

然后像這樣跑

$ sudo puppet apply p.pp
Warning: Could not retrieve fact fqdn
Notice: Compiled catalog for puppet1 in environment production in 0.12 seconds
Notice: /Stage[main]//Package[mysql-server]/ensure: ensure changed 'purged' to 'present'
Notice: Finished catalog run in 57.49 seconds

完成此操作后,mysql-server及其依賴關系均已安裝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM