Enforce SELinux on EL and Enable Apparmor in Ubuntu/Debian/SUSE#225
Enforce SELinux on EL and Enable Apparmor in Ubuntu/Debian/SUSE#225weizhouapache wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces shared Ansible task snippets to enforce SELinux on Enterprise Linux hosts and enable/enforce AppArmor on Ubuntu/Debian/SUSE, and then wires those snippets into the MySQL, KVM, CloudStack manager, and Marvin roles (replacing prior “permissive/disable” logic).
Changes:
- Add
Ansible/tasks/configure_selinux.ymlto switch SELinux to enforcing (runtime + persistent). - Add
Ansible/tasks/configure_apparmor.ymlto install AppArmor tooling and enforce AppArmor profiles. - Replace per-role SELinux/AppArmor handling with
includecalls to the shared task files across multiple distro-specific role task files.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Ansible/tasks/configure_selinux.yml | New shared SELinux enforcement tasks used by EL roles. |
| Ansible/tasks/configure_apparmor.yml | New shared AppArmor enable/enforce tasks used by Debian/Ubuntu/SUSE roles. |
| Ansible/roles/mysql/tasks/suse.yml | Switch SUSE MySQL role to include shared AppArmor configuration. |
| Ansible/roles/mysql/tasks/el9.yml | Switch EL9 MySQL role to include shared SELinux enforcement. |
| Ansible/roles/mysql/tasks/centos8.yml | Switch CentOS 8 MySQL role to include shared SELinux enforcement. |
| Ansible/roles/mysql/tasks/centos.yml | Switch CentOS MySQL role to include shared SELinux enforcement. |
| Ansible/roles/marvin/tasks/main.yml | Replace Marvin role SELinux permissive setup with shared SELinux enforcement include. |
| Ansible/roles/kvm/tasks/ubuntu.yml | Replace libvirt AppArmor disable steps with shared AppArmor enforcement include. |
| Ansible/roles/kvm/tasks/suse.yml | Switch SUSE KVM role to include shared AppArmor configuration. |
| Ansible/roles/kvm/tasks/el9.yml | Switch EL9 KVM role to include shared SELinux enforcement. |
| Ansible/roles/kvm/tasks/debian.yml | Replace libvirt AppArmor disable steps with shared AppArmor enforcement include. |
| Ansible/roles/kvm/tasks/centos8.yml | Switch CentOS 8 KVM role to include shared SELinux enforcement. |
| Ansible/roles/kvm/tasks/centos.yml | Switch CentOS KVM role to include shared SELinux enforcement. |
| Ansible/roles/cloudstack-manager/tasks/ubuntu.yml | Add shared AppArmor configuration include before DB setup. |
| Ansible/roles/cloudstack-manager/tasks/suse.yml | Switch SUSE mgmt role from SELinux permissive handling to shared AppArmor configuration. |
| Ansible/roles/cloudstack-manager/tasks/el9.yml | Switch EL9 mgmt role to include shared SELinux enforcement. |
| Ansible/roles/cloudstack-manager/tasks/debian.yml | Add shared AppArmor configuration include before DB setup. |
| Ansible/roles/cloudstack-manager/tasks/centos8.yml | Switch CentOS 8 mgmt role to include shared SELinux enforcement. |
| Ansible/roles/cloudstack-manager/tasks/centos.yml | Switch CentOS mgmt role to include shared SELinux enforcement. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@wei do these copilot stuff have any sense, or do we just say "when kvm tag included" at a much higher level ("wrapper" script which when tag KVM - invokes these specific Ubuntu/EL sub tasks) ? |
@andrijapanicsb |
26322dc to
4b19093
Compare
f401a85 to
ceb2971
Compare
ceb2971 to
41ae2cf
Compare
41ae2cf to
70e354a
Compare
c7859d9 to
237c550
Compare
To fix smoke test failures caused by error
```
import mysql.connector
conn = mysql.connector.connect(
host="10.0.35.28",
port=3306,
user="root",
password="Pxxxxx",
database="cloud",
use_unicode=True,
)
mysql.connector.errors.ProgrammingError: Character set 'utf8' unsupported
```
237c550 to
f91758e
Compare
No description provided.