Skip to content

Conversation

trinitronx
Copy link

To test, set vars nodejs_version and nodejs_shasum_url in playbook like this:

Note: Playbook assumes localhost is a RHEL system (pre_tasks: may not be needed, but this is an excerpt from the playbook I was testing this role in... The vars: are what's important for Node.js v4.0.0)

- name: Install Node.js
  hosts: localhost
  gather_facts: yes
  sudo: yes
  vars:
    nodejs_version: 4.0.0
    nodejs_shasum_url: http://nodejs.org/dist/v4.0.0/SHASUMS256.txt
  pre_tasks:
    - name: update packages
      yum: >
         name=*
         state=latest

    - name: install specific packages
      yum: name={{ item }} state=latest
      with_items:
        - wget
        - gcc
        - make
        - gcc-c++
        - vim
        - mlocate
        - mc
        - lsof
        - psmisc
        - bind-utils
        - epel-release
        - nc
        - git

    - name: install epel specific packages
      yum: name={{ item }} state=latest
      with_items:
        - nrpe
        - nagios-plugins-nrpe
        - unbound
        - liblockfile
        - lockfile-progs
        - perl-IPC-Signal
        - perl-Proc-WaitStat
        - perl-mime-construct
  roles:
    - JasonGiedymin.nodejs

@@ -16,7 +16,11 @@

- name: Verify SHASUM of nodejs {{nodejs_version_tag}}
shell: curl {{nodejs_shasum_url}} | grep {{nodejs_file_name}} | sha1sum -c chdir={{nodejs_tmp_dir}}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ansible module get_url support sha256sum checks, please see http://docs.ansible.com/ansible/get_url_module.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants