From 6c85255ad4ec8ed25af2c9bdd717ce43e68e134c Mon Sep 17 00:00:00 2001 From: Vincent Schwarzer Date: Wed, 10 May 2017 14:23:04 +0200 Subject: Adjusted Naming Schema of Calico Roles --- roles/calico/tasks/main.yml | 26 +++++++++++++------------- roles/calico/templates/10-calico.cfg.j2 | 9 +++++++++ roles/calico/templates/calico.cfg.j2 | 9 --------- roles/calico/templates/calico.conf.j2 | 18 ------------------ roles/calico/templates/calicoctl.conf.j2 | 18 ++++++++++++++++++ 5 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 roles/calico/templates/10-calico.cfg.j2 delete mode 100644 roles/calico/templates/calico.cfg.j2 delete mode 100644 roles/calico/templates/calico.conf.j2 create mode 100644 roles/calico/templates/calicoctl.conf.j2 (limited to 'roles/calico') diff --git a/roles/calico/tasks/main.yml b/roles/calico/tasks/main.yml index abdbcf8d6..fa5e338b3 100644 --- a/roles/calico/tasks/main.yml +++ b/roles/calico/tasks/main.yml @@ -7,7 +7,7 @@ etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}" etcd_cert_subdir: "openshift-calico-{{ openshift.common.hostname }}" -- name: Assure the calico certs have been generated +- name: Calico Node | Assure the calico certs have been generated stat: path: "{{ item }}" with_items: @@ -15,12 +15,12 @@ - "{{ calico_etcd_cert_file}}" - "{{ calico_etcd_key_file }}" -- name: Configure Calico service unit file +- name: Calico Node | Configure Calico service unit file template: dest: "/lib/systemd/system/calico.service" src: calico.service.j2 -- name: Enable calico +- name: Calico Node | Enable calico become: yes systemd: name: calico @@ -29,46 +29,46 @@ enabled: yes register: start_result -- name: Assure CNI conf dir exists +- name: Calico Node | Assure CNI conf dir exists become: yes file: path="{{ cni_conf_dir }}" state=directory -- name: Generate Calico CNI config +- name: Calico Node | Generate Calico CNI config become: yes template: - src: "calico.conf.j2" + src: "10-calico.conf.j2" dest: "{{ cni_conf_dir }}/10-calico.conf" -- name: Assures Kuberentes CNI bin dir exists +- name: Calico Node | Assures Kuberentes CNI bin dir exists become: yes file: path="{{ cni_bin_dir }}" state=directory -- name: Download Calico CNI Plugin +- name: Calico Node | Download Calico CNI Plugin become: yes get_url: url: "{{ calico_url_cni }}" dest: "{{ cni_bin_dir }}" mode: a+x -- name: Download Calico IPAM Plugin +- name: Calico Node | Download Calico IPAM Plugin become: yes get_url: url: "{{ calico_url_ipam }}" dest: "{{ cni_bin_dir }}" mode: a+x -- name: Download and unzip standard CNI plugins +- name: Calico Node | Download and extract standard CNI plugins become: yes unarchive: remote_src: True src: "{{ cni_url }}" dest: "{{ cni_bin_dir }}" -- name: Assure Calico conf dir exists +- name: Calico Node | Assure Calico conf dir exists become: yes file: path=/etc/calico/ state=directory -- name: Set calicoctl.cfg +- name: Calico Node | Set calicoctl.cfg template: - src: calico.cfg.j2 + src: calicoctl.cfg.j2 dest: "/etc/calico/calicoctl.cfg" diff --git a/roles/calico/templates/10-calico.cfg.j2 b/roles/calico/templates/10-calico.cfg.j2 new file mode 100644 index 000000000..722385ed8 --- /dev/null +++ b/roles/calico/templates/10-calico.cfg.j2 @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: calicoApiConfig +metadata: +spec: + datastoreType: "etcdv2" + etcdEndpoints: "{{ etcd_endpoints }}" + etcdKeyFile: "{{ calico_etcd_key_file }}" + etcdCertFile: "{{ calico_etcd_cert_file }}" + etcdCaCertFile: "{{ calico_etcd_ca_cert_file }}" diff --git a/roles/calico/templates/calico.cfg.j2 b/roles/calico/templates/calico.cfg.j2 deleted file mode 100644 index 722385ed8..000000000 --- a/roles/calico/templates/calico.cfg.j2 +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: calicoApiConfig -metadata: -spec: - datastoreType: "etcdv2" - etcdEndpoints: "{{ etcd_endpoints }}" - etcdKeyFile: "{{ calico_etcd_key_file }}" - etcdCertFile: "{{ calico_etcd_cert_file }}" - etcdCaCertFile: "{{ calico_etcd_ca_cert_file }}" diff --git a/roles/calico/templates/calico.conf.j2 b/roles/calico/templates/calico.conf.j2 deleted file mode 100644 index 3c8c6b046..000000000 --- a/roles/calico/templates/calico.conf.j2 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "calico", - "type": "calico", - "ipam": { - "type": "calico-ipam" - }, - "etcd_endpoints": "{{ etcd_endpoints }}", - "etcd_key_file": "{{ calico_etcd_key_file }}", - "etcd_cert_file": "{{ calico_etcd_cert_file }}", - "etcd_ca_cert_file": "{{ calico_etcd_ca_cert_file }}", - "kubernetes": { - "kubeconfig": "{{ kubeconfig }}" - }, - "hostname": "{{ openshift.common.hostname }}", - "policy": { - "type": "k8s" - } -} diff --git a/roles/calico/templates/calicoctl.conf.j2 b/roles/calico/templates/calicoctl.conf.j2 new file mode 100644 index 000000000..3c8c6b046 --- /dev/null +++ b/roles/calico/templates/calicoctl.conf.j2 @@ -0,0 +1,18 @@ +{ + "name": "calico", + "type": "calico", + "ipam": { + "type": "calico-ipam" + }, + "etcd_endpoints": "{{ etcd_endpoints }}", + "etcd_key_file": "{{ calico_etcd_key_file }}", + "etcd_cert_file": "{{ calico_etcd_cert_file }}", + "etcd_ca_cert_file": "{{ calico_etcd_ca_cert_file }}", + "kubernetes": { + "kubeconfig": "{{ kubeconfig }}" + }, + "hostname": "{{ openshift.common.hostname }}", + "policy": { + "type": "k8s" + } +} -- cgit v1.2.1