--- - name: Install OpenShift Node package yum: pkg=openshift-node state=installed - local_action: command /usr/bin/mktemp -d /tmp/openshift-ansible-XXXXXXX register: mktemp - name: Retrieve OpenShift Master credentials local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' root@{{ openshift_master_public_ips[0] }}:/var/lib/openshift/openshift.local.certificates/admin/ {{ mktemp.stdout }} ignore_errors: yes - file: path=/var/lib/openshift/openshift.local.certificates/admin state=directory - name: Store OpenShift Master credentials local_action: command /usr/bin/rsync --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' {{ mktemp.stdout }}/ root@{{ openshift_public_ip }}:/var/lib/openshift/openshift.local.certificates/admin ignore_errors: yes - local_action: file name={{ mktemp.stdout }} state=absent - name: Configure firewall for OpenShift Node include: "{{ role_path | dirname }}/openshift_common/tasks/firewall.yml" allow: - { service: OpenShift kubelet, port: 10250/tcp } - name: Configure OpenShift Node settings lineinfile: dest: /etc/sysconfig/openshift-node regexp: '^OPTIONS=' line: "OPTIONS=\"--master=https://{{ openshift_master_ips[0] }}:8443 --loglevel={{ openshift_node_debug_level }}\"" 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 }}" # fixme: Once the openshift_cluster playbook is published state should be started # Always bounce service to pick up new credentials - name: Start and enable openshift-node service: name=openshift-node enabled=yes state=restarted 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 # TODO: expose openshift_register_node options to allow for overriding the # defaults. - name: Register node (if not already registered) openshift_register_node: name: "{{ openshift_hostname }}"