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
+25 -27
View File
@@ -1,29 +1,27 @@
--- ---
collections: collections:
- name: 'ansible.netcommon' - name: ansible.netcommon
- name: 'ansible.mysql' - name: ansible.mysql
- name: 'ansible.posix' - name: ansible.posix
- name: 'ansible.windows' - name: ansible.windows
- name: 'awx.awx' - name: awx.awx
- name: 'community.crypto' - name: community.crypto
- name: 'community.digitalocean' - name: community.digitalocean
- name: 'community.dns' - name: community.dns
- name: 'community.general' - name: community.general
- name: 'community.grafana' - name: community.grafana
- name: 'community.hashi_vault' - name: community.hashi_vault
- name: 'community.libvirt' - name: community.libvirt
- name: 'community.postgresql' - name: community.postgresql
- name: 'community.proxysql' - name: community.proxysql
- name: 'community.rabbitmq' - name: community.rabbitmq
- name: 'community.windows' - name: community.windows
- name: 'community.zabbix' - name: community.zabbix
- name: 'containers.podman' - name: containers.podman
- name: 'grafana.grafana' - name: grafana.grafana
- name: 'gluster.gluster' - name: gluster.gluster
- name: 'kubernetes.core' - name: kubernetes.core
- name: 'kubevirt.core' - name: kubevirt.core
- name: 'openstack.cloud' - name: openstack.cloud
- name: 'microsoft.ad' - name: microsoft.ad
- name: 'microsoft.iis' - name: microsoft.iis
...
+2 -7
View File
@@ -1,16 +1,13 @@
--- ---
language: python language: python
python: "2.7" python: '2.7'
# Use the new container infrastructure # Use the new container infrastructure
sudo: false sudo: false
# Install ansible # Install ansible
addons: addons:
apt: apt:
packages: packages: [python-pip]
- python-pip
install: install:
# Install ansible # Install ansible
- pip install ansible - pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path # Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg - printf '[defaults]\nroles_path=../' >ansible.cfg
script: script:
# Basic role syntax check # Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications: 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 # handlers file for ensure_ansible_prereq
- name: 'ensure_ansible_prereq.package_facts' - name: ensure_ansible_prereq.package_facts
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'ensure_ansible_prereq.service_facts' - name: ensure_ansible_prereq.service_facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure_ansible_prereq.service_reload' - name: ensure_ansible_prereq.service_reload
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd' - ansible_facts["service_mgr"] == 'systemd'
- ensure_ansible_prereq is defined - ensure_ansible_prereq is defined
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: 'yes' daemon_reload: 'yes'
- name: 'ensure_ansible_prereq.service_restart' - name: ensure_ansible_prereq.service_restart
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined - ensure_ansible_prereq is defined
@@ -21,9 +21,7 @@
ansible.builtin.service: ansible.builtin.service:
enabled: '{{ item.enabled }}' enabled: '{{ item.enabled }}'
name: '{{ item.name }}' name: '{{ item.name }}'
state: 'restarted' state: restarted
loop: '{{ ensure_ansible_prereq.service_list }}' loop: '{{ ensure_ansible_prereq.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be restarted' label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info: galaxy_info:
author: Jason Rothstein author: Jason Rothstein
description: Ensure required pre-req are present for ansible management description: Ensure required pre-req are present for ansible management
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0 # - Apache-2.0
# - CC-BY-4.0 # - CC-BY-4.0
license: LGPL-3.0-or-later license: LGPL-3.0-or-later
min_ansible_version: 2.9 min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version. # If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0 # - 1.0
# - 7 # - 7
# - 99.99 # - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # 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 # 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. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above, # List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list. # if you add dependencies to this list.
@@ -1,9 +1,7 @@
--- ---
# tasks file for ensure_ansible_prereq # tasks file for ensure_ansible_prereq
- name: 'repository changes' - name: repository changes
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: '/etc/apt/sources.list' path: /etc/apt/sources.list
state: 'absent' state: absent
regexp: 'deb cdrom:' 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 # tasks file for ensure_ansible_prereq
- name: 'include vendor / version specific tasks' - name: include vendor / version specific tasks
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_tasks: ansible.builtin.include_tasks:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
errors: 'ignore' errors: ignore
- name: 'include vendor / version specific variables' - name: include vendor / version specific variables
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
name: 'ensure_ansible_prereq' name: ensure_ansible_prereq
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
paths: paths: [../vars/]
- '../vars/' errors: ignore
errors: 'ignore' - name: package discovery
- name: 'package discovery'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: service discovery
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined - ansible_facts["services"] is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure packages' - name: ensure packages
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined - ensure_ansible_prereq is defined
@@ -58,9 +63,9 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_ansible_prereq.package_facts' - ensure_ansible_prereq.package_facts
- 'ensure_ansible_prereq.service_facts' - ensure_ansible_prereq.service_facts
- name: 'ensure configurations' - name: ensure configurations
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined - ensure_ansible_prereq is defined
@@ -81,11 +86,11 @@
loop_control: loop_control:
label: '{{ item.dest }} will be ensured' label: '{{ item.dest }} will be ensured'
notify: notify:
- 'ensure_ansible_prereq.package_facts' - ensure_ansible_prereq.package_facts
- 'ensure_ansible_prereq.service_facts' - ensure_ansible_prereq.service_facts
- 'ensure_ansible_prereq.service_reload' - ensure_ansible_prereq.service_reload
- 'ensure_ansible_prereq.service_restart' - ensure_ansible_prereq.service_restart
- name: 'ensure services' - name: ensure services
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_ansible_prereq is defined - ensure_ansible_prereq is defined
@@ -99,8 +104,7 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_ansible_prereq.package_facts' - ensure_ansible_prereq.package_facts
- 'ensure_ansible_prereq.service_facts' - ensure_ansible_prereq.service_facts
- name: 'flush handlers' - name: flush handlers
ansible.builtin.meta: 'flush_handlers' ansible.builtin.meta: flush_handlers
...
+1 -2
View File
@@ -1,5 +1,4 @@
--- ---
- hosts: localhost - hosts: localhost
remote_user: root remote_user: root
roles: roles: [ensure_ansible_prereq]
- 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 ...
+2 -7
View File
@@ -1,16 +1,13 @@
--- ---
language: python language: python
python: "2.7" python: '2.7'
# Use the new container infrastructure # Use the new container infrastructure
sudo: false sudo: false
# Install ansible # Install ansible
addons: addons:
apt: apt:
packages: packages: [python-pip]
- python-pip
install: install:
# Install ansible # Install ansible
- pip install ansible - pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path # Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg - printf '[defaults]\nroles_path=../' >ansible.cfg
script: script:
# Basic role syntax check # Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications: 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 # defaults file for ensure_apache
lets_encrypt_admin: 'root@example.com' lets_encrypt_admin: root@example.com
lets_encrypt_url: 'https://acme-v02.api.letsencrypt.org/directory' lets_encrypt_url: https://acme-v02.api.letsencrypt.org/directory
+5 -7
View File
@@ -1,17 +1,17 @@
--- ---
# handlers file for ensure_apache # handlers file for ensure_apache
- name: 'ensure_apache.package_facts' - name: ensure_apache.package_facts
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'ensure_apache.service_facts' - name: ensure_apache.service_facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure_apache.service_reload' - name: ensure_apache.service_reload
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd' - ansible_facts["service_mgr"] == 'systemd'
- ensure_apache is defined - ensure_apache is defined
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: 'yes' daemon_reload: 'yes'
- name: 'ensure_apache.service_restart' - name: ensure_apache.service_restart
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -21,9 +21,7 @@
ansible.builtin.service: ansible.builtin.service:
enabled: '{{ item.enabled }}' enabled: '{{ item.enabled }}'
name: '{{ item.name }}' name: '{{ item.name }}'
state: 'restarted' state: restarted
loop: '{{ ensure_apache.service_list }}' loop: '{{ ensure_apache.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be restarted' label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info: galaxy_info:
author: Jason Rothstein author: Jason Rothstein
description: Ensure Apache is installed, running, and functional description: Ensure Apache is installed, running, and functional
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0 # - Apache-2.0
# - CC-BY-4.0 # - CC-BY-4.0
license: LGPL-3.0-or-later license: LGPL-3.0-or-later
min_ansible_version: 2.9 min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version. # If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0 # - 1.0
# - 7 # - 7
# - 99.99 # - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # 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 # 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. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above, # List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list. # if you add dependencies to this list.
+71 -70
View File
@@ -1,35 +1,37 @@
--- ---
# tasks file for ensure_apache # tasks file for ensure_apache
- name: 'include variables' - name: include variables
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
name: 'ensure_apache' name: ensure_apache
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
paths: paths: [../vars/]
- '../vars/' errors: ignore
errors: 'ignore' - name: package discovery
- name: 'package discovery'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: service discovery
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined - ansible_facts["services"] is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure sysctl' - name: ensure sysctl
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -46,11 +48,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.value }}' label: '{{ item.name }} will be {{ item.value }}'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure packages' - name: ensure packages
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -63,11 +65,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure seboolean' - name: ensure seboolean
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -81,11 +83,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure configurations' - name: ensure configurations
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- http_vhost is defined - http_vhost is defined
@@ -107,11 +109,11 @@
loop_control: loop_control:
label: '{{ item.dest }} will be ensured' label: '{{ item.dest }} will be ensured'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure firewall' - name: ensure firewall
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts.packages["firewalld"] is defined - ansible_facts.packages["firewalld"] is defined
@@ -127,11 +129,11 @@
loop_control: loop_control:
label: '{{ item.service }} will be {{ item.state }}' label: '{{ item.service }} will be {{ item.state }}'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure permissions' - name: ensure permissions
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -158,11 +160,11 @@
loop_control: loop_control:
label: '{{ item.path }} will be ensured' label: '{{ item.path }} will be ensured'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure vhost document roots' - name: ensure vhost document roots
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -170,21 +172,21 @@
- http_vhost is iterable - http_vhost is iterable
- item.fqdn is defined - item.fqdn is defined
ansible.builtin.file: ansible.builtin.file:
path: '/srv/http/{{ item.fqdn }}' path: /srv/http/{{ item.fqdn }}
state: 'directory' state: directory
owner: 'root' owner: root
group: 'root' group: root
mode: '0755' mode: '0755'
setype: 'httpd_sys_content_t' setype: httpd_sys_content_t
loop: '{{ http_vhost }}' loop: '{{ http_vhost }}'
loop_control: loop_control:
label: '/srv/http/{{ item.fqdn }} will be ensured' label: /srv/http/{{ item.fqdn }} will be ensured
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure website content from git repos' - name: ensure website content from git repos
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -194,17 +196,17 @@
- item.repo is defined - item.repo is defined
ansible.builtin.git: ansible.builtin.git:
accept_hostkey: 'yes' accept_hostkey: 'yes'
dest: '/srv/http/{{ item.fqdn }}' dest: /srv/http/{{ item.fqdn }}
repo: '{{ item.repo }}' repo: '{{ item.repo }}'
loop: '{{ http_vhost }}' loop: '{{ http_vhost }}'
loop_control: loop_control:
label: '/srv/http/{{ item.fqdn }} will be populated...' label: /srv/http/{{ item.fqdn }} will be populated...
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'ensure services' - name: ensure services
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_apache is defined - ensure_apache is defined
@@ -218,10 +220,9 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_apache.package_facts' - ensure_apache.package_facts
- 'ensure_apache.service_facts' - ensure_apache.service_facts
- 'ensure_apache.service_reload' - ensure_apache.service_reload
- 'ensure_apache.service_restart' - ensure_apache.service_restart
- name: 'flush handlers' - name: flush handlers
ansible.builtin.meta: 'flush_handlers' ansible.builtin.meta: flush_handlers
...
+1 -2
View File
@@ -1,5 +1,4 @@
--- ---
- hosts: localhost - hosts: localhost
remote_user: root remote_user: root
roles: roles: [ensure_apache]
- ensure_apache
+209 -179
View File
@@ -1,229 +1,259 @@
--- ---
# vars file for ensure_apache # vars file for ensure_apache
package_list: package_list:
- name: 'httpd' - name: httpd
state: 'present' state: present
- name: 'httpd-filesystem' - name: httpd-filesystem
state: 'present' state: present
- name: 'httpd-tools' - name: httpd-tools
state: 'present' state: present
- name: 'mod_http2' - name: mod_http2
state: 'present' state: present
- name: 'mod_md' - name: mod_md
state: 'present' state: present
- name: 'mod_ssl' - name: mod_ssl
state: 'present' state: present
- name: 'php' - name: php
state: 'present' state: present
- name: 'php-cli' - name: php-cli
state: 'present' state: present
- name: 'php-common' - name: php-common
state: 'present' state: present
- name: 'php-fpm' - name: php-fpm
state: 'present' state: present
- name: 'php-mbstring' - name: php-mbstring
state: 'present' state: present
- name: 'php-mysqlnd' - name: php-mysqlnd
state: 'present' state: present
- name: 'php-opcache' - name: php-opcache
state: 'present' state: present
- name: 'php-pdo' - name: php-pdo
state: 'present' state: present
- name: 'php-sodium' - name: php-sodium
state: 'present' state: present
- name: 'php-xml' - name: php-xml
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'http' service: http
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'https' service: https
state: 'enabled' state: enabled
permission_list: permission_list:
- path: '/etc/httpd/md' - path: /etc/httpd/md
group: 'apache' group: apache
owner: 'root' owner: root
mode: '0770' mode: '0770'
state: 'directory' state: directory
setype: 'httpd_var_lib_t' setype: httpd_var_lib_t
seboolean_list: seboolean_list:
- name: 'httpd_can_network_connect' - name: httpd_can_network_connect
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
- name: 'httpd_can_network_connect_db' - name: httpd_can_network_connect_db
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
service_list: service_list:
- name: 'httpd.service' - name: httpd.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'httpd-reload.timer' - name: httpd-reload.timer
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'php-fpm.service' - name: php-fpm.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
template_list: template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf' - dest: /etc/httpd/conf.d/autoindex.conf
group: 'root' group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/README' }}/etc/httpd/conf.d/autoindex.conf'
group: 'root' - dest: /etc/httpd/conf.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/vhost.conf' }}/etc/httpd/conf.d/README'
group: 'root' - dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/ssl.conf' }}/etc/httpd/conf.d/vhost.conf'
group: 'root' - dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/userdir.conf' }}/etc/httpd/conf.d/ssl.conf'
group: 'root' - dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/welcome.conf' }}/etc/httpd/conf.d/userdir.conf'
group: 'root' - dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/httpd.conf' }}/etc/httpd/conf.d/welcome.conf'
group: 'root' - dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/magic' }}/etc/httpd/conf/httpd.conf'
group: 'root' - dest: /etc/httpd/conf/magic
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-base.conf' }}/etc/httpd/conf/magic'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf' }}/etc/httpd/conf.modules.d/00-base.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-dav.conf' }}/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-lua.conf' }}/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf' }}/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-optional.conf' }}/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf' }}/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf' }}/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf' }}/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf' }}/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-md.conf' }}/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-h2.conf' }}/etc/httpd/conf.modules.d/01-md.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf' }}/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/README' }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/logrotate.d/httpd' }}/etc/httpd/conf.modules.d/README'
group: 'root' - dest: /etc/logrotate.d/httpd
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/sysconfig/htcacheclean' }}/etc/logrotate.d/httpd'
group: 'root' - dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/htcacheclean.service' }}/etc/sysconfig/htcacheclean'
group: 'root' - dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.service' }}/usr/lib/systemd/system/htcacheclean.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket' }}/usr/lib/systemd/system/httpd.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-init.service' }}/usr/lib/systemd/system/httpd.socket'
group: 'root' - dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.service' }}/usr/lib/systemd/system/httpd-init.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.timer' }}/usr/lib/systemd/system/httpd-reload.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd@.service' }}/usr/lib/systemd/system/httpd-reload.timer'
group: 'root' - dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' }}/usr/lib/systemd/system/httpd@.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' 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 # vars file for ensure_apache
package_list: package_list:
- name: 'httpd' - name: httpd
state: 'present' state: present
- name: 'httpd-filesystem' - name: httpd-filesystem
state: 'present' state: present
- name: 'httpd-tools' - name: httpd-tools
state: 'present' state: present
- name: 'mod_http2' - name: mod_http2
state: 'present' state: present
- name: 'mod_md' - name: mod_md
state: 'present' state: present
- name: 'mod_ssl' - name: mod_ssl
state: 'present' state: present
- name: 'php' - name: php
state: 'present' state: present
- name: 'php-cli' - name: php-cli
state: 'present' state: present
- name: 'php-common' - name: php-common
state: 'present' state: present
- name: 'php-fpm' - name: php-fpm
state: 'present' state: present
- name: 'php-mbstring' - name: php-mbstring
state: 'present' state: present
- name: 'php-mysqlnd' - name: php-mysqlnd
state: 'present' state: present
- name: 'php-opcache' - name: php-opcache
state: 'present' state: present
- name: 'php-pdo' - name: php-pdo
state: 'present' state: present
- name: 'php-sodium' - name: php-sodium
state: 'present' state: present
- name: 'php-xml' - name: php-xml
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'http' service: http
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'https' service: https
state: 'enabled' state: enabled
permission_list: permission_list:
- path: '/etc/httpd/md' - path: /etc/httpd/md
group: 'apache' group: apache
owner: 'root' owner: root
mode: '0770' mode: '0770'
state: 'directory' state: directory
setype: 'httpd_var_lib_t' setype: httpd_var_lib_t
seboolean_list: seboolean_list:
- name: 'httpd_can_network_connect' - name: httpd_can_network_connect
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
- name: 'httpd_can_network_connect_db' - name: httpd_can_network_connect_db
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
service_list: service_list:
- name: 'httpd.service' - name: httpd.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'httpd-reload.timer' - name: httpd-reload.timer
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'php-fpm.service' - name: php-fpm.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
template_list: template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf' - dest: /etc/httpd/conf.d/autoindex.conf
group: 'root' group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/README' }}/etc/httpd/conf.d/autoindex.conf'
group: 'root' - dest: /etc/httpd/conf.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/vhost.conf' }}/etc/httpd/conf.d/README'
group: 'root' - dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/ssl.conf' }}/etc/httpd/conf.d/vhost.conf'
group: 'root' - dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/userdir.conf' }}/etc/httpd/conf.d/ssl.conf'
group: 'root' - dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/welcome.conf' }}/etc/httpd/conf.d/userdir.conf'
group: 'root' - dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/httpd.conf' }}/etc/httpd/conf.d/welcome.conf'
group: 'root' - dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/magic' }}/etc/httpd/conf/httpd.conf'
group: 'root' - dest: /etc/httpd/conf/magic
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-base.conf' }}/etc/httpd/conf/magic'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf' }}/etc/httpd/conf.modules.d/00-base.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-dav.conf' }}/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-lua.conf' }}/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf' }}/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-optional.conf' }}/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf' }}/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf' }}/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf' }}/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf' }}/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-md.conf' }}/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-h2.conf' }}/etc/httpd/conf.modules.d/01-md.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf' }}/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/README' }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/logrotate.d/httpd' }}/etc/httpd/conf.modules.d/README'
group: 'root' - dest: /etc/logrotate.d/httpd
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/sysconfig/htcacheclean' }}/etc/logrotate.d/httpd'
group: 'root' - dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/htcacheclean.service' }}/etc/sysconfig/htcacheclean'
group: 'root' - dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.service' }}/usr/lib/systemd/system/htcacheclean.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket' }}/usr/lib/systemd/system/httpd.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-init.service' }}/usr/lib/systemd/system/httpd.socket'
group: 'root' - dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.service' }}/usr/lib/systemd/system/httpd-init.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.timer' }}/usr/lib/systemd/system/httpd-reload.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd@.service' }}/usr/lib/systemd/system/httpd-reload.timer'
group: 'root' - dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' }}/usr/lib/systemd/system/httpd@.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' 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 # vars file for ensure_apache
package_list: package_list:
- name: 'httpd' - name: httpd
state: 'present' state: present
- name: 'httpd-filesystem' - name: httpd-filesystem
state: 'present' state: present
- name: 'httpd-tools' - name: httpd-tools
state: 'present' state: present
- name: 'mod_http2' - name: mod_http2
state: 'present' state: present
- name: 'mod_md' - name: mod_md
state: 'present' state: present
- name: 'mod_ssl' - name: mod_ssl
state: 'present' state: present
- name: 'php' - name: php
state: 'present' state: present
- name: 'php-cli' - name: php-cli
state: 'present' state: present
- name: 'php-common' - name: php-common
state: 'present' state: present
- name: 'php-fpm' - name: php-fpm
state: 'present' state: present
- name: 'php-mbstring' - name: php-mbstring
state: 'present' state: present
- name: 'php-mysqlnd' - name: php-mysqlnd
state: 'present' state: present
- name: 'php-opcache' - name: php-opcache
state: 'present' state: present
- name: 'php-pdo' - name: php-pdo
state: 'present' state: present
- name: 'php-sodium' - name: php-sodium
state: 'present' state: present
- name: 'php-xml' - name: php-xml
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'http' service: http
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'https' service: https
state: 'enabled' state: enabled
permission_list: permission_list:
- path: '/etc/httpd/md' - path: /etc/httpd/md
group: 'apache' group: apache
owner: 'root' owner: root
mode: '0770' mode: '0770'
state: 'directory' state: directory
setype: 'httpd_var_lib_t' setype: httpd_var_lib_t
seboolean_list: seboolean_list:
- name: 'httpd_can_network_connect' - name: httpd_can_network_connect
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
- name: 'httpd_can_network_connect_db' - name: httpd_can_network_connect_db
persistent: 'yes' persistent: 'yes'
state: 'yes' state: 'yes'
service_list: service_list:
- name: 'httpd.service' - name: httpd.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'httpd-reload.timer' - name: httpd-reload.timer
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
- name: 'php-fpm.service' - name: php-fpm.service
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
template_list: template_list:
- dest: '/etc/httpd/conf.d/autoindex.conf' - dest: /etc/httpd/conf.d/autoindex.conf
group: 'root' group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/autoindex.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/README' }}/etc/httpd/conf.d/autoindex.conf'
group: 'root' - dest: /etc/httpd/conf.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/vhost.conf' }}/etc/httpd/conf.d/README'
group: 'root' - dest: /etc/httpd/conf.d/vhost.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/vhost.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/ssl.conf' }}/etc/httpd/conf.d/vhost.conf'
group: 'root' - dest: /etc/httpd/conf.d/ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/userdir.conf' }}/etc/httpd/conf.d/ssl.conf'
group: 'root' - dest: /etc/httpd/conf.d/userdir.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/userdir.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.d/welcome.conf' }}/etc/httpd/conf.d/userdir.conf'
group: 'root' - dest: /etc/httpd/conf.d/welcome.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.d/welcome.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/httpd.conf' }}/etc/httpd/conf.d/welcome.conf'
group: 'root' - dest: /etc/httpd/conf/httpd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/httpd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf/magic' }}/etc/httpd/conf/httpd.conf'
group: 'root' - dest: /etc/httpd/conf/magic
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf/magic' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-base.conf' }}/etc/httpd/conf/magic'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-base.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-base.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-brotli.conf' }}/etc/httpd/conf.modules.d/00-base.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-brotli.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-brotli.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-dav.conf' }}/etc/httpd/conf.modules.d/00-brotli.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-dav.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-dav.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-lua.conf' }}/etc/httpd/conf.modules.d/00-dav.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-lua.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-lua.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-mpm.conf' }}/etc/httpd/conf.modules.d/00-lua.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-mpm.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-mpm.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-optional.conf' }}/etc/httpd/conf.modules.d/00-mpm.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-optional.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-optional.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-proxy.conf' }}/etc/httpd/conf.modules.d/00-optional.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-proxy.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-proxy.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-ssl.conf' }}/etc/httpd/conf.modules.d/00-proxy.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-ssl.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/00-systemd.conf' }}/etc/httpd/conf.modules.d/00-ssl.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/00-systemd.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/00-systemd.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-cgi.conf' }}/etc/httpd/conf.modules.d/00-systemd.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-cgi.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-cgi.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/01-md.conf' }}/etc/httpd/conf.modules.d/01-cgi.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/01-md.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/01-md.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-h2.conf' }}/etc/httpd/conf.modules.d/01-md.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/10-proxy_h2.conf' }}/etc/httpd/conf.modules.d/10-h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/10-proxy_h2.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/10-proxy_h2.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/httpd/conf.modules.d/README' }}/etc/httpd/conf.modules.d/10-proxy_h2.conf'
group: 'root' - dest: /etc/httpd/conf.modules.d/README
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/httpd/conf.modules.d/README' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/logrotate.d/httpd' }}/etc/httpd/conf.modules.d/README'
group: 'root' - dest: /etc/logrotate.d/httpd
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/logrotate.d/httpd' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/sysconfig/htcacheclean' }}/etc/logrotate.d/httpd'
group: 'root' - dest: /etc/sysconfig/htcacheclean
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/sysconfig/htcacheclean' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/htcacheclean.service' }}/etc/sysconfig/htcacheclean'
group: 'root' - dest: /usr/lib/systemd/system/htcacheclean.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/htcacheclean.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.service' }}/usr/lib/systemd/system/htcacheclean.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket' }}/usr/lib/systemd/system/httpd.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-init.service' }}/usr/lib/systemd/system/httpd.socket'
group: 'root' - dest: /usr/lib/systemd/system/httpd-init.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-init.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.service' }}/usr/lib/systemd/system/httpd-init.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd-reload.timer' }}/usr/lib/systemd/system/httpd-reload.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd-reload.timer
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd-reload.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd@.service' }}/usr/lib/systemd/system/httpd-reload.timer'
group: 'root' - dest: /usr/lib/systemd/system/httpd@.service
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd@.service' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.service.d/php-fpm.conf' }}/usr/lib/systemd/system/httpd@.service'
group: 'root' - dest: /usr/lib/systemd/system/httpd.service.d/php-fpm.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.service.d/php-fpm.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' }}/usr/lib/systemd/system/httpd.service.d/php-fpm.conf'
group: 'root' - dest: /usr/lib/systemd/system/httpd.socket.d/10-listen443.conf
group: root
mode: '0644' mode: '0644'
owner: 'root' owner: root
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/httpd.socket.d/10-listen443.conf' 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 ...
+2 -7
View File
@@ -1,16 +1,13 @@
--- ---
language: python language: python
python: "2.7" python: '2.7'
# Use the new container infrastructure # Use the new container infrastructure
sudo: false sudo: false
# Install ansible # Install ansible
addons: addons:
apt: apt:
packages: packages: [python-pip]
- python-pip
install: install:
# Install ansible # Install ansible
- pip install ansible - pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path # Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg - printf '[defaults]\nroles_path=../' >ansible.cfg
script: script:
# Basic role syntax check # Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications: 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 # handlers file for ensure_cockpit
- name: 'ensure_cockpit.package_facts' - name: ensure_cockpit.package_facts
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'ensure_cockpit.service_facts' - name: ensure_cockpit.service_facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure_cockpit.service_reload' - name: ensure_cockpit.service_reload
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd' - ansible_facts["service_mgr"] == 'systemd'
- ensure_cockpit is defined - ensure_cockpit is defined
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: 'yes' daemon_reload: 'yes'
- name: 'ensure_cockpit.service_restart' - name: ensure_cockpit.service_restart
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined - ensure_cockpit is defined
@@ -21,9 +21,7 @@
ansible.builtin.service: ansible.builtin.service:
enabled: '{{ item.enabled }}' enabled: '{{ item.enabled }}'
name: '{{ item.name }}' name: '{{ item.name }}'
state: 'restarted' state: restarted
loop: '{{ ensure_cockpit.service_list }}' loop: '{{ ensure_cockpit.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be restarted' label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info: galaxy_info:
author: Jason Rothstein author: Jason Rothstein
description: Ensures cockpit is installed, running, and functional description: Ensures cockpit is installed, running, and functional
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0 # - Apache-2.0
# - CC-BY-4.0 # - CC-BY-4.0
license: LGPL-3.0-or-later license: LGPL-3.0-or-later
min_ansible_version: 2.9 min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version. # If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0 # - 1.0
# - 7 # - 7
# - 99.99 # - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # 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 # 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. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above, # List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list. # if you add dependencies to this list.
+27 -31
View File
@@ -1,35 +1,37 @@
--- ---
# tasks file for ensure_cockpit # tasks file for ensure_cockpit
- name: 'include variables' - name: include variables
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
name: 'ensure_cockpit' name: ensure_cockpit
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
paths: paths: [../vars/]
- '../vars/' errors: ignore
errors: 'ignore' - name: package discovery
- name: 'package discovery'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: service discovery
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined - ansible_facts["services"] is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure packages' - name: ensure packages
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined - ensure_cockpit is defined
@@ -41,10 +43,8 @@
loop: '{{ ensure_cockpit.package_list }}' loop: '{{ ensure_cockpit.package_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify: [ensure_cockpit.package_facts, ensure_cockpit.service_facts]
- 'ensure_cockpit.package_facts' - name: ensure configurations
- 'ensure_cockpit.service_facts'
- name: 'ensure configurations'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined - ensure_cockpit is defined
@@ -65,11 +65,11 @@
loop_control: loop_control:
label: '{{ item.dest }} will be ensured' label: '{{ item.dest }} will be ensured'
notify: notify:
- 'ensure_cockpit.package_facts' - ensure_cockpit.package_facts
- 'ensure_cockpit.service_facts' - ensure_cockpit.service_facts
- 'ensure_cockpit.service_reload' - ensure_cockpit.service_reload
- 'ensure_cockpit.service_restart' - ensure_cockpit.service_restart
- name: 'ensure services' - name: ensure services
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_cockpit is defined - ensure_cockpit is defined
@@ -82,10 +82,6 @@
loop: '{{ ensure_cockpit.service_list }}' loop: '{{ ensure_cockpit.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify: [ensure_cockpit.package_facts, ensure_cockpit.service_facts]
- 'ensure_cockpit.package_facts' - name: flush handlers
- 'ensure_cockpit.service_facts' ansible.builtin.meta: flush_handlers
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
+1 -2
View File
@@ -1,5 +1,4 @@
--- ---
- hosts: localhost - hosts: localhost
remote_user: root remote_user: root
roles: roles: [ensure_cockpit]
- ensure_cockpit
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-kdump' - name: cockpit-kdump
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-selinux' - name: cockpit-selinux
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-kdump' - name: cockpit-kdump
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-selinux' - name: cockpit-selinux
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+24 -26
View File
@@ -1,31 +1,29 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-kdump' - name: cockpit-kdump
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-selinux' - name: cockpit-selinux
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+18 -20
View File
@@ -1,25 +1,23 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
- name: 'cockpit-ws-selinux' - name: cockpit-ws-selinux
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' enabled: 'yes'
...
+20 -22
View File
@@ -1,27 +1,25 @@
--- ---
# vars file for ensure_cockpit # vars file for ensure_cockpit
package_list: package_list:
- name: 'cockpit' - name: cockpit
state: 'present' state: present
- name: 'cockpit-bridge' - name: cockpit-bridge
state: 'present' state: present
- name: 'cockpit-doc' - name: cockpit-doc
state: 'present' state: present
- name: 'cockpit-networkmanager' - name: cockpit-networkmanager
state: 'present' state: present
- name: 'cockpit-packagekit' - name: cockpit-packagekit
state: 'present' state: present
- name: 'cockpit-sosreport' - name: cockpit-sosreport
state: 'present' state: present
- name: 'cockpit-storaged' - name: cockpit-storaged
state: 'present' state: present
- name: 'cockpit-system' - name: cockpit-system
state: 'present' state: present
- name: 'cockpit-ws' - name: cockpit-ws
state: 'present' state: present
service_list: service_list:
- name: 'cockpit.socket' - name: cockpit.socket
state: 'started' state: started
enabled: 'yes' 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 ...
+2 -7
View File
@@ -1,16 +1,13 @@
--- ---
language: python language: python
python: "2.7" python: '2.7'
# Use the new container infrastructure # Use the new container infrastructure
sudo: false sudo: false
# Install ansible # Install ansible
addons: addons:
apt: apt:
packages: packages: [python-pip]
- python-pip
install: install:
# Install ansible # Install ansible
- pip install ansible - pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path # Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg - printf '[defaults]\nroles_path=../' >ansible.cfg
script: script:
# Basic role syntax check # Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications: 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 # defaults file for ensure_dovecot
dovecot_vhost: '{{ inventory_hostname }}' dovecot_vhost: '{{ inventory_hostname }}'
dovecot_quota: '1G' dovecot_quota: 1G
+5 -7
View File
@@ -1,17 +1,17 @@
--- ---
# handlers file for ensure_dovecot # handlers file for ensure_dovecot
- name: 'ensure_dovecot.package_facts' - name: ensure_dovecot.package_facts
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'ensure_dovecot.service_facts' - name: ensure_dovecot.service_facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure_dovecot.service_reload' - name: ensure_dovecot.service_reload
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd' - ansible_facts["service_mgr"] == 'systemd'
- ensure_dovecot is defined - ensure_dovecot is defined
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: 'yes' daemon_reload: 'yes'
- name: 'ensure_dovecot.service_restart' - name: ensure_dovecot.service_restart
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -21,9 +21,7 @@
ansible.builtin.service: ansible.builtin.service:
enabled: '{{ item.enabled }}' enabled: '{{ item.enabled }}'
name: '{{ item.name }}' name: '{{ item.name }}'
state: 'restarted' state: restarted
loop: '{{ ensure_dovecot.service_list }}' loop: '{{ ensure_dovecot.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be restarted' label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info: galaxy_info:
author: your name author: your name
description: your role description description: your role description
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0 # - Apache-2.0
# - CC-BY-4.0 # - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc) license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.9 min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version. # If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0 # - 1.0
# - 7 # - 7
# - 99.99 # - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # 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 # 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. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above, # List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list. # if you add dependencies to this list.
+45 -47
View File
@@ -1,35 +1,37 @@
--- ---
# tasks file for ensure_dovecot # tasks file for ensure_dovecot
- name: 'include variables' - name: include variables
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
name: 'ensure_dovecot' name: ensure_dovecot
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
paths: paths: [../vars/]
- '../vars/' errors: ignore
errors: 'ignore' - name: package discovery
- name: 'package discovery'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: service discovery
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined - ansible_facts["services"] is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure sysctl' - name: ensure sysctl
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -46,11 +48,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.value }}' label: '{{ item.name }} will be {{ item.value }}'
notify: notify:
- 'ensure_dovecot.package_facts' - ensure_dovecot.package_facts
- 'ensure_dovecot.service_facts' - ensure_dovecot.service_facts
- 'ensure_dovecot.service_reload' - ensure_dovecot.service_reload
- 'ensure_dovecot.service_restart' - ensure_dovecot.service_restart
- name: 'ensure packages' - name: ensure packages
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -63,11 +65,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_dovecot.package_facts' - ensure_dovecot.package_facts
- 'ensure_dovecot.service_facts' - ensure_dovecot.service_facts
- 'ensure_dovecot.service_reload' - ensure_dovecot.service_reload
- 'ensure_dovecot.service_restart' - ensure_dovecot.service_restart
- name: 'ensure seboolean' - name: ensure seboolean
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -81,11 +83,11 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_dovecot.package_facts' - ensure_dovecot.package_facts
- 'ensure_dovecot.service_facts' - ensure_dovecot.service_facts
- 'ensure_dovecot.service_reload' - ensure_dovecot.service_reload
- 'ensure_dovecot.service_restart' - ensure_dovecot.service_restart
- name: 'ensure configurations' - name: ensure configurations
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -106,11 +108,11 @@
loop_control: loop_control:
label: '{{ item.dest }} will be ensured' label: '{{ item.dest }} will be ensured'
notify: notify:
- 'ensure_dovecot.package_facts' - ensure_dovecot.package_facts
- 'ensure_dovecot.service_facts' - ensure_dovecot.service_facts
- 'ensure_dovecot.service_reload' - ensure_dovecot.service_reload
- 'ensure_dovecot.service_restart' - ensure_dovecot.service_restart
- name: 'ensure firewall' - name: ensure firewall
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts.packages["firewalld"] is defined - ansible_facts.packages["firewalld"] is defined
@@ -126,11 +128,11 @@
loop_control: loop_control:
label: '{{ item.service }} will be {{ item.state }}' label: '{{ item.service }} will be {{ item.state }}'
notify: notify:
- 'ensure_dovecot.package_facts' - ensure_dovecot.package_facts
- 'ensure_dovecot.service_facts' - ensure_dovecot.service_facts
- 'ensure_dovecot.service_reload' - ensure_dovecot.service_reload
- 'ensure_dovecot.service_restart' - ensure_dovecot.service_restart
- name: 'ensure services' - name: ensure services
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_dovecot is defined - ensure_dovecot is defined
@@ -143,10 +145,6 @@
loop: '{{ ensure_dovecot.service_list }}' loop: '{{ ensure_dovecot.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify: [ensure_dovecot.package_facts, ensure_dovecot.service_facts]
- 'ensure_dovecot.package_facts' - name: flush handlers
- 'ensure_dovecot.service_facts' ansible.builtin.meta: flush_handlers
- name: 'flush handlers'
ansible.builtin.meta: 'flush_handlers'
...
+1 -2
View File
@@ -1,5 +1,4 @@
--- ---
- hosts: localhost - hosts: localhost
remote_user: root remote_user: root
roles: roles: [ensure_dovecot]
- ensure_dovecot
+119 -88
View File
@@ -1,100 +1,131 @@
--- ---
# vars file for ensure_dovecot # vars file for ensure_dovecot
package_list: package_list:
- name: 'dovecot' - name: dovecot
state: 'present' state: present
- name: 'dovecot-fts-xapian' - name: dovecot-fts-xapian
state: 'present' state: present
- name: 'dovecot-mysql' - name: dovecot-mysql
state: 'present' state: present
- name: 'dovecot-pigeonhole' - name: dovecot-pigeonhole
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'imap' service: imap
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'imaps' service: imaps
state: 'enabled' state: enabled
service_list: service_list:
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot.service' name: dovecot.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.service' name: dovecot-copytls.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.timer' name: dovecot-copytls.timer
state: 'started' state: started
template_list: template_list:
- dest: '/etc/dovecot/conf.d/10-auth.conf' - dest: /etc/dovecot/conf.d/10-auth.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-auth.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/10-director.conf' }}/etc/dovecot/conf.d/10-auth.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-director.conf' - dest: /etc/dovecot/conf.d/10-director.conf
- dest: '/etc/dovecot/conf.d/10-logging.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-logging.conf' }}/etc/dovecot/conf.d/10-director.conf'
- dest: '/etc/dovecot/conf.d/10-mail.conf' - dest: /etc/dovecot/conf.d/10-logging.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-mail.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/10-master.conf' }}/etc/dovecot/conf.d/10-logging.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-master.conf' - dest: /etc/dovecot/conf.d/10-mail.conf
- dest: '/etc/dovecot/conf.d/10-metrics.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-metrics.conf' }}/etc/dovecot/conf.d/10-mail.conf'
- dest: '/etc/dovecot/conf.d/10-ssl.conf' - dest: /etc/dovecot/conf.d/10-master.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/10-ssl.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/15-lda.conf' }}/etc/dovecot/conf.d/10-master.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/15-lda.conf' - dest: /etc/dovecot/conf.d/10-metrics.conf
- dest: '/etc/dovecot/conf.d/15-mailboxes.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/15-mailboxes.conf' }}/etc/dovecot/conf.d/10-metrics.conf'
- dest: '/etc/dovecot/conf.d/20-imap.conf' - dest: /etc/dovecot/conf.d/10-ssl.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-imap.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/20-lmtp.conf' }}/etc/dovecot/conf.d/10-ssl.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-lmtp.conf' - dest: /etc/dovecot/conf.d/15-lda.conf
- dest: '/etc/dovecot/conf.d/20-pop3.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-pop3.conf' }}/etc/dovecot/conf.d/15-lda.conf'
- dest: '/etc/dovecot/conf.d/20-submission.conf' - dest: /etc/dovecot/conf.d/15-mailboxes.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-submission.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/90-acl.conf' }}/etc/dovecot/conf.d/15-mailboxes.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-acl.conf' - dest: /etc/dovecot/conf.d/20-imap.conf
- dest: '/etc/dovecot/conf.d/90-plugin.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-plugin.conf' }}/etc/dovecot/conf.d/20-imap.conf'
- dest: '/etc/dovecot/conf.d/90-quota.conf' - dest: /etc/dovecot/conf.d/20-lmtp.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-quota.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/auth-checkpassword.conf.ext' }}/etc/dovecot/conf.d/20-lmtp.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-checkpassword.conf.ext' - dest: /etc/dovecot/conf.d/20-pop3.conf
- dest: '/etc/dovecot/conf.d/auth-deny.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-deny.conf.ext' }}/etc/dovecot/conf.d/20-pop3.conf'
- dest: '/etc/dovecot/conf.d/auth-dict.conf.ext' - dest: /etc/dovecot/conf.d/20-submission.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-dict.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/auth-ldap.conf.ext' }}/etc/dovecot/conf.d/20-submission.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-ldap.conf.ext' - dest: /etc/dovecot/conf.d/90-acl.conf
- dest: '/etc/dovecot/conf.d/auth-master.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-master.conf.ext' }}/etc/dovecot/conf.d/90-acl.conf'
- dest: '/etc/dovecot/conf.d/auth-passwdfile.conf.ext' - dest: /etc/dovecot/conf.d/90-plugin.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-passwdfile.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/auth-sql.conf.ext' }}/etc/dovecot/conf.d/90-plugin.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-sql.conf.ext' - dest: /etc/dovecot/conf.d/90-quota.conf
- dest: '/etc/dovecot/conf.d/auth-static.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-static.conf.ext' }}/etc/dovecot/conf.d/90-quota.conf'
- dest: '/etc/dovecot/conf.d/auth-system.conf.ext' - dest: /etc/dovecot/conf.d/auth-checkpassword.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/auth-system.conf.ext' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/20-managesieve.conf' }}/etc/dovecot/conf.d/auth-checkpassword.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/20-managesieve.conf' - dest: /etc/dovecot/conf.d/auth-deny.conf.ext
- dest: '/etc/dovecot/conf.d/90-sieve-extprograms.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-sieve-extprograms.conf' }}/etc/dovecot/conf.d/auth-deny.conf.ext'
- dest: '/etc/dovecot/conf.d/90-sieve.conf' - dest: /etc/dovecot/conf.d/auth-dict.conf.ext
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/90-sieve.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/dovecot.conf' }}/etc/dovecot/conf.d/auth-dict.conf.ext'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf' - dest: /etc/dovecot/conf.d/auth-ldap.conf.ext
- dest: '/etc/dovecot/local.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/local.conf' }}/etc/dovecot/conf.d/auth-ldap.conf.ext'
- dest: '/etc/dovecot/accounts' - dest: /etc/dovecot/conf.d/auth-master.conf.ext
group: 'dovecot' 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' mode: '0600'
owner: 'dovecot' owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/dovecot-copytls.service' }}/etc/dovecot/accounts'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service' - dest: /usr/lib/systemd/system/dovecot-copytls.service
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer' }}/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 # vars file for ensure_dovecot
package_list: package_list:
- name: 'dovecot' - name: dovecot
state: 'present' state: present
- name: 'dovecot-fts-xapian' - name: dovecot-fts-xapian
state: 'present' state: present
- name: 'dovecot-mysql' - name: dovecot-mysql
state: 'present' state: present
- name: 'dovecot-pigeonhole' - name: dovecot-pigeonhole
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'imap' service: imap
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'imaps' service: imaps
state: 'enabled' state: enabled
service_list: service_list:
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot.service' name: dovecot.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.service' name: dovecot-copytls.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.timer' name: dovecot-copytls.timer
state: 'started' state: started
template_list: template_list:
- dest: '/etc/dovecot/dovecot.conf' - dest: /etc/dovecot/dovecot.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/local.conf' }}/etc/dovecot/dovecot.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/local.conf' - dest: /etc/dovecot/conf.d/local.conf
- dest: '/etc/dovecot/accounts' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
group: 'dovecot' }}/etc/dovecot/conf.d/local.conf'
- dest: /etc/dovecot/accounts
group: dovecot
mode: '0600' mode: '0600'
owner: 'dovecot' owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/dovecot-copytls.service' }}/etc/dovecot/accounts'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service' - dest: /usr/lib/systemd/system/dovecot-copytls.service
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer' }}/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 # vars file for ensure_dovecot
package_list: package_list:
- name: 'dovecot' - name: dovecot
state: 'present' state: present
- name: 'dovecot-fts-xapian' - name: dovecot-fts-xapian
state: 'present' state: present
- name: 'dovecot-mysql' - name: dovecot-mysql
state: 'present' state: present
- name: 'dovecot-pigeonhole' - name: dovecot-pigeonhole
state: 'present' state: present
firewall_list: firewall_list:
- permanent: 'yes' - permanent: 'yes'
service: 'imap' service: imap
state: 'enabled' state: enabled
- permanent: 'yes' - permanent: 'yes'
service: 'imaps' service: imaps
state: 'enabled' state: enabled
service_list: service_list:
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot.service' name: dovecot.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.service' name: dovecot-copytls.service
state: 'started' state: started
- enabled: 'yes' - enabled: 'yes'
name: 'dovecot-copytls.timer' name: dovecot-copytls.timer
state: 'started' state: started
template_list: template_list:
- dest: '/etc/dovecot/dovecot.conf' - dest: /etc/dovecot/dovecot.conf
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/dovecot.conf' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/etc/dovecot/conf.d/local.conf' }}/etc/dovecot/dovecot.conf'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/conf.d/local.conf' - dest: /etc/dovecot/conf.d/local.conf
- dest: '/etc/dovecot/accounts' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
group: 'dovecot' }}/etc/dovecot/conf.d/local.conf'
- dest: /etc/dovecot/accounts
group: dovecot
mode: '0600' mode: '0600'
owner: 'dovecot' owner: dovecot
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/etc/dovecot/accounts' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
- dest: '/usr/lib/systemd/system/dovecot-copytls.service' }}/etc/dovecot/accounts'
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.service' - dest: /usr/lib/systemd/system/dovecot-copytls.service
- dest: '/usr/lib/systemd/system/dovecot-copytls.timer' src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"]
src: '{{ ansible_facts["distribution"] }}/{{ ansible_facts["distribution_major_version"] }}/usr/lib/systemd/system/dovecot-copytls.timer' }}/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 @@
---
...
+2 -7
View File
@@ -1,16 +1,13 @@
--- ---
language: python language: python
python: "2.7" python: '2.7'
# Use the new container infrastructure # Use the new container infrastructure
sudo: false sudo: false
# Install ansible # Install ansible
addons: addons:
apt: apt:
packages: packages: [python-pip]
- python-pip
install: install:
# Install ansible # Install ansible
- pip install ansible - pip install ansible
@@ -20,10 +17,8 @@ install:
# Create ansible.cfg with correct roles_path # Create ansible.cfg with correct roles_path
- printf '[defaults]\nroles_path=../' >ansible.cfg - printf '[defaults]\nroles_path=../' >ansible.cfg
script: script:
# Basic role syntax check # Basic role syntax check
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check - ansible-playbook tests/test.yml -i tests/inventory --syntax-check
notifications: 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 # handlers file for ensure_git
- name: 'ensure_git.package_facts' - name: ensure_git.package_facts
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'ensure_git.service_facts' - name: ensure_git.service_facts
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure_git.service_reload' - name: ensure_git.service_reload
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd' - ansible_facts["service_mgr"] == 'systemd'
- ensure_git is defined - ensure_git is defined
ansible.builtin.systemd: ansible.builtin.systemd:
daemon_reload: 'yes' daemon_reload: 'yes'
- name: 'ensure_git.service_restart' - name: ensure_git.service_restart
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -21,9 +21,7 @@
ansible.builtin.service: ansible.builtin.service:
enabled: '{{ item.enabled }}' enabled: '{{ item.enabled }}'
name: '{{ item.name }}' name: '{{ item.name }}'
state: 'restarted' state: restarted
loop: '{{ ensure_git.service_list }}' loop: '{{ ensure_git.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be restarted' label: '{{ item.name }} will be restarted'
...
+1 -4
View File
@@ -1,3 +1,4 @@
---
galaxy_info: galaxy_info:
author: your name author: your name
description: your role description description: your role description
@@ -15,7 +16,6 @@ galaxy_info:
# - Apache-2.0 # - Apache-2.0
# - CC-BY-4.0 # - CC-BY-4.0
license: license (GPL-2.0-or-later, MIT, etc) license: license (GPL-2.0-or-later, MIT, etc)
min_ansible_version: 2.9 min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version. # If this a Container Enabled role, provide the minimum Ansible Container version.
@@ -38,7 +38,6 @@ galaxy_info:
# - 1.0 # - 1.0
# - 7 # - 7
# - 99.99 # - 99.99
galaxy_tags: [] galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes # 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 # 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. # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role. # Maximum 20 tags per role.
dependencies: [] dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above, # List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list. # if you add dependencies to this list.
+39 -43
View File
@@ -1,35 +1,37 @@
--- ---
# tasks file for ensure_git # tasks file for ensure_git
- name: 'include variables' - name: include variables
when: when: ["ansible_facts[\"system\"] == 'Linux'"]
- ansible_facts["system"] == 'Linux'
ansible.builtin.include_vars: ansible.builtin.include_vars:
file: '{{ lookup("first_found", findme) }}' file: '{{ lookup("first_found", findme) }}'
name: 'ensure_git' name: ensure_git
vars: vars:
findme: findme:
files: files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml' - '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["distribution"] }}-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"]
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml' }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"]
}}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml' - '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml' - default.yml
paths: paths: [../vars/]
- '../vars/' errors: ignore
errors: 'ignore' - name: package discovery
- name: 'package discovery'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined - ansible_facts["packages"] is not defined
ansible.builtin.package_facts: ansible.builtin.package_facts:
- name: 'service discovery' - name: service discovery
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined - ansible_facts["services"] is not defined
ansible.builtin.service_facts: ansible.builtin.service_facts:
- name: 'ensure packages' - name: ensure packages
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -41,10 +43,8 @@
loop: '{{ ensure_git.package_list }}' loop: '{{ ensure_git.package_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify: [ensure_git.package_facts, ensure_git.service_facts]
- 'ensure_git.package_facts' - name: ensure configurations
- 'ensure_git.service_facts'
- name: 'ensure configurations'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -65,11 +65,11 @@
loop_control: loop_control:
label: '{{ item.dest }} will be ensured' label: '{{ item.dest }} will be ensured'
notify: notify:
- 'ensure_git.package_facts' - ensure_git.package_facts
- 'ensure_git.service_facts' - ensure_git.service_facts
- 'ensure_git.service_reload' - ensure_git.service_reload
- 'ensure_git.service_restart' - ensure_git.service_restart
- name: 'ensure services' - name: ensure services
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -82,10 +82,8 @@
loop: '{{ ensure_git.service_list }}' loop: '{{ ensure_git.service_list }}'
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify: [ensure_git.package_facts, ensure_git.service_facts]
- 'ensure_git.package_facts' - name: Ensure SELinux is configured
- 'ensure_git.service_facts'
- name: 'Ensure SELinux is configured'
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -94,13 +92,13 @@
ansible.posix.selinux: ansible.posix.selinux:
policy: '{{ ensure_git.selinux_policy }}' policy: '{{ ensure_git.selinux_policy }}'
state: '{{ ensure_git.selinux_state }}' state: '{{ ensure_git.selinux_state }}'
register: 'results' register: results
notify: notify:
- 'ensure_git.package_facts' - ensure_git.package_facts
- 'ensure_git.service_facts' - ensure_git.service_facts
- 'ensure_git.service_reload' - ensure_git.service_reload
- 'ensure_git.service_restart' - ensure_git.service_restart
- name: 'Reboot if required' - name: Reboot if required
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -110,7 +108,7 @@
- results.reboot_required is defined - results.reboot_required is defined
- results.reboot_required - results.reboot_required
reboot: reboot:
- name: 'ensure seboolean' - name: ensure seboolean
when: when:
- ansible_facts["system"] == 'Linux' - ansible_facts["system"] == 'Linux'
- ensure_git is defined - ensure_git is defined
@@ -124,11 +122,9 @@
loop_control: loop_control:
label: '{{ item.name }} will be {{ item.state }}' label: '{{ item.name }} will be {{ item.state }}'
notify: notify:
- 'ensure_git.package_facts' - ensure_git.package_facts
- 'ensure_git.service_facts' - ensure_git.service_facts
- 'ensure_git.service_reload' - ensure_git.service_reload
- 'ensure_git.service_restart' - ensure_git.service_restart
- name: 'flush handlers' - name: flush handlers
ansible.builtin.meta: 'flush_handlers' ansible.builtin.meta: flush_handlers
...
+1 -2
View File
@@ -1,5 +1,4 @@
--- ---
- hosts: localhost - hosts: localhost
remote_user: root remote_user: root
roles: roles: [ensure_git]
- ensure_git
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...
+2 -4
View File
@@ -1,7 +1,5 @@
--- ---
# vars file for ensure_git # vars file for ensure_git
package_list: package_list:
- name: 'git' - name: git
state: 'present' state: present
...

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