trainline-eu.ansible_postgresql_role

PostgreSQL Ansibleロール ビルドステータス

PostgreSQL クラスター、データベース、ユーザーをインストールして設定するための Ansible ロールです。

詳細は Ansible Galaxy のロールページ をご覧ください。

インストール

このロールは、Ansible 2.5.0 以降でテストされています。

インストールするには:

ansible-galaxy install trainline-eu.ansible_postgresql_role

依存関係

依存関係はありません。

推奨される依存関係:

互換性マトリックス

次の表は、テストされた OS/PostgreSQL のバージョンを示しています。

ディストリビューション / PostgreSQL 9.4 9.5 9.6 10 11 12 13
Debian 9.x :no_entry: :white_check_mark: :no_entry: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
Debian 10.x :no_entry: :white_check_mark: :no_entry: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark:
  • :white_check_mark: - テスト済み、正常に動作
  • :grey_question: - 将来的に動作する予定(協力できる方はお願いします)
  • :interrobang: - もしかしたら動作するがテスト未実施
  • :no_entry: - PostgreSQL のサポートが終了

変数

# 基本設定
postgres_listen_addresses: [ '127.0.0.1' ] # オプション
postgres_log_dir: '/home/postgres-logs'    # オプション
postgres_data_dir: '/home/postgres'        # オプション
postgres_clusters:                         # 必須
  - version: 11                              # 必須
    name: 'main'                             # 必須
    port: 5432                               # 必須
    checksums: True                          # オプション
    fsync_enabled: False                     # オプション
    archive_enabled: False                   # オプション
    wal_level: 'logical'                     # オプション
    max_replication_slots: 10                # オプション
    barman_directory: None                   # オプション
    # クラスターをスタンバイサーバとして定義
    primary:                                 # オプション
      host: '127.0.1.1'                      # 必須
      port: 5433                             # 必須
      replication_user: 'replicator'         # 必須
      replication_password: 'SuperSecret'    # 必須
      restore_command: None                   # オプション
      restore_barman_directory: None          # オプション
    # 作成されるユーザーのリスト(オプション)
    users:
      - username: 'replicator'               # 必須
        password: 'SuperSecret'              # 必須
        permissions: 'REPLICATION'           # 必須
    # 作成されるデータベースのリスト(オプション)
    databases:
      - dbname: my_database                  # 必須
        owner: john                          # 必須
        extensions:                          # オプション
          - names: [ 'postgis', 'postgis_topology' ]
            apt_deps: [ 'postgresql-11-postgis' ]
    extra_config:                          # オプション
      max_connections: 100                   # オプション
      shared_preload_libraries: ''           # オプション
      max_worker_processes: 8                # オプション
      track_commit_timestamp: off            # オプション
      max_standby_archive_delay: 30s         # オプション
      max_standby_streaming_delay: 600s      # オプション

# PostgreSQL 設定 (オプション)
postgres_log_line_prefix: '%m [%p] database: %d host: %h user: %u '
postgres_datestyle: 'iso, dmy'
postgres_locale_formats: fr_FR.UTF-8
postgres_text_search_config: pg_catalog.french

# PostgreSQL pg_hba 設定 (オプション)
postgres_allowed_hosts:
  - user: all
    range: 10.0.0.0/24
postgres_replication_hosts:
  - user: replicator
    range: 10.0.0.0/24

# Ansible 関連設定
postgres_become_method: su  # オプション

# Barman 接続設定
postgres_barman_server: barman.example.com  # 1 つ以上のサーバが archive_enabled の場合は必須
postgres_barman_rsync_enabled: False        # オプション
postgres_barman_rsync_options: ''           # オプション
postgres_barman_remote_user: barman         # オプション
postgres_barman_path_prefix: '~'            # オプション、rsync を使用する場合は必須

テスト

このプロジェクトには test/main.yml のテストプレイブックが含まれています。これは Docker を使用してローカルにコンテナをプロビジョニングし、3ノードの PostgreSQL クラスターとバーマンサーバーをセットアップします。

このプレイブックのカバレッジは完全ではないかもしれませんが、少なくとも存在します。

貢献される方は、まず test/ ディレクトリ内の Docker コンテナで新しいプレイブックに変更をテストし、可能であればテストに変更がカバーされることを確認してください。

ライセンス

このプロジェクトは MIT ライセンスの下でライセンスされています。詳細は LICENSE ファイルをご覧ください。

感謝

作成者:

メンテナ:

フィードバック、バグレポート、リクエスト...

歓迎!

プロジェクトについて

Install, configure and manage PostgreSQL clusters

インストール
ansible-galaxy install trainline-eu.ansible_postgresql_role
ライセンス
mit
ダウンロード
3.8k
所有者