hammadrauf.apache2

Ansible 角色:Apache2

此角色在基于 Debian 的操作系统上安装 Apache2 或 HTTPD,也支持基于 RHEL 的操作系统。它还可以执行一些常见的 Apache2 配置,例如创建虚拟主机、自签名 SSL、基于 CertBot 的 SSL 等。

需求

任何基于 Debian 或 RHEL 的虚拟机或物理服务器,要求 Ansible 用户具有 SUDO 权限,并且已安装 python3。

角色变量

完整列表请参见 defaults/main.yml。

以下是默认主页的可选文件或模板。

ap2_template_index: ./some/path/index.html.j2
ap2_file_css: ./some/path/site_style.css
ap2_file_ico: ./some/path/favicon.ico

以下数据结构尚在开发中,待实现...

ap2_virtualhosts:
  - directory: "/var/www/html"
    contextroot: "/"
    domainname: "www.abc.net"
    port80: true
    port443: true
    port80redirect: true
    ssl_enabled: true
    ssl_self_signed: false
    ssl_certbot: true

依赖

示例剧本

    - hosts: servers
      roles:
         - role: hammadrauf.apache2

使用 Molecule 进行测试

使用以下命令在 Molecule/Ansible 之外启动 Podman 实例:

podman run -d --name debian12 --hostname debian12 -it docker.io/hammadrauf/dockerdeb12:latest sleep infinity & wait
podman run -d --name fedora40 --hostname fedora40 -it docker.io/hammadrauf/fedora40:latest
podman run -d --name ubuntu --hostname ubuntu -it docker.io/hammadrauf/ubuntunoble:latest sleep infinity & wait

许可证

MIT

作者信息

此角色由 Hammad Rauf 于 2024 年 5 月 9 日创建。

关于项目

Debian/RHEL installation of Apache2/Httpd and some basic configuration of Websites.

安装
ansible-galaxy install hammadrauf.apache2
许可证
Unknown
下载
83
拥有者