robertdebock.httpd
Ansibleロールhttpd
あなたのシステムにhttpdをインストールして設定します。
GitHub | GitLab | ダウンロード | バージョン |
---|---|---|---|
例のプレイブック
この例はmolecule/default/converge.yml
から取得され、各プッシュ、プルリクエスト、リリースでテストされています。
---
- name: Converge
hosts: all
become: true
gather_facts: true
vars_files:
- ../../vars/main.yml
- ../../defaults/main.yml
roles:
- role: robertdebock.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_vhosts:
# - name: my_vhost_docroot
# servername: www1.example.com
# documentroot: "{{ httpd_data_directory }}/www1.example.com"
# - name: my_vhost_backend_http
# servername: www2.example.com
# backend_url: "http://www.example.com/"
# serveralias:
# - example.com
# - www.example.com
# - name: my_vhost_remote
# servername: www3.example.com
# remote: "http://localhost:3128/"
# - name: my_vhost_backend_https
# servername: www4.example.com
# backend_url: "https://www.example.com/"
# - name: my_vhost_piratebay
# servername: piratebay.nl
# backend_url: "https://thepirate-bay.org/"
# proxy_preserve_host: Off
# proxy_requests: Off
# setenv:
# - name: force-proxy-request-1.0
# value: 1
# - name: proxy-nokeepalive
# value: 1
# - name: proxy-initial-not-pooled
# - name: proxy-sendchunks
# value: 1
# - name: no_doc_root
# servername: nodocroot.example.com
# documentroot: /var/www/html/nodocroot
# create_docroot: false
httpd_directories:
- name: my_directory
path: "{{ httpd_data_directory }}/my_directory"
# options:
# - Indexes
# - FollowSymLinks
allow_override: All
マシンを準備する必要があります。CIではmolecule/default/prepare.yml
を使用してこれを行います:
---
- name: Prepare
hosts: all
become: true
gather_facts: false
roles:
- role: robertdebock.bootstrap
- role: robertdebock.epel
- role: robertdebock.buildtools
- role: robertdebock.python_pip
- role: robertdebock.openssl
openssl_items:
- name: apache-httpd
common_name: "{{ ansible_fqdn }}"
これらのロールを使用する方法についての完全な説明と例も参照してください。
ロール変数
変数のデフォルト値はdefaults/main.yml
に設定されています:
---
# httpdのデフォルトファイル
# 使用するサーバー名。
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
# vhostのために使用するテンプレート。自分の設定でconfを上書きするのに便利です。
vhost_conf_template: vhost.conf.j2
default_vhost_conf: default_vhost.conf
要件
- requirements.txtにリストされたpipパッケージ。
使用されているロールの状態
次のロールはシステムを準備するために使用されます。別の方法でシステムを準備することもできます。
要件 | GitHub | GitLab |
---|---|---|
robertdebock.bootstrap | ||
robertdebock.buildtools | ||
robertdebock.epel | ||
robertdebock.openssl | ||
robertdebock.python_pip | ||
robertdebock.selinux |
コンテキスト
このロールは多くの互換性のあるロールの一部です。さらなる情報については、これらのロールのドキュメントを参照してください。
関連するロールの概要:
互換性
このロールは以下のコンテナイメージでテストされています:
コンテナ | タグ |
---|---|
EL | 9 |
Debian | すべて |
Fedora | すべて |
Ubuntu | すべて |
必要なAnsibleの最小バージョンは2.12で、次のテストが行われました:
- 前のバージョン。
- 現在のバージョン。
- 開発バージョン。
問題が見つかった場合は、GitHubに登録してください。
ライセンス
著者情報
私をスポンサーすることを検討してください。
プロジェクトについて
Install and configure httpd on your system.
インストール
ansible-galaxy install robertdebock.httpd
ライセンス
apache-2.0
ダウンロード
377.4k
所有者
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.