Allow unsafe writes when modifying resolv.conf 34/88534/3
authorMichal Zegan <m.zegan@samsung.com>
Mon, 27 May 2019 11:52:53 +0000 (13:52 +0200)
committerMichal Ptacek <m.ptacek@partner.samsung.com>
Wed, 29 May 2019 10:43:08 +0000 (10:43 +0000)
The package-repository role edits /etc/resolv.conf.
Ansible modifies files atomically to prevent data loss on crash, but that
does not work in docker containers because /etc/resolv.conf is
bind-mounted.
Allow ansible to fall back to non atomic writes in such cases.
This makes it unnecessary to hack around this.

Change-Id: I066205322de5cc06569e6ea3aa38885d3834f9cd
Issue-ID: OOM-1816
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
ansible/roles/package-repository/tasks/main.yml

index 599e105..7dc2e76 100644 (file)
@@ -5,6 +5,7 @@
     path: /etc/resolv.conf
     state: present
     insertbefore: BOF
+    unsafe_writes: true
 
 - name: Disable all OS default repositories
   block: