12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- ---
- # Set some facts to reference from hostvars
- - import_tasks: set_facts.yml
- - name: setup firewall
- import_tasks: firewall.yml
- # TODO: this task may not be needed with Validate permissions
- - name: Ensure etcd datadir exists
- file:
- path: "{{ etcd_data_dir }}"
- state: directory
- mode: 0700
- - name: Validate permissions on the config dir
- file:
- path: "{{ etcd_conf_dir }}"
- state: directory
- mode: 0700
- - name: Validate permissions on the static pods dir
- file:
- path: "/etc/origin/node/pods/"
- state: directory
- owner: "root"
- group: "root"
- mode: 0700
- - name: Write etcd global config file
- template:
- src: etcd.conf.j2
- dest: "{{ etcd_conf_file }}"
- backup: true
- - name: Create temp directory for static pods
- command: mktemp -d /tmp/openshift-ansible-XXXXXX
- register: mktemp
- changed_when: false
- - name: Prepare etcd static pod
- copy:
- src: "{{ item }}"
- dest: "{{ mktemp.stdout }}"
- mode: 0600
- with_items:
- - etcd.yaml
- - name: Update etcd static pod
- yedit:
- src: "{{ mktemp.stdout }}/{{ item }}"
- edits:
- - key: spec.containers[0].image
- value: "{{ etcd_image }}"
- with_items:
- - etcd.yaml
- - name: Deploy etcd static pod
- copy:
- remote_src: true
- src: "{{ mktemp.stdout }}/{{ item }}"
- dest: "/etc/origin/node/pods/"
- mode: 0600
- with_items:
- - etcd.yaml
- - name: Remove temp directory
- file:
- state: absent
- name: "{{ mktemp.stdout }}"
- changed_when: False
|