Skip to content

Commit

Permalink
feat: allow multiple file systems to be remounted
Browse files Browse the repository at this point in the history
Merge branch 'alter-filesystem-remount-task' of https://github.com/goetzk/ansible-apt into feature/goetzk-alter-filesystem-remount-task

closes #14
  • Loading branch information
franklinkim committed Aug 24, 2017
2 parents 0fed23d + a1f412f commit 5cb5a96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ apt_unattended_upgrades_automatic_reboot_time: now
# remount file system: rootfs | tmpfs
# tmpfs: remount tmp before running if mounted noexec
# rootfs: remount root filesystem r/w before running if mounted r/o
apt_remount_filesystem:
apt_remount_filesystem: []
# repositories to register
apt_repositories: []
Expand Down
6 changes: 3 additions & 3 deletions tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

- name: Configuring remount filesystems
template:
src: "{{ item }}.j2"
dest: "/{{ item }}"
src: "etc/apt/apt.conf.d/10remount_{{ item }}.j2"
dest: "/etc/apt/apt.conf.d/10remount_{{ item }}"
owner: "root"
group: "root"
mode: "0644"
when: apt_remount_filesystem
with_items:
- "etc/apt/apt.conf.d/10remount_{{ apt_remount_filesystem }}"
- "{{ apt_remount_filesystem }}"

- name: Configuring APT proxy behavior
template:
Expand Down
4 changes: 2 additions & 2 deletions templates/etc/apt/apt.conf.d/10remount_tmpfs.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// {{ ansible_managed }}

DPkg {
// Auto re-mounting of a noexec /tmp since some packages which require it
// Auto re-mounting of a noexec /tmp since some packages desire exec
Pre-Invoke { "mount -o remount,exec /tmp"; };
Post-Invoke { "test ${NO_APT_REMOUNT:-no} = yes || mount -o remount,exec /tmp || true"; };
Post-Invoke { "test ${NO_APT_REMOUNT:-no} = yes || mount -o remount,noexec /tmp || true"; };
};

0 comments on commit 5cb5a96

Please sign in to comment.