Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
las-it-organisation
32-0-IT instructions and rules
ansible
Commits
4c3f106f
Commit
4c3f106f
authored
Dec 17, 2020
by
julian.gethmann
Committed by
julian.gethmann
Dec 17, 2020
Browse files
Add dependency on Python package
parent
40723e84
Changes
2
Hide whitespace changes
Inline
Side-by-side
roles/lasarchiv/tasks/main.yml
View file @
4c3f106f
---
-
import_tasks
:
nfs.yml
-
name
:
install requirements
dnf
:
state
:
present
name
:
[
"
nfs-utils"
,
"
python3-netaddr"
]
become
:
yes
when
:
ansible_distribution == 'Fedora'
-
name
:
install requirements
apt
:
state
:
present
name
:
nfs-common
become
:
yes
when
:
ansible_distribution == 'Ubuntu'
-
name
:
install requirements
yum
:
state
:
present
name
:
nfs-utils
become
:
yes
when
:
ansible_distribution == 'CentOS'
-
name
:
add lasarchiv1 to fstab
mount
:
name
:
"
/mnt/las-archiv1"
src
:
"
{{
nfs_server
}}:/las-archiv1"
fstype
:
nfs4
opts
:
"
soft,timeo=14,intr,nosuid"
state
:
"
present"
become
:
yes
when
:
(ansible_default_ipv4.address | ipv4('129.13.238.64/26')) or (ansible_default_ipv6.address | ipv6('2a00:1398:4:8200::/64'))
register
:
fstab
-
name
:
check if mount exist
stat
:
path
:
"
/mnt/las-archiv1"
register
:
lasarchiv1
ignore_errors
:
True
-
name
:
create mount dir
become
:
yes
file
:
name
:
/mnt/las-archiv1
state
:
directory
when
:
not lasarchiv1.stat.isdir is not defined
-
name
:
remount lasarchiv1
mount
:
name
:
"
/mnt/las-archiv1"
src
:
"
{{
nfs_server
}}:/las-archiv1"
fstype
:
nfs4
opts
:
"
soft,timeo=14,intr,nosuid"
state
:
"
remounted"
become
:
yes
when
:
>
((ansible_default_ipv4.address | ipv4('129.13.238.64/26')) or (ansible_default_ipv6.address | ipv6('2a00:1398:4:8200::/64'))) and
((fstab.changed) and (lasarchiv1.stat.isdir is defined and lasarchiv1.stat.isdir) or ("'Input/output error' in lasarchiv1.stderr"))
roles/lasarchiv/tasks/nfs.yml
deleted
100644 → 0
View file @
40723e84
---
-
name
:
install requirements
dnf
:
state
:
present
name
:
nfs-utils
become
:
yes
when
:
ansible_distribution == 'Fedora'
-
name
:
install requirements
apt
:
state
:
present
name
:
nfs-common
become
:
yes
when
:
ansible_distribution == 'Ubuntu'
-
name
:
install requirements
yum
:
state
:
present
name
:
nfs-utils
become
:
yes
when
:
ansible_distribution == 'CentOS'
-
name
:
add lasarchiv1 to fstab
mount
:
name
:
"
/mnt/las-archiv1"
src
:
"
{{
nfs_server
}}:/las-archiv1"
fstype
:
nfs4
opts
:
"
soft,timeo=14,intr,nosuid"
state
:
"
present"
become
:
yes
when
:
(ansible_default_ipv4.address | ipv4('129.13.238.64/26')) or (ansible_default_ipv6.address | ipv6('2a00:1398:4:8200::/64'))
register
:
fstab
-
name
:
check if mount exist
stat
:
path
:
"
/mnt/las-archiv1"
register
:
lasarchiv1
ignore_errors
:
True
-
name
:
remount lasarchiv1
mount
:
name
:
"
/mnt/las-archiv1"
src
:
"
{{
nfs_server
}}:/las-archiv1"
fstype
:
nfs4
opts
:
"
soft,timeo=14,intr,nosuid"
state
:
"
remounted"
become
:
yes
when
:
>
((ansible_default_ipv4.address | ipv4('129.13.238.64/26')) or (ansible_default_ipv6.address | ipv6('2a00:1398:4:8200::/64'))) and
((fstab.changed) and (lasarchiv1.stat.isdir is defined and lasarchiv1.stat.isdir) or ("'Input/output error' in lasarchiv1.stderr"))
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