reallyenglish.uchiwa
ansible-role-uchiwa
uchiwa
を管理する、Sensu監視フレームワークのダッシュボードです。
要件
特になし
ロール変数
変数 | 説明 | デフォルト |
---|---|---|
uchiwa_user |
uchiwa のユーザー |
{{ __uchiwa_user }} |
uchiwa_group |
uchiwa のグループ |
{{ __uchiwa_group }} |
uchiwa_log_dir |
ログディレクトリのパス | /var/log/uchiwa |
uchiwa_public_dir |
公開ディレクトリのパス | {{ __uchiwa_public_dir }} |
uchiwa_service |
uchiwa サービスの名前 |
{{ __uchiwa_service }} |
uchiwa_conf_dir |
設定ディレクトリのパス | {{ __uchiwa_conf_dir }} |
uchiwa_conf_file |
uchiwa.json のパス |
{{ uchiwa_conf_dir }}/uchiwa.json |
uchiwa_flags |
起動スクリプトで使用される変数の辞書(例:/etc/default/uchiwaの内容) | {} |
uchiwa_flags_default |
uchiwa_flags のデフォルト値 |
{{ __uchiwa_flags_default }} |
uchiwa_config |
uchiwa.json のYAML表現 |
{} |
uchiwa_config_fragments |
uchiwa_config_fragments_dir のオプションファイルのYAML表現 |
{} |
uchiwa_config_fragments_dir |
{{ uchiwa_conf_dir }}/dashboard.d |
|
uchiwa_privatekey |
privatekey の内容 |
"" |
uchiwa_privatekey_mode |
privatekey のファイルモード |
0400 |
uchiwa_privatekey_path |
privatekey ファイルのパス |
{{ uchiwa_conf_dir }}/keys/uchiwa.rsa |
uchiwa_publickey |
publickey の内容 |
"" |
uchiwa_publickey_mode |
publickey のファイルモード |
0444 |
uchiwa_publickey_path |
publickey ファイルのパス |
{{ uchiwa_conf_dir }}/keys/uchiwa.rsa.pub |
uchiwa_include_role_x509_certificate |
yes のとき、プレイ中にreallyenglish.x509-certificate を含めて実行します(下記参照) |
no |
uchiwa_flags
この変数は、/etc/default
、/etc/sysconfig
、/etc/rc.conf.d
などの起動設定ファイル内の変数の辞書です。これらのファイルは、起動メカニズムによってsh(1)
でsource
されると仮定されています。辞書のキーはファイル内の変数名で、キーの値は変数の値です。この変数は、同じ名前を持ち、末尾に_default
を付けた変数と組み合わされ、起動設定ファイルが作成されます。通常、これはプラットフォームに適したディレクトリ内にあるkey="value"
形式の行が含まれるファイルです。
プラットフォームがOpenBSDの場合、上記の説明は適用されません。この場合、有効なキーはflags
のみで、その値はrc.conf(5)
で説明されているdaemon_flags
に渡されます。ここでのdaemon
は、rc.d(8)
デーモン制御スクリプトの一つの名前です。
uchiwa_flags_default
この変数は、上流のデフォルト設定から派生したキーと値の辞書で、絶対に必要でない限り定数であるべきです。デフォルトでは、この変数を使用して各プラットフォーム用の起動設定ファイルが作成され、デフォルトのものと同一になります。
プラットフォームがOpenBSDの場合、この変数には単一のキーflags
があり、その値は空文字列です。
uchiwa_include_role_x509_certificate
yes
の場合、この変数はプレイ中にreallyenglish.x509
を含めて実行します。これにより、煩雑なハックなしで証明書を管理することができます。この機能は、ansible
バージョンが少なくとも2.2以上である必要があります。
サポートされているプラットフォームの一覧:
プラットフォーム | ansible バージョン |
---|---|
CentOS | 2.3.1.0 |
FreeBSD | 2.3.1.0 |
Ubuntu | 2.3.1.0-1ppa~xenial |
Ubuntu | 2.3.1.0-1ppa~trusty |
Debian
変数 | デフォルト |
---|---|
__uchiwa_user |
uchiwa |
__uchiwa_group |
uchiwa |
__uchiwa_service |
uchiwa |
__uchiwa_conf_dir |
/etc/sensu |
__uchiwa_public_dir |
/opt/uchiwa/src/public |
__uchiwa_flags_default |
{} |
FreeBSD
変数 | デフォルト |
---|---|
__uchiwa_user |
uchiwa |
__uchiwa_group |
uchiwa |
__uchiwa_service |
uchiwa |
__uchiwa_conf_dir |
/usr/local/etc/uchiwa |
__uchiwa_public_dir |
/usr/local/share/uchiwa/public |
__uchiwa_flags_default |
{"uchiwa_user"=>"{{ uchiwa_user }}", "uchiwa_group"=>"{{ uchiwa_group }}", "uchiwa_config"=>"{{ uchiwa_conf_file }}", "uchiwa_logfile"=>"{{ uchiwa_log_dir }}/uchiwa.log", "uchiwa_publicdir"=>"{{ uchiwa_public_dir }}"} |
RedHat
変数 | デフォルト |
---|---|
__uchiwa_user |
uchiwa |
__uchiwa_group |
uchiwa |
__uchiwa_service |
uchiwa |
__uchiwa_conf_dir |
/etc/sensu |
__uchiwa_public_dir |
/opt/uchiwa/src/public |
__uchiwa_flags_default |
{} |
依存関係
特になし
サンプルプレイブック
- hosts: localhost
roles:
- name: reallyenglish.apt-repo
when: ansible_os_family == 'Debian'
- name: reallyenglish.redhat-repo
when: ansible_os_family == 'RedHat'
- name: reallyenglish.language-ruby
when: ansible_os_family == 'OpenBSD'
- ansible-role-uchiwa
vars:
x509_certificate:
- name: uchiwa
state: present
public:
path: "{{ uchiwa_conf_dir }}/uchiwa.pem"
key: |
-----BEGIN CERTIFICATE-----
MIIDOjCCAiICCQDaGChPypIR9jANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJB
...
-----END CERTIFICATE-----
secret:
path: "{{ uchiwa_conf_dir }}/uchiwa.key"
owner: "{{ uchiwa_user }}"
group: "{{ uchiwa_group }}"
mode: "0640"
key: |
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA2fZ3dYrKBhnh+DhW0Opqc5ZXaONvC6hGEh+Bu34cyzCnWLCK
...
-----END RSA PRIVATE KEY-----
uchiwa_include_role_x509_certificate: yes
uchiwa_config:
sensu:
- name: "Site 1"
host: "localhost"
port: 4567
uchiwa:
host: 0.0.0.0
port: 3000
users:
- name: admin
password: password
accessToken: vFzX6rFDAn3G9ieuZ4ZhN-XrfdRow4Hd5CXXOUZ5NsTw4h3k3l4jAw__
readonly: false
- name: guest
password: password
accessToken: hrKMW3uIt2RGxuMIoXQ-bVp-TL1MP4St5Hap3KAanMxI3OovFV48ww__
readonly: true
auth:
privatekey: "{{ uchiwa_privatekey_path }}"
publickey: "{{ uchiwa_publickey_path }}"
ssl:
certfile: "{{ uchiwa_conf_dir }}/uchiwa.pem"
keyfile: "{{ uchiwa_conf_dir }}/uchiwa.key"
uchiwa_flags:
"# foo": bar
uchiwa_publickey: |
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwU+ZfaKjXxFQq8WNUgai
...
-----END PUBLIC KEY-----
uchiwa_privatekey_path: "{{ uchiwa_conf_dir }}/privatekeys/uchiwa.rsa"
uchiwa_privatekey_mode: 0440
uchiwa_privatekey: |
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAwU+ZfaKjXxFQq8WNUgaiIKOo7JN/03P5d0ZrVLSDXeQ5F5MG
...
-----END RSA PRIVATE KEY-----
redhat_repo:
sensu:
baseurl: https://sensu.global.ssl.fastly.net/yum/$releasever/$basearch
gpgcheck: no
enabled: yes
apt_repo_keys_to_add:
- https://sensu.global.ssl.fastly.net/apt/pubkey.gpg
apt_repo_enable_apt_transport_https: yes
apt_repo_to_add:
- "deb https://sensu.global.ssl.fastly.net/apt {{ ansible_distribution_release }} main"
ライセンス
Copyright (c) 2017 Tomoyuki Sakurai <tomoyukis@reallyenglish.com>
このソフトウェアを使用、コピー、修正、配布する権利は、上記の著作権表示およびこの許可書がすべてのコピーに掲載される場合に与えられます。
このソフトウェアは「現状のまま」提供され、著者はこのソフトウェアに関連するすべての保証を明示または黙示を問わず放棄します。著者は、このソフトウェアの使用または性能に起因するいかなる特別、直接、間接、または結果的損害についても責任を負いません。
著者情報
Tomoyuki Sakurai tomoyukis@reallyenglish.com
このREADMEはqansibleによって作成されました。