Add fail2ban role and clean up yaml lint noise

This commit is contained in:
2026-08-08 23:50:32 -05:00
parent 9b837dd780
commit 6c7ecfc724
352 changed files with 4632 additions and 4186 deletions
+3 -8
View File
@@ -1,16 +1,13 @@
---
language: python
python: "2.7"
python: '2.7'
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
packages: [python-pip]
install:
# Install ansible
- pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
@@ -1,2 +1,2 @@
---
# defaults file for ensure_ansible_prereq
...
@@ -1,17 +1,17 @@
---
# handlers file for ensure_ansible_prereq
- name: 'ensure_ansible_prereq.package_facts'
- name: ensure_ansible_prereq.package_facts
ansible.builtin.package_facts:
- name: 'ensure_ansible_prereq.service_facts'
- name: ensure_ansible_prereq.service_facts
ansible.builtin.service_facts:
- name: 'ensure_ansible_prereq.service_reload'
- name: ensure_ansible_prereq.service_reload
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_ansible_prereq is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_ansible_prereq.service_restart'
- name: ensure_ansible_prereq.service_restart
when:
- ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined
@@ -21,9 +21,7 @@
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
state: restarted
loop: '{{ ensure_ansible_prereq.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info:
author: Jason Rothstein
description: Ensure required pre-req are present for ansible management
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0
# - CC-BY-4.0
license: LGPL-3.0-or-later
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
@@ -46,8 +45,6 @@ galaxy_info:
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
@@ -1,9 +1,7 @@
---
# tasks file for ensure_ansible_prereq
- name: 'repository changes'
- name: repository changes
ansible.builtin.lineinfile:
path: '/etc/apt/sources.list'
state: 'absent'
path: /etc/apt/sources.list
state: absent
regexp: 'deb cdrom:'
...
@@ -1,2 +1,2 @@
---
# tasks file for ensure_ansible_prereq
...
+41 -37
View File
@@ -1,51 +1,56 @@
---
# tasks file for ensure_ansible_prereq
- name: 'include vendor / version specific tasks'
when:
- ansible_facts["system"] == 'Linux'
- name: include vendor / version specific tasks
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_tasks:
file: '{{ lookup("first_found", findme) }}'
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
errors: 'ignore'
- name: 'include vendor / version specific variables'
when:
- ansible_facts["system"] == 'Linux'
- default.yml
errors: ignore
- name: include vendor / version specific variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: 'ensure_ansible_prereq'
name: ensure_ansible_prereq
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure packages'
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined
@@ -58,9 +63,9 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_ansible_prereq.package_facts'
- 'ensure_ansible_prereq.service_facts'
- name: 'ensure configurations'
- ensure_ansible_prereq.package_facts
- ensure_ansible_prereq.service_facts
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined
@@ -81,11 +86,11 @@
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_ansible_prereq.package_facts'
- 'ensure_ansible_prereq.service_facts'
- 'ensure_ansible_prereq.service_reload'
- 'ensure_ansible_prereq.service_restart'
- name: 'ensure services'
- ensure_ansible_prereq.package_facts
- ensure_ansible_prereq.service_facts
- ensure_ansible_prereq.service_reload
- ensure_ansible_prereq.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined
@@ -99,8 +104,7 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_ansible_prereq.package_facts'
- 'ensure_ansible_prereq.service_facts'
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
- ensure_ansible_prereq.package_facts
- ensure_ansible_prereq.service_facts
- name: flush handlers
ansible.builtin.meta: flush_handlers
+1 -2
View File
@@ -1,5 +1,4 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_ansible_prereq
roles: [ensure_ansible_prereq]
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_ansible_prereq
...
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_ansible_prereq
...
+3 -8
View File
@@ -1,16 +1,13 @@
---
language: python
python: "2.7"
python: '2.7'
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
packages: [python-pip]
install:
# Install ansible
- pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
+2 -2
View File
@@ -1,4 +1,4 @@
---
# defaults file for ensure_apache
lets_encrypt_admin: 'root@example.com'
lets_encrypt_url: 'https://acme-v02.api.letsencrypt.org/directory'
lets_encrypt_admin: root@example.com
lets_encrypt_url: https://acme-v02.api.letsencrypt.org/directory
+5 -7
View File
@@ -1,17 +1,17 @@
---
# handlers file for ensure_apache
- name: 'ensure_apache.package_facts'
- name: ensure_apache.package_facts
ansible.builtin.package_facts:
- name: 'ensure_apache.service_facts'
- name: ensure_apache.service_facts
ansible.builtin.service_facts:
- name: 'ensure_apache.service_reload'
- name: ensure_apache.service_reload
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_apache is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_apache.service_restart'
- name: ensure_apache.service_restart
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -21,9 +21,7 @@
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
state: restarted
loop: '{{ ensure_apache.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info:
author: Jason Rothstein
description: Ensure Apache is installed, running, and functional
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0
# - CC-BY-4.0
license: LGPL-3.0-or-later
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
@@ -46,8 +45,6 @@ galaxy_info:
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+71 -70
View File
@@ -1,35 +1,37 @@
---
# tasks file for ensure_apache
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
- name: include variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: 'ensure_apache'
name: ensure_apache
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure sysctl'
- name: ensure sysctl
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -46,11 +48,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.value }}'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure packages'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -63,11 +65,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure seboolean'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure seboolean
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -81,11 +83,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure configurations'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- http_vhost is defined
@@ -107,11 +109,11 @@
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure firewall'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure firewall
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts.packages["firewalld"] is defined
@@ -127,11 +129,11 @@
loop_control:
label: '{{ item.service }} will be {{ item.state }}'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure permissions'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure permissions
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -158,11 +160,11 @@
loop_control:
label: '{{ item.path }} will be ensured'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure vhost document roots'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure vhost document roots
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -170,21 +172,21 @@
- http_vhost is iterable
- item.fqdn is defined
ansible.builtin.file:
path: '/srv/http/{{ item.fqdn }}'
state: 'directory'
owner: 'root'
group: 'root'
path: /srv/http/{{ item.fqdn }}
state: directory
owner: root
group: root
mode: '0755'
setype: 'httpd_sys_content_t'
setype: httpd_sys_content_t
loop: '{{ http_vhost }}'
loop_control:
label: '/srv/http/{{ item.fqdn }} will be ensured'
label: /srv/http/{{ item.fqdn }} will be ensured
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure website content from git repos'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure website content from git repos
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -194,17 +196,17 @@
- item.repo is defined
ansible.builtin.git:
accept_hostkey: 'yes'
dest: '/srv/http/{{ item.fqdn }}'
dest: /srv/http/{{ item.fqdn }}
repo: '{{ item.repo }}'
loop: '{{ http_vhost }}'
loop_control:
label: '/srv/http/{{ item.fqdn }} will be populated...'
label: /srv/http/{{ item.fqdn }} will be populated...
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'ensure services'
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_apache is defined
@@ -218,10 +220,9 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_apache.package_facts'
- 'ensure_apache.service_facts'
- 'ensure_apache.service_reload'
- 'ensure_apache.service_restart'
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
- ensure_apache.package_facts
- ensure_apache.service_facts
- ensure_apache.service_reload
- ensure_apache.service_restart
- name: flush handlers
ansible.builtin.meta: flush_handlers
+1 -2
View File
@@ -1,5 +1,4 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_apache
roles: [ensure_apache]
+209 -179
View File
@@ -1,229 +1,259 @@
---
# vars file for ensure_apache
package_list:
- name: 'httpd'
state: 'present'
- name: 'httpd-filesystem'
state: 'present'
- name: 'httpd-tools'
state: 'present'
- name: 'mod_http2'
state: 'present'
- name: 'mod_md'
state: 'present'
- name: 'mod_ssl'
state: 'present'
- name: 'php'
state: 'present'
- name: 'php-cli'
state: 'present'
- name: 'php-common'
state: 'present'
- name: 'php-fpm'
state: 'present'
- name: 'php-mbstring'
state: 'present'
- name: 'php-mysqlnd'
state: 'present'
- name: 'php-opcache'
state: 'present'
- name: 'php-pdo'
state: 'present'
- name: 'php-sodium'
state: 'present'
- name: 'php-xml'
state: 'present'
- name: httpd
state: present
- name: httpd-filesystem
state: present
- name: httpd-tools
state: present
- name: mod_http2
state: present
- name: mod_md
state: present
- name: mod_ssl
state: present
- name: php
state: present
- name: php-cli
state: present
- name: php-common
state: present
- name: php-fpm
state: present
- name: php-mbstring
state: present
- name: php-mysqlnd
state: present
- name: php-opcache
state: present
- name: php-pdo
state: present
- name: php-sodium
state: present
- name: php-xml
state: present
firewall_list:
- permanent: 'yes'
service: 'http'
state: 'enabled'
service: http
state: enabled
- permanent: 'yes'
service: 'https'
state: 'enabled'
service: https
state: enabled
permission_list:
- path: '/etc/httpd/md'
group: 'apache'
owner: 'root'
- path: /etc/httpd/md
group: apache
owner: root
mode: '0770'
state: 'directory'
setype: 'httpd_var_lib_t'
state: directory
setype: httpd_var_lib_t
seboolean_list:
- name: 'httpd_can_network_connect'
- name: httpd_can_network_connect
persistent: 'yes'
state: 'yes'
- name: 'httpd_can_network_connect_db'
- name: httpd_can_network_connect_db
persistent: 'yes'
state: 'yes'
service_list:
- name: 'httpd.service'
state: 'started'
- name: httpd.service
state: started
enabled: 'yes'
- name: 'httpd-reload.timer'
state: 'started'
- name: httpd-reload.timer
state: started
enabled: 'yes'
- name: 'php-fpm.service'
state: 'started'
- name: php-fpm.service
state: started
enabled: 'yes'
template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf'
group: 'root'
- dest: /etc/httpd/conf.d/autoindex.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf'
- dest: '/etc/httpd/conf.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/autoindex.conf'
- dest: /etc/httpd/conf.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README'
- dest: '/etc/httpd/conf.d/vhost.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/README'
- dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf'
- dest: '/etc/httpd/conf.d/ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/vhost.conf'
- dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf'
- dest: '/etc/httpd/conf.d/userdir.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/ssl.conf'
- dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf'
- dest: '/etc/httpd/conf.d/welcome.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/userdir.conf'
- dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf'
- dest: '/etc/httpd/conf/httpd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/welcome.conf'
- dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf'
- dest: '/etc/httpd/conf/magic'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/httpd.conf'
- dest: /etc/httpd/conf/magic
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic'
- dest: '/etc/httpd/conf.modules.d/00-base.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/magic'
- dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf'
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-base.conf'
- dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: '/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: '/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: '/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: '/etc/httpd/conf.modules.d/01-md.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf'
- dest: '/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-md.conf'
- dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: '/etc/httpd/conf.modules.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README'
- dest: '/etc/logrotate.d/httpd'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/README'
- dest: /etc/logrotate.d/httpd
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd'
- dest: '/etc/sysconfig/htcacheclean'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/logrotate.d/httpd'
- dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean'
- dest: '/usr/lib/systemd/system/htcacheclean.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/sysconfig/htcacheclean'
- dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service'
- dest: '/usr/lib/systemd/system/httpd.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/htcacheclean.service'
- dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service'
- dest: '/usr/lib/systemd/system/httpd.socket'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.service'
- dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket'
- dest: '/usr/lib/systemd/system/httpd-init.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket'
- dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service'
- dest: '/usr/lib/systemd/system/httpd-reload.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-init.service'
- dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service'
- dest: '/usr/lib/systemd/system/httpd-reload.timer'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.service'
- dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer'
- dest: '/usr/lib/systemd/system/httpd@.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.timer'
- dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service'
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd@.service'
- dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
...
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
+209 -179
View File
@@ -1,229 +1,259 @@
---
# vars file for ensure_apache
package_list:
- name: 'httpd'
state: 'present'
- name: 'httpd-filesystem'
state: 'present'
- name: 'httpd-tools'
state: 'present'
- name: 'mod_http2'
state: 'present'
- name: 'mod_md'
state: 'present'
- name: 'mod_ssl'
state: 'present'
- name: 'php'
state: 'present'
- name: 'php-cli'
state: 'present'
- name: 'php-common'
state: 'present'
- name: 'php-fpm'
state: 'present'
- name: 'php-mbstring'
state: 'present'
- name: 'php-mysqlnd'
state: 'present'
- name: 'php-opcache'
state: 'present'
- name: 'php-pdo'
state: 'present'
- name: 'php-sodium'
state: 'present'
- name: 'php-xml'
state: 'present'
- name: httpd
state: present
- name: httpd-filesystem
state: present
- name: httpd-tools
state: present
- name: mod_http2
state: present
- name: mod_md
state: present
- name: mod_ssl
state: present
- name: php
state: present
- name: php-cli
state: present
- name: php-common
state: present
- name: php-fpm
state: present
- name: php-mbstring
state: present
- name: php-mysqlnd
state: present
- name: php-opcache
state: present
- name: php-pdo
state: present
- name: php-sodium
state: present
- name: php-xml
state: present
firewall_list:
- permanent: 'yes'
service: 'http'
state: 'enabled'
service: http
state: enabled
- permanent: 'yes'
service: 'https'
state: 'enabled'
service: https
state: enabled
permission_list:
- path: '/etc/httpd/md'
group: 'apache'
owner: 'root'
- path: /etc/httpd/md
group: apache
owner: root
mode: '0770'
state: 'directory'
setype: 'httpd_var_lib_t'
state: directory
setype: httpd_var_lib_t
seboolean_list:
- name: 'httpd_can_network_connect'
- name: httpd_can_network_connect
persistent: 'yes'
state: 'yes'
- name: 'httpd_can_network_connect_db'
- name: httpd_can_network_connect_db
persistent: 'yes'
state: 'yes'
service_list:
- name: 'httpd.service'
state: 'started'
- name: httpd.service
state: started
enabled: 'yes'
- name: 'httpd-reload.timer'
state: 'started'
- name: httpd-reload.timer
state: started
enabled: 'yes'
- name: 'php-fpm.service'
state: 'started'
- name: php-fpm.service
state: started
enabled: 'yes'
template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf'
group: 'root'
- dest: /etc/httpd/conf.d/autoindex.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf'
- dest: '/etc/httpd/conf.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/autoindex.conf'
- dest: /etc/httpd/conf.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README'
- dest: '/etc/httpd/conf.d/vhost.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/README'
- dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf'
- dest: '/etc/httpd/conf.d/ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/vhost.conf'
- dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf'
- dest: '/etc/httpd/conf.d/userdir.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/ssl.conf'
- dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf'
- dest: '/etc/httpd/conf.d/welcome.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/userdir.conf'
- dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf'
- dest: '/etc/httpd/conf/httpd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/welcome.conf'
- dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf'
- dest: '/etc/httpd/conf/magic'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/httpd.conf'
- dest: /etc/httpd/conf/magic
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic'
- dest: '/etc/httpd/conf.modules.d/00-base.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/magic'
- dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf'
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-base.conf'
- dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: '/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: '/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: '/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: '/etc/httpd/conf.modules.d/01-md.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf'
- dest: '/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-md.conf'
- dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: '/etc/httpd/conf.modules.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README'
- dest: '/etc/logrotate.d/httpd'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/README'
- dest: /etc/logrotate.d/httpd
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd'
- dest: '/etc/sysconfig/htcacheclean'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/logrotate.d/httpd'
- dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean'
- dest: '/usr/lib/systemd/system/htcacheclean.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/sysconfig/htcacheclean'
- dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service'
- dest: '/usr/lib/systemd/system/httpd.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/htcacheclean.service'
- dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service'
- dest: '/usr/lib/systemd/system/httpd.socket'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.service'
- dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket'
- dest: '/usr/lib/systemd/system/httpd-init.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket'
- dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service'
- dest: '/usr/lib/systemd/system/httpd-reload.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-init.service'
- dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service'
- dest: '/usr/lib/systemd/system/httpd-reload.timer'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.service'
- dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer'
- dest: '/usr/lib/systemd/system/httpd@.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.timer'
- dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service'
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd@.service'
- dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
...
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
+214 -183
View File
@@ -1,234 +1,265 @@
---
# vars file for ensure_apache
package_list:
- name: 'httpd'
state: 'present'
- name: 'httpd-filesystem'
state: 'present'
- name: 'httpd-tools'
state: 'present'
- name: 'mod_http2'
state: 'present'
- name: 'mod_md'
state: 'present'
- name: 'mod_ssl'
state: 'present'
- name: 'php'
state: 'present'
- name: 'php-cli'
state: 'present'
- name: 'php-common'
state: 'present'
- name: 'php-fpm'
state: 'present'
- name: 'php-mbstring'
state: 'present'
- name: 'php-mysqlnd'
state: 'present'
- name: 'php-opcache'
state: 'present'
- name: 'php-pdo'
state: 'present'
- name: 'php-sodium'
state: 'present'
- name: 'php-xml'
state: 'present'
- name: httpd
state: present
- name: httpd-filesystem
state: present
- name: httpd-tools
state: present
- name: mod_http2
state: present
- name: mod_md
state: present
- name: mod_ssl
state: present
- name: php
state: present
- name: php-cli
state: present
- name: php-common
state: present
- name: php-fpm
state: present
- name: php-mbstring
state: present
- name: php-mysqlnd
state: present
- name: php-opcache
state: present
- name: php-pdo
state: present
- name: php-sodium
state: present
- name: php-xml
state: present
firewall_list:
- permanent: 'yes'
service: 'http'
state: 'enabled'
service: http
state: enabled
- permanent: 'yes'
service: 'https'
state: 'enabled'
service: https
state: enabled
permission_list:
- path: '/etc/httpd/md'
group: 'apache'
owner: 'root'
- path: /etc/httpd/md
group: apache
owner: root
mode: '0770'
state: 'directory'
setype: 'httpd_var_lib_t'
state: directory
setype: httpd_var_lib_t
seboolean_list:
- name: 'httpd_can_network_connect'
- name: httpd_can_network_connect
persistent: 'yes'
state: 'yes'
- name: 'httpd_can_network_connect_db'
- name: httpd_can_network_connect_db
persistent: 'yes'
state: 'yes'
service_list:
- name: 'httpd.service'
state: 'started'
- name: httpd.service
state: started
enabled: 'yes'
- name: 'httpd-reload.timer'
state: 'started'
- name: httpd-reload.timer
state: started
enabled: 'yes'
- name: 'php-fpm.service'
state: 'started'
- name: php-fpm.service
state: started
enabled: 'yes'
template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf'
group: 'root'
- dest: /etc/httpd/conf.d/autoindex.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf'
- dest: '/etc/httpd/conf.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/autoindex.conf'
- dest: /etc/httpd/conf.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README'
- dest: '/etc/httpd/conf.d/vhost.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/README'
- dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf'
- dest: '/etc/httpd/conf.d/ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/vhost.conf'
- dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf'
- dest: '/etc/httpd/conf.d/userdir.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/ssl.conf'
- dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf'
- dest: '/etc/httpd/conf.d/welcome.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/userdir.conf'
- dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf'
- dest: '/etc/httpd/conf/httpd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.d/welcome.conf'
- dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf'
- dest: '/etc/httpd/conf/magic'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/httpd.conf'
- dest: /etc/httpd/conf/magic
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic'
- dest: '/etc/httpd/conf.modules.d/00-base.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf/magic'
- dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf'
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-base.conf'
- dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: '/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-brotli.conf'
- dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: '/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-dav.conf'
- dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-lua.conf'
- dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: '/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-mpm.conf'
- dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-optional.conf'
- dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-proxy.conf'
- dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-ssl.conf'
- dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/00-systemd.conf'
- dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: '/etc/httpd/conf.modules.d/01-md.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-cgi.conf'
- dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf'
- dest: '/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/01-md.conf'
- dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-h2.conf'
- dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: '/etc/httpd/conf.modules.d/README'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
- dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README'
- dest: '/etc/logrotate.d/httpd'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/httpd/conf.modules.d/README'
- dest: /etc/logrotate.d/httpd
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd'
- dest: '/etc/sysconfig/htcacheclean'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/logrotate.d/httpd'
- dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean'
- dest: '/usr/lib/systemd/system/htcacheclean.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/sysconfig/htcacheclean'
- dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service'
- dest: '/usr/lib/systemd/system/httpd.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/htcacheclean.service'
- dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service'
- dest: '/usr/lib/systemd/system/httpd.socket'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.service'
- dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket'
- dest: '/usr/lib/systemd/system/httpd-init.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket'
- dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service'
- dest: '/usr/lib/systemd/system/httpd-reload.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-init.service'
- dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service'
- dest: '/usr/lib/systemd/system/httpd-reload.timer'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.service'
- dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer'
- dest: '/usr/lib/systemd/system/httpd@.service'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd-reload.timer'
- dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service'
- dest: '/usr/lib/systemd/system/httpd.service.d/php-fpm.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd@.service'
- dest: /usr/lib/systemd/system/httpd.service.d/php-fpm.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service.d/php-fpm.conf'
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
group: 'root'
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.service.d/php-fpm.conf'
- dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644'
owner: 'root'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
...
owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf'
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_apache
...
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_apache
...
+3 -8
View File
@@ -1,16 +1,13 @@
---
language: python
python: "2.7"
python: '2.7'
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
packages: [python-pip]
install:
# Install ansible
- pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
+1 -1
View File
@@ -1,2 +1,2 @@
---
# defaults file for ensure_cockpit
...
+5 -7
View File
@@ -1,17 +1,17 @@
---
# handlers file for ensure_cockpit
- name: 'ensure_cockpit.package_facts'
- name: ensure_cockpit.package_facts
ansible.builtin.package_facts:
- name: 'ensure_cockpit.service_facts'
- name: ensure_cockpit.service_facts
ansible.builtin.service_facts:
- name: 'ensure_cockpit.service_reload'
- name: ensure_cockpit.service_reload
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_cockpit is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_cockpit.service_restart'
- name: ensure_cockpit.service_restart
when:
- ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined
@@ -21,9 +21,7 @@
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
state: restarted
loop: '{{ ensure_cockpit.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info:
author: Jason Rothstein
description: Ensures cockpit is installed, running, and functional
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0
# - CC-BY-4.0
license: LGPL-3.0-or-later
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
@@ -46,8 +45,6 @@ galaxy_info:
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+27 -31
View File
@@ -1,35 +1,37 @@
---
# tasks file for ensure_cockpit
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
- name: include variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: 'ensure_cockpit'
name: ensure_cockpit
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure packages'
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined
@@ -41,10 +43,8 @@
loop: '{{ ensure_cockpit.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_cockpit.package_facts'
- 'ensure_cockpit.service_facts'
- name: 'ensure configurations'
notify: [ensure_cockpit.package_facts, ensure_cockpit.service_facts]
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined
@@ -65,11 +65,11 @@
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_cockpit.package_facts'
- 'ensure_cockpit.service_facts'
- 'ensure_cockpit.service_reload'
- 'ensure_cockpit.service_restart'
- name: 'ensure services'
- ensure_cockpit.package_facts
- ensure_cockpit.service_facts
- ensure_cockpit.service_reload
- ensure_cockpit.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined
@@ -82,10 +82,6 @@
loop: '{{ ensure_cockpit.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_cockpit.package_facts'
- 'ensure_cockpit.service_facts'
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
notify: [ensure_cockpit.package_facts, ensure_cockpit.service_facts]
- name: flush handlers
ansible.builtin.meta: flush_handlers
+1 -2
View File
@@ -1,5 +1,4 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_cockpit
roles: [ensure_cockpit]
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-kdump'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-selinux'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-kdump
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-selinux
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-kdump'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-selinux'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-kdump
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-selinux
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-kdump'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-selinux'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-kdump
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-selinux
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: 'cockpit-ws-selinux'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
- name: cockpit-ws-selinux
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
---
# vars file for ensure_cockpit
package_list:
- name: 'cockpit'
state: 'present'
- name: 'cockpit-bridge'
state: 'present'
- name: 'cockpit-doc'
state: 'present'
- name: 'cockpit-networkmanager'
state: 'present'
- name: 'cockpit-packagekit'
state: 'present'
- name: 'cockpit-sosreport'
state: 'present'
- name: 'cockpit-storaged'
state: 'present'
- name: 'cockpit-system'
state: 'present'
- name: 'cockpit-ws'
state: 'present'
- name: cockpit
state: present
- name: cockpit-bridge
state: present
- name: cockpit-doc
state: present
- name: cockpit-networkmanager
state: present
- name: cockpit-packagekit
state: present
- name: cockpit-sosreport
state: present
- name: cockpit-storaged
state: present
- name: cockpit-system
state: present
- name: cockpit-ws
state: present
service_list:
- name: 'cockpit.socket'
state: 'started'
- name: cockpit.socket
state: started
enabled: 'yes'
...
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_cockpit
...
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_cockpit
...
+3 -8
View File
@@ -1,16 +1,13 @@
---
language: python
python: "2.7"
python: '2.7'
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
packages: [python-pip]
install:
# Install ansible
- pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
+1 -1
View File
@@ -1,4 +1,4 @@
---
# defaults file for ensure_dovecot
dovecot_vhost: '{{ inventory_hostname }}'
dovecot_quota: '1G'
dovecot_quota: 1G
+5 -7
View File
@@ -1,17 +1,17 @@
---
# handlers file for ensure_dovecot
- name: 'ensure_dovecot.package_facts'
- name: ensure_dovecot.package_facts
ansible.builtin.package_facts:
- name: 'ensure_dovecot.service_facts'
- name: ensure_dovecot.service_facts
ansible.builtin.service_facts:
- name: 'ensure_dovecot.service_reload'
- name: ensure_dovecot.service_reload
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_dovecot is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_dovecot.service_restart'
- name: ensure_dovecot.service_restart
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -21,9 +21,7 @@
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
state: restarted
loop: '{{ ensure_dovecot.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info:
author: your name
description: your role description
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
@@ -46,8 +45,6 @@ galaxy_info:
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+45 -47
View File
@@ -1,35 +1,37 @@
---
# tasks file for ensure_dovecot
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
- name: include variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: 'ensure_dovecot'
name: ensure_dovecot
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure sysctl'
- name: ensure sysctl
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -46,11 +48,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.value }}'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- 'ensure_dovecot.service_reload'
- 'ensure_dovecot.service_restart'
- name: 'ensure packages'
- ensure_dovecot.package_facts
- ensure_dovecot.service_facts
- ensure_dovecot.service_reload
- ensure_dovecot.service_restart
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -63,11 +65,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- 'ensure_dovecot.service_reload'
- 'ensure_dovecot.service_restart'
- name: 'ensure seboolean'
- ensure_dovecot.package_facts
- ensure_dovecot.service_facts
- ensure_dovecot.service_reload
- ensure_dovecot.service_restart
- name: ensure seboolean
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -81,11 +83,11 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- 'ensure_dovecot.service_reload'
- 'ensure_dovecot.service_restart'
- name: 'ensure configurations'
- ensure_dovecot.package_facts
- ensure_dovecot.service_facts
- ensure_dovecot.service_reload
- ensure_dovecot.service_restart
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -106,11 +108,11 @@
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- 'ensure_dovecot.service_reload'
- 'ensure_dovecot.service_restart'
- name: 'ensure firewall'
- ensure_dovecot.package_facts
- ensure_dovecot.service_facts
- ensure_dovecot.service_reload
- ensure_dovecot.service_restart
- name: ensure firewall
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts.packages["firewalld"] is defined
@@ -126,11 +128,11 @@
loop_control:
label: '{{ item.service }} will be {{ item.state }}'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- 'ensure_dovecot.service_reload'
- 'ensure_dovecot.service_restart'
- name: 'ensure services'
- ensure_dovecot.package_facts
- ensure_dovecot.service_facts
- ensure_dovecot.service_reload
- ensure_dovecot.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined
@@ -143,10 +145,6 @@
loop: '{{ ensure_dovecot.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_dovecot.package_facts'
- 'ensure_dovecot.service_facts'
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
notify: [ensure_dovecot.package_facts, ensure_dovecot.service_facts]
- name: flush handlers
ansible.builtin.meta: flush_handlers
+1 -2
View File
@@ -1,5 +1,4 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_dovecot
roles: [ensure_dovecot]
+119 -88
View File
@@ -1,100 +1,131 @@
---
# vars file for ensure_dovecot
package_list:
- name: 'dovecot'
state: 'present'
- name: 'dovecot-fts-xapian'
state: 'present'
- name: 'dovecot-mysql'
state: 'present'
- name: 'dovecot-pigeonhole'
state: 'present'
- name: dovecot
state: present
- name: dovecot-fts-xapian
state: present
- name: dovecot-mysql
state: present
- name: dovecot-pigeonhole
state: present
firewall_list:
- permanent: 'yes'
service: 'imap'
state: 'enabled'
service: imap
state: enabled
- permanent: 'yes'
service: 'imaps'
state: 'enabled'
service: imaps
state: enabled
service_list:
- enabled: 'yes'
name: 'dovecot.service'
state: 'started'
name: dovecot.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.service'
state: 'started'
name: dovecot-copytls.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.timer'
state: 'started'
name: dovecot-copytls.timer
state: started
template_list:
- dest: '/etc/dovecot/conf.d/10-auth.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-auth.conf'
- dest: '/etc/dovecot/conf.d/10-director.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-director.conf'
- dest: '/etc/dovecot/conf.d/10-logging.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-logging.conf'
- dest: '/etc/dovecot/conf.d/10-mail.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-mail.conf'
- dest: '/etc/dovecot/conf.d/10-master.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-master.conf'
- dest: '/etc/dovecot/conf.d/10-metrics.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-metrics.conf'
- dest: '/etc/dovecot/conf.d/10-ssl.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-ssl.conf'
- dest: '/etc/dovecot/conf.d/15-lda.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/15-lda.conf'
- dest: '/etc/dovecot/conf.d/15-mailboxes.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/15-mailboxes.conf'
- dest: '/etc/dovecot/conf.d/20-imap.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-imap.conf'
- dest: '/etc/dovecot/conf.d/20-lmtp.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-lmtp.conf'
- dest: '/etc/dovecot/conf.d/20-pop3.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-pop3.conf'
- dest: '/etc/dovecot/conf.d/20-submission.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-submission.conf'
- dest: '/etc/dovecot/conf.d/90-acl.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-acl.conf'
- dest: '/etc/dovecot/conf.d/90-plugin.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-plugin.conf'
- dest: '/etc/dovecot/conf.d/90-quota.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-quota.conf'
- dest: '/etc/dovecot/conf.d/auth-checkpassword.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-checkpassword.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-deny.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-deny.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-dict.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-dict.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-ldap.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-ldap.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-master.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-master.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-passwdfile.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-passwdfile.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-sql.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-sql.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-static.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-static.conf.ext'
- dest: '/etc/dovecot/conf.d/auth-system.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-system.conf.ext'
- dest: '/etc/dovecot/conf.d/20-managesieve.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-managesieve.conf'
- dest: '/etc/dovecot/conf.d/90-sieve-extprograms.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-sieve-extprograms.conf'
- dest: '/etc/dovecot/conf.d/90-sieve.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-sieve.conf'
- dest: '/etc/dovecot/dovecot.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf'
- dest: '/etc/dovecot/local.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/local.conf'
- dest: '/etc/dovecot/accounts'
group: 'dovecot'
- dest: /etc/dovecot/conf.d/10-auth.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-auth.conf'
- dest: /etc/dovecot/conf.d/10-director.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-director.conf'
- dest: /etc/dovecot/conf.d/10-logging.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-logging.conf'
- dest: /etc/dovecot/conf.d/10-mail.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-mail.conf'
- dest: /etc/dovecot/conf.d/10-master.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-master.conf'
- dest: /etc/dovecot/conf.d/10-metrics.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-metrics.conf'
- dest: /etc/dovecot/conf.d/10-ssl.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/10-ssl.conf'
- dest: /etc/dovecot/conf.d/15-lda.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/15-lda.conf'
- dest: /etc/dovecot/conf.d/15-mailboxes.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/15-mailboxes.conf'
- dest: /etc/dovecot/conf.d/20-imap.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/20-imap.conf'
- dest: /etc/dovecot/conf.d/20-lmtp.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/20-lmtp.conf'
- dest: /etc/dovecot/conf.d/20-pop3.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/20-pop3.conf'
- dest: /etc/dovecot/conf.d/20-submission.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/20-submission.conf'
- dest: /etc/dovecot/conf.d/90-acl.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/90-acl.conf'
- dest: /etc/dovecot/conf.d/90-plugin.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/90-plugin.conf'
- dest: /etc/dovecot/conf.d/90-quota.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/90-quota.conf'
- dest: /etc/dovecot/conf.d/auth-checkpassword.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-checkpassword.conf.ext'
- dest: /etc/dovecot/conf.d/auth-deny.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-deny.conf.ext'
- dest: /etc/dovecot/conf.d/auth-dict.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-dict.conf.ext'
- dest: /etc/dovecot/conf.d/auth-ldap.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-ldap.conf.ext'
- dest: /etc/dovecot/conf.d/auth-master.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-master.conf.ext'
- dest: /etc/dovecot/conf.d/auth-passwdfile.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-passwdfile.conf.ext'
- dest: /etc/dovecot/conf.d/auth-sql.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-sql.conf.ext'
- dest: /etc/dovecot/conf.d/auth-static.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-static.conf.ext'
- dest: /etc/dovecot/conf.d/auth-system.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/auth-system.conf.ext'
- dest: /etc/dovecot/conf.d/20-managesieve.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/20-managesieve.conf'
- dest: /etc/dovecot/conf.d/90-sieve-extprograms.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/90-sieve-extprograms.conf'
- dest: /etc/dovecot/conf.d/90-sieve.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/90-sieve.conf'
- dest: /etc/dovecot/dovecot.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/dovecot.conf'
- dest: /etc/dovecot/local.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/local.conf'
- dest: /etc/dovecot/accounts
group: dovecot
mode: '0600'
owner: 'dovecot'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts'
- dest: '/usr/lib/systemd/system/dovecot-copytls.service'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer'
...
owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/accounts'
- dest: /usr/lib/systemd/system/dovecot-copytls.service
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: /usr/lib/systemd/system/dovecot-copytls.timer
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.timer'
+35 -32
View File
@@ -1,44 +1,47 @@
---
# vars file for ensure_dovecot
package_list:
- name: 'dovecot'
state: 'present'
- name: 'dovecot-fts-xapian'
state: 'present'
- name: 'dovecot-mysql'
state: 'present'
- name: 'dovecot-pigeonhole'
state: 'present'
- name: dovecot
state: present
- name: dovecot-fts-xapian
state: present
- name: dovecot-mysql
state: present
- name: dovecot-pigeonhole
state: present
firewall_list:
- permanent: 'yes'
service: 'imap'
state: 'enabled'
service: imap
state: enabled
- permanent: 'yes'
service: 'imaps'
state: 'enabled'
service: imaps
state: enabled
service_list:
- enabled: 'yes'
name: 'dovecot.service'
state: 'started'
name: dovecot.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.service'
state: 'started'
name: dovecot-copytls.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.timer'
state: 'started'
name: dovecot-copytls.timer
state: started
template_list:
- dest: '/etc/dovecot/dovecot.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf'
- dest: '/etc/dovecot/conf.d/local.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/local.conf'
- dest: '/etc/dovecot/accounts'
group: 'dovecot'
- dest: /etc/dovecot/dovecot.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/dovecot.conf'
- dest: /etc/dovecot/conf.d/local.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/local.conf'
- dest: /etc/dovecot/accounts
group: dovecot
mode: '0600'
owner: 'dovecot'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts'
- dest: '/usr/lib/systemd/system/dovecot-copytls.service'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer'
...
owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/accounts'
- dest: /usr/lib/systemd/system/dovecot-copytls.service
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: /usr/lib/systemd/system/dovecot-copytls.timer
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.timer'
+35 -31
View File
@@ -1,43 +1,47 @@
---
# vars file for ensure_dovecot
package_list:
- name: 'dovecot'
state: 'present'
- name: 'dovecot-fts-xapian'
state: 'present'
- name: 'dovecot-mysql'
state: 'present'
- name: 'dovecot-pigeonhole'
state: 'present'
- name: dovecot
state: present
- name: dovecot-fts-xapian
state: present
- name: dovecot-mysql
state: present
- name: dovecot-pigeonhole
state: present
firewall_list:
- permanent: 'yes'
service: 'imap'
state: 'enabled'
service: imap
state: enabled
- permanent: 'yes'
service: 'imaps'
state: 'enabled'
service: imaps
state: enabled
service_list:
- enabled: 'yes'
name: 'dovecot.service'
state: 'started'
name: dovecot.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.service'
state: 'started'
name: dovecot-copytls.service
state: started
- enabled: 'yes'
name: 'dovecot-copytls.timer'
state: 'started'
name: dovecot-copytls.timer
state: started
template_list:
- dest: '/etc/dovecot/dovecot.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf'
- dest: '/etc/dovecot/conf.d/local.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/local.conf'
- dest: '/etc/dovecot/accounts'
group: 'dovecot'
- dest: /etc/dovecot/dovecot.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/dovecot.conf'
- dest: /etc/dovecot/conf.d/local.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/conf.d/local.conf'
- dest: /etc/dovecot/accounts
group: dovecot
mode: '0600'
owner: 'dovecot'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts'
- dest: '/usr/lib/systemd/system/dovecot-copytls.service'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer'
...
owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/dovecot/accounts'
- dest: /usr/lib/systemd/system/dovecot-copytls.service
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.service'
- dest: /usr/lib/systemd/system/dovecot-copytls.timer
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/usr/lib/systemd/system/dovecot-copytls.timer'
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_dovecot
...
+1 -1
View File
@@ -1,2 +1,2 @@
---
# vars file for ensure_dovecot
...
+14
View File
@@ -0,0 +1,14 @@
---
# handlers file for ensure_fail2ban
- name: ensure_fail2ban.package_facts
ansible.builtin.package_facts:
- name: ensure_fail2ban.service_facts
ansible.builtin.service_facts:
- name: ensure_fail2ban.service_reload
ansible.builtin.service:
name: fail2ban
state: reloaded
- name: ensure_fail2ban.service_restart
ansible.builtin.service:
name: fail2ban
state: restarted
+3
View File
@@ -0,0 +1,3 @@
---
dependencies:
- role: ensure_os_patch
+130
View File
@@ -0,0 +1,130 @@
---
# tasks file for ensure_fail2ban
- name: include variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: ensure_fail2ban
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.package_list is defined
- ensure_fail2ban.package_list is iterable
ansible.builtin.package:
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_fail2ban.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify: [ensure_fail2ban.package_facts, ensure_fail2ban.service_facts]
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.template_list is defined
- ensure_fail2ban.template_list is iterable
ansible.builtin.template:
backup: 'no'
dest: '{{ item.dest }}'
group: '{{ item.group | default(omit) }}'
mode: '{{ item.mode | default(omit) }}'
owner: '{{ item.owner | default(omit) }}'
selevel: '{{ item.selevel | default(omit) }}'
serole: '{{ item.serole | default(omit) }}'
setype: '{{ item.setype | default(omit) }}'
seuser: '{{ item.seuser | default(omit) }}'
src: '{{ item.src }}'
loop: '{{ ensure_fail2ban.template_list }}'
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- ensure_fail2ban.package_facts
- ensure_fail2ban.service_facts
- ensure_fail2ban.service_reload
- ensure_fail2ban.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.service_list is defined
- ensure_fail2ban.service_list is iterable
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_fail2ban.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify: [ensure_fail2ban.package_facts, ensure_fail2ban.service_facts]
- name: Ensure SELinux is configured
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.selinux_policy is defined
- ensure_fail2ban.selinux_state is defined
ansible.posix.selinux:
policy: '{{ ensure_fail2ban.selinux_policy }}'
state: '{{ ensure_fail2ban.selinux_state }}'
register: ensure_fail2ban_results
notify:
- ensure_fail2ban.package_facts
- ensure_fail2ban.service_facts
- ensure_fail2ban.service_reload
- ensure_fail2ban.service_restart
- name: Reboot if required
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.selinux_policy is defined
- ensure_fail2ban.selinux_state is defined
- ensure_fail2ban_results is defined
- ensure_fail2ban_results.reboot_required is defined
- ensure_fail2ban_results.reboot_required
ansible.builtin.reboot:
- name: ensure seboolean
when:
- ansible_facts["system"] == 'Linux'
- ensure_fail2ban is defined
- ensure_fail2ban.seboolean_list is defined
- ensure_fail2ban.seboolean_list is iterable
ansible.posix.seboolean:
name: '{{ item.name }}'
persistent: '{{ item.persistent }}'
state: '{{ item.state }}'
loop: '{{ ensure_fail2ban.seboolean_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- ensure_fail2ban.package_facts
- ensure_fail2ban.service_facts
- ensure_fail2ban.service_reload
- ensure_fail2ban.service_restart
- name: flush handlers
ansible.builtin.meta: flush_handlers
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = firewallcmd-rich-rules
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = firewallcmd-rich-rules
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,37 @@
# Default block/ban configuration
[DEFAULT]
bantime = 1h
findtime = 10m
maxretry = 5
banaction = iptables-multiport
backend = systemd
# SSH is enabled on all servers
[sshd]
enabled = true
# Apache
[apache-auth]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-badbots]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-noscript]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
[apache-overflows]
enabled = {{ 'true' if ('httpd' in ansible_facts.packages or 'apache2' in ansible_facts.packages) else 'false' }}
# Postfix
[postfix]
enabled = {{ 'true' if 'postfix' in ansible_facts.packages else 'false' }}
# Dovecot
[dovecot]
enabled = {{ 'true' if 'dovecot' in ansible_facts.packages or 'dovecot-core' in ansible_facts.packages else 'false' }}
# MariaDB / MySQL
[mysqld-auth]
enabled = {{ 'true' if ('mariadb-server' in ansible_facts.packages or 'mariadb' in ansible_facts.packages or 'mysql-server' in ansible_facts.packages) else 'false' }}
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban-all
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban-all
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
@@ -0,0 +1,16 @@
---
# vars file for ensure_fail2ban
package_list:
- name: fail2ban
state: present
service_list:
- name: fail2ban
state: started
enabled: true
template_list:
- dest: /etc/fail2ban/jail.d/99-custom_jails.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
}}/etc/fail2ban/jail.d/99-custom_jails.conf.j2'
owner: root
group: root
mode: '0644'
+2
View File
@@ -0,0 +1,2 @@
---
...
+2
View File
@@ -0,0 +1,2 @@
---
...
+3 -8
View File
@@ -1,16 +1,13 @@
---
language: python
python: "2.7"
python: '2.7'
# Use the new container infrastructure
sudo: false
# Install ansible
addons:
apt:
packages:
- python-pip
packages: [python-pip]
install:
# Install ansible
- pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg
script:
# Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
+1 -2
View File
@@ -1,3 +1,2 @@
---
# defaults file for ensure_git
...
+5 -7
View File
@@ -1,17 +1,17 @@
---
# handlers file for ensure_git
- name: 'ensure_git.package_facts'
- name: ensure_git.package_facts
ansible.builtin.package_facts:
- name: 'ensure_git.service_facts'
- name: ensure_git.service_facts
ansible.builtin.service_facts:
- name: 'ensure_git.service_reload'
- name: ensure_git.service_reload
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_git is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_git.service_restart'
- name: ensure_git.service_restart
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -21,9 +21,7 @@
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
state: restarted
loop: '{{ ensure_git.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info:
author: your name
description: your role description
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0
# - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
@@ -46,8 +45,6 @@ galaxy_info:
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+39 -43
View File
@@ -1,35 +1,37 @@
---
# tasks file for ensure_git
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
- name: include variables
when: ["ansible_facts[\"system\"] == 'Linux'"]
ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}'
name: 'ensure_git'
name: ensure_git
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
- default.yml
paths: [../vars/]
errors: ignore
- name: package discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
- name: service discovery
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure packages'
- name: ensure packages
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -41,10 +43,8 @@
loop: '{{ ensure_git.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_git.package_facts'
- 'ensure_git.service_facts'
- name: 'ensure configurations'
notify: [ensure_git.package_facts, ensure_git.service_facts]
- name: ensure configurations
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -65,11 +65,11 @@
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_git.package_facts'
- 'ensure_git.service_facts'
- 'ensure_git.service_reload'
- 'ensure_git.service_restart'
- name: 'ensure services'
- ensure_git.package_facts
- ensure_git.service_facts
- ensure_git.service_reload
- ensure_git.service_restart
- name: ensure services
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -82,10 +82,8 @@
loop: '{{ ensure_git.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_git.package_facts'
- 'ensure_git.service_facts'
- name: 'Ensure SELinux is configured'
notify: [ensure_git.package_facts, ensure_git.service_facts]
- name: Ensure SELinux is configured
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -94,13 +92,13 @@
ansible.posix.selinux:
policy: '{{ ensure_git.selinux_policy }}'
state: '{{ ensure_git.selinux_state }}'
register: 'results'
register: results
notify:
- 'ensure_git.package_facts'
- 'ensure_git.service_facts'
- 'ensure_git.service_reload'
- 'ensure_git.service_restart'
- name: 'Reboot if required'
- ensure_git.package_facts
- ensure_git.service_facts
- ensure_git.service_reload
- ensure_git.service_restart
- name: Reboot if required
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -110,7 +108,7 @@
- results.reboot_required is defined
- results.reboot_required
reboot:
- name: 'ensure seboolean'
- name: ensure seboolean
when:
- ansible_facts["system"] == 'Linux'
- ensure_git is defined
@@ -124,11 +122,9 @@
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_git.package_facts'
- 'ensure_git.service_facts'
- 'ensure_git.service_reload'
- 'ensure_git.service_restart'
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
- ensure_git.package_facts
- ensure_git.service_facts
- ensure_git.service_reload
- ensure_git.service_restart
- name: flush handlers
ansible.builtin.meta: flush_handlers
+1 -2
View File
@@ -1,5 +1,4 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_git
roles: [ensure_git]
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present
+2 -4
View File
@@ -1,7 +1,5 @@
---
# vars file for ensure_git
package_list:
- name: 'git'
state: 'present'
...
- name: git
state: present

Some files were not shown because too many files have changed in this diff Show More