2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Fabric を使って FreeBSD に pkg をインストールする方法

Last updated at Posted at 2018-12-09

構成管理ツールのFabricを使ってFreeBSDにpkgをインストールしてみます
fabricのcuisineを使って冪等性を持たせます(下記の記事を参考にしました)
https://qiita.com/techys/items/71983349a84683959e86

fabricを実行するホストのOSはFreeBSD以外でも大丈夫ですが
今回はFreeBSDから実行してみます

pkgを使ってfabricとcuisineをインストールします

$ sudo pkg install py27-fabric py27-cuisine

fabfile.pyを下記の内容にします

# coding: utf-8
from fabric import api as fab
import cuisine

# この3行を設定しておけばfabricはFreeBSDで動作しそう
fab.env.shell = '/bin/sh -c'
cuisine.select_package("pkgng")
cuisine.select_os_flavour("bsd")

def install():
        cuisine.package_ensure('zip ja-nkf')

fabricを実行

fab -H "リモートホスト名" install

これでリモートホストにzip ja-nkfがインストールされます

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?