Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update RedHat Container Native Storage
- hosts: cns01
vars:
description: "get updated templates for cns"
tasks:
- name: add cns channel
shell: subscription-manager repos --enable=rh-gluster-3-for-rhel-7-server-rpms
- name: install latest cns-deploy package
yum: name="cns-deploy" state=latest
- name: install latest kerketi packages
yum: name="heketi-client" state=latest
- name: remove cns channel
shell: subscription-manager repos --disable=rh-gluster-3-for-rhel-7-server-rpms
- name: Copy templates from cns01 to bastion for /usr/share/heketi/templates
fetch:
src: /usr/share/heketi/templates/glusterfs-template.yaml
dest: glusterfs-template.yaml
flat: yes
- hosts: master1
tasks:
- name: use gluster project
shell: oc project glusterfs
- name: delete daemon set
command: oc delete ds glusterfs
ignore_errors: yes
- name: Delete Old Templates
shell: oc delete templates glusterfs
ignore_errors: yes
- hosts: glusterfs
tasks:
- name: relabel nodes
local_action: command oc label nodes {{ansible_hostname}} storagenode=glusterfs --overwrite
- hosts: localhost
tasks:
- name: Use new template
local_action: command oc create -f glusterfs-template.yaml
- name: Wait for distribution of template
pause:
seconds: 10
- name: Deploy the template
local_action: shell oc process glusterfs | oc create -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment