Commit 4c3f106f authored by julian.gethmann's avatar julian.gethmann Committed by julian.gethmann
Browse files

Add dependency on Python package

parent 40723e84
---
- 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"))
---
- 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"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment