12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- ---
- - name: Test if node certs and config exist
- stat: path={{ item }}
- failed_when: not result.stat.exists
- register: result
- with_items:
- - "{{ cert_path }}"
- - "{{ cert_path }}/cert.crt"
- - "{{ cert_path }}/key.key"
- - "{{ cert_path }}/.kubeconfig"
- - "{{ cert_path }}/server.crt"
- - "{{ cert_path }}/server.key"
- - "{{ cert_parent_path }}/ca/cert.crt"
- #- "{{ cert_path }}/node.yaml"
- - name: Install OpenShift Node package
- yum: pkg=openshift-node state=installed
- # --create-certs=false is a temporary workaround until
- # https://github.com/openshift/origin/pull/1361 is merged upstream and it is
- # the default for nodes
- - name: Configure OpenShift Node settings
- lineinfile:
- dest: /etc/sysconfig/openshift-node
- regexp: '^OPTIONS='
- line: "OPTIONS=\"--hostname={{ openshift_hostname }} --loglevel={{ openshift_node_debug_level }} --create-certs=false\""
- notify:
- - restart openshift-node
- - name: Set default registry url
- lineinfile:
- dest: /etc/sysconfig/openshift-node
- regexp: '^IMAGES='
- line: "IMAGES={{ openshift_registry_url }}"
- when: openshift_registry_url is defined
- notify:
- - restart openshift-node
- - name: Set OpenShift node facts
- include: "{{ role_path | dirname }}/openshift_common/tasks/set_facts.yml"
- facts:
- - section: node
- option: debug_level
- value: "{{ openshift_node_debug_level }}"
- - section: node
- option: public_ip
- value: "{{ openshift_public_ip }}"
- - section: node
- option: externally_managed
- value: "{{ openshift_node_manage_service_externally }}"
- - name: Start and enable openshift-node
- service: name=openshift-node enabled=yes state=started
- when: not openshift_node_manage_service_externally
- - name: Disable openshift-node if openshift-node is managed externally
- service: name=openshift-node enabled=false
- when: openshift_node_manage_service_externally
|