Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 38eae76

Browse files
Merge branch 'devel-2.x' into r72626-serve-static-webm-with-nginx-PR-devel-2.x
2 parents fdfa6cc + f79e782 commit 38eae76

File tree

15 files changed

+159
-61
lines changed

15 files changed

+159
-61
lines changed

.ansible-lint

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ skip_list:
1414
- template-instead-of-copy # to skip over roles/ssl/tasks/copy.yml errors, temporarily.
1515
- name[template] # it doesn't like Jinja templates being in the middle of a task name, which seems silly to me.
1616
- name[casing] # sometimes included Galaxy roles break linting rules and cause failures
17+
- args[module] # causing odd issue with ACL role
18+
- jinja[spacing] # pendantic! we get these from GitHub Actions anyway
1719
exclude_paths:
1820
- roles/contrib/ # we don't control these roles

docs/_Sidebar.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,18 @@
33
- [Install](install)
44
- [Usage](scripts)
55
- [Roles](roles)
6+
- [Init role](/roles/_init)
7+
- ["Meta" roles that group individual roles together.](/roles/_meta)
8+
- [AWS account](/roles/_meta/aws_account)
9+
- [AWS client](/roles/_meta/aws_client_instance)
10+
- [AWS region](/roles/_meta/aws_region)
11+
- [\_overrides.](/roles/_overrides)
612
- [AWS Infrastructure](/roles/aws)
13+
- [AWS Network Info](/roles/aws/_aws_network_info)
714
- [AWS ACL](/roles/aws/aws_acl)
815
- [AWS Certificate Manager](/roles/aws/aws_acm)
9-
- [AWS AMI ASG Cleanup](/roles/aws/aws_ami_asg_cleanup)
1016
- [AWS AMI](/roles/aws/aws_ami)
17+
- [AWS AMI ASG Cleanup](/roles/aws/aws_ami_asg_cleanup)
1118
- [AWS Backup](/roles/aws/aws_backup)
1219
- [AWS Backup Validation](/roles/aws/aws_backup_validation)
1320
- [AWS CloudFront distribution](/roles/aws/aws_cloudfront_distribution)
@@ -20,7 +27,6 @@
2027
- [AWS ElastiCache](/roles/aws/aws_elasticache)
2128
- [AWS IAM EC2](/roles/aws/aws_iam_role)
2229
- [AWS IAM SAML](/roles/aws/aws_iam_saml)
23-
- [AWS Network Info](/roles/aws/_aws_network_info)
2430
- [AWS OpenSearch](/roles/aws/aws_opensearch)
2531
- [AWS key pair.](/roles/aws/aws_provision_ec2_keypair)
2632
- [AWS RDS](/roles/aws/aws_rds)
@@ -34,8 +40,8 @@
3440
- [VPC](/roles/aws/aws_vpc_subnet)
3541
- [Contributed roles](/roles/contrib)
3642
- [Debian Packages](/roles/debian)
37-
- [Ansible Galaxy](/roles/debian/ansible_galaxy)
3843
- [Ansible](/roles/debian/ansible)
44+
- [Ansible Galaxy](/roles/debian/ansible_galaxy)
3945
- [APACHE](/roles/debian/apache)
4046
- [Apparmor](/roles/debian/apparmor)
4147
- [Extra packages](/roles/debian/apt_extra_packages)
@@ -75,10 +81,10 @@
7581
- [PAM LinOTP](/roles/debian/pam_linotp)
7682
- [PHP terminal client](/roles/debian/php-cli)
7783
- [PHP common components](/roles/debian/php-common)
78-
- [PHP Composer](/roles/debian/php_composer)
7984
- [PHP-FPM](/roles/debian/php-fpm)
80-
- [phpMyAdmin](/roles/debian/phpmyadmin)
85+
- [PHP Composer](/roles/debian/php_composer)
8186
- [PHP XDebug](/roles/debian/php_xdebug)
87+
- [phpMyAdmin](/roles/debian/phpmyadmin)
8288
- [Postfix](/roles/debian/postfix)
8389
- [Process Manager](/roles/debian/process_manager)
8490
- [Python Boto](/roles/debian/python_boto)
@@ -95,9 +101,3 @@
95101
- [User Ansible](/roles/debian/user_ansible)
96102
- [varnish_config](/roles/debian/varnish_config)
97103
- [wazuh](/roles/debian/wazuh)
98-
- [Init role](/roles/_init)
99-
- ["Meta" roles that group individual roles together.](/roles/_meta)
100-
- [AWS account](/roles/_meta/aws_account)
101-
- [AWS client](/roles/_meta/aws_client_instance)
102-
- [AWS region](/roles/_meta/aws_region)
103-
- [\_overrides.](/roles/_overrides)

git-hooks/pre-push.d/ansible-lint.hook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for file in $(git diff "$1/$BASE_BRANCH" --name-only --staged); do
2323
case $file in
2424
"$ROLE"*)
2525
printf "\e[36m Running Ansible linter against the\e[1m %s\e[0m\e[36m role. \e[0m \n" "$ROLE"
26-
ANSIBLE_LINT_CMD="$DOCKER_CMD $ANSIBLE_LINT $CONTAINER_BASE_PATH/$ROLE"
26+
ANSIBLE_LINT_CMD="$DOCKER_CMD $ANSIBLE_LINT -q $CONTAINER_BASE_PATH/$ROLE"
2727
ERRORS=$($ANSIBLE_LINT_CMD | wc -l)
2828
if [ "$ERRORS" != "0" ]; then
2929
$ANSIBLE_LINT_CMD

roles/aws/aws_acl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,4 +133,5 @@ aws_acl:
133133
priority: 13
134134

135135
```
136+
136137
<!--ENDROLEVARS-->

roles/aws/aws_ami/tasks/repack.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
register: aws_ami_running_instances
1010

1111
- name: Create a Security Group to access the controller.
12-
amazon.aws.ec2_security_group:
12+
ansible.builtin.include_role:
13+
name: aws/aws_vpc
14+
tasks_from: security_group
15+
vars:
16+
aws_vpc:
1317
profile: "{{ aws_ami.aws_profile }}"
1418
region: "{{ aws_ami.region }}"
1519
name: "{{ aws_ami.repack.cluster_name }}-repacker"
1620
tags: "{{ aws_ami.tags }}"
1721
state: present
18-
vpc_id: "{{ aws_ami.repack.vpc_id }}"
22+
id: "{{ aws_ami.repack.vpc_id }}"
1923
description: "Allow controller to access the {{ aws_ami.ami_name }}-repacking instance"
2024
rules:
2125
- proto: tcp

roles/aws/aws_backup_validation/tasks/testing_resources.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,32 @@
3030
register: _main_subnets_info
3131

3232
- name: Create SG for restored instances.
33-
amazon.aws.ec2_security_group:
34-
name: Restore_testing
35-
description: This SG is used to allow SSM and SSH access to the server
36-
region: "{{ _aws_region }}"
37-
vpc_id: "{{ _main_vpc_info.vpcs[0].vpc_id }}"
38-
rules:
39-
- proto: tcp
40-
from_port: 80
41-
to_port: 80
42-
cidr_ip: 0.0.0.0/0
43-
- proto: tcp
44-
from_port: 443
45-
to_port: 443
46-
cidr_ip: 0.0.0.0/0
47-
- proto: tcp
48-
from_port: 22
49-
to_port: 22
50-
cidr_ip: 0.0.0.0/0
51-
register: _restore_testing_sg
33+
ansible.builtin.include_role:
34+
name: aws/aws_vpc
35+
tasks_from: security_group
36+
vars:
37+
aws_vpc:
38+
name: "Restore_testing"
39+
region: "{{ aws_ec2_autoscale_cluster.region }}"
40+
id: "{{ _main_vpc_info.vpcs[0].vpc_id }}"
41+
description: "This SG is used to allow SSM and SSH access to the server"
42+
rules:
43+
- proto: tcp
44+
from_port: 80
45+
to_port: 80
46+
cidr_ip: 0.0.0.0/0
47+
- proto: tcp
48+
from_port: 443
49+
to_port: 443
50+
cidr_ip: 0.0.0.0/0
51+
- proto: tcp
52+
from_port: 22
53+
to_port: 22
54+
cidr_ip: 0.0.0.0/0
55+
56+
- name: Construct AWS instance type dict.
57+
ansible.builtin.set_fact:
58+
_restore_testing_sg: "{{ aws_vpc._result['Restore_testing'] }}"
5259

5360
- name: Remove restore testing query file.
5461
ansible.builtin.file:

roles/aws/aws_ec2_autoscale_cluster/tasks/main.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,25 @@
2626
when: (aws_ec2_autoscale_cluster.vpc_name is not defined or aws_ec2_autoscale_cluster.vpc_name | length < 0)
2727

2828
- name: Create matching Security Group.
29-
amazon.aws.ec2_security_group:
30-
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
31-
region: "{{ aws_ec2_autoscale_cluster.region }}"
32-
name: "{{ aws_ec2_autoscale_cluster.name }}"
33-
tags: "{{ aws_ec2_autoscale_cluster.tags | combine({'Name': aws_ec2_autoscale_cluster.name}) }}"
34-
state: "{{ aws_ec2_autoscale_cluster.state }}"
35-
vpc_id: "{{ _aws_ec2_autoscale_cluster_vpc_id }}"
36-
description: "Allow internal traffic for cluster {{ aws_ec2_autoscale_cluster.name }}"
37-
rules:
38-
- proto: all
39-
group_name: "{{ aws_ec2_autoscale_cluster.name }}"
40-
register: _aws_ec2_autoscale_cluster_security_group
29+
ansible.builtin.include_role:
30+
name: aws/aws_vpc
31+
tasks_from: security_group
32+
vars:
33+
aws_vpc:
34+
name: "{{ aws_ec2_autoscale_cluster.name }}"
35+
profile: "{{ aws_ec2_autoscale_cluster.aws_profile }}"
36+
region: "{{ aws_ec2_autoscale_cluster.region }}"
37+
tags: "{{ aws_ec2_autoscale_cluster.tags | combine({'Name': aws_ec2_autoscale_cluster.name}) }}"
38+
state: "{{ aws_ec2_autoscale_cluster.state }}"
39+
id: "{{ _aws_ec2_autoscale_cluster_vpc_id }}"
40+
description: "Allow internal traffic for cluster {{ aws_ec2_autoscale_cluster.name }}"
41+
rules:
42+
- proto: all
43+
group_name: "{{ aws_ec2_autoscale_cluster.name }}"
44+
45+
- name: Set _aws_ec2_autoscale_cluster_security_group variable.
46+
ansible.builtin.set_fact:
47+
_aws_ec2_autoscale_cluster_security_group: "{{ aws_vpc._result[aws_ec2_autoscale_cluster.name] }}"
4148

4249
- name: Reset subnets lists.
4350
ansible.builtin.set_fact:

roles/aws/aws_vpc_subnet/tasks/subnet.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,21 @@
3434
when: subnet.nat_ipv4 is defined and subnet.nat_ipv4
3535

3636
- name: Create matching Security Group.
37-
amazon.aws.ec2_security_group:
38-
name: "{{ subnet.name }}"
39-
profile: "{{ aws_vpc_subnet.aws_profile }}"
40-
region: "{{ aws_vpc_subnet.region }}"
41-
tags: "{{ aws_vpc_subnet.tags | combine({'Name': subnet.name}) }}"
42-
state: "{{ aws_vpc_subnet.state }}"
43-
vpc_id: "{{ _aws_vpc_subnet_vpc_id }}"
44-
description: "Allow internal traffic for subnet {{ subnet.name }}"
45-
rules:
46-
- proto: all
47-
group_name: "{{ subnet.name }}"
37+
ansible.builtin.include_role:
38+
name: aws/aws_vpc
39+
tasks_from: security_group
40+
vars:
41+
aws_vpc:
42+
name: "{{ subnet.name }}"
43+
profile: "{{ aws_vpc_subnet.aws_profile }}"
44+
region: "{{ aws_vpc_subnet.region }}"
45+
tags: "{{ aws_vpc_subnet.tags | combine({'Name': subnet.name}) }}"
46+
state: "{{ aws_vpc_subnet.state }}"
47+
id: "{{ _aws_vpc_subnet_vpc_id }}"
48+
description: "Allow internal traffic for subnet {{ subnet.name }}"
49+
rules:
50+
- proto: all
51+
group_name: "{{ subnet.name }}"
4852
when:
4953
- subnet.security_group is defined
5054
- subnet.security_group

roles/debian/pam_ldap/templates/ldap.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pam_lookup_policy yes
1414

1515
{% if pam_ldap.ssl_certificate_check is defined and not pam_ldap.ssl_certificate_check %}
1616
TLS_REQCERT never
17-
{% endif %}
17+
{% endif %}

roles/debian/sudo_config/tasks/main.yml

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,48 @@
55
state: directory
66
mode: "0750"
77

8-
- name: "Add {{ sudo_config.entity_name }} to sudoers."
8+
- name: Create temporary directory for sudoers validation
9+
ansible.builtin.tempfile:
10+
state: directory
11+
suffix: sudoers
12+
register: temp_sudoers_dir
13+
when: sudo_config | default([]) | length > 0
14+
15+
- name: Create sudoers file for validation
916
ansible.builtin.template:
1017
src: "sudoer.j2"
11-
dest: "/etc/sudoers.d/{{ sudo_config.filename }}"
18+
dest: "{{ temp_sudoers_dir.path }}/{{ item.filename }}"
1219
owner: root
1320
group: root
1421
mode: "0440"
15-
when: sudo_config.entity_name | length > 0
22+
when: item.entity_name | default('') | length > 0
23+
with_items: "{{ sudo_config if sudo_config is iterable and sudo_config is not mapping else [sudo_config] }}"
24+
register: sudo_templates
25+
26+
- name: Validate sudoers file on remote
27+
ansible.builtin.command: "visudo -cf {{ temp_sudoers_dir.path }}/{{ item.filename }}"
28+
register: visudo_check
29+
failed_when: visudo_check.rc != 0
30+
changed_when: false
31+
with_items: "{{ sudo_config if sudo_config is iterable and sudo_config is not mapping else [sudo_config] }}"
32+
when: item.entity_name | default('') | length > 0
33+
loop_control:
34+
label: "{{ item.filename }}"
35+
delegate_to: "{{ inventory_hostname }}"
36+
37+
- name: Install validated sudoers file
38+
ansible.builtin.copy:
39+
src: "{{ temp_sudoers_dir.path }}/{{ item.filename }}"
40+
dest: "/etc/sudoers.d/{{ item.filename }}"
41+
owner: root
42+
group: root
43+
mode: "0440"
44+
remote_src: true
45+
when: item.entity_name | default('') | length > 0
46+
with_items: "{{ sudo_config if sudo_config is iterable and sudo_config is not mapping else [sudo_config] }}"
47+
48+
- name: Clean up temporary files
49+
ansible.builtin.file:
50+
path: "{{ temp_sudoers_dir.path }}"
51+
state: absent
52+
when: temp_sudoers_dir.path is defined

0 commit comments

Comments
 (0)