123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- ---
- - name: install needed rpm(s)
- package:
- name: "{{ item }}"
- state: present
- with_items: "{{ openshift_node_ami_prep_packages }}"
- - name: create the directory for node
- file:
- state: directory
- path: "/etc/systemd/system/{{ openshift_service_type }}-node.service.d"
- - name: laydown systemd override
- copy:
- dest: "/etc/systemd/system/{{ openshift_service_type }}-node.service.d/override.conf"
- content: |
- [Unit]
- After=cloud-init.service
- - name: update the sysconfig to have KUBECONFIG
- lineinfile:
- dest: "/etc/sysconfig/{{ openshift_service_type }}-node"
- line: "KUBECONFIG=/root/csr_kubeconfig"
- regexp: "^KUBECONFIG=.*"
- - name: update the ExecStart to have bootstrap
- lineinfile:
- dest: "/usr/lib/systemd/system/{{ openshift_service_type }}-node.service"
- line: "{% raw %}ExecStart=/usr/bin/openshift start node --bootstrap --kubeconfig=${KUBECONFIG} $OPTIONS{% endraw %}"
- regexp: "^ExecStart=.*"
- - name: "systemctl enable {{ openshift_service_type }}-node"
- systemd:
- name: "{{ item }}"
- enabled: no
- with_items:
- - "{{ openshift_service_type }}-node.service"
- - "{{ openshift_service_type }}-master.service"
- - name: Check for RPM generated config marker file .config_managed
- stat:
- path: /etc/origin/.config_managed
- register: rpmgenerated_config
- - when: rpmgenerated_config.stat.exists
- block:
- - name: Remove RPM generated config files if present
- file:
- path: "/etc/origin/{{ item }}"
- state: absent
- with_items:
- - master
- # with_fileglob doesn't work correctly due to a few issues.
- # Could change this to fileglob when it gets fixed.
- - name: find all files in /etc/origin/node so we can remove them
- find:
- path: /etc/origin/node/
- register: find_results
- - name: Remove everything except the resolv.conf required for node
- file:
- path: "{{ item.path }}"
- state: absent
- when: "'resolv.conf' not in item.path or 'node-dnsmasq.conf' not in item.path"
- with_items: "{{ find_results.files }}"
|