Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
slapos.package
Commits
fc782668
Commit
fc782668
authored
Dec 06, 2016
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm-bootstrap playbook: configure disks only once
parent
b2fd7c04
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
playbook/roles/vm-bootstrap/files/mounted_disk
playbook/roles/vm-bootstrap/files/mounted_disk
+6
-0
playbook/roles/vm-disks/tasks/main.yml
playbook/roles/vm-disks/tasks/main.yml
+2
-0
No files found.
playbook/roles/vm-bootstrap/files/mounted_disk
View file @
fc782668
...
@@ -6,6 +6,12 @@ for i in a b c d e f g h i j k l m n o p q r s t u
...
@@ -6,6 +6,12 @@ for i in a b c d e f g h i j k l m n o p q r s t u
do
do
if
[
-e
"/dev/vd
$i
"
]
if
[
-e
"/dev/vd
$i
"
]
then
then
if
[
-s
"/etc/opt/disks"
]
;
then
MOUNTED
=
$(
cat
/etc/opt/disks |
grep
vd
$i
)
if
[
!
-z
"
$MOUNTED
"
]
;
then
continue
fi
fi
R
=
$(
ls
/dev/vd
$i
|
cut
-d
'/'
-f3
)
R
=
$(
ls
/dev/vd
$i
|
cut
-d
'/'
-f3
)
RESULT
=
"
$RESULT
$R
"
RESULT
=
"
$RESULT
$R
"
fi
fi
...
...
playbook/roles/vm-disks/tasks/main.yml
View file @
fc782668
...
@@ -30,3 +30,5 @@
...
@@ -30,3 +30,5 @@
-
name
:
Mount /data{{ data_n }}
-
name
:
Mount /data{{ data_n }}
mount
:
name=/data{{ data_n }} src=/dev/vd{{ vd_disk }}1 fstype=ext4 state=mounted
mount
:
name=/data{{ data_n }} src=/dev/vd{{ vd_disk }}1 fstype=ext4 state=mounted
when
:
partition_vd_created.stat.exists == True
when
:
partition_vd_created.stat.exists == True
-
lineinfile
:
dest=/etc/opt/disks state=present line="vd{{ vd_disk }}" create=yes
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment