From 0a0f0fc3126179b01f45f76cc85bc30cee428070 Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Thu, 3 Nov 2016 10:40:47 -0400 Subject: Update flannel etcd vars for 0.5.5 flannel-0.5.5 uses different variable names in /etc/sysconfig/flannel. This writes both the old and next variable name to the file for quick compatibility. Fixes #2635 Fixes Bug 1391515 --- roles/flannel/tasks/main.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'roles/flannel') diff --git a/roles/flannel/tasks/main.yml b/roles/flannel/tasks/main.yml index 6b6dfb423..d41eb0de8 100644 --- a/roles/flannel/tasks/main.yml +++ b/roles/flannel/tasks/main.yml @@ -4,21 +4,18 @@ action: "{{ ansible_pkg_mgr }} name=flannel state=present" when: not openshift.common.is_containerized | bool -- name: Set flannel etcd url +- name: Set flannel etcd options become: yes lineinfile: dest: /etc/sysconfig/flanneld backrefs: yes - regexp: "^(FLANNEL_ETCD=)" - line: '\1{{ etcd_hosts|join(",") }}' - -- name: Set flannel etcd key - become: yes - lineinfile: - dest: /etc/sysconfig/flanneld - backrefs: yes - regexp: "^(FLANNEL_ETCD_KEY=)" - line: '\1{{ flannel_etcd_key }}' + regexp: "{{ item.regexp }}" + line: "{{ item.line }}" + with_items: + - { regexp: "^(FLANNEL_ETCD=)", line: '\1{{ etcd_hosts|join(",") }}' } + - { regexp: "^(FLANNEL_ETCD_ENDPOINTS=)", line: '\1{{ etcd_hosts|join(",") }}' } + - { regexp: "^(FLANNEL_ETCD_KEY=)", line: '\1{{ flannel_etcd_key }}' } + - { regexp: "^(FLANNEL_ETCD_KEY_PREFIX=)", line: '\1{{ flannel_etcd_key }}' } - name: Set flannel options become: yes -- cgit v1.2.1