From af8417da3228b6f0307944525837ae7725d61444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20K=C3=A1rolyi?= Date: Thu, 10 Jan 2019 23:09:57 +0100 Subject: [PATCH] Resolv.conf can be non-default now --- tasks/jail/create.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tasks/jail/create.yml b/tasks/jail/create.yml index 56896cc..d514c50 100644 --- a/tasks/jail/create.yml +++ b/tasks/jail/create.yml @@ -31,10 +31,26 @@ src: rc.conf dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc' +- name: Templating resolv.conf for jail + template: + src: resolv.conf.j2 + dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc/resolv.conf' + register: template_resolv + ignore_errors: yes + +- name: Copy local resolv.conf over to the new jail + copy: + src: resolv.conf + dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc' + register: local_resolv + ignore_errors: yes + when: template_resolv is failed + - name: Copy resolv.conf over to the new jail copy: src: /etc/resolv.conf dest: '{{ vars["jail_" + jail_name + "_new_path"] }}/etc' + when: local_resolv is failed - name: Setup timezone in jail command: