--- - name: check existing installation stat: path="{{ nhc_dir }}/sbin/nhc" register: nhc_binary - name: install automake yum: name=automake state=present become: true become_user: root when: ansible_os_family=='RedHat' - name: install automake apt: name=automake state=present become: true become_user: root when: ansible_os_family=='Debian' - name: unarchive nhc unarchive: args: src: "http://consistency0/src/{{ nhc_version }}.tar.gz" copy: no dest: /tmp creates: /tmp/nhc-{{ nhc_version }}/autogen.sh when: not nhc_binary.stat.exists - name: build nhc shell: ./autogen.sh && ./configure --prefix={{ nhc_dir }} && make args: chdir: /tmp/nhc-{{ nhc_version }} creates: /tmp/nhc-{{ nhc_version }}/configure when: not nhc_binary.stat.exists - name: install nhc shell: make install sudo: true args: chdir: /tmp/nhc-{{ nhc_version }} when: not nhc_binary.stat.exists - name: ensure sysconfig dir exists file: dest=/etc/sysconfig state=directory owner=root group=root mode=755 sudo: true - name: copy nhc sysconfig script template: dest=/etc/sysconfig/nhc src=nhc.sysconfig.j2 mode=644 sudo: true - name: copy nhc log rotate script template: dest=/etc/logrotate.d/nhc src=nhclog.j2 mode=644 sudo: true - name: install nhc config file copy: src=nhc.conf dest={{ nhc_dir }}/etc/nhc/{{ nhc_config_file }} become: true become_user: root - name: install nhc scripts copy: src=scripts/ dest={{ nhc_dir }}/etc/nhc/scripts/ become: true become_user: root - name: modifying DF_FLAGS in lbnl_fs script replace: path: {{ nhc_dir }}/etc/nhc/scripts/lbnl_fs.nhc regexp: 'DF_FLAGS="${DF_FLAGS:--Tka}"' replace: 'DF_FLAGS="${DF_FLAGS:--Tk}"' backup: yes