Показывай плейбук
- hosts: ms00
become: yes
gather_facts: true
vars:
hostname: ms-19
ifconfig_vmx0: 10.248.47.41
ifconfig_vmx1: 10.148.4.46
id: 10283
tasks:
- name: Insert new volumes in /etc/fstab
blockinfile:
path: /etc/fstab
block: |
/dev/da1p1.journal /data ufs rw 2 2
/dev/da2p1.journal /data2 ufs rw 2 2
md /md mfs rw,async,noatime,nosuid,-s16g 2 0
- hosts: web
become: yes
gather_facts: true
vars:
hostname: ms-19
ifconfig_vmx0: 10.248.47.41
ifconfig_vmx1: 10.148.4.46
id: 10283
tasks:
- name: Create directory
shell: |
mkdir -p /usr/local/nfs/{{ hostname }}/hls
mkdir -p /usr/local/nfs/{{ hostname }}/mp4
mkdir -p /usr/local/nfs/{{ hostname }}/mp4_2
- name: Insert links to media-server in /etc/fstab
blockinfile:
path: /etc/fstab
block: |
{{ ifconfig_vmx0 }}:/md /usr/local/nfs/{{ hostname }}/hls nfs rw,bg,-i,soft,retrans=5,retrycnt=3,intr,late,failok 0 0
{{ ifconfig_vmx0 }}:/data /usr/local/nfs/{{ hostname }}/mp4 nfs rw,bg,-i,soft,retrans=5,retrycnt=3,intr,late,failok 0 0
{{ ifconfig_vmx0 }}:/data2 /usr/local/nfs/{{ hostname }}/mp4_2 nfs rw,bg,-i,soft,retrans=5,retrycnt=3,intr,late,failok 0 0