-
Notifications
You must be signed in to change notification settings - Fork 37
Debian 13 #235
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
base: master
Are you sure you want to change the base?
Debian 13 #235
Changes from all commits
94bdba8
2eaa886
43136b1
2127171
bd9d7f9
b5d0258
9f0d562
d47f01a
a7faf2e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| ansible.builtin.package: | ||
| name: | ||
| - nmap | ||
| - curl | ||
|
|
||
| - name: Execute tests | ||
| gather_facts: false | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| --- | ||
| - name: Set OS dependent variables | ||
| ansible.builtin.include_vars: "{{ ansible_facts['os_family'] }}.yaml" | ||
|
|
||
| - name: Install Apache httpd | ||
| ansible.builtin.package: | ||
| name: | ||
| - httpd | ||
| - mod_ssl | ||
| name: "{{ httpd_packages }}" | ||
| state: present | ||
|
|
||
| - name: Set httpd_can_network_connect so Apache can connect to Puma and Gunicorn | ||
|
|
@@ -13,9 +14,14 @@ | |
| persistent: true | ||
| when: ansible_facts['selinux']['status'] == "enabled" | ||
|
|
||
| - name: Enable required modules | ||
| community.general.apache2_module: | ||
| name: "{{ item }}" | ||
| loop: "{{ httpd_modules }}" | ||
|
|
||
| - name: Disable welcome page | ||
| ansible.builtin.file: | ||
| path: /etc/httpd/conf.d/welcome.conf | ||
| path: "{{ httpd_conf_path }}/welcome.conf" | ||
| state: absent | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A thought for upgrades and not necessary for this PR: RPM will place this file back. Should we ensure it's empty instead?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or just deploy on Debian, where the package manager is actually sane and respects the choices of the admin ;)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or just put it all in a container |
||
|
|
||
| - name: Create cert directories | ||
|
|
@@ -31,8 +37,8 @@ | |
| ansible.builtin.file: | ||
| path: "{{ httpd_pub_dir }}" | ||
| state: directory | ||
| group: apache | ||
| owner: apache | ||
| group: "{{ httpd_group }}" | ||
| owner: "{{ httpd_user }}" | ||
| mode: "0755" | ||
|
|
||
| - name: Deploy certificates | ||
|
|
@@ -63,7 +69,7 @@ | |
| - name: Configure MPM event module | ||
| ansible.builtin.template: | ||
| src: event.conf.j2 | ||
| dest: /etc/httpd/conf.modules.d/event.conf | ||
| dest: "{{ httpd_modules_path }}/event.conf" | ||
| mode: "0644" | ||
| notify: | ||
| - Restart httpd | ||
|
|
@@ -79,28 +85,28 @@ | |
| - name: Configure foreman vhost | ||
| ansible.builtin.template: | ||
| src: foreman-vhost.conf.j2 | ||
| dest: /etc/httpd/conf.d/foreman.conf | ||
| dest: "{{ httpd_conf_path }}/foreman.conf" | ||
| mode: "0644" | ||
| notify: | ||
| - Restart httpd | ||
|
|
||
| - name: Configure foreman-ssl vhost | ||
| ansible.builtin.template: | ||
| src: foreman-ssl-vhost.conf.j2 | ||
| dest: /etc/httpd/conf.d/foreman-ssl.conf | ||
| dest: "{{ httpd_conf_path }}/foreman-ssl.conf" | ||
| mode: "0644" | ||
| notify: | ||
| - Restart httpd | ||
|
|
||
| - name: Create systemd drop-in directory for httpd | ||
| ansible.builtin.file: | ||
| path: /etc/systemd/system/httpd.service.d | ||
| path: /etc/systemd/system/{{ httpd_service }}.service.d | ||
| state: directory | ||
| mode: "0755" | ||
|
|
||
| - name: Add httpd to foreman.target | ||
| ansible.builtin.copy: | ||
| dest: /etc/systemd/system/httpd.service.d/foreman-target.conf | ||
| dest: /etc/systemd/system/{{ httpd_service }}.service.d/foreman-target.conf | ||
| mode: "0644" | ||
| content: | | ||
| [Install] | ||
|
|
@@ -117,6 +123,6 @@ | |
|
|
||
| - name: Start Apache httpd | ||
| ansible.builtin.service: | ||
| name: httpd | ||
| name: "{{ httpd_service }}" | ||
| state: started | ||
| enabled: true | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Services are enabled by default on Debian, so this line doesn't trigger an "enable" action, and thus the "Add httpd to foreman.target" is never applied (as |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| httpd_packages: | ||
| - apache2 | ||
| httpd_etc_path: /etc/apache2 | ||
| httpd_conf_path: "{{ httpd_etc_path }}/conf-enabled" | ||
| httpd_modules_path: "{{ httpd_etc_path }}/mods-enabled" | ||
| httpd_service: apache2 | ||
| httpd_log_path: /var/log/apache2 | ||
| httpd_user: www-data | ||
| httpd_group: www-data | ||
| httpd_modules: | ||
| - ssl | ||
| - headers | ||
| - proxy | ||
| - proxy_http |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| httpd_packages: | ||
| - httpd | ||
| - mod_ssl | ||
| httpd_etc_path: /etc/httpd | ||
| httpd_conf_path: "{{ httpd_etc_path }}/conf.d" | ||
| httpd_modules_path: "{{ httpd_etc_path }}/conf.modules.d" | ||
| httpd_service: httpd | ||
| httpd_log_path: /var/log/httpd | ||
| httpd_user: apache | ||
| httpd_group: apache | ||
| httpd_modules: [] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,15 @@ | ||
| import pytest | ||
|
|
||
|
|
||
| def test_hammer_ping(server): | ||
| if server.system_info.distribution == 'debian': | ||
| pytest.xfail('Hammer is not properly set up on Debian yet') | ||
| hammer = server.run("hammer ping") | ||
| assert hammer.succeeded | ||
|
|
||
|
|
||
| def test_hammer_organizations_list(server): | ||
| if server.system_info.distribution == 'debian': | ||
| pytest.xfail('Hammer is not properly set up on Debian yet') | ||
| hammer = server.run("hammer organization list") | ||
| assert hammer.succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like pulling in
community.generalhere, but this is something we'd have to consider anyway.In the Puppet installer, we run with
apache::default_mods: false, which wipes all enabled modules and then we enable the ones we need.We didn't port that detail over to foremanctl, and rely on the OS to enable those modules for us. But it also most probably enables things we do not want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also want to enable the event MPM in a similar way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I ask why it is bad to use
community.general?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly because it's a dependency we don't yet have
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also mentions compatibility:
So configuring Apache with Ansible is certainly worse than what we had with our Puppet module.