blob: af2478837c66a5a81eecd5606e1f46c942268221 [file] [log] [blame]
Peter Pentchev7b8acdc2022-11-11 11:32:02 +02001- hosts: localhost
2 connection: local
Peter Pentchevafc36372022-11-15 12:22:05 +02003 vars:
Peter Pentchev5243a992022-11-22 15:15:52 +02004 host_id: "{{ hostvars['controller']['nodepool']['external_id'] }}"
Peter Pentchevafc36372022-11-15 12:22:05 +02005 storprep_filename: "/tmp/storprep-bootstrap-{{ host_id }}.sh"
Peter Pentchev7b8acdc2022-11-11 11:32:02 +02006 tasks:
Peter Pentchev18f67c62022-11-14 14:09:09 +02007 - name: ctrl-sp-whoami-hostname
8 shell:
Peter Pentchev03989dd2022-11-15 10:35:42 +02009 cmd: hostname || true
Peter Pentchev18f67c62022-11-14 14:09:09 +020010
Peter Pentchevff460a52022-11-15 11:47:40 +020011 - name: ctrl-sp-fetch-storprep
Peter Pentchev18f67c62022-11-14 14:09:09 +020012 shell:
Peter Pentchevafc36372022-11-15 12:22:05 +020013 cmd: curl -C - -o '{{ storprep_filename }}' -- https://spfactory.storpool.com/sp-osci/storprep-bootstrap-sh.txt
Peter Pentchev18f67c62022-11-14 14:09:09 +020014
Biser Milanov3c8e02d2023-03-14 17:52:51 +020015 - name: storprep
16 block:
17
18 - name: Create a Temporary Directory
19 ansible.builtin.tempfile:
20 state: directory
21 prefix: storprep-bootstrap.
22 register: tmpdir
23
24 - name: Provision OpenStack Data
25 no_log: true
26 ansible.builtin.copy:
27 content: "{{ OPENSTACK_DATA['v'] }}"
28 dest: "{{ tmpdir.path }}/clouds.yaml"
29 mode: '0600'
30
31 - name: ctrl-sp-run-storprep
32 shell:
Peter Pentchevc475abc2023-03-14 18:22:43 +020033 cmd: sh '{{ storprep_filename }}' -d '{{ tmpdir.path }}' -- -n lab-charmed-testing-storage -s lab-vlan400 -- {{ host_id }}
Biser Milanov3c8e02d2023-03-14 17:52:51 +020034
35 always:
36
37 - name: Remove the Temporary Directory
38 ansible.builtin.file:
39 path: "{{ tmpdir.path }}"
40 state: absent
41 when: tmpdir.path is defined
Peter Pentchevafc36372022-11-15 12:22:05 +020042
43 - name: ctrl-sp-rm-storprep
44 shell:
45 cmd: rm -- '{{ storprep_filename }}'
Peter Pentchev1a318ae2022-11-11 11:24:39 +020046
Peter Pentchev251b1f52022-11-18 10:52:30 +020047 - name: ctrl-sp-processes
48 shell:
49 cmd: ps awwfux
50
Peter Pentchev5243a992022-11-22 15:15:52 +020051- hosts: all
Peter Pentchev251b1f52022-11-18 10:52:30 +020052 tasks:
Peter Pentchev1e7ec642022-11-22 14:25:21 +020053 - name: sp-examine-pwd
54 shell:
55 cmd: pwd
56
57 - name: sp-examine-ls-zuul
58 shell:
59 cmd: ls -l /home/zuul
60
61 - name: sp-examine-ls-zuul-src
62 shell:
63 cmd: ls -l /home/zuul/src
64
65 - name: sp-examine-ls-zuul/src/spfactory.storpool.com
66 shell:
67 cmd: ls -l /home/zuul/src/spfactory.storpool.com
68
Peter Pentchev251b1f52022-11-18 10:52:30 +020069 - name: Apply the StorPool patches
70 shell:
Peter Pentchev4bd0dd12023-01-13 11:35:00 +020071 cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series -S am
72 chdir: /opt/stack
73 when: sp_experimental is not defined or not sp_experimental
74 become: true
75 become_user: stack
76
77 - name: Apply the StorPool experimental patches
78 shell:
Peter Pentchev251b1f52022-11-18 10:52:30 +020079 cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series.experimental -S am
80 chdir: /opt/stack
Peter Pentchev4bd0dd12023-01-13 11:35:00 +020081 when: sp_experimental is defined and sp_experimental
Peter Pentchev251b1f52022-11-18 10:52:30 +020082 become: true
83 become_user: stack
84
85 - name: Apply the StorPool patches to the other place
86 shell:
Peter Pentchev9c89b012023-01-17 15:39:38 +020087 cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series am
Peter Pentchev251b1f52022-11-18 10:52:30 +020088 chdir: /home/zuul/src/opendev.org
Peter Pentchev4bd0dd12023-01-13 11:35:00 +020089 when: sp_experimental is not defined or not sp_experimental
90
91 - name: Apply the StorPool experimental patches to the other place
92 shell:
93 cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/git-if-needed -s /home/zuul/src/spfactory.storpool.com/sp-osci/patches/series.experimental am
94 chdir: /home/zuul/src/opendev.org
95 when: sp_experimental is defined and sp_experimental
Peter Pentchev251b1f52022-11-18 10:52:30 +020096
97# - name: Set up the random StorPool volume prefix
98# shell:
99# cmd: /home/zuul/src/spfactory.storpool.com/sp-osci/tools/bin/sp_rand_init
100# become: true
101
Peter Pentchev7b8acdc2022-11-11 11:32:02 +0200102- hosts: all
103 tasks:
Peter Pentchev1a318ae2022-11-11 11:24:39 +0200104 - name: sp-processes
105 shell:
106 cmd: ps awwfux