aboutsummaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/playbooks/preconfigure-optane.yml
blob: 64622895e94fcbce0fa0628ca5fa54868a1c8bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

# Run the following task only if the SRIOV is set to True
# i.e when SRIOV hardware is available
- hosts: localhost
  become: yes
  pre_tasks:
    - name: Load kud variables
      include_vars:
        file: kud-vars.yml
  tasks:
    - name: Create optane folder
      file:
        state: directory
        path: "{{ optane_dest }}"
      ignore_errors: yes

- hosts: kube-node
  become: yes
  pre_tasks:
    - name: Load kud variables
      include_vars:
        file: kud-vars.yml
  tasks:
    - name: Create OPTANE folder in the target destination
      file:
        state: directory
        path: "{{ item }}"
      with_items:
        - optane
    - copy:
        src: "{{ playbook_dir }}/setup-ca-kubernetes.sh"
        dest: optane
    - name: Changing perm of "sh", adding "+x"
      shell: "chmod +x setup-ca-kubernetes.sh"
      args:
        chdir: "optane"
        warn: False
    - copy:
        src: "{{ playbook_dir }}/setup-ca.sh"
        dest: optane
    - name: Changing perm of "sh", adding "+x"
      shell: "chmod +x setup-ca.sh"
      args:
        chdir: "optane"
        warn: False
    - copy:
        src: "{{ playbook_dir }}/install_optane.sh"
        dest: optane
    - name: Changing perm of "sh", adding "+x"
      shell: "chmod +x install_optane.sh"
      args:
        chdir: "optane"
        warn: False
    - copy:
        src: "{{ playbook_dir }}/deploy_optane.sh"
        dest: optane
    - name: Changing perm of "sh", adding "+x"
      shell: "chmod +x deploy_optane.sh"
      args:
        chdir: "optane"
        warn: False
    - copy:
        src: "{{ playbook_dir }}/../images/pmem-csi-lvm.yaml"
        dest: optane
    - copy:
        src: "{{ playbook_dir }}/../images/pmem-csi-direct.yaml"
        dest: optane
    - name: Run the install script and Re-evaluate the variable
      command: optane/install_optane.sh
      register: output
    - name: restart kubelet services
      become: yes
      service:
        name: kubelet
        state: restarted