Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: feat: Add apache checklist #60

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

wickdChromosome
Copy link
Contributor

This is the first draft for the apache checklist.

Here, the checklist items are shown in blue, intermediate steps are shown in green.

apache_role drawio(1)

Copy link
Collaborator

@s3lph s3lph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from my notes, please make sure that the ansible-lint pipeline is happy. Especially, make sure to always use FQCNs.

roles/maintenance_32_apache/defaults/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
vars:
taskid: 32-009
name: "Apache: Gather details, set vars: query systemd service for binary name being used"
ansible.builtin.shell: "systemctl show -p ExecStart {{ apache_binary_name }} | grep 'ExecStart' | awk '{print $2}' | cut -d= -f2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you achieve from this? Isn't the binary name already known? In fact, you are using the apache_binary_name variable in this task already.

Or is this about whether or not to use the apachectl wrapper?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do this to use the exact binary systemd is using by default..

In RedHat.yml or Debian.yml, apache_binary_name is set to httpd or apache2, which will also be the systemd service name. (Maybe should rename it to include something related to systemd)

In the next task, I check if the systemd service was found, and if not, then the apachectl pointed to by the shell is defaulted to

This is what we agreed to do(to assume apache is managed through systemd, in case there are multiple installs of it present), LMK if this is not necessary in your experience

taskid: 32-009
name: "Apache: Extract config path regexes from main apache config"
ansible.builtin.shell:
cmd: "grep -r '^Include' {{ apache_config_file_name }} | awk '{printf \"/etc/httpd/%s\\n\", $2}'"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debian uses /etc/apache2 rather than /etc/httpd. Other than that, I know of at least one system where we include config files from someplace other than /etc.

roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
taskid: 32-014
name: Test whether that certificate is valid in a month
community.crypto.x509_certificate_info:
path: "{{ item }}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also work for files containing multiple certs? Usually the certs come with a chain of intermediates, which should also be checked.

roles/maintenance_32_apache/tasks/main.yml Outdated Show resolved Hide resolved
wickdChromosome and others added 2 commits May 7, 2024 17:58
Co-authored-by: Sebastian P. <5564491+s3lph@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants