A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/vbotka/ansible-apache below:

vbotka/ansible-apache: Ansible role. Configure Apache HTTP Server.

apache

This role is included in the collection vbotka.freebsd as vbotka.freebsd.apache

Ansible role. Install and configure Apache.

Documentation at readthedocs.io

Feel free to share your feedback and report issues.

Contributions are welcome.

Supported platforms

This role has been developed and tested with

Requirements Collections Roles Variables

Review defaults and examples in vars. By default SSL is off.

apache_ssl: False

Certificates are needed to enable SSL.

apache_ssl: True
apache_version: "24"
apache_SSLCertificateFile: "/usr/local/etc/apache{{ apache_version }}/server.crt"
apache_SSLCertificateKeyFile: "/usr/local/etc/apache{{ apache_version }}/server.key"

Virtual hosts are configured with optional redirection to SSL. By default virtual hosts for ports 80 and 443 will be created and port 80 permanently redirected to 443. Example is available in vars.

Workflow
  1. Change shell to /bin/sh if necessary
shell> ansible webserver -e 'ansible_shell_type=csh ansible_shell_executable=/bin/csh' -a 'sudo pw usermod freebsd -s /bin/sh'
  1. Install role
shell> ansible-galaxy role install vbotka.apache
  1. Fit variables

  2. Create playbook and inventory

shell> cat apache.yml
---
- hosts: webserver
  roles:
    - vbotka.apache
shell> cat hosts
[webserver]
<webserver-ip-or-fqdn>
[webserver:vars]
ansible_connection=ssh
ansible_user=freebsd
ansible_become=true
ansible_become_method=sudo
ansible_python_interpreter=/usr/local/bin/python3.9
ansible_perl_interpreter=/usr/local/bin/perl
  1. Test syntax
shell> ansible-playbook apache.yml --syntax-check
  1. Show variables
shell> ansible-playbook apache.yml -t apache_debug -e apache_debug=true
  1. Install packages
shell> ansible-playbook apache.yml -t apache_pkg -e apache_install=true
  1. Dry run and show differences
shell> ansible-playbook apache.yml --check --diff
  1. Install and configure apache
shell> ansible-playbook apache.yml
  1. Optionally test the webserver
Ansible lint

Use the configuration file .ansible-lint.local when running ansible-lint. Some rules might be disabled and some warnings might be ignored. See the notes in the configuration file.

shell> ansible-lint -c .ansible-lint.local
References License

Author Information

Vladimir Botka


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4