1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- ---
- # TODO: allow for overriding default ports where possible
- # TODO: trigger the external service when restart is needed
- - name: Set node OpenShift facts
- openshift_facts:
- role: 'node'
- local_facts:
- debug_level: "{{ openshift_node_debug_level | default(openshift.common.debug_level) }}"
- - 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.common.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: Start and enable openshift-node
- service: name=openshift-node enabled=yes state=started
- when: not openshift.common.use_openshift_sdn|bool
- - name: Disable openshift-node if openshift-node is managed externally
- service: name=openshift-node enabled=false
- when: openshift.common.use_openshift_sdn|bool
|