In ansible's base role, we install packages before setting resolv.conf. But if resolv.conf isn't set, DNS queries don't necessarily work (e.g. when setting up a new virthost for the first time).
This patch moves the resolv.conf task up to the top of the base role to ensure it's in place before we do anything requiring DNS lookups.
+1's?
-Ricky
diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index 3b71e9c..7af5095 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -4,6 +4,21 @@ # This is the base role for all machines. # Things in here are things we want to do to every machine no matter what. # + +# XXX fixme # a datacenter 'fact' from setup +- name: /etc/resolv.conf + copy: src={{ item }} dest=/etc/resolv.conf + with_first_found: + - "{{ resolvconf }}" + - resolv.conf/{{ ansible_fqdn }} + - resolv.conf/{{ host_group }} + - resolv.conf/{{ datacenter }} + - resolv.conf/resolv.conf + tags: + - config + - resolvconf + - base + - name: global default packages to install yum: state=installed name={{ item }} with_items: @@ -111,20 +126,6 @@ - config - base
-# XXX fixme # a datacenter 'fact' from setup -- name: /etc/resolv.conf - copy: src={{ item }} dest=/etc/resolv.conf - with_first_found: - - "{{ resolvconf }}" - - resolv.conf/{{ ansible_fqdn }} - - resolv.conf/{{ host_group }} - - resolv.conf/{{ datacenter }} - - resolv.conf/resolv.conf - tags: - - config - - resolvconf - - base - - name: rsyslog.conf copy: src={{ item }} dest=/etc/rsyslog.conf mode=644 with_first_found:
On Tue, 21 Oct 2014 20:30:18 -0400 Ricky Elrod codeblock@elrod.me wrote:
In ansible's base role, we install packages before setting resolv.conf. But if resolv.conf isn't set, DNS queries don't necessarily work (e.g. when setting up a new virthost for the first time).
This patch moves the resolv.conf task up to the top of the base role to ensure it's in place before we do anything requiring DNS lookups.
+1's?
Sure, +1... however, since it only changes ordering and existing machines should be right, how about we don't run over all of them until after freeze?
kevin
On Tue, Oct 21, 2014 at 10:03:41PM -0600, Kevin Fenzi wrote:
On Tue, 21 Oct 2014 20:30:18 -0400 Ricky Elrod codeblock@elrod.me wrote:
In ansible's base role, we install packages before setting resolv.conf. But if resolv.conf isn't set, DNS queries don't necessarily work (e.g. when setting up a new virthost for the first time).
This patch moves the resolv.conf task up to the top of the base role to ensure it's in place before we do anything requiring DNS lookups.
+1's?
Sure, +1... however, since it only changes ordering and existing machines should be right, how about we don't run over all of them until after freeze?
+1 for this
Pierre
On Tue, Oct 21, 2014 at 08:30:18PM -0400, Ricky Elrod wrote:
In ansible's base role, we install packages before setting resolv.conf. But if resolv.conf isn't set, DNS queries don't necessarily work (e.g. when setting up a new virthost for the first time).
This patch moves the resolv.conf task up to the top of the base role to ensure it's in place before we do anything requiring DNS lookups.
+1's?
Agreed, +1.
infrastructure@lists.fedoraproject.org