Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_mountHDD2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sti-cluster
ansible_mountHDD2
Merge requests
!4
Add force option to format
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Add force option to format
addForceOptionToFormat
into
master
Overview
0
Commits
6
Pipelines
0
Changes
3
Closed
Pullyvan Krishnamoorthy
requested to merge
addForceOptionToFormat
into
master
3 years ago
Overview
0
Commits
6
Pipelines
0
Changes
1
Expand
Add force option in format Add ignore_error in creation of partition
👍
0
👎
0
Merge request reports
Viewing commit
8ac8a59e
Prev
Next
Show latest version
1 file
+
4
−
42
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
8ac8a59e
add CentOS and Debian support
· 8ac8a59e
Pullyvan Krishnamoorthy
authored
3 years ago
tasks/main.yml
+
4
−
42
Options
---
# tasks file for mount_hdd2
-
name
:
"
Check
if
{{
dev
}}
exists"
stat
:
path
:
"
{{
dev
}}"
register
:
hdd2
-
include
:
debian.yml tags=debian
when
:
ansible_os_family == 'Debian'
-
name
:
Create a new partition on hdd2
become
:
yes
parted
:
name
:
home
part_type
:
primary
label
:
gpt
number
:
1
device
:
/dev/nvme0n1
state
:
present
when
:
hdd2.stat.exists == False
-
name
:
Get System Details
stat
:
path={{ dev }}
register
:
check_mount
when
:
hdd2.stat.exists == False
-
name
:
Check the type of filesystem if its data we need to format
shell
:
file -s {{ dev }}
register
:
fs
when
:
hdd2.stat.exists == False
-
name
:
setting facts
set_fact
:
format_fs
:
true
when
:
"
'{{
dev
}}:
data'
in
fs.stdout"
-
name
:
Format filesystem
filesystem
:
fstype={{ fstype }} dev={{ dev }}
when
:
format_fs is defined and format_fs ==
true
and hdd2.stat.exists == False
-
name
:
Mount filesystem
mount
:
fstype
:
"
{{
fstype
}}"
src
:
"
{{
dev
}}"
name
:
"
{{
mount
}}"
opts
:
"
{{
opts
}}"
state
:
"
{{
state
}}"
register
:
mount_info
-
include
:
centos.yml tags=centos
when
:
ansible_distribution == "CentOS"
\ No newline at end of file
Loading