summaryrefslogtreecommitdiffstats
path: root/roles/flannel/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/flannel/tasks/main.yml')
-rw-r--r--roles/flannel/tasks/main.yml41
1 files changed, 41 insertions, 0 deletions
diff --git a/roles/flannel/tasks/main.yml b/roles/flannel/tasks/main.yml
new file mode 100644
index 000000000..3a8945a82
--- /dev/null
+++ b/roles/flannel/tasks/main.yml
@@ -0,0 +1,41 @@
+---
+- name: Install flannel
+ become: yes
+ package: name=flannel state=present
+ when: not openshift.common.is_atomic | bool
+
+- name: Set flannel etcd options
+ become: yes
+ lineinfile:
+ dest: /etc/sysconfig/flanneld
+ backrefs: yes
+ 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_PREFIX=)", line: '\1{{ flannel_etcd_key }}' }
+
+- name: Set flannel options
+ become: yes
+ lineinfile:
+ dest: /etc/sysconfig/flanneld
+ backrefs: yes
+ regexp: "^#?(FLANNEL_OPTIONS=)"
+ line: '\1--iface {{ flannel_interface }} --etcd-cafile={{ etcd_peer_ca_file }} --etcd-keyfile={{ etcd_peer_key_file }} --etcd-certfile={{ etcd_peer_cert_file }}'
+
+- name: Enable flanneld
+ become: yes
+ systemd:
+ name: flanneld
+ state: started
+ enabled: yes
+ register: start_result
+
+- name: Remove docker bridge ip
+ become: yes
+ shell: ip a del `ip a show docker0 | grep "inet[[:space:]]" | awk '{print $2}'` dev docker0
+ notify:
+ - restart docker
+ - restart node