適宜、メモを書いていきましょう。
仮想環境/クラウド環境を統一的なインターフェイスでコントロールする開発支援ツール
開発環境を簡単に作れるぜ! VirtualBoxとか経由して。
ベースになるBox = イメージファイルがまず必要
Vagrant コマンド(https://www.vagrantup.com/docs/cli/)
vagrant の Provision で仮想化の起動後の設定やらを記述する
vagrant up
でProvisionされる時にAnsibleも走る。使用するリポジトリ(https://github.com/histudy/vagrant-redmine)
※ 会場のネットワーク環境の混雑解消のため vagrantのベースboxを事前に取得しておいた。
$ vagrant box add histudy/stretch
$ git clone https://github.com/histudy/vagrant-redmine.git
$ cp -a extra_vars_example.yml extra_vars.yml
extra_vars.yml 内の、Redmine プラグインインストール部分のうち、「agile」「checklists」をコメントアウト(565行以降)
diff -u extra_vars_example.yml extra_vars.yml
--- extra_vars_example.yml 2018-08-17 00:23:30.000000000 +0900
+++ extra_vars.yml 2018-08-18 14:29:09.000000000 +0900
@@ -562,11 +562,11 @@
# チケットの登録日を日付で表示する機能を追加
# ref: https://github.com/suer/redmine_absolute_dates
repo: "https://github.com/suer/redmine_absolute_dates.git"
- - name: agile
+ #- name: agile
# カンバン機能を追加
# ref: https://www.redmineup.com/pages/ja/plugins/agile
- file: /vagrant/plugins/redmine_agile-1_4_6-light.zip
- - name: checklists
+ #file: /vagrant/plugins/redmine_agile-1_4_6-light.zip
+ #- name: checklists
# チケットにチェックリストを追加
# ref: https://www.redmineup.com/pages/ja/plugins/checklists
- file: /vagrant/plugins/redmine_checklists-3_1_11-light.zip
+ #file: /vagrant/plugins/redmine_checklists-3_1_11-light.zip
yamlを書き換える前に仮想マシンを起動している場合、仮想マシンを削除し再起動しておく
$ vagrant destroy
仮想マシンを起動する
$ vagrant up
http://localhost:8080/ にアクセス!
アカウント情報は extra_var.yml の redmine_admin のセクションを参照してください。
インストールに失敗したあと、OSを再起動し、システム環境設定 -> セキュリティ & プライバシー で Oracle からのインストールを許可し、再度 VirtualBox をインストールする。
「Warning: Remote connection disconnect. Retrying…」を繰り返してSSHで止まってしまいAnsibleが実行されない
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
環境変数を設定してからvagrant upを実行するとよい。
$ export SSH_AUTH_SOCK=""
VirtualBoxのネットワーク接続を見て、「ケーブル接続」のチェックが外れていれば、チェックを入れて vagrant reload
する。
GalliumOS:ChromeBookに最適化したという謳い文句のLinuxフレーバー、Xubuntuベース
Ansibleの設定を書いたansible_extra_vars Ymlファイルをロードしない
もしかしたらUbuntuはパッケージのVirtualBox/Vagrantを使うべきかも
apg-get
で入れ直したYamlのロードはコメントアウト
#extra_var_file = File.expand_path(File.join(File.dirname(__FILE__), 'extra_vars.yml'))
#if File.exists?(extra_var_file)
# ansible_extra_vars = YAML.load_file(extra_var_file)
#end
ansible local provisioner:
The following settings shouldn't exist: become, compatibility_mode, config_file
メッセージに従ってVagrantファイルを更にコメントアウト
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
ネットワークのエラー
IPアドレスの指定をコメントアウト
PLAY [Deploy Redmine] *******
TASK [Gathering Facts] ******
ok: [default]
TASK [mariadb : install ufw package] ***
fatal: [default]: FAILED! =>
ここまでは辿り着きました。
redmineのbundleのインストールに失敗した場合、以下のようにインストールをし直す
HOST$ vagrant ssh
VM$ cd /opt/redmine/
VM$ sudo -u redmine bundle install
VM$ exit
HOST$ vagrant provision
http://localhost:8080/ に再アクセス!
redmineのmigrateに失敗した場合、以下のようにmigrateし直す
HOST$ vagrant ssh
VM$ cd /opt/redmine/
VM$ sudo -u redmine rake redmine:plugins:migrate
VM$ exit
HOST$ vagrant provision
http://localhost:8080/ にアクセス!
アプリ開発も、インフラのことが分からないと
「何か分からんけど動かん」
で止まってしまう。
サーバー構築手順がymlファイルで残る
Ansibleの練習には、自由に使えるサーバーが必要
vagrantでhostsを書き換えてくれるプラグイン(vagrant-hostsupdater)は書き戻しもしてくれますか?
ansible と vagrant がセットになっているのはなぜ?
一台のサーバーに、複数のユーザーがある。各ユーザーのホームにファイルを配布するには、各ユーザーで接続するか、ルート権限で配布して所有権を修正するか、どちらが良いか。
gitlabのプロジェクト管理はどうか?
Redmineの使いドコロ
開発者、コードを書く人が複数いる場合の状況把握
機能としては顧客対応、カスタマーサービスにも使える
ステータスが細かい、ほぼ無限に増やせる(Backlogは4つ)
ロール別の権限設定もできる
ここはイマイチ
いろいろな人に優しくするのは大変
加古川IT系インフラ勉強会 2018年9月
姫路IT系勉強会 2018年9月