I am trying to install apache modules on CentOS 8.1. I have a playbook that is working for Ubuntu and need the same tasks on CentOS.
vars:
libs:
- apache2
- libapache2-mod-php
- libapache2-mod-jk
- libapache2-mod-rpaf
- libapache2-mod-geoip
- php-curl
apt:
name: "{{ libs }}"
state: present
install_recommends: yes
I installed httpd and php on my system.
- name: Install apache2 on CentOS
vars:
libs:
- httpd
- httpd-devel
- php
- php-curl
yum:
name: "{{ libs }}"
state: present
when: ansible_distribution == "CentOS"
I don't know what are the mod equivalents for the ones missing. These are the apache modules I need to set.
- name: Set modules
apache2_module:
name: "{{ item }}"
state: present
with_items:
- alias
- authz_host
- autoindex
- deflate
- dir
- env
- expires
- headers
- jk
- mime
- negotiation
- php7.2
- proxy
- proxy_http
- rewrite
- rpaf
- setenvif
- ssl
- filter
Output:
ok: [node1] => (item=alias)
ok: [node1] => (item=authz_host)
ok: [node1] => (item=autoindex)
ok: [node1] => (item=deflate)
ok: [node1] => (item=dir)
ok: [node1] => (item=env)
ok: [node1] => (item=expires)
ok: [node1] => (item=headers)
failed: [node1] (item=jk) => {"ansible_loop_var": "item", "changed": false, "item": "jk", "msg": "None not found. Perhaps this system does not use None to manage apache"}
ok: [node1] => (item=mime)
ok: [node1] => (item=negotiation)
failed: [node1] (item=php7.2) => {"ansible_loop_var": "item", "changed": false, "item": "php7.2", "msg": "None not found. Perhaps this system does not use None to manage apache"}
ok: [node1] => (item=proxy)
ok: [node1] => (item=proxy_http)
ok: [node1] => (item=rewrite)
failed: [node1] (item=rpaf) => {"ansible_loop_var": "item", "changed": false, "item": "rpaf", "msg": "None not found. Perhaps this system does not use None to manage apache"}
ok: [node1] => (item=setenvif)
failed: [node1] (item=ssl) => {"ansible_loop_var": "item", "changed": false, "item": "ssl", "msg": "None not found. Perhaps this system does not use None to manage apache"}
ok: [node1] => (item=filter)
Copyright Notice:Content Author:「Smohic」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60116890/installing-apache-modules-on-centos