- name: deploy nfs gather_facts: no hosts: "{{target}}" become: "{{become_var}}" tasks: - name: rpc mapper & nfs daemon are installed shell: executable: /bin/bash cmd: | set -e # executables for rc.rpc [[ -x /sbin/rpcbind ]] [[ -x /sbin/rpc.statd ]] # executables for rc.nfsd [[ -x /usr/sbin/exportfs ]] [[ -x /usr/sbin/rpc.nfsd ]] [[ -x /usr/sbin/rpc.mountd ]] check_mode: false changed_when: false - name: nfs exports template: src: exports dest: /etc/exports - name: boot-time nfs service blockinfile: content: | # self-verbose /etc/rc.d/rc.rpc start # self-verbose /etc/rc.d/rc.nfsd start dest: /etc/rc.d/rc.local mode: "0755" - name: nfs service is up shell: executable: /bin/bash cmd: | set -e pgrep -a mountd pgrep -a nfsd pgrep -a rpc register: output check_mode: false changed_when: false - debug: var=output.stdout - debug: var=output.stderr when: output.stderr != '' - name: env hotfixen blockinfile: content: | alias diff='colordiff' alias ll='ls -alhF' alias cp='cp -i' alias mv='mv -i' alias rm='rm -i' dest: /etc/profile