Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ansible/roles/vm_set/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,19 @@
sysctl_set: yes
become: yes

- name: Create link for disabling apparmor for ntpd
file:
src: /etc/apparmor.d/usr.sbin.ntpd
dest: /etc/apparmor.d/disable/usr.sbin.ntpd
state: link
become: yes
ignore_errors: yes

- name: Disable apparmor for ntpd
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't this task make use of the result of the previous task? what happens if you just run this command without the link in place?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The apparmor_parser command is required to disable apparmor for a service.
https://www.cyberciti.biz/faq/ubuntu-linux-howto-disable-apparmor-commands/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how do we ensure that apparmor is disabled for ntp since we seem to ignore errors in both the task?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Most of the test setups have apparmor disabled for NTP. In this case running the tasks would fail. These are just two best effort tasks. So, 'ignore_errors' is required.

command: apparmor_parser -R /etc/apparmor.d/usr.sbin.ntpd
become: yes
ignore_errors: yes

- name: Setup external front port
include_tasks: external_port.yml
when: external_port is defined
Expand Down