buluma.httpd
Ansibleロール httpd
システムにhttpdをインストールして設定します。
GitHub | バージョン | 問題 | プルリクエスト | ダウンロード |
---|---|---|---|---|
例のプレイブック
この例は molecule/default/converge.yml
から抜粋され、各プッシュ、プルリクエスト、リリースでテストされています。
---
- name: 適用
hosts: all
become: true
gather_facts: true
vars_files:
- ../../vars/main.yml
- ../../defaults/main.yml
pre_tasks:
- name: aptキャッシュを更新
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
roles:
- role: buluma.httpd
# https_ssl_enable: true
httpd_port: 8080
httpd_ssl_port: 8443
httpd_locations:
- name: my_location
location: /my_location
backend_url: "http://localhost:8080/myapplication"
httpd_directories:
- name: my_directory
path: "{{ httpd_data_directory }}/my_directory"
allow_override: All
マシンの準備が必要です。CIではこれを molecule/default/prepare.yml
を使って行います。
---
- name: 準備
hosts: all
become: true
gather_facts: false
roles:
- role: buluma.bootstrap
- role: buluma.epel
- role: buluma.buildtools
- role: buluma.python_pip
- role: buluma.openssl
openssl_items:
- name: apache-httpd
common_name: "{{ ansible_fqdn }}"
これらのロールの使用方法についての完全な説明と例も参照してください。
ロール変数
変数のデフォルト値は defaults/main.yml
に設定されています。
---
# httpd用のデフォルトファイル
# 使用するservername。
httpd_servername: "{{ ansible_fqdn }}"
# 使用する非SSLポート。
httpd_port: 80
# SSLを有効にしますか?(自己署名証明書)
https_ssl_enable: false
# httpsを設定するには、リッスンするホスト名を設定します。
httpd_ssl_servername: "{{ ansible_fqdn }}"
# SSLのためにTCPポートが必要です。
httpd_ssl_port: 443
# SSL証明書:
httpd_openssl_crt: "{{ httpd_openssl_crt_directory }}/apache-httpd.crt"
# SSLキー
httpd_openssl_key: "{{ httpd_openssl_key_directory }}/apache-httpd.key"
# "動作中"ページを保持するか
httpd_remove_example: false
# インストールする追加のhttpdモジュール
httpd_additionnal_modules: []
httpd_custom_modules_to_activate_with_command: []
apache_global_vhost_settings: |
DirectoryIndex index.php index.html
# vhostsのためのテンプレート。自分の設定でconfを上書きするのに便利です。
vhost_conf_template: vhost.conf.j2
default_vhost_conf: default_vhost.conf
要件
- requirements.txt にリストされているpipパッケージ。
使用中のロールの状態
システムの準備に使用されるロールは以下のとおりです。他の方法でシステムを準備することもできます。
要件 | GitHub | バージョン |
---|---|---|
buluma.bootstrap | ||
buluma.buildtools | ||
buluma.epel | ||
buluma.openssl | ||
buluma.python_pip | ||
buluma.selinux |
コンテキスト
このロールは多くの互換ロールの一部です。さらに詳しい情報はこれらのロールのドキュメントを参照してください。
関連するロールの概要:
互換性
このロールは以下のコンテナイメージでテストされています。
コンテナ | タグ |
---|---|
EL | 8, 9 |
Debian | すべて |
Fedora | すべて |
opensuse | すべて |
Ubuntu | jammy, focal, bionic, lunar, noble |
必要なAnsibleの最小バージョンは2.12であり、テストは以下のバージョンで行われました:
- 前のバージョン。
- 現在のバージョン。
- 開発バージョン。
問題を見つけた場合は、GitHubに登録してください。